Skip to main content
skill CX Codex

simplify-codebase — Claude Code skill: what it does, how to install

simplify-codebase — a skill that audits a codebase for accidental complexity, then removes dead code, duplicated state or redundant layers once each cut is backed by evidence.

MIT ★ 98,599 updated 2026-10-25

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add tt-a1i/archify --skill simplify-codebase -a claude-code
Open on GitHub

What simplify-codebase does

Two modes. Survey stays read-only: it walks the entrypoints, ranks every candidate cut, and returns the reasoning behind each one. Change mode implements the strongest authorized cut and checks that the surviving contract still holds. Coverage is either narrow, on the subsystem you name, or across the whole repository.

Nothing gets touched before a written record exists: which contract goes away, what keeping it costs, who still reaches it, which capability is surrendered, and the smallest check that would catch a bad cut. That last field decides the outcome. When no check can separate a clean removal from an accidental break, the code stays.

Authorization checks, trust-boundary validation, security isolation, accessibility and data-loss prevention remain unless you make them the explicit objective. Dropping a reachable capability counts as a product decision, so the skill states the consequence and asks, unless you already chose it. A run may end with the conclusion that the inspected surface is justified as it stands. Style-only refactoring and performance tuning sit outside its remit.

What it helps with

  • find dead code and prove nothing still reaches it
  • collapse duplicated state into a single owner
  • drop a redundant layer or API that adds nothing
  • settle abstractions nobody owns
  • retire stale compatibility shims and design notes

Example prompts for the agent

  • Audit src/sync and rank what can go, with proof for each cut.
  • Remove the duplicated state under store/ and run the repo's checks.
  • Survey the whole repository for simplification candidates, change nothing.

How to install simplify-codebase

1Skills CLI (Vercel)

npx skills add tt-a1i/archify --skill simplify-codebase -a claude-code

2Manually: put the files in place

~/.claude/skills/simplify-codebase/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/simplify-codebase/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about simplify-codebase

How do I install simplify-codebase in Claude Code?

Run npx skills add tt-a1i/archify --skill simplify-codebase -a claude-code. The skill file lands at ~/.claude/skills/simplify-codebase/SKILL.md.

What does simplify-codebase do?

It hunts for accidental complexity: dead code, duplicated state, extra layers, abstractions with no owner. In survey mode it only reports ranked candidates; in change mode it removes them and validates the remaining contract.

Will it delete code without asking?

Removing a reachable capability is treated as a product decision, so the skill describes the consequence and waits for direction. Authorization, trust-boundary validation, security isolation, accessibility and data-loss prevention stay untouched unless you make them the explicit objective.

Source text

SKILL.md · MIT
---
name: simplify-codebase
description: Simplification audit or authorized codebase simplification whose stated objective is to remove accidental complexity. Use for evidence-backed deletion or consolidation of dead code, duplicate state, redundant APIs or layers, ownerless abstractions, obsolete compatibility or design records, and over-engineering in any language; also use for 代码简化 or 熵回收. Do not use for general code review, onboarding, style-only refactoring, or performance tuning.
metadata:
  internal: true
---

# Simplify Codebase

Reduce the number of concepts and obligations a codebase must keep coherent. Line-count reduction is supporting evidence, not the objective. A successful run may conclude that the inspected surface is already justified.

## Select mode and scope

First choose the authority mode:

- **Survey** for simplification audit, investigation, or candidate-finding requests. Remain read-only and return ranked evidence.
- **Change** for explicit simplify, remove, consolidate, refactor, or repository-documentation edit requests. Prove each cut, implement it within the authorized scope, and validate the surviving contract.

Then choose the coverage scope:

- **Focused** when the user names a subsystem, symbol, state machine, dependency, or suspected duplication. Cover that boundary thoroughly before expanding outward.
- **Broad** when the request spans the repository or asks for multiple candidates. Partition the system and account for every in-scope domain.

Deleting a reachable capability, supported interface, stored representation, or compatibility path is a product decision. Describe the consequence and obtain direction unless the user has already chosen it.

## Establish the contract

1. Read the repository's instructions, architecture and decision records, manifests, test guidance, and generated-file conventions.
2. Inspect version-control state and preserve unrelated work. Identify vendored, generated, migration, fixture, and public-package surfaces before classifying them.
3. Trace the runtime path from entrypoints through configuration, registration, dispatch, persistence, processes, and wire boundaries. Record public, dynamic, persisted, generated, and compatibility-sensitive contracts.
4. In Change mode, discover the repository's real verification commands and capture a proportional baseline when feasible. A failing baseline narrows what the final checks can prove.

Preserve authorization, trust-boundary validation, security isolation, accessibility essentials, data-loss prevention, stored-format compatibility, and cleanup that establishes quiescence. Treat changes to these protections as their own explicitly authorized objective, not an incidental simplification.

The contract map is complete when all in-scope entrypoints and authority boundaries are enumerated, each is traced far enough to name its owner and observable contract, and every uninspected or externally unknowable surface is recorded as a blind spot.

## Cover the relevant surface

For every Broad engagement, and for Focused work involving dynamic architecture or dependency substitution, read [investigation.md](references/investigation.md). Build a coverage map before ranking findings; the first plausible deletion must not end the survey.

For concurrency, cancellation, readiness, cleanup, defensive copies, validation, authorization, security isolation, accessibility, data-loss prevention, or cross-process data, also read [boundaries-and-lifecycle.md](references/boundaries-and-lifecycle.md).

Use repository-native search, compiler and linter output, dependency metadata, and history as discovery instruments. Treat their findings as leads until runtime consumers and contracts have been examined.

## Build a proof record

For every in-scope lead that reaches consumer-map evidence or could retire a meaningful contract, record:

```text
Candidate: the exact contract, representation, or layer to remove or merge
Burden: the concepts, synchronization, publication, or testing cost it creates
Reachability: production, non-production, dynamic, external, and persisted consumers
Rationale: why it exists and whether that reason remains current
Cut: declarations, implementations, branches, artifacts, docs, and dependencies affected
Consequence: observable capability or compatibility behavior surrendered
Confidence / risk: evidence strength, uncertainty, blast radius, and reversibility
Proof: the smallest check that would expose an incorrect cut
Net effect: maintenance concepts removed minus replacement or migration machinery added
```

Prove cut boundaries below file granularity when the candidate shares an artifact with surviving consumers. Account for candidate-exclusive selectors, members, fields, keys, registry entries, generated fragments, and fixtures without disturbing the surviving owners.

Keep or downgrade the candidate when a real consumer exists, dynamic reachability remains unresolved, a current decision still owns the design, the change merely relocates complexity, the result is outside scope or retires no meaningful obligation, or the available check cannot distinguish success from accidental breakage.

Rank confidence separately from benefit. A high-value guess does not outrank a smaller proved cut.

Candidate proof is complete when every qualifying lead is classified as ranked, rejected, or unresolved, and every unresolved lead names the fact required to decide it.

## Decide and act

In Survey mode, stop after reporting the ranked evidence. Include important rejected candidates when the rejection teaches something or identifies a concrete missing fact.

In Change mode, read [execution-and-recovery.md](references/execution-and-recovery.md) and select the strongest authorized cut. One ownership boundary is the default batch size, not a run limit: for an explicitly requested set of cuts, finish and validate each boundary before starting the next.

If the user requests a simplification proposal, local cleanup annotation, or design-record consolidation, or if a selected change invalidates an ADR, RFC, design note, or architectural inventory, read [decision-records.md](references/decision-records.md). Do not turn an ordinary code audit into a repository-wide documentation purge.

If the user asks to combine findings from another branch, pull request, task, or agent run, read [integrating-findings.md](references/integrating-findings.md). Preserve evidence, not finding counts.

## Deliver the result

For a survey, report coverage, ranked proof records, rejected or unresolved high-value leads, and the next fact needed for each uncertainty.

For a change, complete the validation and operation receipt defined in [execution-and-recovery.md](references/execution-and-recovery.md). Report each validation layer separately; a narrow green check does not establish broader runtime, deployment, or user acceptance.

© tt-a1i · MIT · tt-a1i/archify

Similar skills

All skills for Code review and refactoring →

From the same set10

The whole set →
cache-miss.sequence cache-miss.sequence drives the Archify skill to build a sequence diagram for a dashboard request that misses cache in Redis and falls through to PostgreSQL. CX Codex GP ChatGPT ★ 98,599repo stars web-runtime.architecture web-runtime.architecture — a prompt for generating a production web architecture JSON diagram using Archify and saving it directly to benchmark-candidate.json. CX Codex GP ChatGPT ★ 98,599repo stars product-analytics.dataflow This prompt guides Archify through a product analytics data-flow diagram, from web and mobile events to dashboards and a model, with a distinct path for consent-gated identity data. CX Codex GP ChatGPT ★ 98,599repo stars agent-tool-call.workflow agent-tool-call.workflow — a prompt for building a workflow diagram where an AI agent calls tools with human approval gates. CX Codex GP ChatGPT ★ 98,599repo stars agent-run.lifecycle agent-run.lifecycle instructs an agent to build a structured lifecycle diagram for an agent run using the Archify workflow. CX Codex GP ChatGPT ★ 98,599repo stars archify-review The archify-review skill weighs issues, pull requests, and code by value, cost, and impact. Use it for triage, change reviews, and maintenance decisions. CX Codex +1 ★ 98,599repo stars archify-tuning archify-tuning guides tuning and evaluation workflows for Archify diagram generation to improve visual layout and cut down repair cycles. CX Codex +1 ★ 98,599repo stars test-value The test-value skill helps select tests by risk, spot duplicate coverage, and investigate flaky checks. Use it during implementation, audits, or review before a commit. CX Codex +1 ★ 98,599repo stars

Project sponsors

Companies that keep this analytics open