clean-code
Code Cleanup
Clean up code files by removing dead code, simplifying structure, and eliminating redundancy while preserving exact behavior. Language-agnostic. Applies project conventions when available.
When invoked with arguments, clean the files specified by $ARGUMENTS. When invoked without arguments, clean files changed in the current git working tree.
Workflow
- Resolve targets: Determine the set of files to clean
- File paths or glob patterns: expand and validate each path exists
git:staged: clean files in the git staging areagit:branch: clean files changed on the current branch vs the base branch- No arguments: run
git diff --name-onlyandgit diff --cached --name-onlyto collect modified files - Skip binary files, generated files (lock files, build output,
.min.*), and vendored dependencies
- Load context: Read project conventions from
CLAUDE.md,.editorconfig, linter configs, and formatter configs in the project root. These override any default assumptions - Read and analyze: For each target file, read the full contents and identify cleanup opportunities from the catalog below
- Apply cleanup: Edit each file, applying all applicable cleanup passes. Preserve all existing behavior
- Validate: Run the project's existing linter and test commands if configured. If validation fails, revert the change that caused the failure and continue with remaining files
- Report: Summarize changes per file using the output format below
More from jkappers/agent-skills
dotnet-dockerfile
Create optimized, secure multi-stage Dockerfiles for .NET Core and ASP.NET Core applications. Use when (1) creating a new Dockerfile for a .NET project, (2) containerizing a .NET application, (3) optimizing an existing .NET Dockerfile, (4) setting up Docker for .NET 6/7/8+ apps, or (5) user mentions .NET and Docker/container together.
39enhance-prompt
Analyzes and improves LLM prompts and agent instructions for token efficiency, determinism, and clarity. Use when (1) writing a new system prompt, skill, or CLAUDE.md file, (2) reviewing or improving an existing prompt for clarity and efficiency, (3) diagnosing why a prompt produces inconsistent or unexpected results, (4) converting natural language instructions into imperative LLM directives, or (5) evaluating prompt anti-patterns and suggesting fixes. Applies to all LLM platforms (Claude, GPT, Gemini, Llama).
34conventional-commit
Conventional Commits v1.0.0 standards for git messages. Use when (1) creating git commits, (2) writing or drafting commit messages, (3) reviewing commit message format, (4) explaining commit conventions, or (5) validating commit message compliance.
24react-dockerfile
Create optimized, secure multi-stage Dockerfiles for React applications (Vite, CRA, Next.js static). Use when (1) creating a new Dockerfile for a React project, (2) containerizing a React/Vite application, (3) optimizing an existing React Dockerfile, (4) setting up Docker for React with Nginx, or (5) user mentions React and Docker/container together.
23gap-analysis
Product and feature evaluation. Use when (1) Evaluating product/feature feasibility and market viability (2) Assessing product-market fit before investment (3) Comparing opportunities for roadmap prioritization (4) Competitive analysis to identify gaps (5) User asks "should we build X?" or "is this viable?" (6) Risk assessment for product decisions
16skill-creator
Guide for creating effective agent skills following the Agent Skills open standard. This skill should be used when users want to create a new skill (or update an existing skill) that extends agent capabilities with specialized knowledge, workflows, or tool integrations.
16