Remove Deadcode
Remove unused code from this project with ultrawork mode, LSP-verified safety, atomic...
Install
npx skills add code-yeongyu/oh-my-openagent --skill remove-deadcode -g -a claude-code -y- Repository
- code-yeongyu/oh-my-openagent70.6k
- Category
- Engineering
- Updated
- 3d ago
- License
- See repository
- Context cost
- Mediumabout 1,753 tokens
- Runs scripts
- No, instructions only
What it does
Remove unused code from this project with ultrawork mode, LSP-verified safety, atomic commits. Triggers: remove dead code, dead code, cleanup, remove unused.
Dead code removal via massively parallel deep agents. You are the ORCHESTRATOR, you scan, verify, batch, then delegate ALL removals to parallel agents.
<rules> - **LSP is law.** Verify with `LspFindReferences(includeDeclaration=false)` before ANY removal decision. - **Never remove entry points.** `src/index.ts`, `src/cli/index.ts`, test files, config files, `packages/`, off-limits. - **You do NOT remove code yourself.** You scan, verify, batch, then fire deep agents. They do the work. </rules> <false-positive-guards> NEVER mark as dead: - Symbols in `src/index.ts` or barrel `index.ts` re-exports - Symbols referenced in test files (tests are valid consumers) - Symbols with `@public` / `@api` JSDoc tags - Hook factories (`createXXXHook`), tool factories (`createXXXTool`), agent definitions in `agentSources` - Command templates, skill definitions, MCP configs - Symbols in `package.json` exports </false-positive-guards>PHASE 1: SCAN, Find Dead Code Candidates
Run ALL of these in parallel:
<parallel-scan>TypeScript strict mode (your primary scanner, run this FIRST):
bunx tsc --noEmit --noUnusedLocals --noUnusedParameters 2>&1
This gives you the definitive list of unused locals, imports, parameters, and types with exact file:line locations.
Explore agents (fire ALL simultaneously as background):
task(subagent_type="explore", run_in_background=true, load_skills=[],
description="Find orphaned files",
prompt="Find files in src/ NOT imported by any other file. Check all import statements. EXCLUDE: index.ts, *.test.ts, entry points, .md, packages/. Return: file paths.")
