Skip to content
Back to skills

Codebase Design

ASecurity

Design or compare a specific module boundary, interface, dependency seam, or refactor. Use when the user wants concrete architecture options for a known design problem. For a broad repository audit that discovers and ranks architectural problems, use improve-codebase-architecture instead.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 6, 2026
ai-agentsapisecuritydocumentation

Works with

  • api

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned November 6, 2026

npx -y skills add bolens/agent-skills --skill codebase-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Codebase Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Codebase Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/bolens-codebase-design/badge)](https://www.skillsdirectory.com/skills/bolens-codebase-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: codebase-design
description: Design or compare a specific module boundary, interface, dependency seam, or refactor. Use when the user wants concrete architecture options for a known design problem. For a broad repository audit that discovers and ranks architectural problems, use improve-codebase-architecture instead.
---

# Codebase Design

Read repository instructions, architecture docs, ADRs, specifications, and representative callers/tests before proposing structure. Established project terminology wins; use the vocabulary below only where it clarifies rather than replacing domain language.

Use this skill when the design target is already known. If the user wants you to search a wider codebase for opportunities, use `improve-codebase-architecture` first.

## Working vocabulary

- **Module**: code with an interface and implementation, at any scale.
- **Interface**: everything callers must know, including invariants and errors.
- **Seam**: a place behavior can vary without editing callers.
- **Adapter**: an implementation selected at a seam.
- **Depth**: useful behavior hidden behind a comparatively small interface.
- **Leverage**: capability gained by callers from that interface.
- **Locality**: related knowledge and change concentrated together.

Treat these as reasoning aids, not rules. A thin adapter can be valuable for isolation; a single adapter can justify a seam when tests, platform separation, security, or ownership require it.

## Analyze

1. Identify the change pressure, callers, dependencies, invariants, and current test surface.
2. Locate duplicated knowledge, leaked policy, pass-through abstractions, and changes that scatter across files.
3. Apply the deletion test: if removing a module merely redistributes its complexity to callers, it may be earning its keep.
4. Respect existing contracts and ADRs. Mark any proposal that would revise them.

## Design

When changing a consumer-facing boundary, read [experience and interfaces](references/experience-and-interfaces.md). Identify the relevant user, developer, or agent journey and its observable friction before choosing an API, command, or UI. Include operator and maintainer needs when the boundary affects them.

Before adding structure, check whether existing code, the standard library, a platform capability, or an installed dependency already meets the requirement. Name the concrete candidate and compare its contract with the callers' needs. A matching API name is insufficient: check errors, ordering, lifetime, concurrency, and supported runtimes where they matter.

Include retaining the current design as an option when no demonstrated problem requires a change. Remove speculative extensions from proposals, but preserve requested behavior. Prefer the option with the lowest maintenance cost that satisfies the contract, even when it needs more lines or an additional dependency.

For example, a bounded memoization helper does not replace a cache that requires expiration, tenant isolation, or cross-process invalidation. A native control is a candidate only if it supports the required interactions and accessibility behavior. Keep validation, recovery, and useful test coverage in the comparison.

When a proposed simplification accepts a known limit, state that limit, an observable trigger for revisiting it, and the likely next step. Use the project's existing decision or debt convention if documentation is authorized. Do not create branded comments or a separate ledger for ordinary implementation choices.

Prefer small interfaces that hide policy and enable behavior-level tests. Dependency injection and pure returns are useful when they reduce coupling, but do not force them over idiomatic repository patterns.

For consequential designs, produce at least two genuinely different options and compare compatibility, migration cost, testability, locality, and operational risk. Read [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md) and [DEEPENING.md](DEEPENING.md) when deeper alternatives are needed. Sub-agents are optional.

Do not implement, create ADRs, or update domain documentation during design analysis unless the user authorizes those changes.

Files in this skill

  • DEEPENING.md2.6 KB
  • DESIGN-IT-TWICE.md2.6 KB
  • SKILL.md4.1 KB
  • UPSTREAM.md426 B
  • agents/openai.yaml208 B
  • references/experience-and-interfaces.md4.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.