Agent skill
clean-code
Comprehensive clean code workflow that analyzes codebase, recommends best practices, and applies clean code principles for React, Next.js, and modern tooling.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/workflow-clean-code-flosrn-claude
SKILL.md
<quick_start> Basic usage (analyze and apply clean code principles):
/clean-code auth feature
Auto mode (skip confirmations):
/clean-code -a dashboard
With save (output to .claude/output/clean-code/):
/clean-code -s -a refactor api
What it does:
- Scans codebase for issues (React, Next.js, Zustand, TanStack Query)
- Loads relevant best practices docs
- Applies clean code improvements
- Verifies with build and tests
- Commits changes </quick_start>
| Flag | Description |
|---|---|
-a |
Auto mode: skip confirmations |
-e |
Economy mode: no subagents, direct tools only |
-s |
Save mode: output to .claude/output/clean-code/ |
-r |
Resume mode: continue from previous task |
--react |
Force load React 19 patterns |
--nextjs |
Force load Next.js 15/16 patterns |
--zustand |
Force load Zustand v5 patterns |
--query |
Force load TanStack Query v5 patterns |
<state_variables>
| Variable | Type | Description |
|---|---|---|
{task_description} |
string | What to analyze |
{task_id} |
string | Kebab-case identifier |
{auto_mode} |
boolean | Skip confirmations |
{economy_mode} |
boolean | No subagents |
{save_mode} |
boolean | Save outputs |
{detected_tech} |
object | Technologies found |
{issues} |
array | Issues found |
</state_variables>
<reference_files>
| File | When Loaded |
|---|---|
references/general-clean-code.md |
Always |
references/react-clean-code.md |
React detected / --react |
references/nextjs-clean-code.md |
Next.js detected / --nextjs |
references/zustand-best-practices.md |
Zustand detected / --zustand |
references/tanstack-query-best-practices.md |
No data fetching / --query |
</reference_files>
<entry_point>
Load steps/step-01-scan.md
</entry_point>
<step_files>
| Step | File | Purpose |
|---|---|---|
| 01 | step-01-scan.md |
Init + analyze |
| 02 | step-02-apply.md |
Load docs + apply |
| 03 | step-03-verify.md |
Build + commit |
</step_files>
<execution_rules>
- Load one step at a time
- Use parallel agents in step-01 (unless economy mode)
- Always run build before completing
- Follow patterns from reference files exactly </execution_rules>
<success_criteria>
- Technologies correctly detected (React, Next.js, Zustand, TanStack Query)
- Issues identified and documented
- Relevant reference docs loaded
- Clean code improvements applied
- Build passes without errors
- Tests pass (if tests exist)
- Changes committed with clear message
- No hacks or shortcuts used </success_criteria>
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?