agentleFS
iadr-deviadr-dev/colab/skills/ohc-coding-discipline/SKILL.md

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.

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
  1. Distinctive:

    Before writing code, state assumptions explicitly:

    line 19
  2. Distinctive:

    If the request has multiple plausible interpretations: → Present them.

    line 24
  3. Distinctive:

    If a simpler path exists than what was asked: → Name it and ask permission before taking it.

    line 28
  4. Distinctive:

    If something is genuinely unclear: → Stop.

    line 31
  5. Distinctive:

    Write the minimum code that solves the stated problem.

    line 40
  6. Distinctive:

    If not, remove it or ask first.

    line 50
  7. Distinctive:

    Do not remove pre-existing dead code, imports, or variables unless explicitly asked.

    line 63
  8. Distinctive:

    Use structured trailer format from CLAUDE.md

    line 68
  9. Distinctive:

    Before writing any code, state the success criterion:

    line 79
  10. Distinctive:

    Never claim done without reading the verification output yourself.

    line 93
  11. Distinctive:

    If no plan: run the PLAN workflow first

    line 103
  12. Distinctive:

    Do NOT write code without an approved plan for large tasks

    line 104
  13. Distinctive:

    When finishing any work session:

    line 110
  14. Very specific:

    Update .ohc/notepad.md (see collaborator agent for format)

    line 111
  15. Distinctive:

    Write for your teammate, not yourself

    line 112
  16. Very specific:

    Before starting: read PROJECT.md conventions section.

    line 120
  17. Very specific:

    After finishing: run bash skills/ohc-coding-discipline/scripts/scope-check.sh Confirm output shows only files in the task scope.

    line 121
  18. Distinctive:

    When reviewing or refactoring structure, use precise architecture vocabulary: module, interface, seam, adapter, depth, leverage, and …

    line 128
  19. Distinctive:

    Prefer deep modules: small interfaces that hide meaningful behavior.

    line 130

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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:

  1. Confirm a plan exists in .ohc/plans/
  2. If no plan: run the PLAN workflow first
  3. Do NOT write code without an approved plan for large tasks

OHC Extension 2: Team Handoff Discipline

When finishing any work session:

  1. Update .ohc/notepad.md (see collaborator agent for format)
  2. Write for your teammate, not yourself
  3. Include: what done, what wasn't, blockers, gotchas, next steps
  4. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.