Skip to content
Agentmart
Submit a tool

codebase-design

Design or improve deep modules.

Skill by luizomf

IndexedMIT★ 3
Write a review

Chalk Labs

Need help deploying codebase-design?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/luizomf-codebase-design

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Design or improve deep modules. Use when shaping a module interface, deepening modules, placing a seam, reducing coupling, designing for testability, or when another skill requires the deep-module vocabulary.

Use cases: design

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 26, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/codebase-design

What's inside

Skill name
codebase-design
Description
Design or improve deep modules. Use when shaping a module interface, deepening modules, placing a seam, reducing coupling, designing for testability, or when another skill requires the deep-module vocabulary.
License
MIT
Instructions
105 lines in SKILL.md · view on GitHub

Files (3)

  • DEEPENING.md
  • DESIGN-IT-TWICE.md
  • SKILL.md

SKILL.md (first lines)

# Codebase Design

Design **deep modules**: modules whose callers can exercise multiple required behaviors through a smaller interface at a defined seam. Apply the terms and rules below when designing or restructuring code. The target outcomes are leverage across callers, locality of changes and defects, and tests that use the same interface as production callers.

## Glossary

Use these architecture terms as defined here. Do not substitute `component`, `service`, `API`, or `boundary`, because those words identify different or narrower concepts.

**Module** — any unit with exactly one interface and an implementation, including a function, class, package, or tier-spanning slice. This term does not imply scale. Avoid `unit`, `component`, and `service` for this concept.

**Interface** — every fact a caller must know to use a module correctly: type signatures, invariants, ordering constraints, error modes, required configuration, and performance characteristics. `API` and `signature` name only part of this surface.

**Implementation** — code inside a module. Use **adapter** instead when discussing the role a concrete implementation fills at a seam. Implementation size and adapter size are independent; for example, a Postgres repository can be a small adapter with a large implementation, while an in-memory fake can be a large adapter with a small implementation.

**Depth** — behavior a caller or test can exercise relative to the interface facts it must learn. A module is **deeper** than an alternative when it preserves required behavior while exposing fewer methods, parameters, invariants, ordering constraints, error modes, configuration requirements, or performance obligations. It is **shallow** when callers must supply or coordinate the implementation's intermediate states and steps.

**Seam** _(Michael Feathers)_ — a location where behavior can be altered without editing code at that location. Seam placement and the behavior behind the seam are separate decisions. A seam may be internal to a module. Avoid `boundary`, which also refers to a DDD bounded context.

**Test seam** — a seam exposed through the caller-visible interface that production callers and behavior tests share. Tests may use a different adapter at that seam, but do not bypass the interface to reach an internal seam.

**Adapter** — a concrete module that satisfies an interface at a seam. The term identifies the role, not the implementation technology.

**Leverage** — reuse of behavior behind one interface across multiple callers or tests. A change behind the interface applies without reproducing the rule at each caller.

**Locality** — concentration of a behavior's code, required knowledge, defects, changes, and verification in one module rather than its callers.

## Deep and shallow modules

A deep module exposes a smaller interface than the behavior it contains:

```text
┌─────────────────────┐
│   Small Interface   │  ← fewer caller-visible facts
├─────────────────────┤
│                     │
│  Deep Implementation│  ← behavior hidden from callers
│                     │
└─────────────────────┘
```

A shallow module exposes an interface that repeats most implementation decisions:

```text
┌─────────────────────────────────┐
│       Large Interface           │  ← many caller-visible facts
├─────────────────────────────────┤
│  Thin Implementation            │  ← forwards or rearranges inputs
└─────────────────────────────────┘
```

When comparing interface designs, check:

- whether multiple methods can become one operation without losing required behavior;
- whether the module can derive or own any current parameters;
- whether invariants, ordering, configuration, errors, or performance obligations can move behind the interface; and
- whether the reduced surface still supports every required caller and test behavior.

## Principles

- **Depth is a property of a module relative to its interface.** Internal composition does not make an external interface shallow. A module may use internal seams available only to its implementation and implementation-level tests while exposing one external seam to callers.
- **Deletion test.** Model deleting the module while preserving required behavior. If no caller must absorb rules or knowledge, the module was a pass-through. If rules or knowledge must be copied or coordinated across callers, the module provides locality or leverage. This is design evidence, not an automatic deletion rule: preserve required behavior and safety constraints, and judge total complexity and caller usability.
- **The interface is the test surface.** Production callers and behavior tests use the same test seam. A test that must bypass the interface is evidence that the interface does not expose required behavior or that the tested behavior belongs to another module.
- **Two justified adapters warrant a port.** Introduce a port only when at least two adapters are justified (typically production + test).

## Designing for testability

### Accept dependencies instead of constructing them inside the behavior

```typescript
// Dependency can vary at the seam.
function processOrder(order, paymentGateway) {}

// Dependency selection is coupled to this implementation.
function processOrder(order) {
  const gateway = new StripeGateway();
}
```

### Return results instead of producing side effects

```typescript
// The result is observable without inspecting mutation.
function calculateDiscount(cart): Discount {}

// Verification requires observing mutation and hidden discount state.
function applyDiscount(cart): void {
  cart.total -= discount;
}
```

### Minimize the caller-visible surface

A smaller caller-visible surface generally requires fewer tests and simpler setup.

## Rejected framings

- **Implementation-lines divided by interface-lines:** this metric can increase by adding implementation code without adding behavior. Evaluate depth by caller-visible facts and exercised behavior instead.

## Progressive references

- For deepening a cluster with known dependencies, read [DEEPENING.md](./DEEPENING.md) for dependency categories, seam discipline, and replace-don't-layer testing.
- For comparing alternative interfaces, read [DESIGN-IT-TWICE.md](./DESIGN-IT-TWICE.md) for the optional one-designer comparison process. Use it only when the invoking workflow authorizes that designer role and the current caller can dispatch a non-delegating leaf within its inherited depth. A non-delegating leaf resolves accepted sources directly or returns a blocker to its caller.
- To scan an entire repository for candidates, use [improve-codebase-architecture](../improve-codebase-architecture/SKILL.md). First run `cd '<loaded-skill-directory>' && pwd -P` with this loaded file's directory and resolve the link from that physical base. Read the target even when absent from discovery.

From luizomf/omskills, MIT.

More from luizomf/omskills

Signals

Stars
3
Forks
0
Open issues
0
Last commit (this folder)
Oct 16, 2026 (14 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from luizomf

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get codebase-design running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying codebase-design?

CallGet help
Cite this page

codebase-design skill. Agent Mart. https://agentmart.dev/skills/luizomf-codebase-design (last updated 2026-10-24)