agentleFS
ahonnahonn/dotfiles/.claude/skills/codebase-design/SKILL.md

codebase-design

Skill62 starsChanged 2 months agoMITView on GitHub

Design or refactor module interfaces to hide complexity, reduce caller coupling, and clarify dependency ownership.

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 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.
  • 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

  • LesaniSkill

    writing-beats

    Shape an article as a journey of beats, choose-your-own-adventure style. The user picks a starting beat from the raw material, you write only that beat, then offer options for where to pivot next, beat by beat, until the article reaches a natural end. Use when the user has raw material and wants to assemble it as a narrative rather than an argument.

    Also in 58 projects that use this

  • AWSSkill

    to-questionnaire

    Turn a decision you can't fully answer into a questionnaire for someone else to fill in.

    Also in 90 projects that use this

  • LesaniSkill

    writing-shape

    Take a markdown file of raw material and shape it into an article through a conversational session — drafting candidate openings, growing the piece paragraph by paragraph, arguing about format (lists, tables, callouts, quotes) at each step. Use when the user has a pile of notes, fragments, or a rough draft and wants help turning it into something publishable.

    Also in 58 projects that use this

  • +1 more from Lesani

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 181 edited versions we read keep these.

  • 7

    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:

    Use the project's established domain language.

    line 10
  2. Distinctive:

    Keep callers' common operations straightforward.

    line 26
  3. Distinctive:

    Keep related behavior together.

    line 27
  4. Distinctive:

    Keep internal dependencies private unless callers need to supply or configure them.

    line 29
  5. Distinctive:

    Prefer pure computation for domain decisions and explicit ownership for effects.

    line 30
  6. Distinctive:

    Consider removing a pass-through layer when it contributes no policy, isolation, or stable contract.

    line 31
  7. Distinctive:

    Follow global AGENTS.md for test mode and authorization.

    line 35

“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

Codebase Design

Design modules that hide substantial behavior behind interfaces callers can understand. Judge a design by the knowledge and coordination it removes from callers, not by file counts or implementation length.

Use the project's established domain language. The vocabulary below supports reasoning; it does not forbid terms such as component, service, API, or boundary.

Working vocabulary

  • Module: Code with an interface and an implementation, from a function to a package or feature.
  • Interface: Everything callers must know: inputs, outputs, invariants, ordering, errors, configuration, and relevant performance constraints.
  • Depth: Useful behavior exposed relative to the complexity callers must understand.
  • Seam: A place where behavior can be substituted without editing its consumers.
  • Adapter: A concrete implementation that connects a dependency at a seam.
  • Locality: Related decisions and changes stay together instead of spreading across callers.

Design from the actual problem

Inspect callers, implementation, and dependencies before proposing a new interface. Identify the concrete cost: repeated policy, change amplification, unclear ownership, or difficult verification. Keep the existing design when a new abstraction would add more navigation or coordination than it removes.

  • Hide implementation decisions and maintain invariants inside the module that owns them.
  • Keep callers' common operations straightforward. Fewer methods are useful only when they reduce the contract callers must learn.
  • Keep related behavior together. Do not split a coherent function or file merely to satisfy size targets.
  • Introduce dependency injection where substitution, side-effect control, or an existing architectural boundary provides a concrete benefit. Do not invent a second adapter to justify an interface.
  • Keep internal dependencies private unless callers need to supply or configure them.
  • Prefer pure computation for domain decisions and explicit ownership for effects. An orchestration module may legitimately perform I/O.
  • Consider removing a pass-through layer when it contributes no policy, isolation, or stable contract. A thin adapter may still be valuable for an external dependency.

Validation and completion

Follow global AGENTS.md for test mode and authorization. Design for observable behavior through stable contracts, without forcing all tests through one large public interface or discarding useful focused coverage. Preserve existing behavior and callers unless the task authorizes a contract change.

Explain the resulting caller contract, the complexity it hides, meaningful tradeoffs, and validation performed. Compare alternatives only when they differ materially; do not require multiple designs or independent reviewers for routine changes.

Read only when relevant

  • For consolidating a cluster and choosing dependency seams, read DEEPENING.md.
  • For an explicit alternative-design exploration or a consequential unresolved interface choice, read DESIGN-IT-TWICE.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.