[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M74GAZP8WMMVMZNCY63YF5Y9":3,"skill-same:01M74GAZP8WMMVMZNCY63YF5Y9":44},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":29,"install":30,"resources":43},"01M74GAZP8WMMVMZNCY63YF5Y9","code-review",null,"Review a code change for correctness, simplification, and missing tests; produces a structured review summary keyed to the diff. Reviews a diff; not test-gap hunting (coverage-gap).","MohammadBafkar\u002Fpolymath","MohammadBafkar","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F34940462?v=4","01M74G540TQFZWK6KVAPKFVGNR","Mohammad Bafkar","01M74G541HG19QP9V5DQCJVKYE",0,"MIT","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-engineering\u002Fskills\u002Fcode-review\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: code-review\ndescription: Review a code change for correctness, simplification, and missing tests; produces a structured review summary keyed to the diff. Reviews a diff; not test-gap hunting (coverage-gap).\n---\n\n# code-review\n\n> Review a code change with two lenses: correctness (does it do what the PRD says?) and simplification (could it do the same with less?).\n\n**Mode:** analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked `[TBD]` or `[VERIFY]`, never filled in.\n\n## When to use\n\n- A workflow invokes `polymath-engineering:code-review` after `feature-dev`.\n- The user says \"review this\", \"look this over\", \"what would you change?\".\n\n## Inputs\n\n- The diff under review (typically the current git diff or the file set from `feature-dev`).\n- PRD + acceptance criteria for the change (preferred).\n- Project conventions.\n\n## Project localization\n\nBefore the procedure, resolve the project snapshot —\n`${POLYMATH_DATA_DIR:-$HOME\u002F.polymath\u002Fdata}\u002Fpolymath-core\u002Fproject-context.json`\n(ignore it if its `_meta.source` belongs to another repo; absent → read\n`.polymath\u002Fproject.yaml` directly; neither → built-in defaults). Then apply\n(contract: `polymath-core:project-context`):\n\n- `conventions_docs`: read roles `review-checklist` plus the stack docs\n  (`backend-stack`, `frontend-stack`, `database`) that match the diff;\n  treat their Hard rules as review axes; surface `[VERIFY: …]` items only\n  when they affect a finding.\n- `skill_overrides[\"polymath-engineering:code-review\"]`: read each\n  `additional_context` file; apply each `additional_axes` entry as an\n  extra review axis. Cite `conventions.code_review_checklist` in the\n  review summary when set.\n\n## Procedure\n\n1. **Establish intent.** Read the PRD's acceptance criteria — each is a checkpoint the code must satisfy. No PRD? Derive intent from the PR description, linked issue, or commit messages, and state that assumption at the top of the review.\n2. **Get the exact diff.** Review against the merge base, not a moving branch tip: `git diff $(git merge-base origin\u002F\u003Cbase> HEAD)` (default base: the remote's default branch), plus staged and unstaged changes when reviewing local work. Note untracked files the change depends on.\n3. **Read the diff in dependency order** (config → models → core logic → API → UI), and read beyond it: for every changed signature, contract, or shared helper, open its callers. Many bugs live in the unchanged code that consumes the change.\n4. **For each acceptance criterion**, verify a test exists that would fail if the corresponding code were broken. If not, flag it as a missing test.\n5. **Correctness pass:**\n   - Off-by-one, signedness, encoding, time-zone, null\u002Fempty handling.\n   - Concurrency: races, ordering, atomicity, idempotency of retried paths.\n   - Error paths: do they leave the system in a recoverable state? Resources (files, connections, locks) released on every path?\n   - Boundary: empty input, single element, max input.\n   - Compatibility: does it break existing callers, persisted data, or a public API\u002Fschema?\n   - Performance on realistic sizes: N+1 queries, unbounded loops or memory, work inside hot paths.\n6. **Simplification pass:**\n   - Could two functions be one? (Only if one of them has no other caller.)\n   - Are there unused parameters, branches, or imports?\n   - Are abstractions premature?\n   - Are comments restating what the code already says?\n7. **Security smell check:**\n   - User input directly in SQL, HTML, shell, paths.\n   - Secrets in code or logs.\n   - Missing AuthN \u002F AuthZ on new endpoints; object-level checks on user-supplied IDs.\n8. **Test smell check:**\n   - Tests asserting implementation details.\n   - Tests that pass without the code change (mock theater).\n   - Flaky test patterns (sleeps, time-of-day).\n9. **Verify before reporting.** For each correctness or security finding, trace a concrete input or path that triggers it. If you can't, downgrade it to a question. Separate issues the change introduced from pre-existing ones (report those last, as non-blocking).\n\n## Output\n\nStructured summary keyed to the diff:\n\n```text\nVerdict: REQUEST CHANGES   (1 blocker, 1 major, 2 minor)\nIntent source: PRD docs\u002Fprds\u002Frate-limit.md   (or: \"derived from PR description\")\n\nAcceptance criteria coverage:\n  - AC1: PASS — test at \u003Cfile>:\u003Cline>\n  - AC2: MISSING — no test for refund path\n\nCorrectness findings:\n  - [blocker] \u003Cfile>:\u003Cline> — boundary: rate-limit window misses requests exactly at start\n    Trigger: request at t = window_start → counted in neither window.\n\nSimplification findings:\n  - \u003Cfile>:\u003Cline> — extracted helper has one caller; inline it\n\nSecurity findings:\n  - \u003Cfile>:\u003Cline> — user-supplied path concatenated without normalization\n\nTest smell findings:\n  - [minor] \u003Cfile>:\u003Cline> — assertion checks private member rather than observed behavior\n\nPre-existing (not introduced by this change, non-blocking):\n  - \u003Cfile>:\u003Cline> — …\n```\n\nNo emoji, no praise filler. Findings only.\n\n## Quality bar\n\n- Every finding cites file:line and carries a severity (blocker \u002F major \u002F minor).\n- Every correctness\u002Fsecurity finding names the input or path that triggers it; unproven suspicions are phrased as questions.\n- Every \"MISSING\" finding either nominates a missing test or proposes an alternative way to verify.\n- No nit-style comments mixed in with correctness findings; pre-existing issues are separated from introduced ones.\n- One verdict: APPROVE, APPROVE WITH NITS, or REQUEST CHANGES.\n","# code-review\n\n> Review a code change with two lenses: correctness (does it do what the PRD says?) and simplification (could it do the same with less?).\n\n**Mode:** analytical — judgment inside a fixed frame. Keep the output shape; every verdict cites its evidence; unknowns are marked `[TBD]` or `[VERIFY]`, never filled in.\n\n## When to use\n\n- A workflow invokes `polymath-engineering:code-review` after `feature-dev`.\n- The user says \"review this\", \"look this over\", \"what would you change?\".\n\n## Inputs\n\n- The diff under review (typically the current git diff or the file set from `feature-dev`).\n- PRD + acceptance criteria for the change (preferred).\n- Project conventions.\n\n## Project localization\n\nBefore the procedure, resolve the project snapshot —\n`${POLYMATH_DATA_DIR:-$HOME\u002F.polymath\u002Fdata}\u002Fpolymath-core\u002Fproject-context.json`\n(ignore it if its `_meta.source` belongs to another repo; absent → read\n`.polymath\u002Fproject.yaml` directly; neither → built-in defaults). Then apply\n(contract: `polymath-core:project-context`):\n\n- `conventions_docs`: read roles `review-checklist` plus the stack docs\n  (`backend-stack`, `frontend-stack`, `database`) that match the diff;\n  treat their Hard rules as review axes; surface `[VERIFY: …]` items only\n  when they affect a finding.\n- `skill_overrides[\"polymath-engineering:code-review\"]`: read each\n  `additional_context` file; apply each `additional_axes` entry as an\n  extra review axis. Cite `conventions.code_review_checklist` in the\n  review summary when set.\n\n## Procedure\n\n1. **Establish intent.** Read the PRD's acceptance criteria — each is a checkpoint the code must satisfy. No PRD? Derive intent from the PR description, linked issue, or commit messages, and state that assumption at the top of the review.\n2. **Get the exact diff.** Review against the merge base, not a moving branch tip: `git diff $(git merge-base origin\u002F\u003Cbase> HEAD)` (default base: the remote's default branch), plus staged and unstaged changes when reviewing local work. Note untracked files the change depends on.\n3. **Read the diff in dependency order** (config → models → core logic → API → UI), and read beyond it: for every changed signature, contract, or shared helper, open its callers. Many bugs live in the unchanged code that consumes the change.\n4. **For each acceptance criterion**, verify a test exists that would fail if the corresponding code were broken. If not, flag it as a missing test.\n5. **Correctness pass:**\n   - Off-by-one, signedness, encoding, time-zone, null\u002Fempty handling.\n   - Concurrency: races, ordering, atomicity, idempotency of retried paths.\n   - Error paths: do they leave the system in a recoverable state? Resources (files, connections, locks) released on every path?\n   - Boundary: empty input, single element, max input.\n   - Compatibility: does it break existing callers, persisted data, or a public API\u002Fschema?\n   - Performance on realistic sizes: N+1 queries, unbounded loops or memory, work inside hot paths.\n6. **Simplification pass:**\n   - Could two functions be one? (Only if one of them has no other caller.)\n   - Are there unused parameters, branches, or imports?\n   - Are abstractions premature?\n   - Are comments restating what the code already says?\n7. **Security smell check:**\n   - User input directly in SQL, HTML, shell, paths.\n   - Secrets in code or logs.\n   - Missing AuthN \u002F AuthZ on new endpoints; object-level checks on user-supplied IDs.\n8. **Test smell check:**\n   - Tests asserting implementation details.\n   - Tests that pass without the code change (mock theater).\n   - Flaky test patterns (sleeps, time-of-day).\n9. **Verify before reporting.** For each correctness or security finding, trace a concrete input or path that triggers it. If you can't, downgrade it to a question. Separate issues the change introduced from pre-existing ones (report those last, as non-blocking).\n\n## Output\n\nStructured summary keyed to the diff:\n\n```text\nVerdict: REQUEST CHANGES   (1 blocker, 1 major, 2 minor)\nIntent source: PRD docs\u002Fprds\u002Frate-limit.md   (or: \"derived from PR description\")\n\nAcceptance criteria coverage:\n  - AC1: PASS — test at \u003Cfile>:\u003Cline>\n  - AC2: MISSING — no test for refund path\n\nCorrectness findings:\n  - [blocker] \u003Cfile>:\u003Cline> — boundary: rate-limit window misses requests exactly at start\n    Trigger: request at t = window_start → counted in neither window.\n\nSimplification findings:\n  - \u003Cfile>:\u003Cline> — extracted helper has one caller; inline it\n\nSecurity findings:\n  - \u003Cfile>:\u003Cline> — user-supplied path concatenated without normalization\n\nTest smell findings:\n  - [minor] \u003Cfile>:\u003Cline> — assertion checks private member rather than observed behavior\n\nPre-existing (not introduced by this change, non-blocking):\n  - \u003Cfile>:\u003Cline> — …\n```\n\nNo emoji, no praise filler. Findings only.\n\n## Quality bar\n\n- Every finding cites file:line and carries a severity (blocker \u002F major \u002F minor).\n- Every correctness\u002Fsecurity finding names the input or path that triggers it; unproven suspicions are phrased as questions.\n- Every \"MISSING\" finding either nominates a missing test or proposes an alternative way to verify.\n- No nit-style comments mixed in with correctness findings; pre-existing issues are separated from introduced ones.\n- One verdict: APPROVE, APPROVE WITH NITS, or REQUEST CHANGES.\n",{"name":5,"description":7},"main","23f6e21841a39580c9da2b5ec941f39dda17cd86","plugins\u002Fpolymath-engineering\u002Fskills\u002Fcode-review","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath","https:\u002F\u002Fgithub.com\u002FMohammadBafkar","2026-10-29 18:34:59",{"source":8,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add MohammadBafkar\u002Fpolymath --skill code-review",{"tool":36,"command":37},"bunx","bunx skills add MohammadBafkar\u002Fpolymath --skill code-review",{"tool":39,"command":40},"pnpm","pnpm dlx skills add MohammadBafkar\u002Fpolymath --skill code-review","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-engineering\u002Fskills\u002Fcode-review\u002FSKILL.md",true,[],[45,52,59,66,73,80],{"skillNo":46,"name":47,"nameZh":6,"description":48,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":49,"categories":50,"keywords":51,"publishedAt":19},"01M74GN87EBRHM9N87M7AP1HDD","runbook","Write or refresh an operational runbook for an alert\u002Fsymptom; structured as TL;DR + Pre-checks + Steps + Verification + Rollback + Escalation.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Frunbook\u002FSKILL.md",[],[],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M74GN5GPKEC1JEKP2DFQNEQJ","rfc","Draft a lightweight design RFC to docs\u002Frfcs\u002F\u003Cslug>.md; Summary, Motivation, Detailed design, Drawbacks, Alternatives, Unresolved questions. A proposal to debate, not a recorded decision (adr).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Frfc\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M74GN2F4CWPMV4X09TG4E304","editorial-pass","Review and tighten prose in a Markdown artifact for a target tone (terse, formal, friendly) without dropping information; preserve quotations and load-bearing constraints.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Feditorial-pass\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M74GMZWGYMZ37C4DYGT6P23G","architecture-review-facilitation","Run an architecture review as a process — entry criteria, reviewer checklist, decision log, and follow-up actions — pairing the design artifact with a red-team pass.","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Farchitecture-review-facilitation\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M74GMXVX0YX3ETDXS527XDGM","architecture-doc","Write a C4-style architecture document; System Context + Containers (+ Components when interesting) with mermaid diagrams. Describes structure, not a decision (adr) or proposal (rfc).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Farchitecture-doc\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M74GMVG1WSMCK066S3KE6V5K","adr","Write an Architecture Decision Record (Michael Nygard format) to docs\u002Fadrs\u002FNNNN-\u003Cslug>.md; frontmatter validated by the ADR artifact schema. Records a made decision, not a proposal to debate (rfc).","https:\u002F\u002Fgithub.com\u002FMohammadBafkar\u002Fpolymath\u002Fblob\u002Fmain\u002Fplugins\u002Fpolymath-writing\u002Fskills\u002Fadr\u002FSKILL.md",[],[]]