Skip to content

/refactor-clean

Safely identify and remove dead code with test verification:

From plugin
claude-scholar
5.9k65 skills6 agents65 commands5 hooks
> /plugin marketplace add Galaxy-Dawn/claude-scholar
> /plugin install claude-scholar@claude-scholar

Command definition

refactor-clean.md

Refactor Clean

Safely identify and remove dead code with test verification:

1. Run dead code analysis tools:

  • vulture: Find unused Python code (functions, classes, variables)
  • pyflakes: Detect unused imports and variables
  • ruff check --select F401: Find unused imports
  • pip-audit: Check for security vulnerabilities

2. Generate comprehensive report in .reports/dead-code-analysis.md

3. Categorize findings by severity:

  • SAFE: Test files, unused utilities, unused imports
  • CAUTION: API routes, models, fixtures
  • DANGER: Config files, main entry points, registry decorators

4. Propose safe deletions only

5. Before each deletion:

  • Run full test suite (pytest)
  • Verify tests pass
  • Apply change
  • Re-run tests
  • Rollback if tests fail

6. Show summary of cleaned items

Never delete code without running tests first!

@galaxy-dawn
Ships withclaude-scholar

Semi-automated research assistant for academic research and software development. Supports Claude Code, Codex CLI, Kimi Code CLI, and OpenCode across ideation, coding, experiments, writing, and publication.

Stars on GitHub

Momentum

stars in total
5.9k
Star history of Galaxy-Dawn/claude-scholar on GitHub, a chart by star-history.com

Other commands on claude-scholar.

More commands from other plugins.

plan

plan

Command

Plan n8n Linear ticket implementation

n8n12d209k
@n8n-io@n8n-ioInstall Command
setup

setup

Command

One-time setup after installing ARIS as a Claude Code plugin — registers the Codex reviewer MCP server from the plugin directory…

aris13d18k
@wanshuiyin@wanshuiyinInstall Command
auto

auto

Command

Smart router - Single entry point with natural language intent detection

octo13d4.3k
@nyldn@nyldnInstall Command