agentleFS
heartnetkungheartnetkung/claude-skills/skills/module-design/SKILL.md

module-design

Skill1 starsChanged 2 months agoMITView on GitHub

How to design a new module before coding it, and how to retire its build docs afterwards. Use when starting a new module or package (contract.md, then spec.md, then boundary.md, then two parallel review agents for simplification/reuse and design quality), and again when that module's implementation is about to be committed or pushed (promote what building taught you, then delete the spec and boundary). Also use when asked to prune, retire, or clean up an existing spec or module README.

4 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. jscott3201/yet-more-skills★ 4same name
    2. AlvaroVFon/skills★ 2same name
    3. cystema/skills★ 1same name
    4. jasoncrawford/claude-skills★ 1same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository5 other files it gives its agents.

The file

Files
SKILL.md

Module docs: contract.md is permanent, the build docs are not

  • contract.md — what the rest of the system may assume of this module, and the rules keeping it true. Permanent. Written before the spec.
  • spec.md — scaffolding for writing the code. Deleted when the module lands. Never named README.md: a doomed file must not wear a durable name.
  • boundary.md — everything the module touches on the outside. Written after the spec, in a separate pass. Deleted when the module lands, alongside the spec.

Default home for a durable fact is the code it is about — call-site comment, test, docstring, --help, or the commit message that made the change. contract.md is the narrow exception; when in doubt it is not a clause.

One-way citation: the doomed files may cite the contract, never the reverse. A contract citing spec.md §Foo breaks when the spec is deleted.

Resolve this skill's directory first

The rest of this skill is in files next to this one, and the reviewers are spawned with their rubrics named by path. Resolve the directory to an absolute path now — an agent starts cold and cannot resolve "next to the skill you were spawned from". It is the "Base directory for this skill" that Claude Code printed when this skill loaded — the same line whether it came from a plugin or a symlink. If there is no such line (the skill arrived as text with no path attached), stop and tell the user — never guess a path.


Phase 1 — starting a module

contract.md, then spec.md, then boundary.md, then two review agents, then reconcile. Read design.md now, before writing any of them. No implementation code until that sequence has finished.

Phase 2 — at merge / commit / push

The build docs are deleted here, but only after what could not be written in advance is captured — and that is the part that gets skipped when it is done from memory. Read merge.md and follow its seven steps.

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.