smithery/row0902

Optimize Codebase

Proactive maintenance to reduce complexity and remove dead code.

Installation

$ npx skills add smithery/row0902 --skill optimize-codebase

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery/row0902.

npx skills add smithery/row0902

Browse all from smithery/row0902

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,032 B
  • docs SUMMARY.md 89 B

History

  1. First recorded snapshot · 0 installs

SKILL.md

🧹 Optimize Codebase (The Mechanic)

Context

Entropy increases over time. This skill proactively fights it.

1. Complexity Scan (Cyclomatic Complexity)

  • Tool: ruff (mccabe plugin) or mental check.
  • Rule: If if/else/for nesting is > 3 levels, Refactor.
  • Action: Extract method.

2. Dead Code Removal

  • Unused Imports: Run uv run ruff check --select F401 --fix.
  • Unused Variables: Rename to _ or remove.
  • Commented Out Code: DELETE IT. Git history remembers.

3. Type Health

  • Any: Search for Any. Can we make it a TypedDict or Protocol?
  • Optional: specific types str | None are better than implicit None.

4. Optimization Routine (Run this)

# 1. Sort Imports
uv run ruff check --select I --fix .

# 2. Fix Formatting
uv run ruff format .

# 3. Check for specific complexity (C901)
uv run ruff check --select C901 .