Skip to content
Back to skills

Clean Code

ASecurity

Clean Code rules for TypeScript, React, and Next.js. Apply when writing, refactoring, or reviewing code - naming, small functions, no any, early returns, typed errors, plus tech-specific rules for React 19, Next.js 15/16, Zustand v5, TanStack Query v5.

  • 3 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added August 31, 2026
developmenttypescriptreactnextjsrefactoring

Security analysis

A100/100

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

Scanned September 22, 2026

npx -y skills add twikus/claude-configuration --skill clean-code --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clean Code?

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

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

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: Clean Code rules for TypeScript, React, and Next.js. Apply when writing, refactoring, or reviewing code - naming, small functions, no any, early returns, typed errors, plus tech-specific rules for React 19, Next.js 15/16, Zustand v5, TanStack Query v5.
argument-hint: "[feature/file]"
---

Apply these rules inline on every edit. When a rule conflicts with the codebase, match the codebase and mention the tension. If a target is given, bring that code in line, then run the project's typecheck/build/tests.

- Names reveal intent. Booleans are predicates. Functions are verbs.
- One responsibility per function/component. Early returns. Soft ceiling: functions < 20 lines, components < 150.
- Abstract on the third repetition. Delete dead and commented-out code.
- Never `any`: `unknown` + narrowing, generics, or discriminated unions.
- Typed errors; fail fast at the boundary. No leftover `console.log`.
- Immutability by default. Handle error/empty/loading first.

Load when touching that stack: [general-clean-code.md](references/general-clean-code.md), [react-clean-code.md](references/react-clean-code.md), [nextjs-clean-code.md](references/nextjs-clean-code.md), [zustand-best-practices.md](references/zustand-best-practices.md), [tanstack-query-best-practices.md](references/tanstack-query-best-practices.md).

Fix on sight: `any`; `useEffect`/`useState` for server data; props drilling 3+ levels; unmeasured manual memo; `forwardRef`; deep nesting; magic numbers.

Never leave the codebase broken to satisfy a style rule.

Files in this skill

  • SKILL.md4.9 KB
  • agents/openai.yaml280 B
  • assets/codex-icon.svg383 B
  • references/general-clean-code.md6.9 KB
  • references/nextjs-clean-code.md8.8 KB
  • references/react-clean-code.md8.5 KB
  • references/tanstack-query-best-practices.md11.5 KB
  • references/zustand-best-practices.md9.9 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…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.