agentleFS
ldaumeldaume/agentic-engineering-harness/skills/engineering/coding-discipline/SKILL.md

coding-discipline

Skill3 starsChanged 3 months agoMITView on GitHub

Enforces clarity, surgical diffs, simplicity, and goal-driven TDD for any codebase. Use when implementing features, fixing bugs, refactoring, or making any code change.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

21 rules. About 0 are common, 20 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈20

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the repo's local instructions: AGENTS.md, CLAUDE.md, .cursor/rules/, README.md, contributing docs, or equivalents.

    line 18
  2. Distinctive:

    If project rules conflict with this skill, follow the project rules and tell the user about the trade-off when it matters.

    line 24
  3. Distinctive:

    If expected agent docs are missing and the task is non-trivial, suggest

    line 26
  4. Distinctive:

    If multiple consequential interpretations remain after investigation, present them with a recommendation - do not pick silently.

    line 32
  5. Distinctive:

    Stop before the dependent change when uncertainty cannot be resolved safely.

    line 35
  6. Distinctive:

    Prefer the language standard library, native platform behavior, or an installed dependency over new code or another dependency.

    line 41
  7. Distinctive:

    Add only the minimum code for the requested problem.

    line 43
  8. Distinctive:

    Prefer correction, consolidation, or deletion over another layer.

    line 45
  9. Distinctive:

    Do not simplify away input validation at trust boundaries, security, accessibility, data integrity, necessary recovery, or error handling.

    line 46
  10. Distinctive:

    Start from the product outcome, domain language, constraints, failure modes, and required qualities.

    line 53
  11. Distinctive:

    Treat languages, frameworks, database families, CQRS, and hexagonal or other architecture styles as tools.

    line 56
  12. Distinctive:

    Keep user interfaces thin: presentation, interaction, local UI state, and feedback stay close to the user.

    line 59
  13. Distinctive:

    Prefer task-shaped read models and intent-shaped mutation or command models when generic CRUD or database repositories would hide domain …

    line 62
  14. Distinctive:

    When a material technology choice remains uncertain, run the smallest disposable comparison with representative data shape and volume, …

    line 68
  15. Distinctive:

    Follow the target repository's language and audience rules.

    line 76
  16. Distinctive:

    When no rule exists, preserve the language and terminology of the touched area.

    line 77
  17. Distinctive:

    Do not refactor, reformat, or "improve" adjacent code.

    line 86
  18. Distinctive:

    Remove only imports/symbols your diff made unused.

    line 89
  19. Distinctive:

    Every changed line should trace to the user's request.

    line 90
  20. Distinctive:

    Test through public interfaces (API routes, package exports, user-visible behavior).

    line 110
  21. Distinctive:

    Do not mock internals; do not test private helpers in isolation.

    line 117

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

Coding Discipline

Prime directive: clarity, safe change, bounded impact. Small localized diffs. Investigate discoverable facts; ask when intent, authority, domain semantics, or material impact remain unresolved.

Bias toward caution over speed. Use judgment on trivial tasks.

Project Fit Check

Before changing code:

  1. Read the repo's local instructions: AGENTS.md, CLAUDE.md, .cursor/rules/, README.md, contributing docs, or equivalents.
  2. Detect the package manager, formatter, linter, test runner, language level, and branch/worktree conventions from project files before choosing commands.
  3. Match existing architecture, naming, test style, and error-handling patterns in the touched area.
  4. If project rules conflict with this skill, follow the project rules and tell the user about the trade-off when it matters.
  5. If expected agent docs are missing and the task is non-trivial, suggest scaffold-harness or adapt to the repo's existing docs.

Think before coding

  • State material assumptions explicitly.
  • If multiple consequential interpretations remain after investigation, present them with a recommendation - do not pick silently.
  • Name simpler approaches and push back when warranted.
  • Stop before the dependent change when uncertainty cannot be resolved safely.

Simplicity first

  • Reuse the owning implementation or established repository pattern when it already fits.
  • Prefer the language standard library, native platform behavior, or an installed dependency over new code or another dependency.
  • Add only the minimum code for the requested problem. No speculative features, abstractions, or configuration.
  • Prefer correction, consolidation, or deletion over another layer.
  • Do not simplify away input validation at trust boundaries, security, accessibility, data integrity, necessary recovery, or error handling.
  • Self-check: Would a senior engineer call this overcomplicated? If yes, simplify.

End-to-end architecture

  • Start from the product outcome, domain language, constraints, failure modes, and required qualities. Frontend, backend, data, infrastructure, and operations are one change system, not handoff departments.
  • Treat languages, frameworks, database families, CQRS, and hexagonal or other architecture styles as tools. Select them for the current context and evidence, not as maturity badges.
  • Keep user interfaces thin: presentation, interaction, local UI state, and feedback stay close to the user; domain policy and durable decisions stay at the strongest reusable boundary.
  • Prefer task-shaped read models and intent-shaped mutation or command models when generic CRUD or database repositories would hide domain language, authorization, concurrency, transaction, or query semantics.
  • Preserve cheap change through explicit boundaries and public contracts. Do not pre-build speculative flexibility in the name of avoiding future lock-in.
  • When a material technology choice remains uncertain, run the smallest disposable comparison with representative data shape and volume, concurrency, failures, latency, memory, I/O, recovery, and operating cost. Record the decision and discard the spike unless production hardening is an explicit next investment.

Language

  • Follow the target repository's language and audience rules.
  • When no rule exists, preserve the language and terminology of the touched area. Do not translate product copy, documentation, or tests incidentally.

Surgical changes

  • Touch only what the request requires.
  • One rule with several call sites is one unit of work. Fixing only the site the request names leaves the rule half-applied. Extend the fix to its siblings and say which ones, or name them when the extension is genuinely out of scope.
  • Do not refactor, reformat, or "improve" adjacent code.
  • Match existing style and patterns in the touched area.
  • Unrelated dead code: mention it - do not delete unless asked.
  • Remove only imports/symbols your diff made unused.
  • Every changed line should trace to the user's request.

Goal-driven execution

RequestSuccess criteria
Add validationTests for invalid inputs pass
Fix bugFailing test reproduces it, then passes
RefactorTests pass before and after

Multi-step work: brief plan as [Step] -> verify: [check].

TDD

Tests are design feedback, not a phase after implementation. Use vertical slices - one behavior test, minimal implementation, repeat. Prefer the harness-referenced or catalog coding-discipline Skill (or the consumer's pinned release). Follow a project-local tdd Skill only when it is a thin wrapper with real local deltas, not a duplicate of portable TDD.

  • Test through public interfaces (API routes, package exports, user-visible behavior).
  • Express each behavior with Given/When/Then semantics: preconditions and context, one relevant stimulus, then an externally observable outcome. Use the target framework's names and structure; comments or a GWT library are not required.
  • Name behavior in the target's domain language; keep examples, tests, code, and public contracts aligned.
  • Do not mock internals; do not test private helpers in isolation.
  • Match test type to risk: unit for logic, integration/e2e for user flows (per AGENTS.md).
  • For a disposable spike whose purpose is learning, use a hypothesis, timebox, and exit decision instead of pretending it is production code. Discard it or restart the production slice from public behavior with tests.

Quality mindset

  • Understand the problem before choosing a solution; assess value and risk before estimating effort.
  • For bugs, reproduce the failure, trace callers and shared ownership, and fix the root cause at the narrowest common boundary.
  • Quality at the start: acceptance criteria and tests - not late inspection.
  • Readable over clever; abstractions only when they remove real complexity.
  • Direct communication: name trade-offs, constraints, and next step.

Optional Complement

Use the upstream ponytail Skill only when repeated overengineering justifies a stronger implementation-style guardrail and the target host has passed a representative pilot. It complements this workflow; it does not override target instructions or the safeguards above.

Working signal

Fewer unnecessary diff lines, fewer rewrites from over-engineering, clarifying questions before implementation.

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.