code-review-and-quality
Conducts multi-axis code review and runs the disciplined post-green refactor pass. Use before merging any change, when reviewing code written by yourself, another agent, or a human, or when the opt-in `delivery.refactorStage` checkpoint asks for a behaviour-preserving CRAP/duplication pass after the suite is green.
- License 许可
- MIT
- 所属仓库
- dsj1984/mandrel
- 最近更新
- 2026-11-14
- Stars
- ★ 7
- Forks
- 1
01 前言 Front Matter
- name
- code-review-and-quality
- description
- Conducts multi-axis code review and runs the disciplined post-green refactor pass. Use before merging any change, when reviewing code written by yourself, another agent, or a human, or when the opt-in `delivery.refactorStage` checkpoint asks for a behaviour-preserving CRAP/duplication pass after the suite is green.
02 资源文件 4
- 许可证LICENSE1.0 KB
- 参考文档reference.md4.4 KB
- 参考文档SOURCE.md346 B
- 参考文档TRUST.auto.yaml2.0 KB
03 SKILL.md 正文
Code Review and Quality
Policy Capsule
- Every change gets reviewed before merge — no exceptions, including agent-authored code.
- Apply the five-axis review to every change: Correctness, Readability & Simplicity, Architecture, Security, Performance.
- Flag dead code artifacts (
_unusedvars, backwards-compat shims,// removedcomments) and require their removal before merge. - Defer to
.agents/rules/security-baseline.mdand thesecurity-and-hardeningskill for security review; explicit checks include input validation, no hardcoded secrets, parameterized queries, encoded output, authn+authz, and treating external data as untrusted. - Bug-fix reviews cover both the fix and the regression test; a fix without a failing-then-passing test is not approvable, and neither is one whose commit body states no
Behaviour delta:or whose diff changes behaviour outside it (rules/testing-standards.md§ Applying the Standards). - Refactoring is post-green and behaviour-preserving. Run the refactor pass only when the suite is already green and gates pass; inputs, outputs, side effects, error semantics, and ordering MUST be identical before and after, and existing tests MUST keep passing without modification (if a test had to change, behaviour changed — revert).
- Lower CRAP by lowering complexity, and remove duplication at the root. Target the highest-CRAP well-covered functions and the largest verbatim duplications by measurement (
check-baselines.js), not by smell; extract one well-named helper rather than leaving near-copies. CRAP must not rise and maintainability must not fall on any touched file, and no gate, floor, or threshold may be retuned to make the pass "succeed".
Long-form reference — read on demand
The capsule above is the contract and the whole always-read surface of this
skill. The project-specific material behind it — the finding-severity table and
the post-green refactor pass — lives in the on-demand sibling
reference.md, matching the split the always-on rules already
use (rules/git-conventions.md ⇄
git-conventions-reference.md).
Activating this skill costs the capsule; open a section below only when the
task actually engages it.
04 同仓库更多 Skills
no-capsule-skill
Fixture without a Policy Capsule section.
qa-harness
Conventions for agent-driven QA driving — the one driving-conventions reference behind both `/qa-run` (the known-scenario sweep through a real browser) and `/qa-explore` (agent-led exploratory driving). Use when instrumenting a live surface — covers navigation-first execution, per-surface console and network capture, design-token visual checks, the `F#` finding shape, per-environment resolution, and static driving as the documented interim. The run procedures live in `.agents/workflows/qa-run.md` and `.agents/workflows/qa-explore.md`; this skill is the conventions reference they lean on.
playwright
Robust E2E browser testing with Playwright. Use when writing browser-driven tests — leverage auto-waiting (no `waitForTimeout`), prefer user-visible locators (`getByRole`, `getByText`, `getByLabel`) over CSS/XPath, reuse `storageState` for auth, and enable trace-on-first-retry for CI debugging. Also carries the `data-testid` contract a UI change states in its acceptance criteria.
playwright-bdd
Wires Gherkin `.feature` files to Playwright via the `playwright-bdd` library. Use when running BDD scenarios on a Playwright runtime — pairs with the `gherkin-authoring` skill (scenario prose) and the `playwright` skill (browser conventions). Drives execution by tag expression with trace-first debugging and Playwright-native sharding.
gherkin-authoring
Authors `.feature` files that stay business-readable, translate cleanly from PRD acceptance criteria, and reuse a shared step-definition library. Use when writing or editing scenarios — the SSOT enforcement rules live in `.agents/rules/gherkin-standards.md`; this skill shows authors how to apply them.
security-and-hardening
Hardens code against vulnerabilities. Use when handling user input, authentication, data storage, or external integrations. The non-negotiable security MUSTs live in `.agents/rules/security-baseline.md`; this skill shows how to apply them, with the project's surfacing and validation-response process.