codebase-design
Skill0 starsChanged 19 days agoMITView on GitHub
Use when: desenhar interface de módulo profundo · escolher seam de módulo · melhorar testabilidade pela interface pública. Deep-module design card; shrink interfaces, place seams only where variation exists, and preserve testability through the public interface.
193 other projects use a version of this.
Adopted by
Most recently taken up by
- quarkiverse/quarkus-reactive-messaging-nats-jetstreamtheir own version, first seen Nov 30, 2026
- Rain-kl/OpenFlaretheir own version, first seen Nov 30, 2026
- Forget-C/Jellyfishtheir own version, first seen Nov 29, 2026
- MarkTripoli/skillstheir own version, first seen Nov 29, 2026
- ctaxnagomi/agent-kd-skilltheir own version, first seen Nov 29, 2026
- karanmrn/karanagentskillstheir own version, first seen Nov 29, 2026
Used with
Projects with it also use decision-mapping, setup-ts-deep-modules and 9 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.
FabienDehopreSkilldecision-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
liufeng1976Skillsetup-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 53 projects that use this
RoentekSkillloop-me
Grill me about specs for the workflows I want to build, within this workspace.
Also in 66 projects that use this
LesaniSkillwriting-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 71 projects that use this
AWSSkillwizard
Generate an interactive bash wizard that walks a human through steps only they can perform. Use when provisioning infrastructure, setting up credentials or CI secrets, walking an unfamiliar third-party dashboard, or running a one-off migration or cutover. Don't invoke this for steps the agent can perform itself.
Also in 151 projects that use this
AWSSkillto-questionnaire
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
Also in 109 projects that use this
- +2 more from aws
Other versions193 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 193
- mattpocock/skills★ 335ksame name
- danny-avila/LibreChat★ 48ksame name
- LibreChat-AI/LibreChat★ 48ksame name
- QuivrHQ/quivr★ 40ksame name
- The-Vibe-Company/quivr★ 40ksame name
- windmill-labs/windmill★ 19ksame name
- MODSetter/SurfSense★ 17ksame name
- GreyDGL/PentestGPT★ 16ksame name
- formbricks/formbricks★ 13ksame name
- humanlayer/humanlayer★ 13ksame name
183 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository71 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- adversarial-gateSkill
- anti-over-engineeringSkill
- article-draftSkill
- article-publishSkill
- audit-loggingSkill
- autonomous-loopSkill
- backend-implementationSkill
- brainstormSkill
- browser-automationSkill
- cite-or-flagSkill
- code-optimizeSkill
- code-reviewSkill
- connection-finderSkill
- content-analysisSkill
- content-creationSkill
- content-designSkill
- content-synthesisSkill
- contradiction-sweepSkill
- conversor-md-htmlSkill
- councilSkill
- data-ai-implementationSkill
- decisionsSkill
- diagnoseSkill
- diagram-buildSkill
- domain-modelingSkill
- drift-reviewSkill
- editor-mdSkill
- evolveSkill
- frontend-implementationSkill
- fullstack-codeSkill
- fullstack-security-auditSkill
- grill-meSkill
- handoffSkill
- hill-climbSkill
- implementSkill
- infra-implementationSkill
- ingest-proposalSkill
- ingest-verifySkill
- marketing-content-designSkill
- office-hoursSkill
- pipeline-adsSkill
- plan-handoffSkill
- pre-ingest-dedupSkill
- pre-mortemSkill
- prompt-reviewSkill
- prototypeSkill
- reason-judgeSkill
- repo-radarSkill
- report-synthesisSkill
- research-verifySkill
- resolving-merge-conflictsSkill
- retroSkill
- router-selectSkill
- shipping-checklistSkill
- simplify-codeSkill
- skillifySkill
- spec-lifecycleSkill
- study-digestSkill
- subagent-teamSkill
- The first 60 shown.
The file
Files
Skill: Codebase Design
Desenhar deep modules: muito comportamento atrás de interface pequena, num seam limpo, testável pela interface. Usar esta linguagem onde código for desenhado ou reestruturado. Alvo: leverage para callers, locality para maintainers, testability para todos.
Quando NÃO usar
- Formatting-only / rename-only / edição mecânica — sem variação de design, skill não aplica.
- Módulo já estável com interface testada — redesign é dívida; só com necessidade real.
- Bug fix pontual — corrigir; design é para desenho novo ou refactor deliberado.
- Sessão de spike/protótipo — protótipo é throwaway; não desenhar módulo profundo.
Disambiguation: codebase-design desenha interfaces de módulos profundos; domain-modeling constrói o vocabulário de domínio (GLOSSARY.md); complexity-ratchet impede aumento de complexidade — design precede código, ratchet acompanha.
Condições de Ativação
Ative quando:
- Desenhar ou melhorar a interface de um módulo
- Decidir onde colocar um seam
- Tornar código mais testável ou navegável por IA
- Outra skill (
grill-me) precisar do vocabulário deep-module
NÃO ative para: edições mecânicas sem decisão de design; renomear; formatação.
Glossário
Usar estes termos exatamente — não substituir por "component", "service", "API", "boundary". Linguagem consistente é o ponto inteiro.
- Module — qualquer coisa com interface + implementação. Escala-agnóstico de propósito: função, classe, pacote, ou slice que atravessa camadas. Evitar: unit, component, service.
- Interface — tudo que um caller precisa saber p/ usar o módulo corretamente: assinatura de tipo, mas também invariantes, ordem, modos de erro, config exigida, características de performance. Evitar: API, signature (estreito demais — só a superfície de tipo).
- Implementation — o que está dentro do módulo. Distinta de Adapter: pode-se ter adapter pequeno com implementação grande (repo Postgres) ou adapter grande com implementação pequena (fake in-memory).
- Depth — leverage na interface: quanto comportamento um caller (ou teste) exercita por unidade de interface que precisa aprender. Deep = muito comportamento atrás de interface pequena. Shallow = interface quase tão complexa quanto a implementação.
- Seam (Michael Feathers) — lugar onde se altera comportamento sem editar naquele lugar; a localização da interface. Onde pôr o seam é decisão de design própria, distinta do que vai atrás dele. Evitar: boundary (colide com bounded context do DDD).
- Adapter — coisa concreta que satisfaz uma interface num seam. Descreve papel (que slot preenche), não substância.
- Leverage — o que callers ganham da depth: mais capacidade por unidade de interface aprendida. Uma implementação paga em N call sites e M testes.
- Locality — o que maintainers ganham da depth: mudança, bugs, conhecimento e verificação concentram num lugar. Conserta uma vez, consertado em todo lugar.
Deep vs Shallow
Deep = interface pequena + muita implementação (buscar):
┌─────────────────────┐
│ Interface Pequena │ ← poucos métodos, params simples
├─────────────────────┤
│ Implementação Deep │ ← lógica complexa escondida
└─────────────────────┘Shallow = interface grande + pouca implementação (evitar):
┌─────────────────────────────────┐
│ Interface Grande │ ← muitos métodos, params complexos
├─────────────────────────────────┤
│ Implementação Fina (pass-through)
└─────────────────────────────────┘Ao desenhar interface, perguntar:
- Dá p/ reduzir número de métodos?
- Dá p/ simplificar os params?
- Dá p/ esconder mais complexidade dentro?
Princípios
- Depth é propriedade da interface, não da implementação. Módulo deep pode ser internamente composto de partes pequenas, mockáveis — elas só não fazem parte da interface. Módulo pode ter seams internos (privados, usados pelos próprios testes) além do seam externo na interface.
- Deletion test. Imagine deletar o módulo. Se a complexidade some, era pass-through. Se reaparece espalhada por N callers, estava ganhando o pão.
- A interface é a superfície de teste. Callers e testes cruzam o mesmo seam. Se quer testar além da interface, o módulo tem forma errada.
- Um adapter = seam hipotético. Dois adapters = seam real. Não introduza seam a menos que algo de fato varie através dele.
Desenhar para Testabilidade
- Aceite dependências, não crie-as.
function processOrder(order, paymentGateway) {} // testável function processOrder(order) { const g = new StripeGateway(); } // difícil - Retorne resultados, não efeitos colaterais.
function calculateDiscount(cart): Discount {} // testável function applyDiscount(cart): void { cart.total -= d; } // difícil - Superfície pequena. Menos métodos = menos testes. Menos params = setup mais simples.
Relações
- Um Module tem exatamente uma Interface.
- Depth é propriedade do Module, medida contra a Interface.
- Um Seam é onde a Interface do Module vive.
- Um Adapter senta num Seam e satisfaz a Interface.
- Depth produz Leverage (callers) + Locality (maintainers).
Framings Rejeitados
- Depth como razão linhas-impl / linhas-interface (Ousterhout): premia inchar a implementação. Usamos depth-as-leverage.
- "Interface" como keyword
interfacedo TS / métodos públicos: estreito demais — interface aqui inclui todo fato que o caller precisa saber. - "Boundary": colide com bounded context do DDD. Diga seam ou interface.
Completion
- Termos usados exatamente (Module/Interface/Depth/Seam/Adapter/Leverage/Locality)
- Interface avaliada por depth (deletion test aplicado)
- Seam só introduzido onde algo varia (≥2 adapters)
- Testabilidade: dependências injetadas, resultados retornados, superfície pequena
Failure modes
- Shallow module: interface quase tão complexa quanto impl → esconder mais dentro
- Seam especulativo: seam com 1 adapter só → adiar até 2º adapter existir
- Vocabulário substituído: dizer "service/component/boundary" → quebra a linguagem compartilhada
- Testar além da interface: precisa furar a interface p/ testar → módulo tem forma errada
Relacionado
- domain-modeling — vocabulário de domínio (glossário/ADR); design usa a mesma linguagem
- prd-grade — esboça seams de teste antes de fatiar PRD
- spec-lifecycle — vertical slice corta seams
- tdd — testa pela interface, no seam
- grill-me — grilling usa deep-module para desafiar design
Modos absorvidos (R3)
kind: reference — carregue o spec do modo pedido e execute-o com esta skill como base.
- MODO MELHORAR ARQUITETURA EXISTENTE — improve-codebase-architecture
- MODO RATCHET DE COMPLEXIDADE — complexity-ratchet
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
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.

