agentleFS
justinwilliamesjustinwilliames/skills/coding-craft/SKILL.md

coding-craft

Skill1 starsChanged 5 months agoMITView on GitHub

Frontier-quality code changes: read before writing, match the codebase's idiom, keep diffs minimal, comment only constraints, and debug by evidence rather than pattern-matching. Load for any non-trivial code change, review, or debugging session. Do NOT use for greenfield architecture design (it governs changes within a codebase, not system design) — though its debugging and verification rules apply everywhere.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈5

    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
  • could be automatic: a setting could enforce it
  1. Distinctive:

    No speculative abstraction: Don't build the general mechanism for the single case in front of you.

    line 32
  2. Distinctive:

    Comments state constraints, not narration: Write a comment only for what the code cannot say: an invariant, a non-obvious *why*, an …

    line 34
  3. Very specific:

    The invariant-symptom rule: If the symptom is unchanged under two genuinely different fixes, the bug is upstream of the layer you're …

    line 47
  4. Distinctive:

    Instrument, don't speculate: When stuck, add the log line / breakpoint / minimal repro that would decide between your top two hypotheses.

    line 52
  5. Distinctive:

    No claim of "fixed/working" without running the relevant tests or the app itself, and reading the output — the full standard lives in …

    line 57
  6. Distinctive:

    No secrets, tokens, or credentials in code, commits, or logs — ever, including "temporary" ones.

    line 65

≈ “Common” is an estimate: at least 1 in 5 of the 383,637 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 Craft

Code quality for an agent is mostly restraint: the best change is the smallest one that fully solves the problem, written so the next reader can't tell an agent wrote it.

Before writing

  • Read the neighbourhood first. The surrounding file defines naming, error handling, test style, and idiom. Your change should be indistinguishable from the incumbent author's work — matching conventions beats imposing better ones, unless you're asked to refactor.
  • Find the existing helper before writing a new one. Most codebases already contain the function you're about to write. Search before you add.
  • Check the premise (challenge-before-build): if the request describes code you can read, read it — the described bug and the actual bug are frequently different.

The diff discipline

  • Minimal surface. Touch the lines the task requires. Drive-by reformatting, renames, and "while I'm here" cleanups contaminate review and hide the real change. If you spot unrelated debt, report it — don't fix it inside this diff.
  • No speculative abstraction. Don't build the general mechanism for the single case in front of you. Two concrete call sites justify a helper; one does not.
  • Comments state constraints, not narration. Write a comment only for what the code cannot say: an invariant, a non-obvious why, an external contract. Never "// increment the counter", and never comments that talk to the reviewer about your change — those are noise the moment the change merges.
  • Delete what you obsolete. A change that leaves the old path dangling isn't finished. But before deleting anything you didn't create: inspect it — if what you find contradicts the request's description of it, surface that instead of proceeding.

Debugging by evidence

  1. Reproduce before fixing. A fix for an unreproduced bug is a guess with a commit message.
  2. One variable at a time. Change one thing, observe, then the next. Shotgun edits destroy the information each attempt would have produced.
  3. The invariant-symptom rule. If the symptom is unchanged under two genuinely different fixes, the bug is upstream of the layer you're editing — go inspect the input/data/caller instead of writing fix number three (verification-gates).
  4. Read the error. The message usually names the file, line, and cause. Pattern-matching a symptom to a familiar failure without reading the evidence is how you fix the wrong thing.
  5. Instrument, don't speculate. When stuck, add the log line / breakpoint / minimal repro that would decide between your top two hypotheses.

The verification gate

No claim of "fixed/working" without running the relevant tests or the app itself, and reading the output — the full standard lives in verification-gates. A compiling diff proves compilation, nothing else. If the environment prevents running anything, say so and mark the change unverified.

Hygiene non-negotiables

  • No secrets, tokens, or credentials in code, commits, or logs — ever, including "temporary" ones.
  • New code paths get the same error handling the codebase already uses — not less, not a new scheme.
  • Failing tests you didn't cause are reported, not silently "fixed" by weakening assertions.

Named failure modes

Failure modeDetection signal
Idiom importYour diff introduces a style the file didn't have
Drive-by bloatDiff touches files the task didn't require
Speculative frameworkNew abstraction with one caller
Reviewer commentsComment explains the change instead of the code
Shotgun debuggingSecond simultaneous edit before observing the first
Assertion weakeningA test "fixed" by loosening what it checks
Confident guess"This should fix it" on an unreproduced bug

Sync home

Sync home: github.com/justinwilliames/skills — canonical. Installed copies (e.g. ~/.claude/skills/coding-craft) are distribution artifacts: edit the repo, re-copy.

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.