agentleFS
joshuadavidthomasjoshuadavidthomas/agent-skills/coding-standards/SKILL.md

coding-standards

Skill49 starsChanged 6 months agoMITView on GitHub

Use when reviewing code quality, asking whether a refactor or design is good, looking for code smells, or evaluating architecture tradeoffs. Identifies shallow interfaces, invalid state models, unclear boundaries, hidden effects, weak failure contracts, over-mocking, over-abstraction, compatibility glue, and clean-looking code that preserves bad models.

120 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use everything-claude-code, everything-claude-code-conventions and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • InfopibeSkill

    everything-claude-code

    Also in 9 projects that use this

  • mryeastcodeSkill

    everything-claude-code-conventions

    Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

    Also in 8 projects that use this

  • niloykumarbarmanSkill

    agent-sort

    Build an evidence-backed ECC install plan for a specific repo by sorting skills, commands, rules, hooks, and extras into DAILY vs LIBRARY buckets using parallel repo-aware review passes. Use when ECC should be trimmed to what a project actually needs instead of loading the full bundle.

    Also in 8 projects that use this

  • tpavanipradeepSkill

    nextjs-turbopack

    Next.js 16+ and Turbopack — incremental bundling, FS caching, dev speed, and when to use Turbopack vs webpack.

    Also in 15 projects that use this

  • CodeWithBehnamSkill

    dmux-workflows

    Multi-agent orchestration using dmux (tmux pane manager for AI agents). Patterns for parallel agent workflows across Claude Code, Codex, OpenCode, and other harnesses. Use when running multiple agent sessions in parallel or coordinating multi-agent development workflows.

    Also in 17 projects that use this

  • InfopibeSkill

    investor-outreach

    Draft cold emails, warm intro blurbs, follow-ups, update emails, and investor communications for fundraising. Use when the user wants outreach to angels, VCs, strategic investors, or accelerators and needs concise, personalized, investor-facing messaging.

    Also in 22 projects that use this

  • +1 more from Infopibe

The file

We split this skill into the rules it gives an agent

8 rules. 0 are common, 8 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 104 edited versions we read keep these.

  • 8

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Make valid states and transitions explicit: Prefer states, variants, lifecycle rules, and transition points over boolean blindness, …

    line 22
  2. Distinctive:

    Shape deep modules: Put cohesive behavior behind low-burden interfaces at real seams.

    line 23
  3. Distinctive:

    Do not hard-pivot from one dogma to its opposite.

    line 43
  4. Distinctive:

    “The old shape might still be used.”: Check for a real user, data, or public-contract obligation.

    line 56
  5. Distinctive:

    Understand the local code first: Follow existing conventions when they communicate the model.

    line 61
  6. Distinctive:

    Find the caller burden: Ask what a caller or future maintainer must remember that the code could make explicit or enforce.

    line 63
  7. Distinctive:

    Choose the smallest honest shape: Do not simplify by lying; do not model so much that the truth becomes harder to see.

    line 64
  8. Distinctive:

    Verify the claim: Use project-native tests and checks that prove the behavior or contract the change depends on.

    line 65

“Common” is measured: kept by at least 6 in 10 of the 104 edited versions of this file we could read. “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 Standards

“Thus, programs must be written for people to read, and only incidentally for machines to execute.”
— Abelson and Sussman, Structure and Interpretation of Computer Programs

“In this connection it might be worth-while to point out that the purpose of abstracting is not to be vague, but to create a new semantic level in which one can be absolutely precise.”
— Edsger W. Dijkstra, “The Humble Programmer”

Good code solves a real problem through a model people can understand, use, change, and repair. It tells the truth at the right grain: concepts named where they matter, valid states made clear, boundaries translated, consequences visible, failures classified, behavior verified, and unnecessary structure deleted.

Borrow design pressure, not ecosystem ceremony: impossible states and explicit failure/effect boundaries from Rust; domain modules and algebraic modeling from ML traditions; anti-corruption boundaries from integration-heavy systems. Translate the idea into the host language's native tools.

Core Tenets

  • Code communicates a model. Names, types, modules, tests, and interfaces should reveal what is true in the domain and what must not happen.
  • Represent meaning at the right grain. Make important distinctions explicit; do not turn every primitive, parser detail, or storage artifact into domain vocabulary.
  • Make valid states and transitions explicit. Prefer states, variants, lifecycle rules, and transition points over boolean blindness, nullable phases, and hidden ordering requirements.
  • Shape deep modules. Put cohesive behavior behind low-burden interfaces at real seams; a shallow wrapper mostly gives the same work another name.
  • Translate at boundaries. External, persisted, framework-shaped, protocol-shaped, or runtime-hop data should be mapped into the internal model before it reaches core logic.
  • Make consequences legible. IO, mutation, time, network, async work, authority, retries, resource cost, and other effects should be visible where they affect reasoning.
  • Handle errors as part of the design. Expected failures belong in contracts; defects and operational causes need different recovery, reporting, and diagnostics.
  • Verify the real claim. Tests and checks should prove behavior, invariants, transitions, boundaries, and failure modes through real seams, not private choreography.
  • Delete what does not carry meaning. Collapse speculative generality, indirection mazes, stale shapes, duplicate concepts, and test-only surfaces unless they protect a real obligation.

Non-negotiables

These are not style preferences. Treat them as design failures unless the surrounding code has a real constraint that explains them.

  • Raw boundary data flows through core logic after being “validated.”
  • Illegal states are normal representable values.
  • Private parsing, storage, optimization, or test scaffolding becomes public vocabulary.
  • A pass-through wrapper is presented as architecture.
  • Consequential effects, authority, or expected failures are hidden from callers.
  • Tests prove mocks, spies, or helper choreography instead of observable behavior.

Tradeoffs

Do not hard-pivot from one dogma to its opposite. Every design accepts costs; choose the smallest honest shape with the information available.

Rejected Framings

Reject these when they avoid modeling the real problem.

  • “The value was already validated earlier.” Parse or translate at the boundary, pass the refined value inward, and make later code hard to call with the wrong shape.
  • “This is just the API/DB/framework shape.” Boundary shapes can be used at the edge; they should not become the internal model by accident.
  • “The existing code throws, so this can throw too.” Preserve unsafe failure contracts only when compatibility requires it; new local logic should distinguish expected failures from defects.
  • “This wrapper clarifies responsibilities.” A wrapper earns its keep only when it hides complexity, owns policy or sequencing, protects an invariant, or translates across a real seam.
  • “This distinction exists in the source format.” A distinction can be real and still be an implementation detail. Expose it only when callers need it.
  • “This interface gives us future flexibility.” A seam is real when behavior varies, a boundary translates, or tests substitute through an intentional seam.
  • “Mocks make this isolated.” Module mocks often isolate the wrong thing. Replace behavior through real seams and verify observable outcomes.
  • “The old shape might still be used.” Check for a real user, data, or public-contract obligation. If the contract is intentionally changing, move to the end-state shape.
  • “A lint/type/test suppression fixes it.” Suppressions need a narrow reason and a safety invariant; otherwise they hide contracts.

How to Apply

  1. Understand the local code first. Follow existing conventions when they communicate the model; change them deliberately when they preserve the wrong model.
  2. Classify the concern. Domain model, state, module, boundary, effect, error, verification, complexity, or maintainability.
  3. Find the caller burden. Ask what a caller or future maintainer must remember that the code could make explicit or enforce.
  4. Choose the smallest honest shape. Do not simplify by lying; do not model so much that the truth becomes harder to see.
  5. Verify the claim. Use project-native tests and checks that prove the behavior or contract the change depends on.
  6. Remove obsolete scaffolding. Once the real obligation is understood, keep the requirement and delete the leftover shape.

A review finding is ready only when it names the concrete code shape, the caller or maintainer burden, the standard it violates, and the smallest honest change. Drop findings that do not have code evidence or a real cost.

Reference Map

For nontrivial reviews or design advice, load only the reference files that match the concern below. Do not read every reference by default, and do not treat this root summary as the full standard.

ConcernRead
Shared terms need clarificationreferences/vocabulary.md
Domain distinctions, granularity, identity, or implementation details leaking into the modelreferences/domain-modeling.md
Flags, nullable lifecycle fields, invalid combinations, transitions, loops, or authorityreferences/state.md
Deep modules, module roles, seams, dependency shape, resource ownership, or pass-through wrappersreferences/modules.md
Raw API/DB/framework/provider shapes, parsing, DTOs, source-of-truth conflicts, or trust changesreferences/boundaries.md
IO, mutation, authority, async/background work, retries, idempotency, or hidden consequencesreferences/effects.md
Expected failures, defects, operational failures, diagnostics, or human-facing failure factsreferences/error-handling.md
Behavior tests, brittle mocks, characterization tests, evidence, or weak verificationreferences/verification.md
Overengineering, over-modeling, indirection mazes, speculative generality, or reasoning-cost smellsreferences/complexity.md
Contracts, internal freedom, Chesterton's fence, refactoring, compatibility obligations, or clean end-state changesreferences/maintainability.md

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.