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.
npx agentmods add skills/chianw/c31/c31-coding-disciplinenpx skills add ChianW/C31 --skill c31-coding-disciplinegit clone --depth 1 https://github.com/ChianW/C31Wrote 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.
[](https://agentmods.dev/skills/chianw/c31/c31-coding-discipline)<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>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.
| Model | Per session | Once 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 |
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.
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. |
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.
- 5d ago First seen · 203 lines · 84 tokens per session scan A dad0c5561e96
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.
Other skills, from other repositories
agent-implementer-sparc-coder
Agent skill for implementer-sparc-coder - invoke with $agent-implementer-sparc-coder.
agent-tdd-london-swarm
Agent skill for tdd-london-swarm - invoke with $agent-tdd-london-swarm.
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.
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.
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…
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.