Agent skill

Codebase Design

by citypaul in citypaul/.dotfiles

Design and evaluate deep modules: cohesive responsibility behind a small, stable caller-facing contract, with information hiding, justified seams, explicit effects, dependency strategy, and…

MITAuto-check passedBackend & APIs

Install Codebase Design

skills CLI
$ npx skills add citypaul/.dotfiles --skill codebase-design -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install citypaul/.dotfiles codebase-design --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/citypaul/.dotfiles.git skills-src && mkdir -p .claude/skills && cp -r skills-src/claude/.claude/skills/codebase-design .claude/skills/codebase-design && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
codebase-design
GitHub stars
739
Token cost
~3.1k tokens
SKILL.md length
1,512 words
Files
6 (incl. references)
Skills in repo
44
Repo updated
First seen
Licence
MIT

At a glance

Design and evaluate deep modules: cohesive responsibility behind a small, stable caller-facing contract, with information hiding, justified seams, explicit effects, dependency strategy, and…

  • Works in 7 steps: Define the job and callers → Inventory the full contract burden → Map hidden and leaked knowledge → …
  • Changing an in-process module
  • SKILL.md covers Vocabulary, Design Principles, Workflow and Design Output, plus 2 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Codebase Design is an agent skill from citypaul/.dotfiles. Design and evaluate deep modules: cohesive responsibility behind a small, stable caller-facing contract, with information hiding, justified seams, explicit effects, dependency strategy, and behavior-focused tests. Use when designing or changing an in-process module or package contract, consolidating shallow pass-through modules, deciding what to hide, comparing alternative interfaces, or asking whether code should be combined or split for leverage and locality. For physical layout use structure-codebase; for…

Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `agents/openai.yaml`, `references/deepening.md` and `references/design-it-twice.md`).

It sits in Backend & APIs, covering API design. The licence is MIT.

When your agent uses it

  • Changing an in-process module
  • Package contract
  • Consolidating shallow pass-through modules
  • Deciding what to hide

Example prompts

  • “/codebase-design”

Workflow steps

7 steps, taken from the step headings in SKILL.md.

  1. Define the job and callers
  2. Inventory the full contract burden
  3. Map hidden and leaked knowledge
  4. Choose responsibility before the seam
  5. Design the contract from use scenarios
  6. Test the depth claim
  7. Route delivery to the owning skills

What it can do on your machine

Read from SKILL.md and the folder at commit cd4028d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Codebase Design loads about 3.1k tokens when it runs, and up to ~7.1k if it reads all its reference files. Until then it costs about 190 tokens; SKILL.md has 1,512 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~190
When it runs · the whole SKILL.md, loaded when a task matches
~3.1k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~7.1k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from citypaul/.dotfiles at commit cd4028d, republished under its MIT licence (© citypaul). 1,512 words, ~3,088 tokens.

Download SKILL.mdSave it as .claude/skills/codebase-design/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
codebase-design
description
Design and evaluate deep modules: cohesive responsibility behind a small, stable caller-facing contract, with information hiding, justified seams, explicit effects, dependency strategy, and behavior-focused tests. Use when designing or changing an in-process module or package contract, consolidating shallow pass-through modules, deciding what to hide, comparing alternative interfaces, or asking whether code should be combined or split for leverage and locality. For physical layout use structure-codebase; for public compatibility use api-design; for a repository-wide scan use improve-codebase-architecture. For an already-selected whole-path requirement to support a calibrated net-mechanism-reduction claim, use reduce-system-complexity.

Codebase Design

Design coherent deep modules: substantial, related behavior and design decisions hidden behind a small, stable caller-facing contract. Optimize for leverage for callers and locality for maintainers without creating a god module.

Use this skill for logical responsibility and contract shape. Use structure-codebase for physical paths, packages, exports, dependency direction, enforcement, and folder migration. Use reduce-system-complexity when the selected objective is an evidence-backed net-reduction claim over whole-path mechanism rather than a deeper contract. Use evaluate-existing-solutions for a consequential unresolved library, tool, application, service, framework, or platform choice.

When improve-codebase-architecture loads this skill during an unselected audit, use only its vocabulary, principles, evidence tests, and thin-edge safeguards. Do not run the contract-design workflow or propose an exact interface until the user selects a candidate.

Read the relevant reference before proposing a consequential design:

Vocabulary

TermMeaning
ModuleA cohesive unit with an implementation and one or more role-shaped caller contracts: a function, object, package, or capability. Scale alone does not make it a module.
Interface / public contractEverything a caller must know to use the module correctly: operations, types, invariants, errors, ordering, configuration, lifecycle, effects, and relevant performance characteristics. This is broader than a TypeScript interface or a type signature.
ImplementationThe decisions and behavior hidden behind the caller-facing contract. Private functions may be small and numerous without becoming public modules.
DepthHow much coherent capability and decision-making a caller gains for the contract burden it must learn. Do not measure depth by lines of code.
LeverageThe caller benefit of depth: one learned contract applies useful behavior consistently across many scenarios.
LocalityThe maintainer benefit of depth: related knowledge, changes, bugs, and verification concentrate in one owner.
SeamPer Michael Feathers, a place where behavior can be changed without editing at that place; every seam has an enabling point. Not every module contract is a seam.
AdapterA concrete translator or implementation selected at a seam. In hexagonal architecture, retain that skill's driving, driven, and test-interactor distinctions.

Use these terms to disambiguate, not to erase useful established vocabulary. API, component, service, signature, boundary, port, and bounded context remain valid when they name those specific concepts.

Design Principles

Hide decisions, not merely code

Place a responsibility behind a module when callers should not each know its policy, sequencing, representation, error recovery, or provider mechanics. A private helper extraction does not deepen a module if the same knowledge still leaks through its parameters and call order.

Keep depth cohesive

A tiny contract over an incoherent implementation is a god module, not a good deep module. Combine behavior only when it shares meaning, invariants, ownership, lifecycle, or a real axis of change. Preserve separate modules when they evolve, fail, deploy, or authorize independently. An extraction earns its boundary when the reader can name the decision or responsibility it owns and understand the caller with less cross-file reconstruction; a file per helper or a chain of trivial forwarding functions does not establish ownership.

Apply the behavior-preserving inlining test

Imagine inlining the module into every caller while preserving behavior:

  • If policy, sequencing, error handling, or representation knowledge spreads across callers, the module earns its place.
  • If callers become simpler because a pass-through disappears and no knowledge is duplicated, the module is shallow or misplaced.

This is the useful form of the deletion test. Do not imagine deleting the behavior itself.

Pull complexity downward deliberately

Make the common call simple. Accept complexity inside the implementation when doing so removes configuration, ordering, special cases, or provider knowledge from callers. Keep effects, failure modes, resource ownership, and performance costs explicit enough that callers can use the module safely.

Justify seams with evidence

Create a seam for a concrete need: substitution, independent testing, volatility isolation, ownership, trust, runtime failure, or deployment. Adapter count is evidence, not a rule. A production adapter plus a faithful test interactor may justify a seam; two accidental wrappers do not.

Test at the stable contract

Make caller-observable behavior the primary test surface. Do not export private helpers or expose internal seams solely to test them. A private subsystem may have focused tests when it is itself a coherent module or when an algorithm needs precise failure localization; those tests must not freeze incidental orchestration.

Preserve intentionally thin edges

Do not diagnose a route leaf, CLI command, adapter, generated client, or composition root as shallow merely because it is thin. Translation and wiring should often be thin. Judge whether policy is hidden in the correct inside module and whether the edge leaks provider or transport knowledge across its contract.

Workflow

1. Define the job and callers

State the behavior the module owns, its current and expected callers, the common case, and what must remain outside. Read project instructions, architecture decisions, glossary conventions, and relevant tests before naming anything new.

2. Inventory the full contract burden

List what each caller must know today:

  • operations and data shapes;
  • invariants and preconditions;
  • call ordering and lifecycle;
  • configuration and dependency construction;
  • errors, retries, partial failure, and effects;
  • latency, throughput, consistency, and transaction expectations.

Do not confuse a short type signature with a small interface.

Show full SKILL.md (623 more words)Show less
3. Map hidden and leaked knowledge

Trace callers and collaborators. Identify duplicated decisions, pass-through chains, provider types, repeated orchestration, co-changing files, and tests that must reconstruct internals. Record counterevidence: independent ownership, different failure domains, or callers that genuinely need separate policy.

4. Choose responsibility before the seam

Write one sentence defining the module's coherent responsibility. Decide what knowledge belongs behind it. Only then place seams and select dependency strategies. Read references/deepening.md for existing clusters.

When a material generic dependency or subsystem is not already prescribed, feed this responsibility, caller scenarios, effects, and constraints into evaluate-existing-solutions before finalizing a dependency-shaped contract. Keep the chosen provider or library behind local application language when doing so preserves a useful change boundary; do not wrap every stable primitive by reflex or copy a vendor API into the module contract.

5. Design the contract from use scenarios

Design from representative caller examples, including invalid input, partial failure, cancellation, retries, and lifecycle where relevant. Specify types, invariants, ordering, errors, effects, and performance expectations—not methods alone.

For consequential choices, read references/design-it-twice.md and compare genuinely different designs before recommending one.

6. Test the depth claim

Ask:

  • Does the common caller learn less and coordinate less?
  • Did implementation knowledge move behind the contract, or merely change names?
  • Would a policy change concentrate here rather than fan out?
  • Are effects and failures still honest?
  • Can behavior be tested through the contract with faithful dependencies?
  • Did the design avoid speculative flexibility and a generic command-shaped god interface?
7. Route delivery to the owning skills
  • Use api-design for public HTTP and contracts published or versioned across an ownership boundary. Ordinary in-process component props remain with this skill and the applicable framework/design-system guidance.
  • Use structure-codebase for file/package placement and mechanical dependency enforcement.
  • Use render-code-shape first when the current composition is not yet visible: it returns cited boundaries, signatures, and a call graph, which is the evidence this skill's judgements need.
  • Use reduce-system-complexity when the accepted outcome must remove total branches, states, dependencies, layers, or operational moving parts rather than only improve caller leverage.
  • Use evaluate-existing-solutions when a material generic implementation choice remains unresolved after the responsibility and constraints are known.
  • Use hexagonal-architecture only for an opted-in ports-and-adapters system with purposeful actor conversations.
  • Use finding-seams when existing hard-coded dependencies block a test harness.
  • Use characterisation-tests before restructuring untested behavior.
  • Use tdd, testing, and refactoring during implementation according to whether behavior changes and whether the safety net is trustworthy. At PR readiness, follow the repository's mutation policy; where mutation is not meaningful, record proportionate alternate evidence.
  • Use ubiquitous-language when a domain term must be proposed or changed; never coin it silently.

Design Output

Produce:

  1. The module's one-sentence responsibility and explicit exclusions.
  2. Callers and representative usage scenarios.
  3. The complete proposed contract, including non-type obligations.
  4. Knowledge and behavior hidden behind it.
  5. Dependencies, seams, adapters or test interactors, and their fidelity strategy.
  6. Alternatives considered and why the recommendation wins.
  7. Compatibility and incremental migration constraints.
  8. Behavior tests that should survive implementation changes.
  9. Assumptions, risks, and evidence still needed.

Completion Check

  • Is the contract simpler than the coherent behavior it provides?
  • Does it hide decisions rather than expose orchestration knobs?
  • Is the common case obvious without making uncommon cases impossible?
  • Are cohesion, ownership, failure, and runtime boundaries still honest?
  • Are seams justified by real variation or isolation needs?
  • Can callers and behavior tests use the same stable contract?
  • Are thin edges still thin and policy-free?
  • Does every compatibility or migration claim have a verification path?

Attribution

Adapted from Matt Pocock's MIT-licensed codebase-design skill and linked resources, with deep-module and Design It Twice concepts credited to John Ousterhout and seam terminology credited to Michael Feathers. See references/source-notes.md and LICENSE for pinned provenance and license terms.

© citypaul, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 5 other files (references) in claude/.claude/skills/codebase-design of citypaul/.dotfiles.

  • SKILL.md
  • LICENSE
  • agents/openai.yaml
  • references/deepening.md
  • references/design-it-twice.md
  • references/source-notes.md

Open the folder on GitHubat commit cd4028d

Compare with similar skills

Codebase Design next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Codebase Design compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Codebase Design this skillcitypaul/.dotfiles739—~3.1kAutomated safety check: PassMIT
API DesignerJeffallan/claude-skills12k2 repos~2kAutomated safety check: PassMIT
Nodejs Backend Patternsever-works/ever-works15817 repos~4kAutomated safety check: PassAGPL-3.0
Pangolin CRUD Endpointsfosrl/pangolin23k—~461Automated safety check: PassCustom licence
Backend PatternshellangleZ/burn-in-cceverywhere-ralph11217 repos~3.3kAutomated safety check: PassNone
API And Interface Designdzhalaevd/Donatello1359 repos~2.6kAutomated safety check: PassApache-2.0

Similar skills

  • API Designer

    Jeffallan/claude-skills

    Designs REST and GraphQL APIs from resource modeling to an OpenAPI 3.1 contract, with versioning, pagination and RFC 7807 error handling.

    12k GitHub starsUsed in 2 repos~2k tokens
    Backend & APIsAuto-check passed
  • Nodejs Backend Patterns

    ever-works/ever-works

    Build production-ready Node.js backend services with Express/Fastify, implementing middleware patterns, error handling, authentication, database integration, and API design best practices.

    158 GitHub starsUsed in 17 repos~4k tokens
    Backend & APIsAuto-check passed
  • Use whenever asked to add, create, or scaffold a CRUD endpoint, router, or entity in this repo's server (create/list/get/update/delete handlers, new…

    23k GitHub stars~461 tokensUpdated yesterday
    Backend & APIsAuto-check passed
  • Backend Patterns

    hellangleZ/burn-in-cceverywhere-ralph

    Backend architecture patterns, API design, database optimization, and server-side best practices for Node.js, Express, and Next.js API routes.

    112 GitHub starsUsed in 17 repos~3.3k tokens
    Backend & APIsAuto-check passed
  • API And Interface Design

    dzhalaevd/Donatello

    Guides stable API and interface design. An agent skill from dzhalaevd/Donatello.

    135 GitHub starsUsed in 9 repos~2.6k tokens
    Backend & APIsAuto-check passed
  • API Design Principles

    jh941213/my-cc-harness

    REST 및 GraphQL API 설계 원칙 가이드. An agent skill from jh941213/my-cc-harness.

    126 GitHub starsUsed in 19 repos~3.4k tokens
    Backend & APIsAuto-check passed

More from citypaul/.dotfiles

All 44 skills in this repo
  • Find Skills

    citypaul/.dotfiles

    Discover and, with authorization, install agent skills from the open skills ecosystem.

    739 GitHub stars~2.5k tokensUpdated 5 days ago
    Auto-check passed
  • Render Code Shape

    citypaul/.dotfiles

    Render the shape of code — module boundaries, the types that cross them, signatures, and a cited call graph — for code that already exists or a change about to be built.

    739 GitHub stars~2.5k tokensUpdated 5 days ago
    Auto-check passed
  • Structure Codebase

    citypaul/.dotfiles

    Design, audit, and evolve physical source and package structures that expose real architectural boundaries while keeping related behavior together.

    739 GitHub stars~4.4k tokensUpdated 5 days ago
    Auto-check passed
  • Test Design Reviewer

    citypaul/.dotfiles

    Review test quality using Dave Farley's eight properties of good tests.

    739 GitHub stars~1k tokensUpdated 5 days ago
    Auto-check passed
  • Characterisation Tests

    citypaul/.dotfiles

    A skill your agent uses when modifying existing code that lacks tests and you need to document its actual current behavior before making changes -- the legacy code dilemma where you need tests to…

    739 GitHub stars~3.6k tokensUpdated 5 days ago
    Auto-check passed
  • CI Debugging

    citypaul/.dotfiles

    Systematic CI/CD failure diagnosis using hypothesis-first investigation, local reproduction, and environment delta analysis.

    739 GitHub stars~1.5k tokensUpdated 5 days ago
    Auto-check: notes

Categories

Questions about Codebase Design

What does Codebase Design do?

Design and evaluate deep modules: cohesive responsibility behind a small, stable caller-facing contract, with information hiding, justified seams, explicit effects, dependency strategy, and…. dotfiles. Design and evaluate deep modules: cohesive responsibility behind a small, stable caller-facing contract, with information hiding, justified seams, explicit effects, dependency strategy, and behavior-focused tests.

When should I use Codebase Design?

Codebase Design fits situations like: changing an in-process module; package contract; consolidating shallow pass-through modules; deciding what to hide.

How do I install Codebase Design in Claude Code?

Run `npx skills add citypaul/.dotfiles --skill codebase-design -a claude-code`. Or copy the skill folder (claude/.claude/skills/codebase-design in citypaul/.dotfiles) into .claude/skills/codebase-design in your project. Claude Code loads it when a task matches its description.

How do I install Codebase Design in Codex?

Run `npx skills add citypaul/.dotfiles --skill codebase-design -a codex`. Or copy the skill folder (claude/.claude/skills/codebase-design in citypaul/.dotfiles) into .agents/skills/codebase-design in your project. Codex loads it when a task matches its description.

Can I use Codebase Design in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add citypaul/.dotfiles --skill codebase-design -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codebase-design, .gemini/skills/codebase-design, .github/skills/codebase-design and .opencode/skills/codebase-design in your project.

What does Codebase Design need to run?

SKILL.md names no scripts, command-line tools or credentials: Codebase Design is instructions for the agent only.

Does Codebase Design access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Codebase Design safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Codebase Design use?

Codebase Design is published under the MIT licence (from the LICENSE file in the skill folder). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Codebase Design use?

About 3.1k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 4k tokens, read only when the agent opens those files.

What are the alternatives to Codebase Design?

Skills that share tags, products or a category with Codebase Design: API Designer (Jeffallan/claude-skills, 12k stars), Nodejs Backend Patterns (ever-works/ever-works, 158 stars), Pangolin CRUD Endpoints (fosrl/pangolin, 23k stars) and Backend Patterns (hellangleZ/burn-in-cceverywhere-ralph, 112 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Codebase Design?

citypaul (a GitHub user) maintains it in citypaul/.dotfiles, which has 739 GitHub stars. The repository holds 44 skills in this directory. The repository was last updated on October 2, 2026.

Source: citypaul/.dotfiles on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.