opencode/skills/vim-reaper/SKILL.md
# SKILL.md ## Name VimReaper ## Description VimReaper is a dead‑code cleanup skill that systematically scans a codebase to identify and safely remove unused code—dead functions, unreachable blocks, obsolete variables, redundant imports, and leftover comments—while preserving the intended logic and test suite. As its name suggests, VimReaper wields the **vim editor** as its primary scalpel: code removal is performed using vim’s precise ex commands, search patterns, and scripted editing modes, m
npx skillsauth add mbuyco/dotfiles opencode/skills/vim-reaperInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
VimReaper
VimReaper is a dead‑code cleanup skill that systematically scans a codebase to identify and safely remove unused code—dead functions, unreachable blocks, obsolete variables, redundant imports, and leftover comments—while preserving the intended logic and test suite.
As its name suggests, VimReaper wields the vim editor as its primary scalpel: code removal is performed using vim’s precise ex commands, search patterns, and scripted editing modes, making the cleanup fast, reproducible, and respectful of file formatting. When a task exceeds simple pattern deletion, the agent consults vim’s built‑in manual (:help) to find the optimal surgical command.
Understand Scope
Setup Tooling
vulture, autoflake, dead.ts-prune, knip, ESLint rules (no-unused-vars, no-unreachable).rg / grep with pattern matching, plus AST traversal if a suitable parser exists.vim --version (or nvim --version). Vim 8.0+ is recommended; if missing, install it before proceeding.Initial Scan
Human‑in‑the‑Loop Review
Perform Cleanup with Vim VimReaper’s core editing is done entirely through vim.
:34d or :34,42d for a range.:g/^import.*unusedModule/d./function unusedFunc), then dap (delete a paragraph), or use precise line numbers from the scan.:help delete, :help range, :help :global. Use :help to learn the safest multi‑line deletion or substitution commands.:w.vim -e -s with a command script (e.g., vim -e -s -c "34d | wq" file.py). Prefer interactive editing when user approval is required per item, scripted batch editing when auto‑approved.:g/^$/d (with care) or =G to reindent the file.Validate
vim -d original modified) to inspect the change and offer to revert just that edit.Report and Finalize
chore: reap dead code (VimReaper).:help <topic> inside vim. Common look‑ups include :help delete, :help range, :help :substitute, and :help pattern.-e -s), you can pass a series of -c commands; always include :wq at the end to save and exit.**/migrations/**, vendor/).probable).User: "Clean up dead code in my Flask app." Agent: Invokes VimReaper, scans ./ with Python tooling, finds 3 unused imports, 2 dead functions, and a commented‑out view. Agent: "Here’s what I found. Shall I remove the imports automatically and let you decide on the functions?" User: "Yes, remove imports, but keep the legacy_payment function for now." Agent: Opens each file in vim, uses :g/^from unused_module import/d for imports, and interactive deletion for other items. Runs pytest (all green), commits to branch reaper/cleanup-2025-03-01.
getattr or string‑based dispatch as “possible false positive”.node_modules, venv, or similar.=G (if indentation rules are set) or offer to run the project’s formatter (black, prettier).:q! to abort without saving. For batch operations, test your vim command script on a copy first.ripgrep (rg) for high‑speed text search.VimReaper – because not all code deserves eternal life, and vim’s blade is the sharpest.
development
Test-driven development with red-green-refactor loop. Use when user wants to build features or fix bugs using TDD, mentions "red-green-refactor", wants integration tests, or asks for test-first development.
development
Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.
testing
Interview the user relentlessly about a plan or design until reaching shared understanding, resolving each branch of the decision tree. Use when user wants to stress-test a plan, get grilled on their design, or mentions "grill me".
development
Optimize website and web application performance including loading speed, Core Web Vitals, bundle size, caching strategies, and runtime performance