agentleFS
nshopiknshopik/dream-team/skills/build-rules/SKILL.md

build-rules

Skill2 starsChanged 9 days agoMITView on GitHub

Holds the build rules for a code change: smallest change and reuse first, no speculative abstraction or impossible-case error handling, the change placed in the layer that owns the invariant, comments, option docs and tests. Use before the first edit when asked to build, implement, add, change or fix code, a feature or a bug.

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈14

    Distinctive · estimate

    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:

    Add no abstraction for a hypothetical requirement.

    line 16
  2. Distinctive:

    Leave the code around the change as it is: no cleanup beyond the dedup rules in Scope and Tests.

    line 17
  3. Distinctive:

    Add no error handling or validation for a case that cannot happen.

    line 23
  4. Distinctive:

    Put the change where the invariant lives.

    line 30
  5. Distinctive:

    Never force the change into one file or a local patch.

    line 31
  6. Distinctive:

    Before fixing a shared function, grep every caller.

    line 32
  7. Distinctive:

    Write a comment only for what the code cannot say: a non-obvious constraint, a decision, a gotcha.

    line 38
  8. Distinctive:

    Keep a comment to one sentence where one sentence does.

    line 40
  9. Distinctive:

    Never narrate what the next line does.

    line 41
  10. Distinctive:

    Never restate in prose what readable YAML or config already says.

    line 42
  11. Distinctive:

    Put rationale in the commit body, never in a code comment.

    line 44
  12. Distinctive:

    Write no usage scenario, deployment advice, "set this when …" or consequence of leaving it unset.

    line 53
  13. Distinctive:

    Prefer a new case in an existing table-driven test over a new test function.

    line 65
  14. Distinctive:

    Test through exported APIs where possible.

    line 68

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

build-rules

Scope

  • Implement the smallest change that resolves the task.
  • Reuse what is already in the repo before writing anything new.
  • Add no abstraction for a hypothetical requirement.
  • Leave the code around the change as it is: no cleanup beyond the dedup rules in Scope and Tests.
  • Change the code instead of adding a feature flag or a back-compat shim.
  • Dedup that keeps the line count roughly flat → do it; it need not shrink the diff.

Error handling

  • Add no error handling or validation for a case that cannot happen; trust internal code and framework guarantees.
  • Validate at system boundaries only: user input, external APIs.

Where the change goes

  • Trace the entry point through the layers to the one that owns the invariant.
  • Put the change where the invariant lives.
  • Never force the change into one file or a local patch.
  • Before fixing a shared function, grep every caller.

Comments

These rules cover the comment you are about to write, not only the ones you find.

  • Write a comment only for what the code cannot say: a non-obvious constraint, a decision, a gotcha.
  • Keep a comment to one sentence where one sentence does.
  • Never narrate what the next line does.
  • Never restate in prose what readable YAML or config already says.
  • Give declarative code a header line, not a paragraph.
  • Put rationale in the commit body, never in a code comment.
  • A workaround needs a paragraph of defence → fix the code instead.

Option docs

These rules cover README option lists, reference config comments, --help strings and the comment on the option's own field or constant.

  • Give a config key, flag or env var its accepted values and its default, and stop there.
  • Write no usage scenario, deployment advice, "set this when …" or consequence of leaving it unset.

Tests

  • A bug fix gets a test that reproduces the bug.
  • New behaviour or an exported API change gets a unit or e2e test.
  • A test helper, mock, stub or fixture the change needs → reuse one in the test tree that does the same job.
  • A helper the change would copy from another test file → move it to a shared test module and use it from both files.
  • A path an existing test already covers at another level (unit versus e2e) → extend that test instead of adding a new one.
  • Prefer a new case in an existing table-driven test over a new test function.
  • Convert an existing test to table-driven rather than duplicate it.
  • Mirror realistic data and behaviour.
  • Test through exported APIs where possible.

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.