agentleFS
malinskibeniaminmalinskibeniamin/skills/codebase-design/SKILL.md

codebase-design

Skill4 starsChanged 10 days agoMITView on GitHub

Design deep modules with small interfaces. Use when choosing seams, reducing file-hop friction, deepening modules, testing APIs, or applying shared design vocabulary.

194 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use setup-ts-deep-modules, decision-mapping and 3 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.
  • liufeng1976Skill

    setup-ts-deep-modules

    Wire dependency-cruiser into a TypeScript repo so each package is a deep module — implementation hidden in subfolders, reachable only through its entry-point files. User-invoked.

    Also in 43 projects that use this

  • FabienDehopreSkill

    decision-mapping

    Turn a loose idea into a sequenced map of investigation tickets, then drive them to resolution one at a time.

    Also in 8 projects that use this

  • RoentekSkill

    loop-me

    Grill me about specs for the workflows I want to build, within this workspace.

    Also in 55 projects that use this

  • ryotaroh180105Skill

    claude-handoff

    Hand the current conversation off to a fresh background agent that picks up the work immediately.

    Also in 41 projects that use this

  • simo97Skill

    migrate-to-shoehorn

    Migrate test files from `as` type assertions to @total-typescript/shoehorn. Use when user mentions shoehorn, wants to replace `as` in tests, or needs partial test data.

    Also in 56 projects that use this

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • 0

    Common

    Most of the 181 edited versions we read keep these.

  • 3

    Distinctive

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Use GLOSSARY.md terms, via GLOSSARY-MAP.md when present.

    line 9
  2. Distinctive:

    Ask whether methods/parameters can shrink and more complexity can hide.

    line 35
  3. Distinctive:

    Deletion test: if removal makes complexity vanish, the module was pass-through.

    line 40
  4. Distinctive:

    When two designs survive deletion, Call the Skill tool with "plan-arbiter": depth, locality, test surface, rollback.

    line 57
  5. Very specific:

    Read DEEPENING.md for cleanup/dependencies/tests.

    line 61

“Common” is measured: kept by at least 6 in 10 of the 181 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

On interface/type/shared-state changes, read Poteto.

Design deep modules: substantial behavior behind a small, independently testable interface. Apply verifiability: caller leverage and locality, not implementation size. Use GLOSSARY.md terms, via GLOSSARY-MAP.md when present; respect ADRs.

Reduce caller knowledge/coordination; preserve required behavior.

Imports: checks.

Glossary

Use exactly:

Module -- interface plus implementation: function, class, package, slice.

Interface -- everything callers know: types, invariants, ordering, errors, config, performance; broader than signature.

Implementation -- module internals.

Depth -- interface leverage. Deep means small interface/large behavior; shallow means similar interface and implementation complexity.

Seam -- where behavior can vary without editing the caller; its interface lives here. Avoid: boundary, except DDD bounded context.

Adapter -- concrete implementation at a seam, named by role.

Leverage -- capability per interface learned.

Locality -- change, bugs, knowledge, verification concentrate together.

Ask whether methods/parameters can shrink and more complexity can hide.

Principles

  • Depth is an interface property, not line ratio; private seams need not leak.
  • Deletion test: if removal makes complexity vanish, the module was pass-through; if complexity spreads into callers/tests, it earned its keep.
  • The interface is the test surface: callers and tests cross the same seam. Testing past it signals a weak shape.
  • One adapter is a hypothetical seam; Two adapters means a real one.
  • Direct local code beats an abstraction that only moves code.

Caller-first sketch

For new/changed interfaces, sketch caller success and failure before types. Name state owner, invariant and failure result. Derive signatures; apply probe.

Testability

  1. Exercise the public interface with a focused command and repeatable fixture.
  2. Control dependencies at existing seams; return observable results and isolate state.
  3. Expose invariants and failure diagnostics; prove wrong behavior fails through the public interface.

When two designs survive deletion, Call the Skill tool with "plan-arbiter": depth, locality, test surface, rollback. Other hosts: dependency loading.

Reject depth-by-line-count, interface-as-TypeScript-keyword, and vague boundary wording.

Read DEEPENING.md for cleanup/dependencies/tests; DESIGN-IT-TWICE.md for alternatives.

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.