cleanup
Cleanup
Structured cleanup and modernization workflow.
Input
Scope: $ARGUMENTS
Goals
- Remove duplication and ambiguous ownership
- Investigate code smells instead of suppressing them
- Improve typed boundaries and reduce escape hatches
- Modernize only within the project's compatibility lane
- Preserve behavior unless explicitly changing it
Steps
1. Static Analysis
# Format
uv run ruff format $ARGUMENTS
# Auto-fix linting
uv run ruff check --fix $ARGUMENTS
uv run ruff check --fix --unsafe-fixes $ARGUMENTS
# Type check
uv run ty check $ARGUMENTS
# If project runs mypy: uv run mypy $ARGUMENTS
2. Smell Investigation
For each smell found:
- Identify the root cause (not just the symptom)
- Determine if it's a design smell or a quick fix
- Document the investigation and decision
3. Type Boundary Hardening
- Inventory all
Anyusage - Move boundary code to dedicated modules
- Add typed wrappers where raw data crosses boundaries
- Run typing policy checks
4. Modernization (within project lane)
- Modernize typing imports only if Python floor supports it
- Apply match-case where it reduces complexity
- Use walrus operator where it improves readability
- Only within the project's
requires-pythonconstraint
5. Verification
uv run ruff check $ARGUMENTS
uv run ruff format --check $ARGUMENTS
uv run ty check $ARGUMENTS
uv run pytest $ARGUMENTS -v
Load Specialists
- Load
python3-typingfor boundary refactoring - Load
python3-testingif test gaps are found - Load
python3-toolsfor toolchain changes
More from jamie-bitflight/claude_skills
perl-lint
This skill should be used when the user asks to lint Perl code, run perlcritic, check Perl style, format Perl code, run perltidy, or mentions Perl Critic policies, code formatting, or style checking.
24brainstorming-skill
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or when users request help with ideation, marketing, and strategic planning. Explores user intent, requirements, and design before implementation using 30+ research-validated prompt patterns.
11design-anti-patterns
Enforce anti-AI UI design rules based on the Uncodixfy methodology. Use when generating HTML, CSS, React, Vue, Svelte, or any frontend UI code. Prevents "Codex UI" — the generic AI aesthetic of soft gradients, floating panels, oversized rounded corners, glassmorphism, hero sections in dashboards, and decorative copy. Applies constraints from Linear/Raycast/Stripe/GitHub design philosophy: functional, honest, human-designed interfaces. Triggers on: UI generation, dashboard building, frontend component creation, CSS styling, landing page design, or any task producing visual interface code.
7python3-review
Comprehensive Python code review checking patterns, types, security, and performance. Use when reviewing Python code for quality issues, when auditing code before merge, or when assessing technical debt in a Python codebase.
7hooks-guide
Cross-platform hooks reference for AI coding assistants — Claude Code, GitHub Copilot, Cursor, Windsurf, Amp. Covers hook authoring in Node.js CJS and Python, per-platform event schemas, inline-agent hooks and MCP in agent frontmatter, common JSON I/O, exit codes, best practices, and a fetch script to refresh docs from official sources. Use when writing, reviewing, or debugging hooks for any AI assistant.
7agent-creator
Create high-quality Claude Code agents from scratch or by adapting existing agents as templates. Use when the user wants to create a new agent, modify agent configurations, build specialized subagents, or design agent architectures. Guides through requirements gathering, template selection, and agent file generation following Anthropic best practices (v2.1.63+).
6