review-code-quality-subagents
Run the standard code-smell, DRY, TypeScript-style, and reinvented-abstraction reviews inline in separate review-only subagents without using external review-model APIs.
- License 许可
- MIT
- 所属仓库
- nseng-ai/ns
- 最近更新
- 2026-10-02
- Stars
- ★ 2
- Forks
- 0
01 前言 Front Matter
- name
- review-code-quality-subagents
- metadata
- { "internal": true }
- description
- Run the standard code-smell, DRY, TypeScript-style, and reinvented-abstraction reviews inline in separate review-only subagents without using external review-model APIs.
- disable-model-invocation
- true
02 资源文件 1
- 参考文档agents/openai.yaml43 B
03 SKILL.md 正文
Review code quality with subagents
Run this fixed code-quality review suite against one pinned branch diff:
ns-typescript-style-tripwirereinvented-abstractions-tripwirecode-smell-reviewdry-but-not-too-dry
Each review gets a fresh subagent so its doctrine and context cannot contaminate the others. Do not add other configured reviews implicitly. This workflow uses the current harness's subagents; it must not invoke ns reviews run, Codex, Claude Code, or another external model CLI.
Input
Treat everything after the skill command as a natural-language review request, not positional arguments:
/skill:review-code-quality-subagents <what should be reviewed>
Examples:
/skill:review-code-quality-subagents Review the current Graphite branch against its parent.
/skill:review-code-quality-subagents Review PR #3600.
/skill:review-code-quality-subagents Review the provisioning change on fail-soft-slot-provisioning-resize-coverage against slots-provisioned-ignored-files.
Interpret the request using repository and Graphite evidence, then resolve one exact merge-base comparison. Common resolutions:
- “current branch/change” means
TARGET_REF=HEADand the current Graphite parent fromgt parent --no-interactiveisBASE_REF; - an explicit “X against Y” means
TARGET_REF=XandBASE_REF=Yafter both refs are verified; - a PR request means resolve its exact head and base refs from PR metadata rather than assuming trunk.
Do not treat arbitrary words as ordered ref slots. Do not silently widen a branch review to the whole stack or trunk. If the requested scope has more than one plausible comparison, show the candidate interpretation briefly and ask one clarifying question. Once resolved, pin BASE_REF and TARGET_REF for the entire run.
Preflight
- Confirm
BASE_REFandTARGET_REFresolve withgit rev-parse. - Use merge-base semantics throughout:
git diff "$BASE_REF"..."$TARGET_REF". - Record
git log "$BASE_REF".."$TARGET_REF" --oneline,git diff --stat "$BASE_REF"..."$TARGET_REF", andgit diff --name-only "$BASE_REF"..."$TARGET_REF". - Stop if the diff is empty.
- Run
ns reviews list --format jsonand confirm that all four fixed suite keys are configured. Ignore other configured review keys. Require a readable.ns/reviews/<key>/review.mdfor each suite key; stop on suite/definition drift rather than silently skipping a review.
Subagent contract
Dispatch exactly one fresh task subagent for each of the four suite keys, in the order listed above. Batch all independent review tasks in one subagent-tool call when the harness supports it. Review subagents are read-only: they must not edit files, mutate git or Branch Memory, publish findings, or launch another model CLI.
Each task prompt must include all of the following because the subagent starts cold:
You are the review-only subagent for REVIEW_KEY in REPO_ROOT.
Read and obey REPO_ROOT/.ns/reviews/REVIEW_KEY/review.md as the authoritative review definition. Read applicable AGENTS.md files and any references that the review definition explicitly requires. Review only the merge-base diff BASE_REF...TARGET_REF. The pinned commit list is COMMITS and the changed paths are CHANGED_PATHS.
Do not edit files, mutate git or Branch Memory, publish findings, invoke `ns reviews run`, or launch Codex, Claude Code, or any other model CLI. Repository-local deterministic scanners explicitly required by the review definition are allowed when they do not modify tracked files.
Return a self-contained report for this review only. Follow the definition's finding format and thresholds exactly. Ground every finding in the diff with file:line evidence and a concrete explanation. Report `No findings` when nothing meets the definition's bar. Include a short coverage note naming anything the review required but could not inspect.
Replace every uppercase placeholder with the pinned run evidence. Do not summarize or reinterpret a review definition in the dispatch prompt; the subagent must read the source file itself.
A failed or non-final subagent result is not a completed review. Inspect its diagnostics/session evidence and retry only that review once when the failure is operational and safely recoverable. Otherwise report it as incomplete; never substitute parent-agent judgment silently.
Aggregate
After every subagent completes:
- Present one section per review in the fixed suite order:
## <review-key>. - Preserve each review's own severity, ordering, wording, and no-finding result. Lightly normalize formatting only.
- Do not merge, rerank, or suppress findings across reviews. If two reviews identify the same underlying issue, add a brief cross-review note after both original findings remain visible.
- End with:
- reviews completed and incomplete;
- finding counts per review;
- validation/scanner commands reported by subagents;
- the exact reviewed range,
BASE_REF...TARGET_REF; - an explicit statement that the workflow made no edits and did not invoke external review-model APIs.
This skill is advisory and read-only. It does not fix findings, write review logs, publish comments, or mutate PR state.
04 同仓库更多 Skills
pr-make-accountable
Interview a PR author to establish shared understanding of intent and design decisions, then co-author the What / Why / Changes PR body with opt-in Requested reviewer focus.
typescript-style
Opinionated style guide for strict, portable TypeScript. Use when writing, designing, or reviewing TypeScript: type design, boundary validation, error handling, module architecture, and review discipline.
typescript-fake-driven-testing
TypeScript fake-driven testing architecture. Use when writing or reviewing TS code with external dependencies, gateway interfaces, real adapters, in-memory fakes, or CLI scenario tests.
ns-typescript
TypeScript overlay for ns-style projects. Use when editing or reviewing TS in this repo: tsconfig baseline, pnpm/Vitest/oxlint/oxfmt/native tsc commands, relative .ts imports, workspace subpath exports, and the exactOptionalPropertyTypes spread idiom. Repo-specific enforcement (test lanes, time seams, style guard) lives in the host repo's AGENTS.md.
ns-typescript-style-tripwire
Invoke the ns TypeScript style Tripwire against a supplied diff or current branch.
skill-management
Manage skills with `npx skills`: add, edit, remove, rename, update, or list skills (local or GitHub), and the nested `skills/<disposition>/.../<name>/` / flat `.agents/skills/` layout conventions.