
specs-code-cleanup
Provides final code cleanup after task review approval. Removes debug logs, temporary comments, dead code, optimizes imports, and improves readability. Use when asked to clean up code, polish, finalize, tidy up, remove technical debt, or prepare code for completion after review. Not for refactoring logic or fixing bugs—focused solely on cosmetic and hygiene cleanup.
- Installs
- 1.8K
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill specs-code-cleanup- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads specs-code-cleanup automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Code Cleanup
Overview
Performs post-review cosmetic cleanup to make code production-ready. This workflow is now integrated as Phase T-7 of /developer-kit-specs:specs.task-implementation. It can also be invoked manually using --action=cleanup.
Input: docs/specs/[id]/tasks/TASK-XXX.md (reviewed status)
Output: Cleaned code, task marked completed
When to Use
- Use when asked to clean up code, polish, finalize, tidy up, or remove technical debt after review approval.
- Use to prepare code for completion: remove debug logs, dead code, optimize imports, and improve readability.
- Use as the final quality gate in the specification-driven development workflow.
- Not for refactoring logic or fixing bugs — focused solely on cosmetic and hygiene cleanup.
Arguments
| Argument | Required | Description |
|---|---|---|
--lang | No | java, spring, typescript, nestjs, react, python, general |
--task | Yes | Path to task file |
--action | No | Set to cleanup for manual invocation |
Best Practices
- Clean, not change: Only remove or reorganize — never change functionality
- Preserve behavior: Code must work exactly the same after cleanup
- Use project tools: Prefer
./mvnw spotless:apply,npm run lint:fix,black, etc. - Use TodoWrite: Track progress through all 8 phases
- Stop on failure: If tests fail, stop and report — do not proceed
See references/language-patterns.md for language-specific formatter commands, import ordering, and grep patterns.
Instructions
Phase 1: Task Verification
-
Parse
$ARGUMENTSfor parameters:--lang(optional): Target language/framework--task(required): Task ID or file path--spec(optional): Spec folder path (used with task ID)
Support two formats:
- Format 1 (direct path):
--task=docs/specs/001-feature/tasks/TASK-001.md - Format 2 (spec+task):
--spec=docs/specs/001-feature --task=TASK-001
If Format 2 is used, construct the task file path as:
{spec}/tasks/{task}.md -
Read the task file. Verify:
- Status is
reviewedorimplemented(notcompleted) - Review report
TASK-XXX--review.mdexists and is approved
- Status is
-
If not reviewed → stop and tell user to run
/developer-kit-specs:specs.task-reviewfirst -
Extract task ID, title, and
providesfiles
Phase 2: Identify Files to Clean
- Read
TASK-XXX--review.mdfor files created/modified - Read task
providesfield for file paths - Verify files exist; build cleanup list
- Categorize: source files, test files, config files
Phase 3: Technical Debt Removal
Search files for temporary/debug artifacts with Grep:
console.log,System.out.println,print(,// DEBUG:,// temp,// hack- Resolved
TODO/FIXMEcomments (keep unresolved ones)
Review context for each finding. Remove confirmed debt and document what was removed.
Phase 4: Import Optimization
- Run language-specific import optimizer if available (see references)
- Manually remove unused imports if no tool exists
- Document files changed
Phase 5: Code Readability Improvements
- Run language-specific formatter if available (see references)
- If no formatter: fix indentation, break long lines (>120), fix spacing
- Remove dead code only if obviously safe
- Document changes
Phase 6: Documentation Verification
- Verify class/file headers and public API docs
- Check remaining TODOs are still valid and have context
- Remove or update outdated comments
- Document documentation changes
Phase 7: Final Verification
- Run linters if available
- Run tests if available
- Verify no logic or signature changes were introduced
- If tests fail → stop and report failures
Phase 8: Task Completion
-
Auto-update task status:
- Add a
## Cleanup Summarysection to the task file - Check any remaining boxes in the DoD section
- Hooks automatically update status to
completedand setcompleted_date+cleanup_date
- Add a
-
Append
## Cleanup Summaryto task file with:- Files cleaned
- Changes made
- Verification checklist (linters, tests, no functionality changes)
-
Mark all todos complete
Examples
Spring Boot Cleanup
/developer-kit-specs:specs.task-implementation --lang=spring --task="docs/specs/001-user-auth/tasks/TASK-001.md" --action=cleanup
Actions:
- Verify TASK-001 status is
reviewed - Files:
UserController.java,UserService.java,UserRepository.java - Remove 5
System.out.printlnand 2 resolved TODOs - Run
./mvnw spotless:apply - Run
./mvnw test -q - Mark task
completed
TypeScript Cleanup
/developer-kit-specs:specs.task-implementation --lang=typescript --task="docs/specs/002-dashboard/tasks/TASK-003.md" --action=cleanup
Actions:
- Verify TASK-003 status is
reviewed - Files:
Dashboard.tsx,useDashboard.ts,Dashboard.test.tsx - Remove 8
console.logstatements - Run
npm run lint:fixandnpm run format - Run
npm test - Mark task
completed
Constraints and Warnings
- Never change logic or signatures during cleanup
- Stop immediately and report if tests fail
- Verify behavior is unchanged before marking complete
FAQ
What does the specs-code-cleanup skill do?
Provides final code cleanup after task review approval. Removes debug logs, temporary comments, dead code, optimizes imports, and improves readability. Use when asked to clean up code, polish, finalize, tidy up, remove technical debt, or prepare code for completion after review. Not for refactoring logic or fixing bugs—focused solely on cosmetic and hygiene cleanup.
How do I install specs-code-cleanup?
Run npx skills add https://github.com/giuseppe-trisciuoglio/developer-kit --skill specs-code-cleanup in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/specs-code-cleanup/ (personal) or .claude/skills/specs-code-cleanup/ (project).
Which AI agents can use specs-code-cleanup?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is specs-code-cleanup safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains specs-code-cleanup?
It is published by giuseppe-trisciuoglio in giuseppe-trisciuoglio/developer-kit. It has 1,775 recorded installs.
More from giuseppe-trisciuoglio/developer-kit
shadcn-ui
giuseppe-trisciuoglio/developer-kit
Provides complete shadcn/ui component library patterns including installation, configuration, and implementation of accessible React components. Use when setting up shadcn/ui, installing components, building forms with React Hook Form and Zod, customizing themes with Tailwind CSS, or implementing UI patterns like buttons, dialogs, dropdowns, tables, and complex form layouts.
tailwind-css-patterns
giuseppe-trisciuoglio/developer-kit
Provides comprehensive Tailwind CSS utility-first styling patterns including responsive design, layout utilities, flexbox, grid, spacing, typography, colors, and modern CSS best practices. Use when styling React/Vue/Svelte components, building responsive layouts, implementing design systems, or optimizing CSS workflow.
drizzle-orm-patterns
giuseppe-trisciuoglio/developer-kit
Provides comprehensive Drizzle ORM patterns for schema definition, CRUD operations, relations, queries, transactions, and migrations. Proactively use for any Drizzle ORM development including defining database schemas, writing type-safe queries, implementing relations, managing transactions, and setting up migrations with Drizzle Kit. Supports PostgreSQL, MySQL, SQLite, MSSQL, and CockroachDB.
unit-test-bean-validation
giuseppe-trisciuoglio/developer-kit
Provides patterns for unit testing Jakarta Bean Validation (JSR-380), including @Valid, @NotNull, @Min, @Max, @Email constraints with Hibernate Validator. Generates custom validator tests, constraint violation assertions, validation groups, and parameterized validation tests. Validates data integrity logic without Spring context. Use when writing validation tests, bean validation tests, or testing custom constraint validators.
nextjs-performance
giuseppe-trisciuoglio/developer-kit
Expert Next.js performance optimization skill covering Core Web Vitals, image/font optimization, caching strategies, streaming, bundle optimization, and Server Components best practices. Use when optimizing Next.js applications for Core Web Vitals (LCP, INP, CLS), implementing next/image and next/font, configuring caching with unstablecache and revalidateTag, converting Client Components to Server Components, implementing Suspense streaming, or analyzing and reducing bundle size. Supports Next.js 16 + React 19 patterns.
react-patterns
giuseppe-trisciuoglio/developer-kit
Provides comprehensive React 19 patterns for Server Components, Server Actions, useOptimistic, useActionState, useTransition, concurrent features, Suspense boundaries, and TypeScript integration. Generates executable code patterns, validates security for public endpoints, and optimizes performance with React Compiler or manual memoization. Proactively use when building React 19 applications with Next.js App Router, implementing optimistic UI, or optimizing concurrent rendering.
Popular code quality & workflow skills
grill-me
mattpocock/skills
A relentless interview to sharpen a plan or design.
improve-codebase-architecture
mattpocock/skills
Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.
handoff
mattpocock/skills
Compact the current conversation into a handoff document for another agent to pick up.
domain-modeling
mattpocock/skills
Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.
codebase-design
mattpocock/skills
Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.
diagnosing-bugs
mattpocock/skills
Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.