# Cleanup

> Runs a complete code quality pipeline: ruff linting and formatting, mypy type checking, and pytest test suite. Use for end-of-session quality checks, pre-release validation, or when the user asks to lint, format, or clean up code.

- Skill: `open-agent-tools/cleanup` (Agent Skill)
- Install (CLI): `npx skillmds@latest add open-agent-tools/cleanup`
- Raw SKILL.md: https://api.skillmd.com/api/skills/open-agent-tools/cleanup/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: Open-Agent-Tools (https://skillmd.com/u/open-agent-tools)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/open-agent-tools/cleanup

---


Perform a complete code cleanup by following these steps:

**Output Format**: Use clear section headers, timestamps for each step, and progress indicators for long-running operations.

**Tool Validation**: First verify that required tools are installed (uv, ruff, mypy, pytest) and identify the project source layout (src/ or app/).

### Checklist

- [ ] Ruff linting and formatting
- [ ] Mypy type checking
- [ ] Pytest suite
- [ ] Summary

1. **Run ruff linting and formatting (parallel)**: Execute `uv run ruff check src --fix` and `uv run ruff format src` (or use `app` if that's the project structure) in parallel to automatically fix linting issues and format code. Re-run to verify all issues resolved.
2. **Run mypy type checking**: Execute `uv run mypy src` (or `app`) according to the project structure and fix any errors found. Re-run to verify fixes.
3. **Run pytest via UV**: Execute `uv run pytest` with appropriate timeout handling. If tests timeout, run them in logical sections (e.g., by directory or test file groups) to ensure all tests are executed and results are captured.

**Error Handling**: For each step, run the tool, fix issues found, then re-run to confirm the fix. If unable to fix after two attempts, report the specific error details and suggest manual fixes.

Update the checklist above as each step completes. Provide a final summary of all changes made.

