ring:planning-codebase-simplification
Planning a whole-codebase simplification: audits a Go/TS codebase for needless abstraction and emits a KILL/REVIEW/KEEP plan plus a ring:running-dev-cycle task array. Plans only — no edits. Detects single-impl interfaces, pass-through shims, translation-free adapters, and dead-code cascade chains under an inverted burden of proof. Use for pre-public or post-pivot cleanup. Skip for current diff review (use ring:reviewing-code).
What this skill does
# Dev Simplify — Whole-Codebase Structural Sweep
## When to use
- User asks to simplify, flatten, or audit architecture of a whole codebase
- User mentions "too much indirection", "kill shims", "unnecessary abstractions"
- Pre-public application where break-compatibility refactor is cheap
- Post-pivot cleanup: speculative scaffolding accumulated during exploration
## Skip when
- Diff review on a feature branch → use ring:reviewing-code
- Standards-conformance refactor → use ring:planning-backend-refactor
- Dead code from a specific change → use ring:dead-code-reviewer in ring:reviewing-code
- Application already has external clients depending on internals
## Related
**Complementary:** ring:reviewing-code, ring:codebase-explorer
**Similar:** ring:planning-backend-refactor, ring:auditing-production-readiness
**Core principle:** DELETE is the default verdict. An abstraction survives only with concrete evidence of the swap it enables.
## Hard Constraint
Default: **public APIs MUST NOT break** (HTTP routes, SDK surface, webhooks, event contracts).
Supply `hard_constraint` input to override. Must be declared — never auto-inferred.
## Dispatch Protocol
### ⛔ STOP-CHECK BEFORE DISPATCH
Before emitting any Task call, count the explorers you intend to launch in this turn.
- Count MUST equal 6 (or 5 if branch has no commits ahead of main — Task 5 skipped).
- If your dispatch count diverges → STOP and reconcile against the task table below.
- No substitutions, no omissions.
### ⛔ MUST NOT trickle-dispatch
All explorers leave in the SAME TURN, before reading any explorer output.
Forbidden sequences:
- Dispatch explorer 1 → read result → dispatch explorer 2
- Dispatch a subset → wait → dispatch the rest
- Dispatch follow-up explorers conditioned on partial output
- Loop sequentially over the task list
If you find yourself about to dispatch an explorer in a turn AFTER any explorer has already returned a result → STOP. You violated parallel dispatch. Report the violation and mark the phase INCOMPLETE rather than completing the trickle.
### Self-verify after dispatch
After the dispatch turn, verify all scoped Task calls (6, or 5 if Task 5 skipped) were emitted in that single turn. If fewer went out than scoped, the phase did NOT execute correctly. Mark INCOMPLETE and surface the dispatch failure — do NOT silently continue with a partial pool.
### Parallel dispatch — atomic batch
Emit all scoped Task calls (the count established in the STOP-CHECK above — 6 or 5) in a SINGLE TURN, as one atomic batch.
**If your runtime exposes a `multi_tool_use.parallel` wrapper**, use it to dispatch the complete pool in one wrapped invocation. This is the canonical fan-out mechanism on OpenAI-style tool envelopes and on certain Anthropic SDK consumers — naming it explicitly activates parallel emission on runtimes where trickle-dispatch is the default behavior.
**If your runtime emits parallel tool_use blocks natively** (Claude Code with Claude models), `multi_tool_use.parallel` may not be needed — but naming it is harmless and serves as an enforcement anchor.
The STOP-CHECK, anti-trickle, and self-verify guards above remain binding regardless of which mechanism your runtime uses.
Dispatch 6 explorer agents in **parallel** (5 if branch has no commits ahead of main — skip Task 5):
| Task | Agent | Focus |
|------|-------|-------|
| 1a | ring:codebase-explorer | Single-impl interfaces, ports, repositories |
| 1b | ring:codebase-explorer | Speculative factories, builders, strategies, facades |
| 2 | ring:codebase-explorer | Translation-free adapters, pass-through shims, internal DTOs |
| 3 | ring:codebase-explorer | Architecture topology mapping, indirection depth |
| 4 | ring:codebase-explorer | Cascade chains (Three Rings applied to codebase) |
| 5 | ring:codebase-explorer | Branch AI slop (diff vs main) — skip if no commits ahead |
**Explorer dispatch contract:**
```
## Target: <absolute path to repo root>
## Your Focus: <smell category from task table above>
## Hard Constraint: {hard_constraint}
## Output: Write to /tmp/simplify-{task}-findings.json
Schema: { task, findings: [{name, file_line, smell, rebuttal_if_any, blast_radius, public_api_impact, action}], cascade_chains: [...] }
```
## Abstraction Smell Rubric
| Smell | Signal | Default Action |
|---|---|---|
| Single-implementation interface | One concrete impl; test doubles identical to prod | DELETE |
| Translation-free adapter | A→B is rename-only, 1:1 field mapping | DELETE |
| Pass-through shim | Wraps call site-for-site, no cross-cutting concern | DELETE |
| Speculative factory/builder | Always constructs the same concrete type | DELETE |
| One-strategy strategy | Dispatch over enum with one case | COLLAPSE |
| One-consumer facade | Single call site, "for future reuse" | COLLAPSE INTO CALLER |
| Config seam over constant | Indirection for a value that never varies | DELETE |
| Internal DTO ↔ entity with 1:1 fields | Translation across identical shapes | DELETE |
| Hexagonal port with one adapter | No swap pressure | COLLAPSE |
| Narrating comment (branch diff) | Comment restates what code literally does | DELETE |
| Defensive check in trusted path (branch diff) | Guard where caller already validated | DELETE |
**Accepted evidence to KEEP** (must name concretely, not hypothetically):
- Second implementation exists today in this repo
- Swappability exercised in tests with divergent behavior
- Cross-process or cross-language boundary
- Regulatory or contractual requirement
## Phase 4: Consolidated Report
Dispatch synthesizer to read all explorer files and emit:
1. `docs/ring:planning-codebase-simplification/simplify-report-{timestamp}.md` — KILL / REVIEW / KEEP tables
2. `docs/ring:planning-codebase-simplification/simplify-tasks-{timestamp}.json` — ring:running-dev-cycle task array
MUST emit both artifacts. MUST include cascade chains decomposed into per-ring tasks with `depends_on` wiring.
## Output Format
```markdown
## Simplify Summary
- Scope / Hard Constraint / Generated
- Kill list: N items | Review list: N items | Keep list: N items
## Hard Constraint
- Declared constraint + load-bearing surface location
## Kill List
| Name | file:line | Smell | Blast radius | Action | Acceptance Criteria |
## Review List
| Name | file:line | Smell | Why uncertain | Recommended next step |
## Keep List
| Name | file:line | Smell resembled | Evidence |
## Cascade Chains
| Chain ID | Leaf | Ring depth | Terminal type | Collapse blast radius |
## Cascade Execution Plan
Per-chain DAG: ring-1 (leaf) → ring-N, each with depends_on wiring
## Remaining Risks
| Risk ID | Related findings | Risk type | Mitigation |
```
## Task JSON Schema
```json
{
"tasks": [{
"id": "simplify-001",
"title": "",
"severity": "KILL | REVIEW",
"smell_category": "unexercised-seam | speculative-construction | translation-layer | topology | cascade | branch-slop",
"files_affected": [],
"blast_radius": {"files": 0, "lines": 0},
"acceptance_criteria": [],
"estimated_complexity": "trivial | moderate | complex",
"depends_on": [],
"rebuttal_if_kept": null
}]
}
```
Cascade chains → N tasks with `depends_on` wiring (leaf = ring-1, `depends_on: []`).
Related in Productivity
gitea-workflow
IncludedOrchestrate agile development workflows for Gitea repositories using the tea CLI. Use when working with Gitea-hosted repos and asking to 'run the workflow', 'continue working', 'what's next', 'complete the task cycle', 'start my day', 'end the sprint', 'implement the next task', or wanting guided step-by-step development assistance. Keywords: workflow, orchestrate, agile, task cycle, sprint, daily, implement, review, PR, standup, retrospective, gitea, tea.
microsoft-graph-gateway
IncludedRoute Microsoft Graph work in this workspace. Use when users want to read or write Outlook mail, calendar events, contacts, OneDrive or SharePoint files, Teams, Planner, To Do, users, groups, directory data, or arbitrary Microsoft Graph endpoints from VS Code. Prefer WorkIQ for common read scenarios. Use Microsoft Graph for write actions and gap-read scenarios that need exact Graph properties, filters, permissions, or endpoints.
copilotkit
IncludedUse when building with CopilotKit — setup, development, integrations, debugging, upgrading, or contributing. Routes to the appropriate specialized skill based on the task.
wordly-wisdom
IncludedProvides calibrated decision analysis using Charlie Munger-style multiple mental models, inversion, incentive mapping, circle-of-competence checks, misjudgment audits, second-order effects, and forecast updates. Use when the user asks for an oracle take, a hard call, a decision memo, a premortem, an outside view, a red-team, a sanity-check, what am I missing, think this through, or wants a strategy, hire, investment, plan, product, partnership, or major life choice analysed. Avoid for simple factual lookups or time-sensitive legal, medical, or market questions without fresh evidence.
swain-session
IncludedSession management and project status dashboard. Owns the full session lifecycle (start/work/close/resume), focus lane, bookmarks, worktree detection, and tab naming. Also serves as the project status dashboard — shows active epics, progress, actionable next steps, blocked items, tasks, GitHub issues, and recommendations. Worktree creation is deferred to swain-do task dispatch (SPEC-195). Triggers on: 'session', 'status', 'what's next', 'dashboard', 'overview', 'where are we', 'what should I work on', 'show me priorities', 'bookmark', 'focus on', 'session info'.
gandi
IncludedComprehensive Gandi domain registrar integration for domain and DNS management. Register and manage domains, create/update/delete DNS records (A, AAAA, CNAME, MX, TXT, SRV, and more), configure email forwarding and aliases, check SSL certificate status, create DNS snapshots for safe rollback, bulk update zone files, and monitor domain expiration. Supports multi-domain management, zone file import/export, and automated DNS backups. Includes both read-only and destructive operations with safety controls.