/cleancoding:cleancodingfrom Clean Coding
Evidence-backed engineering for implementing, debugging, refactoring, and reviewing code or configuration. Use when changing code; defining acceptance criteria; fixing a defect at its root cause instead of a symptom; protecting contracts, trust boundaries, state, or error integrity; or deciding how much design, testing, documentation, performance work, or rollout care a change needs. Applies DRY, KISS, and YAGNI, the shared three-loop stop rule, and a receipt-based completion gate.
Ships in Clean Coding. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Before editing, classify the task and derive a proportional task contract in working context (field names follow the shared contracts/task-contract.schema.json in the repository): task type, required observable outcome, acceptance checks, baseline or exact failure evidence, non-goals, expected change surface, constraints and known consumers, and the stop condition. Keep it brief for a mechanical low-risk change. Ask for direction only when a semantic ambiguity would materially change the result.
| Task type | Workflow |
|---|---|
| Defect or incident | Reproduce or directly observe the failure, then follow root-cause.md. The loop limit applies from the first failed fix. |
| Feature | Implement the acceptance checks without inventing a root cause. The loop limit applies only when corrective attempts repeatedly fail the same check. |
| Refactor | Establish a passing behavioral baseline, make small transformations, and re-run the baseline after each meaningful step. Observable behavior is preserved. |
| Review | Compare the artifact with its requirements, contracts, and verified behavior. Report evidence and uncertainty. Do not mutate unless the user also requests changes. |
| Mixed | Separate behavior change, defect correction, and refactoring into explicit phases with their own checks. |
Read the reference that matches the risk in the task contract; skip the rest.
One loop is a completed corrective cycle on the same unmet acceptance criterion: hypothesis, corrective action, verification, criterion still unmet. Read-only evidence gathering is not a loop. Changing the tool, wording, file, or agent does not create a new problem; reset the count only when evidence shows the causal condition materially changed.
Keep a loop log from the first failed cycle: loop number, hypothesis, action, evidence, outcome, and why the criterion remains unmet.
After three unsuccessful loops, do not start a fourth. Stop mutations and repeated executions on that track and begin the next user-visible response with this receipt:
LOOP LIMIT REACHED
Loops: 3 unsuccessful cycles; loop 4 not started.
Problem: <unmet acceptance criterion and exact failure>
Attempts: <three hypotheses, actions, and outcomes>
Mechanism: <evidence-backed cause, or labeled unknown>
Evidence: <logs, tests, traces, or state>
Decision needed: <specific choice, access, or information>
Next step: Waiting for user direction.
Continue unrelated work only when it cannot alter or conceal the blocked problem. After direction, keep the existing count unless the direction changes the causal track or scope. Use the receipt only when work actually stops under this rule; a warning that allowed an action is not a stop.
Before reporting completion, confirm every item in completion-gate.md that applies to the task type. Do not report success when only a symptom changed, verification was skipped, an acceptance check remains unmet, or the loop limit was reached. The bundled Stop hook blocks a final response that changed files but carries no receipt.
After tool-using or mutating work, end the response with a compact factual receipt. Omit it when no work was performed. Every line comes from the recorded actions of this session, not from memory of what was intended.
RECEIPT
Outcome: <what was delivered or decided>
Changed: <files, systems, or state touched; "none" when read-only>
Verified: <checks run and their observed results>
Unverified: <claims, risks, or checks that were skipped, with the reason>
Open: <blocked or deferred items and who decides>
agents/openai.yaml (opens in a new tab)references/completion-gate.md (opens in a new tab)references/contracts-and-boundaries.md (opens in a new tab)references/design-principles.md (opens in a new tab)references/performance-and-rollout.md (opens in a new tab)references/root-cause.md (opens in a new tab)references/tests-and-docs.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
2 plugins ship this exact skill · first indexed Sep 6, 2026
Other plugins' skills for the same job
npx claudepluginhub elijah1128/stanhelp --plugin cleancoding