# Remove Deadcode

Remove unused code from this project with ultrawork mode, LSP-verified safety, atomic...

- Repository: https://github.com/code-yeongyu/oh-my-openagent (70577 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add code-yeongyu/oh-my-openagent --skill remove-deadcode -g -a claude-code -y`
Codex: `npx skills add code-yeongyu/oh-my-openagent --skill remove-deadcode -g -a codex -y`
Cursor: `npx skills add code-yeongyu/oh-my-openagent --skill remove-deadcode -g -a cursor -y`
Gemini CLI: `npx skills add code-yeongyu/oh-my-openagent --skill remove-deadcode -g -a gemini-cli -y`

## Description

Remove unused code from this project with ultrawork mode, LSP-verified safety, atomic commits. Triggers: remove dead code, dead code, cleanup, remove unused.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

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):**
```bash
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.")

The rest: https://github.com/code-yeongyu/oh-my-openagent/blob/HEAD/.agents/skills/remove-deadcode/SKILL.md
