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

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.

agentmods
npx agentmods add skills/chianw/c31/c31-coding-discipline
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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00084 $0.02297
Opus 5 $0.00042 $0.01149
Sonnet 5 $0.00017 $0.00459
Haiku 4.5 $0.00008 $0.00230

Measured 5d ago against content hash dad0c5561e96, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d 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. 5d 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 10d ago), licensed MIT. It adds 84 tokens to every session and 2,297 once invoked, about $0.0004 per session on Opus 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.

Related

Other skills, from other repositories

agent-implementer-sparc-coder

Agent skill for implementer-sparc-coder - invoke with $agent-implementer-sparc-coder.

ruvnet/ruflo · 33 tokens

agent-tdd-london-swarm

Agent skill for tdd-london-swarm - invoke with $agent-tdd-london-swarm.

ruvnet/ruflo · 28 tokens

compare-harnesses

Diff two scaffolded harnesses (ADR-031). Reports manifest meta drift + host list + per-file fingerprint changes (added/removed/changed). Exits 0 IDENTICAL, 1 DRIFT, 2 missing manifest. Use --bundle for the ADR-031 schema-1 JSON envelope.

ruvnet/metaharness · 66 tokens

oia-manifest

Emit .harness/oia-manifest.json declaring layer alignment with the OIA v0.1 9-layer reference architecture. Self-describes the harness's MCP wiring, witness signing, audit log, identity posture (always 'none' at v0.1). --check verifies an existing manifest, --dry-run prints without writing, --json emits to stdout.

ruvnet/metaharness · 79 tokens

create-harness

Scaffold your own focused AI agent harness — pick host (Claude Code, Codex, pi.dev, Hermes), template, agents, skills, and ship a npm-publishable harness with its own npx CLI. Use when a user asks to "create my own agent harness", "scaffold a harness", "make a custom Claude Code plugin like ruflo", or "build a…

ruvnet/metaharness · 89 tokens

diag-harness

Kernel-version skew check (ADR-027). Reports manifest surface + manifest kernel + installed kernel + verdict (match/patch-diff/minor-diff/major-diff). Exits 1 on minor/major skew with a copy-pasteable npm install @metaharness/[email protected] next step. Exits 2 if no .harness/manifest.json at path.

ruvnet/metaharness · 85 tokens