Skip to content
Agentmart
Submit a tool

code-cleanup

Targeted cleanup skills — dead code, error handling, types, function extraction.

Skill by dmoskov

IndexedMIT★ 2
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/dmoskov-code-cleanup

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Targeted cleanup skills — dead code, error handling, types, function extraction. Run one or all.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/code-cleanup

What's inside

Skill name
code-cleanup
Description
Targeted cleanup skills — dead code, error handling, types, function extraction. Run one or all.
License
MIT
Instructions
59 lines in SKILL.md · view on GitHub

Files (6)

  • README.md
  • SKILL.md
  • dead-code.md · prompts/
  • error-handling.md · prompts/
  • extract-functions.md · prompts/
  • type-annotations.md · prompts/

SKILL.md (first lines)

# Code Cleanup Skill

A set of focused cleanup skills. Each targets exactly one concern and produces a diagnostic
summary before making any changes. Based on the "cleanup waves" pattern.

## Sub-Skills

| Sub-Skill | What It Does |
|-----------|--------------|
| `dead-code` | Remove unused imports, unreachable code, unused functions |
| `error-handling` | Find bare except/catch, missing error handling, silent failures |
| `type-annotations` | Add missing type annotations (Python: mypy, TS: strict mode) |
| `extract-functions` | Find functions >50 lines and extract logical units |

## Usage

Run all sub-skills sequentially:
```
/code-cleanup
```

Or run a specific sub-skill by mentioning it:
```
"clean up dead code"
"audit error handling"
"add type annotations"
"extract long functions"
```

## Workflow

Each sub-skill follows the same pattern:

1. **Scan** — Search the codebase for the target pattern
2. **Diagnose** — Produce a summary table of findings with file paths and line numbers
3. **Confirm** — Present findings to the user before making changes
4. **Fix** — Apply targeted fixes, one file at a time
5. **Verify** — Run lint/tests to confirm nothing broke

## Prompts

Each sub-skill has its own prompt in `prompts/`:

- `prompts/dead-code.md` — Unused imports, unreachable code, dead functions
- `prompts/error-handling.md` — Bare except, silent failures, missing handlers
- `prompts/type-annotations.md` — Missing types for Python (mypy) and TypeScript (strict)
- `prompts/extract-functions.md` — Long functions, logical extraction points

## Running All Sub-Skills

When triggered with the generic "code cleanup" command, run each sub-skill in order:
1. Dead code (safest — only removes, never adds)
2. Error handling (adds safety, rarely breaks things)
3. Type annotations (additive, improves tooling)
4. Extract functions (structural change — do last)

Commit after each sub-skill completes so changes are atomic and reviewable.

From dmoskov/sharedskills, MIT.

Signals

Stars
2
Forks
2
Open issues
0
Last commit (this folder)
Aug 21, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from dmoskov

Cite this page

code-cleanup skill. Agent Mart. https://agentmart.dev/skills/dmoskov-code-cleanup (last updated 2026-10-24)