ohc-coding-discipline
Skill2 starsChanged 7 months agoMITView on GitHub
Anti-overengineering rules. Use when writing, reviewing, or refactoring code. Enforces surgical changes, explicit assumptions, minimal scope, and verifiable success criteria. Extended from Karpathy guidelines for team AI workflows.
In this repository32 other files it gives its agents.
- skills/coding/redis-agent-skills/AGENTS.mdAGENTS.md
- skills/coding/redis-agent-skills/CLAUDE.mdCLAUDE.md
- agent-browserSkill
- autopilotSkill
- book-studySkill
- brainstormingSkill
- browser-useSkill
- cavemanSkill
- androidSkill
- brand-guidelinesSkill
- canvas-designSkill
- frontend-designSkill
- supabase-postgres-best-practicesSkill
- theme-factorySkill
- vercel-react-best-practicesSkill
- web-design-guidelinesSkill
- context7-aware-codingSkill
- document-intakeSkill
- explore-codebaseSkill
- find-skillsSkill
- finishing-a-branchSkill
- pdfSkill
- ralphSkill
- requesting-code-reviewSkill
- retrospectiveSkill
- seo-auditSkill
- skill-creatorSkill
- subagent-driven-developmentSkill
- systematic-debuggingSkill
- test-driven-developmentSkill
- writing-plansSkill
- writing-skillsSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
19 rules. About 0 are common, 16 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Before writing code, state assumptions explicitly:
- Distinctive: line 24
If the request has multiple plausible interpretations: → Present them.
- Distinctive: line 28
If a simpler path exists than what was asked: → Name it and ask permission before taking it.
- Distinctive: line 31
If something is genuinely unclear: → Stop.
- Distinctive: line 40
Write the minimum code that solves the stated problem.
- Distinctive: line 50
If not, remove it or ask first.
- Distinctive: line 63
Do not remove pre-existing dead code, imports, or variables unless explicitly asked.
- Distinctive: line 68
Use structured trailer format from CLAUDE.md
- Distinctive: line 79
Before writing any code, state the success criterion:
- Distinctive: line 93
Never claim done without reading the verification output yourself.
- Distinctive: line 103
If no plan: run the PLAN workflow first
- Distinctive: line 104
Do NOT write code without an approved plan for large tasks
- Distinctive: line 110
When finishing any work session:
- Very specific: line 111
Update .ohc/notepad.md (see collaborator agent for format)
- Distinctive: line 112
Write for your teammate, not yourself
- Very specific: line 120
Before starting: read PROJECT.md conventions section.
- Very specific: line 121
After finishing: run bash skills/ohc-coding-discipline/scripts/scope-check.sh Confirm output shows only files in the task scope.
- Distinctive: line 128
When reviewing or refactoring structure, use precise architecture vocabulary: module, interface, seam, adapter, depth, leverage, and …
- Distinctive: line 130
Prefer deep modules: small interfaces that hide meaningful behavior.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
OHC Coding Discipline
Tradeoff: biases toward caution over speed. For trivial one-liners, use judgment. For anything >15 minutes, apply in full.
Principle 1: Explicit Assumptions — Don't guess, ask
Before writing code, state assumptions explicitly:
- What does "done" look like? (specific, not "it works")
- What is the input shape and expected output?
- Are there edge cases not yet mentioned?
If the request has multiple plausible interpretations: → Present them. Don't pick silently. → Threshold: if >1 interpretation AND consequence is >15 min work → ask.
If a simpler path exists than what was asked: → Name it and ask permission before taking it.
If something is genuinely unclear: → Stop. Name what's unclear. Do not infer forward.
See references/assumption-protocol.md for decision tree.
Principle 2: Minimal Scope — No speculative features
Write the minimum code that solves the stated problem.
Forbidden without explicit request:
- Abstractions for single-use code
- Future-proofing
- Unrequested performance optimization
- Refactoring of unrelated code
- New patterns or conventions beyond the task
Test: can every changed line be traced back to the user's explicit request? If not, remove it or ask first.
Unrelated issues: noticed bugs or tech debt outside scope: → Log to .ohc/notepad.md under "## Noticed (not in scope)" → Do NOT fix. Do NOT expand scope silently.
See references/scope-guard.md. Run scripts/scope-check.sh after each task.
Principle 3: Surgical Changes — Clean diffs
Remove only what YOUR changes made unused. Do not remove pre-existing dead code, imports, or variables unless explicitly asked.
Small, logical commits:
- Each commit = one logical change
- Message explains WHY, not just WHAT
- Use structured trailer format from CLAUDE.md
The diff test: would a reviewer understand every changed line from the commit message alone? If not: split the commit or improve the message.
See references/surgical-change.md for examples.
Principle 4: Goal-Driven Execution — Define success first
Before writing any code, state the success criterion:
Success: [specific, verifiable statement]Invalid (not verifiable):
- "Tests pass" — which tests? how many?
- "The feature works" — how do you know?
Valid (verifiable):
- "All 23 auth.test.ts cases pass with 0 skips, coverage ≥80%"
- "curl localhost:3000/api/health returns 200 with {status:'ok'}"
Loop: write → test → read output → fix → test again. Never claim done without reading the verification output yourself.
See references/success-criteria.md for templates by task type.
OHC Extension 1: Workflow Gate
For tasks estimated at >30 minutes:
- Confirm a plan exists in .ohc/plans/
- If no plan: run the PLAN workflow first
- Do NOT write code without an approved plan for large tasks
OHC Extension 2: Team Handoff Discipline
When finishing any work session:
- Update .ohc/notepad.md (see collaborator agent for format)
- Write for your teammate, not yourself
- Include: what done, what wasn't, blockers, gotchas, next steps
- Commit:
chore: update notepad for handoff
OHC Extension 3: Scope Verification
Before starting: read PROJECT.md conventions section.
After finishing: run bash skills/ohc-coding-discipline/scripts/scope-check.sh
Confirm output shows only files in the task scope.
OHC Extension 4: Architecture Language
When reviewing or refactoring structure, use precise architecture vocabulary: module, interface, seam, adapter, depth, leverage, and locality. Prefer deep modules: small interfaces that hide meaningful behavior.
See references/architecture-vocabulary.md before proposing structural changes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

