From feature-purge
Safely remove an entire feature and every dead reference it leaves behind — not just the folder you point at, but the sibling folders in other architecture layers, the imports/registries/routes/i18n keys that point to it, and any newly-orphaned code. Verifies the quality gate stays 100% green and writes a Markdown removal report. Use when deleting a feature, screen, module, or directory and you need it gone WITHOUT leaving dead files or dead code. Triggers on /feature-purge <path>, "remove this feature", "delete this folder safely", "apaga essa feature sem deixar código morto", "limpa essa screen e as camadas".
How this skill is triggered — by the user, by Claude, or both
Slash command
/feature-purge:feature-purgeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Delete a feature for real. You give it one path; it finds the rest of the feature across the codebase, removes it, cleans every reference, and proves the quality gate is still green.
Delete a feature for real. You give it one path; it finds the rest of the feature across the codebase, removes it, cleans every reference, and proves the quality gate is still green.
The danger this skill exists to kill: you delete screens/Bets/ but leave usecases/bets/, the repository impl, the navigation route, the barrel export *, and 12 import { Bets } from ... lines — half-dead feature, red build, ghost code.
/feature-purge <path> [<path2> ...]
<path> is the primary folder/file to remove (usually the most visible one — a screen, a module). The skill derives the feature slug from it (folder name, normalized: Bets → bets/Bets) and uses that slug to discover the rest.
slug from the leaf name. Keep both casings (Bets, bets) and obvious variants (bet, betting) — list them, you'll grep for all.Most codebases split one feature across parallel directories (layers, packages, test mirrors). Find the siblings by slug:
src/, app/, lib/, packages/*, test/, __tests__/) and look for any directory or file whose name matches the slug under each root.confident (name is an exact slug match in a recognized layer) or maybe (fuzzy / shared dir).The slug match finds folders. It does NOT find scattered references (a single import, a route string, an i18n key, a feature-flag entry). Those need a repo-wide grep that is slower and noisier.
Use AskUserQuestion to confirm scope before the expensive search:
If the user already said "be thorough" / "remove everything", skip the question and do the full sweep.
For every file about to be removed, grep the repo for things that point at it:
import / require / re-export (export * from, barrel index files).useCases map).Print the plan: main removals · sibling removals · references to clean. Then:
rm/git rm).Run the project's gate (typecheck / lint / i18n check / tests / build — whatever the repo has). If anything fails because a reference was missed, fix it and re-run. Loop until green. Never finish red.
Write feature-purge-<slug>-<YYYY-MM-DD>.md (in the repo's docs/reports dir if one exists, else repo root). Use the template below.
# Feature Purge — <slug>
Date: <YYYY-MM-DD> · Invoked with: `<paths>`
## Removed — primary
- <path/file> (N files)
## Removed — related (other layers)
- <path/file> — <layer> — confident|maybe
## Modified — references cleaned
- <file>:<line> — removed <import|route|barrel export|i18n key|DI binding>
## Quality gate
- typecheck: ✅ | lint: ✅ | i18n: ✅ | tests: ✅ (<n> passed) | build: ✅
## Notes
- <anything skipped, any `maybe` left in place and why>
Provides a checklist for code reviews covering functionality, security, performance, maintainability, tests, and quality. Use for pull requests, audits, team standards, and developer training.
npx claudepluginhub andersonlimahw/lemon-ai-hub --plugin feature-purge