Przejdź do treści
Biblioteka skilli
Programowanie · Nauka i wyjaśnianie

codebase-design

/codebase-design

Wprowadza wspólne słownictwo do projektowania głębokich modułów: interfejsy, szwy, testowalność i nawigację dla agentów.

Repozytorium
GilzaBots ↗
Licencja
MIT
Ostatnia zmiana repozytorium
10.11.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
4
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 10.11.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wprowadza wspólne słownictwo do projektowania głębokich modułów: interfejsy, szwy, testowalność i nawigację dla agentów.

Oryginalny opis (EN)

Shared vocabulary for designing deep modules. Use when designing or improving a module's interface, finding deepening opportunities, deciding where a seam goes, making code more testable or agent-navigable, or when another skill needs the deep-module vocabulary.

Jak działa

  1. Glossary
  2. Deep vs shallow
  3. Principles
  4. Designing for testability
  5. Relationships
  6. Rejected framings
  7. Going deeper
Sekcje z nagłówków SKILL.md, w oryginale · 105 linii, 795 słów
Podgląd SKILL.md
---
name: codebase-design
description: Shared vocabulary for designing deep modules. Use when designing or improving a module's interface, finding deepening opportunities, deciding where a seam goes, making code more testable or agent-navigable, or when another skill needs the deep-module vocabulary.
---

# Codebase Design

Design **deep modules**: a lot of behaviour behind a small interface, placed at a clean seam, testable through that interface. Use this language and these principles wherever code is being designed or restructured. The aim is leverage for callers, locality for maintainers, and testability for everyone.

## Glossary

Use these terms exactly: don't substitute "component", "service", "API" or "boundary". Consistent language is the whole point.

**Module**: anything with an interface and an implementation. Deliberately scale-agnostic: a function, class, package or tier-spanning slice. _Avoid_: unit, component, service.

**Interface**: everything a caller must know to use the module correctly: the type signature, but also invariants, ordering constraints, error modes, required configuration and performance characteristics. _Avoid_: API, signature (too narrow: they name only the type-level surface).

**Implementation**: what's inside a module, its body of code. Distinct from **Adapter**: a thing can be a small adapter with a large implementation (a Postgres repository) or a large adapter with a small implementation (an in-memory fake). Say "adapter" when the seam is the topic, "implementation" otherwise.

**Depth**: leverage at the interface: the amount of behaviour a caller (or test) can exercise per unit of interface it has to learn. A module is **deep** when a large amount of behaviour sits behind a small interface, **shallow** when the interface is nearly as complex as the implementation.

**Seam** _(Michael Feathers)_: a place where you can alter behaviour without editing in that place; the _location_ at which a module's interface lives. Where the seam goes is its own design decision, distinct from what goes behind it. _Avoid_: boundary (overloaded with DDD's bounded context).

**Adapter**: a concrete thing that satisfies an interface at a seam. Describes _role_ (which slot it fills), not substance (what's inside).

**Leverage**: what callers get from depth: more capability per unit of interface learned. One implementation pays back across N call sites and M tests.

**Locality**: what maintainers get from depth: change, bugs, knowledge and verification concentrate in one place instead of spreading across callers. Fix once, fixed everywhere.

## Deep vs shallow

**Deep module** = small interface + lots of implementation:

```
┌─────────────────────┐
│   Small Interface   │  ← few methods, simple params
├─────────────────────┤
│                     │
│  Deep Implementation│  ← complex logic hidden
│                     │
└─────────────────────┘
```

**Shallow module** = large interface + little implementation (avoid):

```
┌─────────────────────────────────┐
│       Large Interface           │  ← many methods, complex params
├─────────────────────────────────┤
│  Thin Implementation            │  ← just passes through
└─────────────────────────────────┘
```

When designing an interface, ask: can I reduce the number of methods? Simplify the parameters? Hide more complexity inside?

## Principles

- **Depth is a property of the interface, not the implementation.** A deep module can be built from small, mockable, swappable parts; they just aren't part of the interface. A module can have **internal seams** (private to its implementation, used by its own tests) as well as the **external seam** at its interface.
- **The deletion test.** Imagine deleting the module. If complexity vanishes, it was a pass-through. If complexity reappears across N callers, it was earning its keep.
- **The interface is the test surface.** Callers and tests cross the same seam. If you want to test _past_ the interface, the module is probably the wrong shape.
- **One adapter means a hypothetical seam. Two adapters mean a real one.** Don't introduce a seam unless something actually varies across it.

## Designing for testability

1. **Accept dependencies, don't create them.**

   ```python
   # Testable
   def process_order(order, payment_gateway): ...

   # Hard to test
   def process_order(order):
       gateway = StripeGateway()
   ```

2. **Return results, don't produce side effects.**

   ```python
   # Testable
   def calculate_discount(cart) -> Discount: ...

   # Hard to test
   def apply_discount(cart) -> None:
       cart.total -= discount
   ```

3. **Small surface area.** Fewer methods mean fewer tests; fewer parameters mean simpler setup.

## Relationships

- A **Module** has exactly one **Interface** (the surface it presents to callers and tests).
- **Depth** is a property of a **Module**, measured against its **Interface**.
- A **Seam** is where a **Module**'s **Interface** lives.
- An **Adapter** sits at a **Seam** and satisfies the **Interface**.
- **Depth** produces **Leverage** for callers and **Locality** for maintainers.

## Rejected framings

- **Depth as the ratio of implementation lines to interface lines** (Ousterhout): rewards padding the implementation. Depth here is leverage.
- **"Interface" as a language's `interface` keyword or a class's public methods**: too narrow; the interface is every fact a caller must know.
- **"Boundary"**: overloaded with DDD's bounded context. Say **seam** or **interface**.

## Going deeper

These files are in this skill's directory; read them with `read_file` when the branch applies.

- **Deepening a cluster given its dependencies**: [DEEPENING.md](DEEPENING.md): dependency categories, seam discipline, replace-don't-layer testing.
- **Exploring alternative interfaces**: [DESIGN-IT-TWICE.md](DESIGN-IT-TWICE.md): several subagents design the interface radically differently, in parallel, then compare on depth, locality and seam placement.
Pliki w paczce (4)
  • ATTRIBUTION.md 1 KB
  • DEEPENING.md 2 KB
  • DESIGN-IT-TWICE.md 3 KB
  • SKILL.md 6 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · gilzamir18/GilzaBots100MIT
mikeleg/skills100MIT
VincenzoImp/pitcrew100MIT
kriscard/kriscard-claude-plugins100MIT
akillness/jeo-skills100MIT
JamalLyons/Agent-Skills100MIT
zenobi-us/dotfiles100MIT
FrancoStino/opencode-skills-collection100MIT
yassimba/loom100Apache-2.0

Migawka bazy z 13.11.2026 · wersja paczki 15a82ccef007 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 95workflow-codebase-design
    Wyjaśnia wspólne słownictwo do projektowania głębokich modułów: interfejsy, szwy i miejsca poprawy testowalności kodu.
  • 100oracle-codebase-design
    Opisuje wspólne słownictwo i zasady projektowania głębokich modułów: interfejsy, miejsca szwów, obsługa niezaufanych danych na brzegach, poziom testowania i nazewnictwo.
  • 100improve-codebase
    Pomaga projektować i przeglądać interfejsy modułów, wskazywać płytkie moduły i szwy oraz wyodrębniać powtarzany kod do wspólnej biblioteki.
  • 100module-design
    Projektuje głębokie moduły: interfejs, miejsca na szwy, podział do współbieżności i uproszczenie rozgałęzień, dla testowalności.
  • 100matt-codebase-design
    Wyjaśnia pojęcia głębokich modułów, szwów i adapterów, szuka w kodzie miejsc do pogłębienia i zapisuje propozycje ulepszeń architektury.
  • 100rc-codebase-design
    Podaje słownik głębokich modułów: interfejs, głębokość, szew i adapter, pomocny przy decyzji, gdzie umieścić interfejs.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.