Skip to content
Back to skills

Clean Code 6

ASecurity

Comprehensive clean code workflow that analyzes codebase, recommends best practices, and applies clean code principles for React, Next.js, and modern tooling.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
toolsbashreactnextjstestingapibackendsecurity

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 17 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill clean-code-6 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clean Code 6?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Clean Code 6
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-clean-code-6/badge)](https://www.skillsdirectory.com/skills/david-li0406-clean-code-6)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: clean-code
description: Comprehensive clean code workflow that analyzes codebase, recommends best practices, and applies clean code principles for React, Next.js, and modern tooling.
argument-hint: "[-a] [-e] [-s] [-r <id>] <feature/file>"
---

<objective>
Fast, systematic clean code improvements using parallel agents.
</objective>

<quick_start>
**Basic usage (analyze and apply clean code principles):**

```bash
/clean-code auth feature
```

**Auto mode (skip confirmations):**

```bash
/clean-code -a dashboard
```

**With save (output to `.claude/output/clean-code/`):**

```bash
/clean-code -s -a refactor api
```

**What it does:**

1. Scans codebase for issues (React, Next.js, Zustand, TanStack Query)
2. Loads relevant best practices docs
3. Applies clean code improvements
4. Verifies with build and tests
5. Commits changes
   </quick_start>

<parameters>

| 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             |
| `--backend`  | Force load Backend/Prisma patterns                |
| `--test`     | Force load Testing patterns                       |
| `--expo`     | Force load Expo/React Native patterns             |
| `--forms`    | Force load Forms patterns                         |
| `--css`      | Force load CSS/Tailwind patterns                  |
| `--ux`       | Force load UX Design patterns                     |
| `--security` | Force load Security patterns                      |
| `--no-a11y`  | Skip accessibility checks                         |

<examples>
```bash
/clean-code auth feature          # Basic
/clean-code -a dashboard          # Auto mode
/clean-code -e -a fix types       # Economy + auto
/clean-code -s refactor api       # Save outputs
/clean-code -r auth-feature       # Resume
/clean-code --nextjs --query data # Force docs
/clean-code --backend api routes  # Backend focus
/clean-code --test --security auth # Testing + security
```
</examples>

</parameters>

<workflow>
```
SCAN → APPLY → VERIFY
  │       │       │
  │       │       └─ Build, test, commit
  │       └─ Load docs, recommend, apply
  └─ Parse flags, detect tech, find issues
```
</workflow>

<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                      |
| `{force_*}`          | boolean | Tech flags (CLI or auto-detected) |
| `{issues}`           | array   | Issues found                      |

</state_variables>

<reference_files>

| File                                          | When Loaded                        |
| --------------------------------------------- | ---------------------------------- |
| `references/general-clean-code.md`            | Always                             |
| `references/react-clean-code.md`              | `force_react`                      |
| `references/nextjs-clean-code.md`             | `force_nextjs`                     |
| `references/zustand-best-practices.md`        | `force_zustand`                    |
| `references/tanstack-query-best-practices.md` | `force_query`                      |
| `references/backend-best-practices.md`        | `force_backend`                    |
| `references/testing-best-practices.md`        | `force_test`                       |
| `references/expo-best-practices.md`           | `force_expo`                       |
| `references/forms-best-practices.md`          | `force_forms`                      |
| `references/css-best-practices.md`            | `force_css`                        |
| `references/accessibility-best-practices.md`  | Always (can skip with `--no-a11y`) |
| `references/ux-design-best-practices.md`      | `force_ux`                         |
| `references/security-best-practices.md`       | `force_security`                   |

</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>

Files in this skill

  • SKILL.md5.6 KB
  • references/accessibility-best-practices.md7 KB
  • references/backend-best-practices.md6.5 KB
  • references/css-best-practices.md5.4 KB
  • references/expo-best-practices.md4.7 KB
  • references/forms-best-practices.md6.2 KB
  • references/general-clean-code.md13.4 KB
  • references/nextjs-clean-code.md12.6 KB
  • references/react-clean-code.md12.8 KB
  • references/security-best-practices.md7.3 KB
  • references/tanstack-query-best-practices.md12.1 KB
  • references/testing-best-practices.md7.7 KB
  • references/ux-design-best-practices.md6.2 KB
  • references/zustand-best-practices.md10.2 KB
  • steps/step-01-scan.md4.9 KB
  • steps/step-02-apply.md4.4 KB
  • steps/step-03-verify.md2.5 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…