用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/anasgets111/dotfiles --skill codebase-design命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Scan codebase for shallow modules. Present deep refactoring targets in a visual HTML report. YAGNI-first.
Two-axis code review (Standards vs. Spec). Parallel execution. Enforces YAGNI and systems-level discipline.
Diagnosis loop for hard bugs and performance regressions. Forked for Laravel/Livewire and Quickshell/QML.
基于 SOC 职业分类
正在显示 SKILL.md
| name | codebase-design |
| description | Shared vocabulary for designing deep modules. Enforce Systems Thinking, leverage, locality, and YAGNI. |
| disable-model-invocation | true |
Design deep modules: massive implementation hidden behind a minimal interface, placed at a clean seam, fully testable. Optimize for leverage (caller efficiency) and locality (maintainer efficiency).
Use these exact terms. Do not substitute with "component," "service," "API," or "boundary."
| Term | Strict Definition |
|---|---|
| Module | Anything with an interface and implementation (function, class, package). |
| Interface | Everything a caller must know: type signature, invariants, ordering, errors, config. |
| Implementation | The internal body of code hiding behind the interface. |
| Depth | Leverage at the interface. High depth = minimal interface + massive implementation. |
| Seam | The location where a module's interface lives (where behavior can be swapped). |
| Adapter | The concrete logic that satisfies an interface at a seam (e.g., Postgres Repo, Stripe API). |
| Leverage | Caller benefit: capabilities gained per unit of interface learned. |
| Locality | Maintainer benefit: bugs, logic, and tests concentrate in one place. Fix once. |
Deep module = small interface + deep implementation. High leverage.
┌─────────────────────┐
│ Small Interface │ ← Minimal methods/params (e.g., `ChargeCard()`)
├─────────────────────┤
│ │
│ Deep Implementation │ ← Retries, logging, payload mapping hidden
│ │
└─────────────────────┘
Shallow module = large interface + thin implementation. A useless pass-through. Delete it.
┌─────────────────────────────────┐
│ Large Interface │ ← Requires setting up 5 DTOs
├─────────────────────────────────┤
│ Thin Implementation │ ← Just calls a Laravel Facade
└─────────────────────────────────┘
1. Accept dependencies, do not instantiate them.
// Testable
public function processOrder(Order $order, PaymentGateway $gateway) {}
// Garbage (Hard to test, hidden coupling)
public function processOrder(Order $order) {
$gateway = new StripeGateway();
}
2. Return results, avoid hidden state mutations.
// Testable
public function calculateDiscount(Cart $cart): int {}
// Garbage (Hidden side effects)
public function applyDiscount(Cart $cart): void {
$cart->total -= $this->discount;
}
deepening.design-it-twice.