Home/Catalog/Subtract
Subtract — what should go?
Brief 26

Prune Audit

Dead code, unreachable routes, stale flags, unused deps — a deletion list grouped by confidence. Git makes it reversible; bias to delete.

PRUNE.md4 phases7 lenses~2.5k chars

Free & open · no signup · read-only — it ends by asking · nothing leaves your machine

What it does

You are working inside this repo. Mission: find everything that can be deleted — dead code, unreachable routes, stale flags, unused dependencies — and produce a deletion list grouped by confidence. Git makes deletion reversible; the bias is to delete.

Read-only pass. Your only write is the report file.

What it looks for

7 lenses it looks through

Phase 2 sweeps the codebase through every one of these, citing file and line for each finding.

1

Dead code

unreferenced functions, components, and modules; exports nothing imports

2

Unreachable surface

routes and pages no navigation or link reaches

3

Stale flags

feature flags evaluating to one value forever; both the flag and the dead branch

4

Unused dependencies

installed, never imported; or imported only by dead code

5

Fossils

commented-out blocks, .bak/.old files, abandoned experiment directories

6

Orphaned config

settings, env vars, and CI steps serving removed features

7

Duplicate losers

where two implementations exist and one clearly won: delete the loser

The deliverable

What lands in your repo

One structured report at the repo root — or in reports/, if you keep one — the same shape every time, ready for a teammate — or the optional Studio — to act on.

PRUNE.md
1
Reclaim totals
lines, files, deps that can go
2
Safe deletions
grouped for one clean PR, ordered
3
Verify-first list
item · risk · verification step
4
Flag retirements
flag · winning branch · code to keep
5
The great deletion PR
proposed scope for the first satisfying sweep
One file. Evidence-backed. It ends by asking before touching anything.
How it works

What it makes the agent do

Every Goal Prompt follows the same four steps, so results are consistent and repeatable — no matter which one you run.

1
Phase 1

Build the reachability picture

Map the entry points.

2
Phase 2

Hunt through 7 lenses

Dead code — unreferenced functions, components, and modules.

3
Phase 3

Curate by confidence

Safe — provably unreferenced.

4
Phase 4

Report

Create PRUNE.md at repo root.

Get started

Three ways to run this Goal Prompt

01 · COPY

Paste it in

Copy it and paste it into your agent inside the repo you want checked.

02 · INSTALL

As a slash command

Install the goal plugin once — two commands — then just type /goal:prune-audit.

1/plugin marketplace add GhostlyGawd/goal-prompts
2/plugin install goal@goal-prompts

Or install only this Goal Prompt as /goal-prune-audit:

curl -fsSL https://goal-prompts.vercel.app/install | BRIEF=26 sh
03 · AGENT

From an agent (MCP)

Let an agent fetch it mid-conversation, or pull the raw Goal Prompt by URL.

https://goal-prompts.vercel.app/raw/26.md
Transparency

The exact prompt

Nothing hidden — this is the whole Goal Prompt, verbatim. Read it in a minute, edit it, or copy it as-is.

Read the full brief (2,460 characters)
# Goal: Prune Audit

You are working inside this repo. Mission: find everything that can be deleted — dead code, unreachable routes, stale flags, unused dependencies — and produce a deletion list grouped by confidence. Git makes deletion reversible; the bias is to delete.

Read-only pass. Your only write is the report file.

## Phase 1 — Build the reachability picture
- Map the entry points: routes, exported APIs, scheduled jobs, CLI commands, build entries.
- From those roots, what is reachable? Everything else is a candidate.
- Gather the low-hanging census: unused dependencies, unreferenced assets, commented-out blocks.

## Phase 2 — Hunt through 7 lenses
1. **Dead code** — unreferenced functions, components, and modules; exports nothing imports
2. **Unreachable surface** — routes and pages no navigation or link reaches
3. **Stale flags** — feature flags evaluating to one value forever; both the flag and the dead branch
4. **Unused dependencies** — installed, never imported; or imported only by dead code
5. **Fossils** — commented-out blocks, .bak/.old files, abandoned experiment directories
6. **Orphaned config** — settings, env vars, and CI steps serving removed features
7. **Duplicate losers** — where two implementations exist and one clearly won: delete the loser

## Phase 3 — Curate by confidence
- **Safe** — provably unreferenced; delete on sight
- **Verify-first** — probably dead but with a dynamic-reference risk (string lookups, reflection, external callers); each gets a one-line verification step
- Count the reclaim: lines, files, kilobytes, dependencies

## Phase 4 — Report
Create `PRUNE.md` at repo root:
1. **Reclaim totals** — lines, files, deps that can go
2. **Safe deletions** — grouped for one clean PR, ordered
3. **Verify-first list** — item · risk · verification step
4. **Flag retirements** — flag · winning branch · code to keep
5. **The great deletion PR** — proposed scope for the first satisfying sweep

Start the report with today's date. If `PRUNE.md` already exists from a previous run, read it first and lead with what changed since.

## Rules
- Provably unreferenced or verifiably dead — no vibes-based deletion
- Deleting code you might need later is what git history is for
- If a `reports/` directory exists at the repo root, write the report there instead of the root.
- Before asking, present the top findings as a ranked list in plain words
- Report only — end by asking which deletions to make

House rules for this Goal Prompt

  • Provably unreferenced or verifiably dead — no vibes-based deletion
  • Deleting code you might need later is what git history is for
  • If a reports/ directory exists at the repo root, write the report there instead of the root.
  • Before asking, present the top findings as a ranked list in plain words
  • Report only — end by asking which deletions to make
Keep exploring

More Subtract briefs

Runs inside these playbooks — curated sequences you can launch with one paste: