Code Quality (quality)
quality is the author-side quality gate MODE child of the sk-code family.
It runs after the acting agent applying workflow-implement.md changes the code and before the surface's verification workflow or done-claim.
It consumes the shared surface router, loads the right checklist for the detected surface and target path, fixes quality-gate failures in place, and leaves findings-only output to sk-code-review.
1. WHEN TO USE
Activation Triggers
Use this mode when the request involves:
- Running the post-implementation quality gate before a completion claim.
- Applying P0/P1/P2 author-side checks to changed code, scripts, skills, agents, commands, MCP servers, or spec docs.
- Checking comment hygiene on modified files and removing ephemeral artifact references from comments while preserving durable WHY.
- Loading a SKILLED authoring checklist for
.skilled/skills/, .skilled/agents/, .skilled/commands/, specs/, MCP server source, or language-specific SKILLED files.
- Fixing quality-gate failures in place with
Edit when the fix belongs to the already-authored file.
Keyword triggers: quality gate, code quality, comment hygiene, surface checklist, authoring checklist, SKILLED checklist, check before done.
When NOT to Use
Skip this mode when:
- The user needs code written, files scaffolded, or behavior implemented. Hand it to the acting agent applying
workflow-implement.md for the detected surface.
- A failure needs symptom-to-root-cause investigation or a single-cause bug fix. Use the surface's debugging workflow (
workflow-debug.md).
- The task is to collect final non-mutating verification evidence. Use the surface's verification workflow (
workflow-verify.md).
- The user asks for findings-first review output, severity-ranked findings, or PR review. Use
sk-code-review.
- The task is documentation-only prose with no code-work contract. Use
sk-doc.
Family Boundary
This is an independently invokable member of the sk-code family. It owns the quality gate, not implementation planning, debugging, verification evidence, or formal review reporting. It may edit files that the surface skill already changed to satisfy gate failures, but it does not create new files and does not dispatch subagents.
Pairs well with:
- The surface skill (
sk-code-skilled) immediately before this gate, because implementation writes the files this mode checks.
- The surface's debugging workflow (
workflow-debug.md) when a quality failure reveals a functional bug or failing command.
- The surface's verification workflow (
workflow-verify.md) after P0 quality issues are clear, because verification gates the final claim.
sk-code-review when the user wants findings-only output rather than author-side correction.
2. SMART ROUTING
The sk-code hub routes a post-implementation quality gate here: the request names a quality gate, comment hygiene, an authoring checklist or a check before done, and the hub's quality signal selects this packet.
This mode routes by target path more than by keyword, because the checklists a change needs follow the files it touches.
node scripts/quality-gate.cjs --explain <path> names those checklists and why, and its answer outranks any keyword match.
Three resources load first: references/runner-contract.md for the runner's CLI, gate values and verdict;
../shared/references/universal/code-quality-standards.md for the shared severity floor; and references/code-style-guide.md for this packet's style and comment rules.
The resource domains, loading levels, path-keyed rows and comment-hygiene layers follow in the next section.
The prompt-intent projection in that router only makes the default resources scoreable; it never picks the path-keyed checklist.
Read ROUTER.md before selecting skill-local resources; open only the matched files.
3. RESOURCES
Resource Domains
- This mode ships no house-style checklist. The universal floor and the universal style guide apply on every surface, and each surface's own checklists carry its house style.
../sk-code-skilled/assets/checklists/universal-checklist.md is the SKILLED baseline, loaded when SKILLED is a resolved surface of the target, and the SKILLED JavaScript and CSS house checks sit under ../sk-code-skilled/assets/checklists/js-css-style/.
../sk-code-skilled/assets/checklists/ contains SKILLED authoring checklists for skills, agents, commands, MCP servers, language files, and config; the spec-folder checklist is owned by system-spec-kit.
scripts/quality-gate.cjs is the runner. It reads the change, runs the built-in checks, probes the enforcement layers, lists the checklists the declarations name and prints one verdict. It writes no file.
The only commands it runs beyond its own are the ones a repository's committed .skilled/skills/sk-code/sk-code-quality/repository/quality.json names, each as an argv array under a deadline and the workspace guard, and only once the repository is trusted (references/quality-config.md section 8).
A command a manifest implies is reported as a suggestion it never runs.
references/runner-contract.md holds its CLI, gate values, verdict, envelope grammar and rule ids, and references/quality-config.md holds the repository config: its schema, discovery order, merge rule and trust boundary.
assets/quality-defaults.json holds the runner's base layer: excluded paths, sensor settings and the checklist rows this mode owns. It names no command.
scripts/check-comment-hygiene.sh is the per-file comment-hygiene gate. The runner calls it once per run with --json.
scripts/check-dist-staleness.sh checks generated/distribution artifact drift when that is part of the target.
scripts/ceiling-report.sh [<file>...] lists the ceiling: and intentional-limit: comment markers and tags the ones with no trigger or no measurable signal.
Run it for a debt pass, before a release or when a reviewer asks what limits the code knowingly accepts.
It reads every tracked code file, or only the files named, prints one path:line text [tags] line per marker and a closing markers=N no-trigger=N no-signal=N line, and exits 0 because it reports and does not gate.
scripts/hooks/claude-posttooluse.sh is the legacy write-time hook, kept for direct tests and registered in no runtime. The live write-time warning is .skilled/hooks/post-edit-quality/claude/claude-posttooluse.cjs.
../shared/references/universal/code-quality-standards.md is the cross-mode severity standard this packet consumes, and references/code-style-guide.md is this packet's own style and comment-hygiene guide.
Resource Loading Levels
| Level |
When to Load |
Resources |
| ALWAYS |
Any quality-gate invocation |
../shared/references/stack-detection.md, ../ROUTER.md, ../shared/references/phase-detection.md |
| ALWAYS |
Before any implementation-done claim |
references/runner-contract.md, ../shared/references/universal/code-quality-standards.md, references/code-style-guide.md |
| ALWAYS |
Any quality-gate invocation on changed files |
scripts/quality-gate.cjs, which calls scripts/check-comment-hygiene.sh once over every modified file |
| CONDITIONAL |
The verdict lists a checklist |
Every file in the runner's checklists[], each with the why the verdict gives |
| CONDITIONAL |
The repository has or needs .skilled/skills/sk-code/sk-code-quality/repository/quality.json, or the verdict reports a configured check, a config error or a suggestion |
references/quality-config.md |
| CONDITIONAL |
SKILLED is a resolved surface of the target |
../sk-code-skilled/assets/checklists/universal-checklist.md |
| CONDITIONAL |
A direct check on one file, outside a runner call |
scripts/check-comment-hygiene.sh |
| CONDITIONAL |
.skilled/skills/ target |
../sk-code-skilled/assets/checklists/skill-authoring.md |
| CONDITIONAL |
.skilled/agents/ target |
../sk-code-skilled/assets/checklists/agent-authoring.md |
| CONDITIONAL |
.skilled/commands/ target |
../sk-code-skilled/assets/checklists/command-authoring.md |
| CONDITIONAL |
specs/ target |
../../system-spec-kit/references/workflows/spec-folder-authoring-checklist.md (system-spec-kit) |
| CONDITIONAL |
MCP server source |
../sk-code-skilled/assets/checklists/mcp-server-authoring.md |
| CONDITIONAL |
SKILLED JavaScript, TypeScript, Python, Shell, Rust, JSON, or JSONC files |
../sk-code-skilled/assets/checklists/javascript-checklist.md, ../sk-code-skilled/assets/checklists/typescript-checklist.md, ../sk-code-skilled/assets/checklists/python-checklist.md, ../sk-code-skilled/assets/checklists/shell-checklist.md, ../sk-code-skilled/assets/checklists/rust-checklist/overview-and-p0-parity.md, ../sk-code-skilled/assets/checklists/rust-checklist/p0-safety-and-boundary-discipline.md, ../sk-code-skilled/assets/checklists/rust-checklist/p1-required.md, ../sk-code-skilled/assets/checklists/rust-checklist/p2-evidence-validation-and-resources.md, ../sk-code-skilled/assets/checklists/config-checklist.md as applicable |
| CONDITIONAL |
Generated distribution artifacts or mirrored outputs changed |
scripts/check-dist-staleness.sh |
| ON_DEMAND |
Debt pass, before a release or a reviewer asks what limits the code knowingly accepts |
scripts/ceiling-report.sh |
| ON_DEMAND |
Need the legacy write-time hook's behavior, which no runtime registers |
scripts/hooks/claude-posttooluse.sh |
Target-Path Checklist Map
The runner resolves checklists from two sources: the rows this mode owns in assets/quality-defaults.json, which are the universal floor and, in this hub's own repository, the spec-folder authoring checklist, and each surface's quality.checklists declaration.
Ask the runner which checklists apply to a file, and why, with node scripts/quality-gate.cjs --explain <path>. Its checklists[] and each entry's why are the answer, in any repository.
This repository's own map, the SKILLED rows among them, is rendered in ../sk-code-skilled/SKILL.md under "Quality Checklist Map".
/doctor:sk-code quality shows the same answer for a whole repository: every checklist the gate would load, its seat, its override rows and the hygiene rules that apply.
A repository outside this hub declares its rules in its own config. The runner reads surface declarations only from the hub that holds it: the hub's mode-registry.json and the graph-metadata.json of each skill in the skills folder beside that hub.
- A surface skill that lives in the repository under test, or in any other checkout, is never discovered, even when it declares
surface_detection and a quality block.
- Such a repository names its rules in
.skilled/skills/sk-code/sk-code-quality/repository/quality.json instead.
- Each
checklists[] row names a repository-relative checklist file and selects files by paths, extensions or contentMarkers.
- A file the row names may carry a
## Rule overrides section, read through the shared linter ../shared/scripts/check-rule-overrides.cjs, to drop or replace a rule outside the hard floor at the repository level, which ranks above every surface.
- The limit stays: such a row adds a checklist and never a surface label, so
--explain lists the checklist while its surfaces and surface_skills never name a surface of the repository's own.
references/quality-config.md section 3 holds the row rules.
Comment-Hygiene Enforcement Gates
This mode owns the author-side check and knows the three independent enforcement layers. In any repository, the runner's layers field reports what a probe found for each one, present, absent, untrusted, broken or unknown, and a quality claim cites that field, never this table.
This repository's wiring. The table and the notes after it describe this hub's own repository. They are not universal: another repository may wire none of these layers, or wire them differently.
| Gate |
Where |
Effect |
| Write-time warning |
.skilled/hooks/post-edit-quality/claude/claude-posttooluse.cjs, wired as the Claude PostToolUse hook for Write and Edit in .claude/settings.json |
Warns during authoring when a comment carries ephemeral artifact labels. |
| Pre-commit block |
.skilled/scripts/git-hooks/pre-commit, installed through core.hooksPath by .skilled/scripts/install-git-hooks.sh |
Blocks commits with forbidden comment patterns across runtimes. |
| CI block |
.github/workflows/comment-hygiene.yml |
Blocks pull requests with forbidden comment patterns. |
A repository can switch named core hygiene rules off with commentHygiene.disableRules in its quality config, never a rule the shared rule-overrides.json fixes.
The runner, the pre-commit block and the CI block all read that key through scripts/lib/quality-config.cjs, so a rule switched off for one is off for all three.
The config's additions, such as a ticket prefix, reach the runner alone, so the pre-commit and CI blocks keep the core set minus the disabled rules, and config.hygiene.disabled in the verdict names what is off.
The write-time warning still applies every core rule, and it never blocks.
references/quality-config.md holds the key's rules.
The write-time warning is one adapter of the shared router in .skilled/hooks/post-edit-quality/, which runs after every edit through one adapter per runtime (Claude Code, Codex, Devin, Cursor, Pi and OpenCode) and reports findings before the model's next turn.
The pre-commit block can be bypassed for one commit with SPECKIT_SKIP_COMMENT_HYGIENE=1 git commit, and the CI block re-checks every PR to main, which --no-verify cannot skip.
The live .skilled/scripts/git-hooks/pre-commit also runs the agent-mirror-sync gate and other repository gates, independent of comment hygiene, documented in .skilled/scripts/git-hooks/README.md.
The older .skilled/hooks/git/pre-commit and scripts/hooks/claude-posttooluse.sh are compatibility helpers kept for direct tests. Neither is an installed hook.
Run node scripts/quality-gate.cjs, which calls scripts/check-comment-hygiene.sh once over every modified file that can contain comments.
A finding blocks when it is P0, exact and on a changed line.
A finding on an unchanged line of a touched file blocks only when layers reports the pre-commit or CI layer present, because that layer scans whole files and would fail the change anyway.
Otherwise it is P1 touched-file debt the change did not write.
4. HOW IT WORKS
Quality Gate Workflow
- Resolve the surface and lifecycle state through the shared router. If no implementation changed files yet, route to the appropriate surface skill (
sk-code-skilled) unless the user explicitly asked for a standalone quality audit.
- Collect the changed-file set from the task context or targeted paths. Read each target before editing.
- Run
node scripts/quality-gate.cjs from the repository root. It takes the working-tree change by default, or --base <ref> or --files <path>.... Read the gate before anything else.
BLOCKED means fix in place or escalate.
UNVERIFIED means a required check produced no evidence or two override sources at one level disagree on a rule, so hand each check or rule id in summary.unverified to verification as an open claim.
NOTHING_CHECKED is reported as such and never as clean. ERROR stops the gate until its errors[] entry is repaired.
- Load every checklist the verdict's
checklists[] names, with the why it gives. The universal floor ../shared/references/universal/code-quality-standards.md is always one of them.
- Judge each item in
judgment_required. No built-in check decides input validation, silent failures, initialization safety, commented-out code, accessibility or design restraint.
- Apply the P0/P1/P2 model: P0 blocks completion, P1 should be fixed before handoff unless explicitly accepted, P2 can be documented when there is a clear reason.
- Before a gate fix adds code, apply the Design Restraint Ladder in
../shared/references/universal/code-quality-standards.md and stop at the first rung that holds.
- Fix gate failures in place with
Edit when the correction is limited to already-authored files, then rerun the runner.
- If a gate failure requires new files, broader implementation, or behavior design, hand back to the acting agent applying
workflow-implement.md.
- If a gate failure is caused by an unclear runtime failure, hand to the surface's debugging workflow (
workflow-debug.md) with the observed command, output, and failing target.
- When P0 items are clear, render
node scripts/quality-gate.cjs --format envelope, fill its three PENDING_AGENT_JUDGMENT fields, and hand to the surface's verification workflow (workflow-verify.md) for non-mutating evidence before any done-claim.
P0/P1/P2 Author Checks
The tier rules and the P0 categories live in code-quality-standards.md: the tiers in its section 2, and the P0 categories with the mechanical floor in its section 3.
| Severity |
Meaning |
Gate Effect |
| P0 |
Correctness, safety, broken contract, or forbidden comment metadata |
Blocks completion until fixed or escalated. |
| UNVERIFIED |
Unchecked generated drift, missing required checklist evidence, a required check that produced no evidence, or two override sources at one level that disagree on a rule |
Neither clean nor blocked. The claim stays open until verification proves it with its own command or reports it open. |
| P1 |
Maintainability, routing, style, or authoring-contract issue likely to confuse future work |
Fix before handoff unless the user accepts a documented risk. |
| P2 |
Local polish, clarity, or minor consistency issue with low behavioral risk |
Fix when cheap; otherwise document the deferral and why it is safe. |
Author-Side, Not Review-Side
Quality mode is allowed to edit because it is part of the implementation lifecycle. It should leave the workspace better than it found it, but only inside the current scope. If the requested output is a review report, use sk-code-review; if the requested output is evidence that commands pass, use the surface's verification workflow (workflow-verify.md).
Comment Hygiene
Comments should explain durable WHY and constraints. They must not embed temporary artifact labels, spec paths, packet labels, ticket labels, or phase bookkeeping. When this mode finds a violation, it edits the comment to preserve the durable reason or removes the comment if it has no durable value.
Advisory Evidence-Handoff Envelope
When the orchestrator or surface workflow requests structured evidence, append this advisory envelope after the prose handoff. Never place it in a position that reads as a status verdict, and never let it stand in for the handoff to the surface's verification workflow (workflow-verify.md).
CODE_QUALITY_RESULT v1
schema_version: code-quality/v1
status: advisory
modified_files: <repo-relative paths, or none>
resolved_surface: <declared surface label(s) in detection order | unknown>
checklists_loaded: <checklist paths loaded, or none>
checker_outputs: code-quality-run/v1 gate=<GATE> exit=<n> p0_blocking=<n> unverified=<ids|none> unchecked=<n> layers=pc:<state>,ci:<state>,pe:<state>
p0_p1_p2_decisions: <per-severity dispositions>
accepted_deferrals: <documented P1/P2 deferrals and why safe, or none>
verification_handoff: workflow-verify.md
remaining_accepted_risk: <one-line residual risk, or none>
node scripts/quality-gate.cjs --format envelope renders the machine fields, and references/runner-contract.md section 4 holds the grammar.
The three judgment fields, p0_p1_p2_decisions, accepted_deferrals and remaining_accepted_risk, print as PENDING_AGENT_JUDGMENT until the agent fills them, and a field that still reads it is open work.
p0_p1_p2_decisions also lists each ## Rule overrides row the run applied, as override <rule id> <none|replace> from <checklist file>, and each override-conflict <rule id> <checklist file> <checklist file> between two checklists at one precedence level, ahead of the marker.
A conflicting rule keeps its default and is unverified.
A refused override section, or one with a row whose id no rule carries, ends the run CONFIG_INVALID, exit 3.
A private surface prints by its label only, so the envelope never names a local- skill.
This envelope is advisory and additive only: its status is fixed to advisory and MUST NOT be pass, success, or done. Its presence NEVER reads as a completion, done, works, or passing claim, and it never replaces the handoff to the surface's verification workflow (workflow-verify.md) — it reinforces, and does not relax, the §5 NEVER rule that this mode makes no passing claims.
5. RULES
✅ ALWAYS
- Read target files before editing them.
- Run the runner,
node scripts/quality-gate.cjs, before any implementation-done or quality-pass claim, and load every checklist its checklists[] names. The universal floor is always one of them.
- Resolve surface identity through
../shared/references/stack-detection.md; do not re-author surface detection in this packet.
- Load the SKILLED authoring checklist the verdict names before checking
.skilled/ work. Load the MCP server checklist when the target is MCP server source: a file that defines an MCP server, registers its tools or sets how it starts.
- Let the runner call
scripts/check-comment-hygiene.sh over every modified comment-capable file, or run the checker directly on one file outside a runner call.
- Fix P0 issues before handing to verification unless the only safe action is escalation.
- Keep fixes scoped to quality-gate failures in files already in scope.
- Hand failures that need root-cause investigation to the surface's debugging workflow (
workflow-debug.md) with the exact symptom and evidence.
- Reread the request before the handoff to verification and name any outcome it asks for that no check covers.
⛔ NEVER
- Never create new files; this mode has no
Write authority.
- Never dispatch subagents; this mode has no
Task authority.
- Never make completion, done, works, or passing claims; hand to the surface's verification workflow (
workflow-verify.md) for evidence.
- Never replace a formal findings-first review; route that to
sk-code-review.
- Never paste or fork shared surface-detection, quality, or style references into this packet.
- Never broaden scope into cleanup or refactor work unrelated to the gate failure.
- Never allow ephemeral artifact labels in code comments; preserve durable WHY only.
- Never add a packet-local
graph-metadata.json.
- Never run a command the repository layer does not name. The runner runs its built-in checks and the commands the repository's committed config names, and this mode adds no command of its own.
- Never read
NOTHING_CHECKED or UNVERIFIED as clean. Each names evidence that does not exist yet.
⚠️ ESCALATE IF
- A required P0 check is UNVERIFIED and only the operator can name or install its tool.
- The correct checklist cannot be identified from the target path.
- A P0 issue requires new files, new behavior, or scope beyond an in-place quality fix.
- Comment-hygiene enforcement layers disagree on a blocking result.
- Generated artifacts appear stale but the regeneration command is unknown or unsafe to run.
6. SUCCESS CRITERIA
- The quality gate ran after implementation and before verification.
- Surface identity came from the shared router, not packet-local detection logic.
scripts/quality-gate.cjs ran on the change, and its gate is quoted as printed, never restated as a pass.
- Every checklist the verdict's
checklists[] names was loaded before any quality-pass claim, the universal floor among them.
- The comment-hygiene result came from the runner's single checker call, with zero blocking findings or a documented escalation.
- Each id in
summary.unverified is handed to verification as an open claim.
- P0 issues are fixed in place or escalated with evidence; P1/P2 handling is explicit.
- No new files were authored by this mode.
- Handoff to the surface's verification workflow (
workflow-verify.md) includes the quality evidence and any remaining accepted risk.
7. INTEGRATION POINTS
sk-code routes quality prompts here through mode-registry.json and keeps the hub routing-only.
- The acting agent applying
workflow-implement.md changes files before this gate runs, then applies the surface's workflow-debug.md and workflow-verify.md, which sk-code-skilled bundles as read-only doctrine.
sk-code-review owns findings-first review output and PR-style severity reporting.
system-spec-kit owns spec-folder documentation, validation, and memory workflows when the broader task requires them.
8. REFERENCES AND RELATED RESOURCES
Parent And Shared Router
Quality References And Assets
references/runner-contract.md - The runner's CLI, gate values, verdict, envelope grammar, rule ids and reader rules.
references/quality-config.md - The repository config .skilled/skills/sk-code/sk-code-quality/repository/quality.json: schema, discovery order, merge rule, error codes, trust boundary and known limits.
assets/quality-defaults.json - The runner's base layer: excluded paths, sensor settings and the checklist rows this mode owns.
assets/comment-syntax.json - The language table: the extensions, shebangs and comment syntax the runner and the comment-hygiene checker read.
assets/quality-config.template.json - A starting repository config that holds every key and passes the schema.
../sk-code-skilled/assets/checklists/universal-checklist.md - SKILLED quality baseline, loaded when SKILLED is a resolved surface.
../sk-code-skilled/assets/checklists/skill-authoring.md - Skill authoring checklist.
../sk-code-skilled/assets/checklists/agent-authoring.md - Agent authoring checklist.
../sk-code-skilled/assets/checklists/command-authoring.md - Command authoring checklist.
spec-folder-authoring-checklist.md - Spec folder authoring checklist (owned by system-spec-kit).
../sk-code-skilled/assets/checklists/mcp-server-authoring.md - MCP server authoring checklist.
../sk-code-skilled/assets/checklists/javascript-checklist.md - JavaScript checklist.
../sk-code-skilled/assets/checklists/typescript-checklist.md - TypeScript checklist.
../sk-code-skilled/assets/checklists/python-checklist.md - Python checklist.
../sk-code-skilled/assets/checklists/shell-checklist.md - Shell checklist.
../sk-code-skilled/assets/checklists/rust-checklist/overview-and-p0-parity.md - Rust checklist overview and P0 parity.
../sk-code-skilled/assets/checklists/rust-checklist/p0-safety-and-boundary-discipline.md - Rust P0 safety and boundary discipline.
../sk-code-skilled/assets/checklists/rust-checklist/p1-required.md - Rust required P1 checks.
../sk-code-skilled/assets/checklists/rust-checklist/p2-evidence-validation-and-resources.md - Rust P2 evidence, validation, and resources.
../sk-code-skilled/assets/checklists/config-checklist.md - JSON and JSONC config checklist.
Scripts
scripts/quality-gate.cjs - The quality runner, which prints one verdict for a change in any repository.
scripts/tests/ - The runner's suites, one part per behavior: the named fixtures, the surfaces, the outside-skill rows, the layers and generated rows, the dist adapter, the explain output, the config cases and the unit cases. Run one with node --test.
scripts/check-comment-hygiene.sh - Per-file comment-hygiene checker.
scripts/tests/check-comment-hygiene.test.sh - Comment-hygiene checker tests.
scripts/check-dist-staleness.sh - Distribution drift checker.
scripts/ceiling-report.sh - Ceiling-marker report. Run it for a debt pass, before a release or when a reviewer asks what limits the code knowingly accepts.
scripts/tests/ceiling-report.test.sh - Ceiling-marker report tests.
scripts/hooks/claude-posttooluse.sh - Legacy write-time comment-hygiene hook, kept for direct tests and registered in no runtime.
Universal Standards
Manual Testing Playbook
manual-testing-playbook/manual-testing-playbook.md - The root index of the manual scenarios, with one file per scenario under manual-testing-playbook/quality-gate/.
- Validate the package with
node .skilled/skills/sk-doc/sk-create-manual-testing-playbook/scripts/validate-playbook-package.cjs --package .skilled/skills/sk-code/sk-code-quality/manual-testing-playbook, run from the repository root.
1---2name: sk-code-quality3description: "sk-code quality gate after implementation, before verification: P0/P1/P2 author checks, comment hygiene, and surface checklists."4allowed-tools: [Read, Edit, Bash, Grep, Glob]5version: 1.13.21.06metadata:7 source: https://skillmd.com/skills/michelkerkmeester/sk-code-quality8 family: sk-code9---1011# Code Quality (quality)1213`quality` is the author-side quality gate MODE child of the `sk-code` family.14It runs after the acting agent applying `workflow-implement.md` changes the code and before the surface's verification workflow or done-claim.15It consumes the shared surface router, loads the right checklist for the detected surface and target path, fixes quality-gate failures in place, and leaves findings-only output to `sk-code-review`.1617---1819## 1. WHEN TO USE2021### Activation Triggers2223Use this mode when the request involves:24- Running the post-implementation quality gate before a completion claim.25- Applying P0/P1/P2 author-side checks to changed code, scripts, skills, agents, commands, MCP servers, or spec docs.26- Checking comment hygiene on modified files and removing ephemeral artifact references from comments while preserving durable WHY.27- Loading a SKILLED authoring checklist for `.skilled/skills/`, `.skilled/agents/`, `.skilled/commands/`, `specs/`, MCP server source, or language-specific SKILLED files.28- Fixing quality-gate failures in place with `Edit` when the fix belongs to the already-authored file.2930Keyword triggers: `quality gate`, `code quality`, `comment hygiene`, `surface checklist`, `authoring checklist`, `SKILLED checklist`, `check before done`.3132### When NOT to Use3334Skip this mode when:35- The user needs code written, files scaffolded, or behavior implemented. Hand it to the acting agent applying `workflow-implement.md` for the detected surface.36- A failure needs symptom-to-root-cause investigation or a single-cause bug fix. Use the surface's debugging workflow (`workflow-debug.md`).37- The task is to collect final non-mutating verification evidence. Use the surface's verification workflow (`workflow-verify.md`).38- The user asks for findings-first review output, severity-ranked findings, or PR review. Use `sk-code-review`.39- The task is documentation-only prose with no code-work contract. Use `sk-doc`.4041### Family Boundary4243This is an independently invokable member of the `sk-code` family. It owns the quality gate, not implementation planning, debugging, verification evidence, or formal review reporting. It may edit files that the surface skill already changed to satisfy gate failures, but it does not create new files and does not dispatch subagents.4445Pairs well with:46- The surface skill (`sk-code-skilled`) immediately before this gate, because implementation writes the files this mode checks.47- The surface's debugging workflow (`workflow-debug.md`) when a quality failure reveals a functional bug or failing command.48- The surface's verification workflow (`workflow-verify.md`) after P0 quality issues are clear, because verification gates the final claim.49- `sk-code-review` when the user wants findings-only output rather than author-side correction.5051---5253## 2. SMART ROUTING5455The `sk-code` hub routes a post-implementation quality gate here: the request names a quality gate, comment hygiene, an authoring checklist or a check before done, and the hub's `quality` signal selects this packet.56This mode routes by target path more than by keyword, because the checklists a change needs follow the files it touches.57`node scripts/quality-gate.cjs --explain <path>` names those checklists and why, and its answer outranks any keyword match.5859Three resources load first: `references/runner-contract.md` for the runner's CLI, gate values and verdict;60`../shared/references/universal/code-quality-standards.md` for the shared severity floor; and `references/code-style-guide.md` for this packet's style and comment rules.61The resource domains, loading levels, path-keyed rows and comment-hygiene layers follow in the next section.6263The prompt-intent projection in that router only makes the default resources scoreable; it never picks the path-keyed checklist.64Read [`ROUTER.md`](./ROUTER.md) before selecting skill-local resources; open only the matched files.6566---6768## 3. RESOURCES6970### Resource Domains7172- This mode ships no house-style checklist. The universal floor and the universal style guide apply on every surface, and each surface's own checklists carry its house style.73 `../sk-code-skilled/assets/checklists/universal-checklist.md` is the SKILLED baseline, loaded when SKILLED is a resolved surface of the target, and the SKILLED JavaScript and CSS house checks sit under `../sk-code-skilled/assets/checklists/js-css-style/`.74- `../sk-code-skilled/assets/checklists/` contains SKILLED authoring checklists for skills, agents, commands, MCP servers, language files, and config; the spec-folder checklist is owned by `system-spec-kit`.75- `scripts/quality-gate.cjs` is the runner. It reads the change, runs the built-in checks, probes the enforcement layers, lists the checklists the declarations name and prints one verdict. It writes no file.76 The only commands it runs beyond its own are the ones a repository's committed `.skilled/skills/sk-code/sk-code-quality/repository/quality.json` names, each as an argv array under a deadline and the workspace guard, and only once the repository is trusted (`references/quality-config.md` section 8).77 A command a manifest implies is reported as a suggestion it never runs.78 `references/runner-contract.md` holds its CLI, gate values, verdict, envelope grammar and rule ids, and `references/quality-config.md` holds the repository config: its schema, discovery order, merge rule and trust boundary.79- `assets/quality-defaults.json` holds the runner's base layer: excluded paths, sensor settings and the checklist rows this mode owns. It names no command.80- `scripts/check-comment-hygiene.sh` is the per-file comment-hygiene gate. The runner calls it once per run with `--json`.81- `scripts/check-dist-staleness.sh` checks generated/distribution artifact drift when that is part of the target.82- `scripts/ceiling-report.sh [<file>...]` lists the `ceiling:` and `intentional-limit:` comment markers and tags the ones with no trigger or no measurable signal.83 Run it for a debt pass, before a release or when a reviewer asks what limits the code knowingly accepts.84 It reads every tracked code file, or only the files named, prints one `path:line text [tags]` line per marker and a closing `markers=N no-trigger=N no-signal=N` line, and exits 0 because it reports and does not gate.85- `scripts/hooks/claude-posttooluse.sh` is the legacy write-time hook, kept for direct tests and registered in no runtime. The live write-time warning is `.skilled/hooks/post-edit-quality/claude/claude-posttooluse.cjs`.86- `../shared/references/universal/code-quality-standards.md` is the cross-mode severity standard this packet consumes, and `references/code-style-guide.md` is this packet's own style and comment-hygiene guide.8788### Resource Loading Levels8990| Level | When to Load | Resources |91| --- | --- | --- |92| ALWAYS | Any quality-gate invocation | `../shared/references/stack-detection.md`, `../ROUTER.md`, `../shared/references/phase-detection.md` |93| ALWAYS | Before any implementation-done claim | `references/runner-contract.md`, `../shared/references/universal/code-quality-standards.md`, `references/code-style-guide.md` |94| ALWAYS | Any quality-gate invocation on changed files | `scripts/quality-gate.cjs`, which calls `scripts/check-comment-hygiene.sh` once over every modified file |95| CONDITIONAL | The verdict lists a checklist | Every file in the runner's `checklists[]`, each with the `why` the verdict gives |96| CONDITIONAL | The repository has or needs `.skilled/skills/sk-code/sk-code-quality/repository/quality.json`, or the verdict reports a configured check, a config error or a suggestion | `references/quality-config.md` |97| CONDITIONAL | SKILLED is a resolved surface of the target | `../sk-code-skilled/assets/checklists/universal-checklist.md` |98| CONDITIONAL | A direct check on one file, outside a runner call | `scripts/check-comment-hygiene.sh` |99| CONDITIONAL | `.skilled/skills/` target | `../sk-code-skilled/assets/checklists/skill-authoring.md` |100| CONDITIONAL | `.skilled/agents/` target | `../sk-code-skilled/assets/checklists/agent-authoring.md` |101| CONDITIONAL | `.skilled/commands/` target | `../sk-code-skilled/assets/checklists/command-authoring.md` |102| CONDITIONAL | `specs/` target | `../../system-spec-kit/references/workflows/spec-folder-authoring-checklist.md` (system-spec-kit) |103| CONDITIONAL | MCP server source | `../sk-code-skilled/assets/checklists/mcp-server-authoring.md` |104| CONDITIONAL | SKILLED JavaScript, TypeScript, Python, Shell, Rust, JSON, or JSONC files | `../sk-code-skilled/assets/checklists/javascript-checklist.md`, `../sk-code-skilled/assets/checklists/typescript-checklist.md`, `../sk-code-skilled/assets/checklists/python-checklist.md`, `../sk-code-skilled/assets/checklists/shell-checklist.md`, `../sk-code-skilled/assets/checklists/rust-checklist/overview-and-p0-parity.md`, `../sk-code-skilled/assets/checklists/rust-checklist/p0-safety-and-boundary-discipline.md`, `../sk-code-skilled/assets/checklists/rust-checklist/p1-required.md`, `../sk-code-skilled/assets/checklists/rust-checklist/p2-evidence-validation-and-resources.md`, `../sk-code-skilled/assets/checklists/config-checklist.md` as applicable |105| CONDITIONAL | Generated distribution artifacts or mirrored outputs changed | `scripts/check-dist-staleness.sh` |106| ON_DEMAND | Debt pass, before a release or a reviewer asks what limits the code knowingly accepts | `scripts/ceiling-report.sh` |107| ON_DEMAND | Need the legacy write-time hook's behavior, which no runtime registers | `scripts/hooks/claude-posttooluse.sh` |108109### Target-Path Checklist Map110111The runner resolves checklists from two sources: the rows this mode owns in `assets/quality-defaults.json`, which are the universal floor and, in this hub's own repository, the spec-folder authoring checklist, and each surface's `quality.checklists` declaration.112Ask the runner which checklists apply to a file, and why, with `node scripts/quality-gate.cjs --explain <path>`. Its `checklists[]` and each entry's `why` are the answer, in any repository.113This repository's own map, the SKILLED rows among them, is rendered in `../sk-code-skilled/SKILL.md` under "Quality Checklist Map".114`/doctor:sk-code quality` shows the same answer for a whole repository: every checklist the gate would load, its seat, its override rows and the hygiene rules that apply.115116**A repository outside this hub declares its rules in its own config.** The runner reads surface declarations only from the hub that holds it: the hub's `mode-registry.json` and the `graph-metadata.json` of each skill in the skills folder beside that hub.117- A surface skill that lives in the repository under test, or in any other checkout, is never discovered, even when it declares `surface_detection` and a `quality` block.118- Such a repository names its rules in `.skilled/skills/sk-code/sk-code-quality/repository/quality.json` instead.119- Each `checklists[]` row names a repository-relative checklist file and selects files by `paths`, `extensions` or `contentMarkers`.120- A file the row names may carry a `## Rule overrides` section, read through the shared linter `../shared/scripts/check-rule-overrides.cjs`, to drop or replace a rule outside the hard floor at the repository level, which ranks above every surface.121- The limit stays: such a row adds a checklist and never a surface label, so `--explain` lists the checklist while its `surfaces` and `surface_skills` never name a surface of the repository's own.122- `references/quality-config.md` section 3 holds the row rules.123124### Comment-Hygiene Enforcement Gates125126This mode owns the author-side check and knows the three independent enforcement layers. In any repository, the runner's `layers` field reports what a probe found for each one, `present`, `absent`, `untrusted`, `broken` or `unknown`, and a quality claim cites that field, never this table.127128**This repository's wiring.** The table and the notes after it describe this hub's own repository. They are not universal: another repository may wire none of these layers, or wire them differently.129130| Gate | Where | Effect |131| --- | --- | --- |132| Write-time warning | `.skilled/hooks/post-edit-quality/claude/claude-posttooluse.cjs`, wired as the Claude `PostToolUse` hook for `Write` and `Edit` in `.claude/settings.json` | Warns during authoring when a comment carries ephemeral artifact labels. |133| Pre-commit block | `.skilled/scripts/git-hooks/pre-commit`, installed through `core.hooksPath` by `.skilled/scripts/install-git-hooks.sh` | Blocks commits with forbidden comment patterns across runtimes. |134| CI block | `.github/workflows/comment-hygiene.yml` | Blocks pull requests with forbidden comment patterns. |135136A repository can switch named core hygiene rules off with `commentHygiene.disableRules` in its quality config, never a rule the shared `rule-overrides.json` fixes.137The runner, the pre-commit block and the CI block all read that key through `scripts/lib/quality-config.cjs`, so a rule switched off for one is off for all three.138The config's additions, such as a ticket prefix, reach the runner alone, so the pre-commit and CI blocks keep the core set minus the disabled rules, and `config.hygiene.disabled` in the verdict names what is off.139The write-time warning still applies every core rule, and it never blocks.140`references/quality-config.md` holds the key's rules.141142The write-time warning is one adapter of the shared router in `.skilled/hooks/post-edit-quality/`, which runs after every edit through one adapter per runtime (Claude Code, Codex, Devin, Cursor, Pi and OpenCode) and reports findings before the model's next turn.143The pre-commit block can be bypassed for one commit with `SPECKIT_SKIP_COMMENT_HYGIENE=1 git commit`, and the CI block re-checks every PR to main, which `--no-verify` cannot skip.144The live `.skilled/scripts/git-hooks/pre-commit` also runs the agent-mirror-sync gate and other repository gates, independent of comment hygiene, documented in `.skilled/scripts/git-hooks/README.md`.145The older `.skilled/hooks/git/pre-commit` and `scripts/hooks/claude-posttooluse.sh` are compatibility helpers kept for direct tests. Neither is an installed hook.146147Run `node scripts/quality-gate.cjs`, which calls `scripts/check-comment-hygiene.sh` once over every modified file that can contain comments.148A finding blocks when it is P0, exact and on a changed line.149A finding on an unchanged line of a touched file blocks only when `layers` reports the pre-commit or CI layer `present`, because that layer scans whole files and would fail the change anyway.150Otherwise it is P1 touched-file debt the change did not write.151152---153154## 4. HOW IT WORKS155156### Quality Gate Workflow1571581. Resolve the surface and lifecycle state through the shared router. If no implementation changed files yet, route to the appropriate surface skill (`sk-code-skilled`) unless the user explicitly asked for a standalone quality audit.1592. Collect the changed-file set from the task context or targeted paths. Read each target before editing.1603. Run `node scripts/quality-gate.cjs` from the repository root. It takes the working-tree change by default, or `--base <ref>` or `--files <path>...`. Read the gate before anything else.161 `BLOCKED` means fix in place or escalate.162 `UNVERIFIED` means a required check produced no evidence or two override sources at one level disagree on a rule, so hand each check or rule id in `summary.unverified` to verification as an open claim.163 `NOTHING_CHECKED` is reported as such and never as clean. `ERROR` stops the gate until its `errors[]` entry is repaired.1644. Load every checklist the verdict's `checklists[]` names, with the `why` it gives. The universal floor `../shared/references/universal/code-quality-standards.md` is always one of them.1655. Judge each item in `judgment_required`. No built-in check decides input validation, silent failures, initialization safety, commented-out code, accessibility or design restraint.1666. Apply the P0/P1/P2 model: P0 blocks completion, P1 should be fixed before handoff unless explicitly accepted, P2 can be documented when there is a clear reason.1677. Before a gate fix adds code, apply the Design Restraint Ladder in `../shared/references/universal/code-quality-standards.md` and stop at the first rung that holds.1688. Fix gate failures in place with `Edit` when the correction is limited to already-authored files, then rerun the runner.1699. If a gate failure requires new files, broader implementation, or behavior design, hand back to the acting agent applying `workflow-implement.md`.17010. If a gate failure is caused by an unclear runtime failure, hand to the surface's debugging workflow (`workflow-debug.md`) with the observed command, output, and failing target.17111. When P0 items are clear, render `node scripts/quality-gate.cjs --format envelope`, fill its three `PENDING_AGENT_JUDGMENT` fields, and hand to the surface's verification workflow (`workflow-verify.md`) for non-mutating evidence before any done-claim.172173### P0/P1/P2 Author Checks174175The tier rules and the P0 categories live in [`code-quality-standards.md`](../shared/references/universal/code-quality-standards.md): the tiers in its section 2, and the P0 categories with the mechanical floor in its section 3.176177| Severity | Meaning | Gate Effect |178| --- | --- | --- |179| P0 | Correctness, safety, broken contract, or forbidden comment metadata | Blocks completion until fixed or escalated. |180| UNVERIFIED | Unchecked generated drift, missing required checklist evidence, a required check that produced no evidence, or two override sources at one level that disagree on a rule | Neither clean nor blocked. The claim stays open until verification proves it with its own command or reports it open. |181| P1 | Maintainability, routing, style, or authoring-contract issue likely to confuse future work | Fix before handoff unless the user accepts a documented risk. |182| P2 | Local polish, clarity, or minor consistency issue with low behavioral risk | Fix when cheap; otherwise document the deferral and why it is safe. |183184### Author-Side, Not Review-Side185186Quality mode is allowed to edit because it is part of the implementation lifecycle. It should leave the workspace better than it found it, but only inside the current scope. If the requested output is a review report, use `sk-code-review`; if the requested output is evidence that commands pass, use the surface's verification workflow (`workflow-verify.md`).187188### Comment Hygiene189190Comments should explain durable WHY and constraints. They must not embed temporary artifact labels, spec paths, packet labels, ticket labels, or phase bookkeeping. When this mode finds a violation, it edits the comment to preserve the durable reason or removes the comment if it has no durable value.191192### Advisory Evidence-Handoff Envelope193194When the orchestrator or surface workflow requests structured evidence, append this advisory envelope after the prose handoff. Never place it in a position that reads as a status verdict, and never let it stand in for the handoff to the surface's verification workflow (`workflow-verify.md`).195196```text197CODE_QUALITY_RESULT v1198schema_version: code-quality/v1199status: advisory200modified_files: <repo-relative paths, or none>201resolved_surface: <declared surface label(s) in detection order | unknown>202checklists_loaded: <checklist paths loaded, or none>203checker_outputs: code-quality-run/v1 gate=<GATE> exit=<n> p0_blocking=<n> unverified=<ids|none> unchecked=<n> layers=pc:<state>,ci:<state>,pe:<state>204p0_p1_p2_decisions: <per-severity dispositions>205accepted_deferrals: <documented P1/P2 deferrals and why safe, or none>206verification_handoff: workflow-verify.md207remaining_accepted_risk: <one-line residual risk, or none>208```209210`node scripts/quality-gate.cjs --format envelope` renders the machine fields, and `references/runner-contract.md` section 4 holds the grammar.211The three judgment fields, `p0_p1_p2_decisions`, `accepted_deferrals` and `remaining_accepted_risk`, print as `PENDING_AGENT_JUDGMENT` until the agent fills them, and a field that still reads it is open work.212`p0_p1_p2_decisions` also lists each `## Rule overrides` row the run applied, as `override <rule id> <none|replace> from <checklist file>`, and each `override-conflict <rule id> <checklist file> <checklist file>` between two checklists at one precedence level, ahead of the marker.213A conflicting rule keeps its default and is unverified.214A refused override section, or one with a row whose id no rule carries, ends the run `CONFIG_INVALID`, exit 3.215A private surface prints by its label only, so the envelope never names a `local-` skill.216217This envelope is advisory and additive only: its `status` is fixed to `advisory` and MUST NOT be `pass`, `success`, or `done`. Its presence NEVER reads as a completion, done, works, or passing claim, and it never replaces the handoff to the surface's verification workflow (`workflow-verify.md`) — it reinforces, and does not relax, the §5 NEVER rule that this mode makes no passing claims.218219---220221## 5. RULES222223### ✅ ALWAYS2242251. Read target files before editing them.2262. Run the runner, `node scripts/quality-gate.cjs`, before any implementation-done or quality-pass claim, and load every checklist its `checklists[]` names. The universal floor is always one of them.2273. Resolve surface identity through `../shared/references/stack-detection.md`; do not re-author surface detection in this packet.2284. Load the SKILLED authoring checklist the verdict names before checking `.skilled/` work. Load the MCP server checklist when the target is MCP server source: a file that defines an MCP server, registers its tools or sets how it starts.2295. Let the runner call `scripts/check-comment-hygiene.sh` over every modified comment-capable file, or run the checker directly on one file outside a runner call.2306. Fix P0 issues before handing to verification unless the only safe action is escalation.2317. Keep fixes scoped to quality-gate failures in files already in scope.2328. Hand failures that need root-cause investigation to the surface's debugging workflow (`workflow-debug.md`) with the exact symptom and evidence.2339. Reread the request before the handoff to verification and name any outcome it asks for that no check covers.234235### ⛔ NEVER2362371. Never create new files; this mode has no `Write` authority.2382. Never dispatch subagents; this mode has no `Task` authority.2393. Never make completion, done, works, or passing claims; hand to the surface's verification workflow (`workflow-verify.md`) for evidence.2404. Never replace a formal findings-first review; route that to `sk-code-review`.2415. Never paste or fork shared surface-detection, quality, or style references into this packet.2426. Never broaden scope into cleanup or refactor work unrelated to the gate failure.2437. Never allow ephemeral artifact labels in code comments; preserve durable WHY only.2448. Never add a packet-local `graph-metadata.json`.2459. Never run a command the repository layer does not name. The runner runs its built-in checks and the commands the repository's committed config names, and this mode adds no command of its own.24610. Never read `NOTHING_CHECKED` or `UNVERIFIED` as clean. Each names evidence that does not exist yet.247248### ⚠️ ESCALATE IF2492501. A required P0 check is UNVERIFIED and only the operator can name or install its tool.2512. The correct checklist cannot be identified from the target path.2523. A P0 issue requires new files, new behavior, or scope beyond an in-place quality fix.2534. Comment-hygiene enforcement layers disagree on a blocking result.2545. Generated artifacts appear stale but the regeneration command is unknown or unsafe to run.255256---257258## 6. SUCCESS CRITERIA259260- The quality gate ran after implementation and before verification.261- Surface identity came from the shared router, not packet-local detection logic.262- `scripts/quality-gate.cjs` ran on the change, and its gate is quoted as printed, never restated as a pass.263- Every checklist the verdict's `checklists[]` names was loaded before any quality-pass claim, the universal floor among them.264- The comment-hygiene result came from the runner's single checker call, with zero blocking findings or a documented escalation.265- Each id in `summary.unverified` is handed to verification as an open claim.266- P0 issues are fixed in place or escalated with evidence; P1/P2 handling is explicit.267- No new files were authored by this mode.268- Handoff to the surface's verification workflow (`workflow-verify.md`) includes the quality evidence and any remaining accepted risk.269270---271272## 7. INTEGRATION POINTS273274- `sk-code` routes quality prompts here through `mode-registry.json` and keeps the hub routing-only.275- The acting agent applying `workflow-implement.md` changes files before this gate runs, then applies the surface's `workflow-debug.md` and `workflow-verify.md`, which `sk-code-skilled` bundles as read-only doctrine.276- `sk-code-review` owns findings-first review output and PR-style severity reporting.277- `system-spec-kit` owns spec-folder documentation, validation, and memory workflows when the broader task requires them.278279---280281## 8. REFERENCES AND RELATED RESOURCES282283### Parent And Shared Router284285- [`../SKILL.md`](../SKILL.md) - Routing-only parent hub.286- [`../mode-registry.json`](../mode-registry.json) - Source of truth for mode tool surfaces and packet identity.287- [`../shared/references/stack-detection.md`](../shared/references/stack-detection.md) - Shared surface detection consumed by every mode.288- [`../ROUTER.md`](../ROUTER.md) - Root stage-two intent and resource routing.289- [`../shared/references/phase-detection.md`](../shared/references/phase-detection.md) - Lifecycle transitions around the quality gate.290291### Quality References And Assets292293- [`references/runner-contract.md`](references/runner-contract.md) - The runner's CLI, gate values, verdict, envelope grammar, rule ids and reader rules.294- [`references/quality-config.md`](references/quality-config.md) - The repository config `.skilled/skills/sk-code/sk-code-quality/repository/quality.json`: schema, discovery order, merge rule, error codes, trust boundary and known limits.295- [`assets/quality-defaults.json`](assets/quality-defaults.json) - The runner's base layer: excluded paths, sensor settings and the checklist rows this mode owns.296- [`assets/comment-syntax.json`](assets/comment-syntax.json) - The language table: the extensions, shebangs and comment syntax the runner and the comment-hygiene checker read.297- [`assets/quality-config.template.json`](assets/quality-config.template.json) - A starting repository config that holds every key and passes the schema.298- [`../sk-code-skilled/assets/checklists/universal-checklist.md`](../sk-code-skilled/assets/checklists/universal-checklist.md) - SKILLED quality baseline, loaded when SKILLED is a resolved surface.299- [`../sk-code-skilled/assets/checklists/skill-authoring.md`](../sk-code-skilled/assets/checklists/skill-authoring.md) - Skill authoring checklist.300- [`../sk-code-skilled/assets/checklists/agent-authoring.md`](../sk-code-skilled/assets/checklists/agent-authoring.md) - Agent authoring checklist.301- [`../sk-code-skilled/assets/checklists/command-authoring.md`](../sk-code-skilled/assets/checklists/command-authoring.md) - Command authoring checklist.302- [`spec-folder-authoring-checklist.md`](../../system-spec-kit/references/workflows/spec-folder-authoring-checklist.md) - Spec folder authoring checklist (owned by system-spec-kit).303- [`../sk-code-skilled/assets/checklists/mcp-server-authoring.md`](../sk-code-skilled/assets/checklists/mcp-server-authoring.md) - MCP server authoring checklist.304- [`../sk-code-skilled/assets/checklists/javascript-checklist.md`](../sk-code-skilled/assets/checklists/javascript-checklist.md) - JavaScript checklist.305- [`../sk-code-skilled/assets/checklists/typescript-checklist.md`](../sk-code-skilled/assets/checklists/typescript-checklist.md) - TypeScript checklist.306- [`../sk-code-skilled/assets/checklists/python-checklist.md`](../sk-code-skilled/assets/checklists/python-checklist.md) - Python checklist.307- [`../sk-code-skilled/assets/checklists/shell-checklist.md`](../sk-code-skilled/assets/checklists/shell-checklist.md) - Shell checklist.308- [`../sk-code-skilled/assets/checklists/rust-checklist/overview-and-p0-parity.md`](../sk-code-skilled/assets/checklists/rust-checklist/overview-and-p0-parity.md) - Rust checklist overview and P0 parity.309- [`../sk-code-skilled/assets/checklists/rust-checklist/p0-safety-and-boundary-discipline.md`](../sk-code-skilled/assets/checklists/rust-checklist/p0-safety-and-boundary-discipline.md) - Rust P0 safety and boundary discipline.310- [`../sk-code-skilled/assets/checklists/rust-checklist/p1-required.md`](../sk-code-skilled/assets/checklists/rust-checklist/p1-required.md) - Rust required P1 checks.311- [`../sk-code-skilled/assets/checklists/rust-checklist/p2-evidence-validation-and-resources.md`](../sk-code-skilled/assets/checklists/rust-checklist/p2-evidence-validation-and-resources.md) - Rust P2 evidence, validation, and resources.312- [`../sk-code-skilled/assets/checklists/config-checklist.md`](../sk-code-skilled/assets/checklists/config-checklist.md) - JSON and JSONC config checklist.313314### Scripts315316- [`scripts/quality-gate.cjs`](scripts/quality-gate.cjs) - The quality runner, which prints one verdict for a change in any repository.317- [`scripts/tests/`](scripts/tests/) - The runner's suites, one part per behavior: the named fixtures, the surfaces, the outside-skill rows, the layers and generated rows, the dist adapter, the explain output, the config cases and the unit cases. Run one with `node --test`.318- [`scripts/check-comment-hygiene.sh`](scripts/check-comment-hygiene.sh) - Per-file comment-hygiene checker.319- [`scripts/tests/check-comment-hygiene.test.sh`](scripts/tests/check-comment-hygiene.test.sh) - Comment-hygiene checker tests.320- [`scripts/check-dist-staleness.sh`](scripts/check-dist-staleness.sh) - Distribution drift checker.321- [`scripts/ceiling-report.sh`](scripts/ceiling-report.sh) - Ceiling-marker report. Run it for a debt pass, before a release or when a reviewer asks what limits the code knowingly accepts.322- [`scripts/tests/ceiling-report.test.sh`](scripts/tests/ceiling-report.test.sh) - Ceiling-marker report tests.323- [`scripts/hooks/claude-posttooluse.sh`](scripts/hooks/claude-posttooluse.sh) - Legacy write-time comment-hygiene hook, kept for direct tests and registered in no runtime.324325### Universal Standards326327- [`../shared/references/universal/code-quality-standards.md`](../shared/references/universal/code-quality-standards.md) - Shared code quality standards.328- [`references/code-style-guide.md`](references/code-style-guide.md) - This mode's code style and comment hygiene guide.329330### Manual Testing Playbook331332- [`manual-testing-playbook/manual-testing-playbook.md`](manual-testing-playbook/manual-testing-playbook.md) - The root index of the manual scenarios, with one file per scenario under `manual-testing-playbook/quality-gate/`.333- Validate the package with `node .skilled/skills/sk-doc/sk-create-manual-testing-playbook/scripts/validate-playbook-package.cjs --package .skilled/skills/sk-code/sk-code-quality/manual-testing-playbook`, run from the repository root.