/claude-kit:coder-rulesfrom Claude Kit
Enforces 6 critical implementation rules (plan-only, layer dependency, clean domain, no log+return, tests pass, comment quality) and a comment policy for /coder command. Loads at /coder startup or Phase 3 of /workflow.
Ships in Claude Kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Applies to every comment you write into a source file, in any language. It does NOT apply to plan, spec, handoff, checkpoint or commit-message text, where process vocabulary is correct and expected.
Write a comment only when it earns its place. Default to none. Add one where the logic is not self-evident: a hidden constraint, a non-obvious invariant, a workaround for a specific defect, or behaviour that would surprise a reader. If deleting the comment would not confuse a future reader, do not write it.
A comment's subject is the code it sits on. A declaration comment names the thing being described and states what it is, what it returns, or what it does. Explain the non-obvious WHY; do not restate WHAT the code already says through its identifiers. If the code is too unclear to explain itself, simplify the code instead of annotating it.
FORBIDDEN — process references. Never mention the workflow that produced the code:
Part 3, part 2 of the plan)AC-2, per AC 4)CR-004, PR-006 fix)per plan, as specified, per review, requested by the reviewerTraceability from code to plan Parts and acceptance criteria belongs in the handoff artifact and the commit message. Those are the permanent record of the change; a source comment is not, and it rots as the file evolves.
FORBIDDEN — change narrative. Never describe the code relative to a previous
version: now uses X instead of Y, previously this returned nil, no longer needed,
removed the old path, added in this refactor. A reader of the file cannot see the
version you are comparing against. Describe only what the code is now.
Do not retrofit. Do not add comments, doc comments, or type annotations to code you did not change in this task.
Keep comments true. A comment that contradicts the code is worse than no comment. When you change a line, update or delete the comment above it.
Grounding: Anthropic prompting best practices (do not comment code you did not change;
comment only where logic is not self-evident); go.dev/doc/comment (a declaration's doc
comment states what the thing returns or does, and must not pin the current
implementation's internals); Google engineering practices (comments explain why, not
what); PEP 8 (comments that contradict the code are worse than none).
Before implementation, critically evaluate plan (Phase 1.5):
Evaluate checks: feasibility, hidden complexities, edge cases, performance, dependencies.
Output: .claude/prompts/{feature}-evaluate.md
Evaluate has an exploration budget (SEE coder.md → evaluate_budget). When budget is reached, DECIDE with available information. Prefer PROCEED with notes over endless research. The planner already researched — evaluate is VALIDATION, not discovery.
After VERIFY passes, run spec compliance self-check (Phase 3.5):
Full checklist: Spec Check
Reviewer-side note: since release v1.21.x, code-reviewer applies an iter-≥2 spot-check on spec_check.status=PASS to guard against silent regressions. The coder is unaffected; the spot-check is performed entirely on the reviewer side via
git diff --name-only.
Read .claude/prompts/{feature}.md. Verify plan passed plan-review.
If plan not found → ERROR, exit. If not approved → ERROR, exit.
Before writing ANY code, evaluate the plan critically.
Decision: PROCEED / REVISE / RETURN (see Evaluate Protocol above).
Write output to .claude/prompts/{feature}-evaluate.md.
Follow Parts order from plan. The plan's Parts list is the source of truth.
If plan unordered: use {LAYERS} slot dependency direction when {ARCHITECTURE_STYLE} == "layered";
otherwise follow plan order verbatim and emit consolidated NIT if ambiguous.
After each Part: PostToolUse hooks auto-format files (slot-driven via auto-fmt.sh: reads FMT_CMD and LANG_EXT from PROJECT-KNOWLEDGE.md cascade; supports {} placeholder for per-file mode). Run resolved {LINT_CMD} only for import/error checks. Check 6 CRITICAL Rules above continuously.
Do NOT run FMT manually between Parts — hooks handle formatting, VERIFY handles final FMT+LINT.
IMPORTANT: Do NOT run the FULL test suite (resolved {TEST_CMD}) between Parts — full verification runs ONCE at Step 4 VERIFY.
Compile errors are caught by LINT; logic errors are caught at VERIFY.
Targeted RED-GREEN-REFACTOR single-test runs within a Part are part of implementation (not verification) and are expected on every Part by default — see .claude/skills/tdd-rules/SKILL.md for the full cycle.
Run full VERIFY using the resolved command from coder.md verify_startup cascade
(PROJECT-KNOWLEDGE.md → VERIFY_CMD; CLAUDE.md fallback; DEPENDENCY_FILE-aware WARN; SKIP-with-NIT).
Kit-default for Go projects (legacy CLAUDE.md fallback): go vet ./... && make fmt && make lint && make test.
If tests fail 3x → load systematic-debugging skill, run Phase 1 root cause investigation.
On success → proceed to Step 5.
Run SPEC CHECK (see Spec Check). S complexity: lightweight (coverage only). If FAIL: inline fix → re-run VERIFY → re-check (max 1 retry). On PASS/PARTIAL → form handoff payload for code-review, including spec_check.
Good:
type Service struct {
ID string
}
Bad:
type Service struct {
ID string `json:"id"`
}
Why: RULE_3 — Domain entities must be pure. No {DOMAIN_PROHIBIT} (resolved from PROJECT-KNOWLEDGE.md). Tags belong in DTOs at the API/transport layer (highest LAYERS entry per PROJECT-KNOWLEDGE.md → LAYERS).
For more examples, see Examples.
Cause: Bug in implementation logic or wrong approach.
Fix: Load systematic-debugging skill. Run Phase 1 (Root Cause Investigation) with
go test -v -count=1 ./... output as evidence. Trace data flow to find root cause.
If root cause found → implement single fix + VERIFY. If still stuck → STOP, request manual help.
Cause: Didn't check architecture rules before implementation. Fix: Review layer-dependency rule per resolved {LAYER_RULE}. Refactor imports per the resolved rule. BLOCKER when slot is set AND {ARCHITECTURE_STYLE} == "layered"; SKIP-with-consolidated-NIT when unset/non-layered (canonical SKIP).
Cause: Assumed familiarity with library API. Fix: ALWAYS use Context7 for external dependencies: resolve-library-id → query-docs.
For all troubleshooting cases, see Troubleshooting.
For detailed checks, read the supporting files in this skill directory:
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub hex0xdeadbeef/claude-kit --plugin claude-kit9 skills in this plugin
/cavemanProject-local terse-output mode for /workflow pipeline. Cuts Messages token cost via concise prose. Loaded only at SessionStart by .claude/scripts/caveman-activate.sh — not auto-invoked on user prompts.
/code-review-rulesReview standards for code-reviewer agent. Loaded by explicit Read in the code-reviewer STARTUP step (disable-model-invocation blocks subagent preload). Covers: severity classification (BLOCKER/MAJOR/MINOR/NIT), decision matrix (APPROVED/APPROVED_WITH_COMMENTS/CHANGES_REQUESTED), auto-escalation rules, grep search patterns for automated checks./design-rulesDesign phase rules for /designer command. Load at /designer startup (step 0). Covers spec quality, design checklist, approach evaluation criteria./planner-rulesTask analysis and planning rules for /planner command. Load at /planner startup (step 0) or when /workflow enters Phase 1. Covers: task classification (7 types), S/M/L/XL complexity routing, code-researcher delegation (L/XL), plan documentation with full code examples./plan-review-rulesReview standards for plan-reviewer agent. Loaded by explicit Read in the plan-reviewer STARTUP step (disable-model-invocation blocks subagent preload). Covers: architecture compliance (import matrix, domain purity), required plan sections validation, severity classification (BLOCKER/MAJOR/MINOR/NIT), decision matrix (APPROVED/NEEDS_CHANGES/REJECTED)./systematic-debuggingSystematic 4-phase debugging process with Iron Law: Root Cause Investigation → Pattern Analysis → Hypothesis & Testing → Implementation. Use when encountering any bug, test failure, unexpected behavior, or build failure — BEFORE proposing fixes. Auto-trigger: load when /coder VERIFY fails 3x consecutively. Keywords: bug, test failing, stuck, not working, can't fix, root cause, 3x fail, test loop, flaky test, unexpected behavior, debugging, investigate. Do NOT use for pre-implementation planning (that is /planner territory).
Other plugins' skills for the same job