C31-coding-discipline

C31-coding-discipline is a skill for Claude Code, Codex from ChianW/C31. It costs 84 tokens per session (2,297 once invoked), scanned A, original, MIT.

A disciplined workflow for coding tasks that requires a failing test before production code, a plan, isolated work for larger changes, review, and final verification. TDD, or test-driven development, means writing the failing test first, then making it pass.

In plain words
What is it for?
Use it to plan, implement, test, review, and finish software changes, bug fixes, and other coding requests.
Why use it?
It provides checkpoints for unclear requirements, prevents untested production changes, and keeps non-trivial work isolated from the main branch. The workflow also disallows unfinished placeholder code.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: mentions subagents.

Good fit Use it to plan, implement, test, review, and finish software changes, bug fixes, and other coding requests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/chianw/c31/c31-coding-discipline
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add ChianW/C31 --skill c31-coding-discipline
Clone the repo
git clone --depth 1 https://github.com/ChianW/C31

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for C31-coding-discipline

README.md
[![agentmods](https://agentmods.dev/badge/skills/chianw/c31/c31-coding-discipline/github.svg)](https://agentmods.dev/skills/chianw/c31/c31-coding-discipline)
Your own site
<a href="https://agentmods.dev/skills/chianw/c31/c31-coding-discipline"><img src="https://agentmods.dev/badge/skills/chianw/c31/c31-coding-discipline/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for C31-coding-discipline

Your own site · 80×15
<a href="https://agentmods.dev/skills/chianw/c31/c31-coding-discipline"><img src="https://agentmods.dev/badge/skills/chianw/c31/c31-coding-discipline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,297 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00084 $0.02297
Opus 5.5 $0.00034 $0.00919
Sonnet 5.5 $0.00017 $0.00459
Haiku 4.5 $0.00008 $0.00230

Measured 1mo ago against content hash dad0c5561e96, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

C31-coding-discipline scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/core/C31-coding-discipline/SKILL.md · 203 lines

How it starts

The opening of the file, as written. The whole thing — 203 lines — stays where its author put it; the contents beside it link to each section on GitHub.

C31 Coding Discipline

"NO PRODUCTION CODE WITHOUT A FAILING TEST FIRST." — Iron Law of TDD

Enforced development workflow for coding tasks. Not a suggestion — a gate. Each step completes before the next begins. Skill routing conflicts (C31 vs wayfinding vs gsd) resolve in docs/SKILL-ROUTER.md.

7-Step Workflow

1. Brainstorm     ← If requirements unclear, run C31-brainstorm first
2. Worktree       ← git worktree add .feature-branch. Isolated development
3. Plan           ← C31-plan with No Placeholders enforced
4. TDD            ← RED → GREEN → REFACTOR for every unit
5. Execute        ← C31-work wave execution, fresh subagent per task
6. Inline Review  ← 30-second checklist (not 25-minute subagent loops)
7. Finish         ← Verify tests → merge / PR / keep / discard

Step 1: Brainstorm (Conditional)

If the coding task is unclear, ambiguous, or cross-cutting, run C31-brainstorm to produce a requirements doc. If already clear, skip to Step 2.

Gate: Requirements doc must exist (from brainstorm or user) before planning.

Step 2: Worktree (Mandatory for Non-Trivial Tasks)

git worktree add .worktrees/feature-name -b feature/feature-name
cd .worktrees/feature-name
  • Verify clean test baseline: npm test / pytest / etc. must pass before changes.
  • If tests fail on baseline → fix baseline first, or document known failures.

Trivial fast-path: single-file typo fix, one-line change → skip worktree, edit in place.

Step 3: Plan (Mandatory)

Run C31-plan with No Placeholders enforced:

Every unit must contain:
- Exact file path (repo-relative)
- Complete code blocks (not "similar to Task N")
- Exact commands with expected output
- Test scenario: input → action → expected outcome

Placeholder Detection Gate:

Marker Severity Action
"TBD" / "TODO" / "implement later" BLOCKING Stop. Investigate. Fill or remove.
"add appropriate error handling" BLOCKING Specify exact error cases and handling.
"similar to Task N" BLOCKING Inline the actual code.
Vague file paths ("the controller") BLOCKING Use app/controllers/orders_controller.rb.

Read the full file on GitHub · 203 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 203 lines · 84 tokens per session scan A dad0c5561e96

Subscribe to this mod's changes

C31-coding-discipline is a skill published in the GitHub repository ChianW/C31 (1 stars, last pushed 1mo ago), licensed MIT. It adds 84 tokens to every session and 2,297 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.