# Applying Clean Code

> General syntax and naming rules to keep the codebase maintainable. Use for all code generation.

- Skill: `diegosouzapw/applying-clean-code` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add diegosouzapw/applying-clean-code`
- Raw SKILL.md: https://api.skillmd.com/api/skills/diegosouzapw/applying-clean-code/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: diegosouzapw (https://skillmd.com/u/diegosouzapw)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/diegosouzapw/applying-clean-code

---


# Clean Code Principles

## When to use this skill
- Naming variables, functions, and files.
- Deciding on function size and complexity.

## Principles
- **Self-Documenting Names**: `isBookingPending` > `status === 1`.
- **DRY (Don't Repeat Yourself)**: If logic is duplicated, move it to a utility or hook.
- **KISS (Keep It Simple, Stupid)**: Avoid over-engineering complex solutions for simple tasks.
- **Constants**: Use `const` over `let`. Use uppercase constants for magic numbers/IDs: `const MAX_GUESTS = 20;`.

## Naming Conventions
- **Components**: PascalCase (`TourCard.tsx`).
- **Functions/Variables**: camelCase (`handleSubmit`).
- **Interfaces**: PascalCase (`TourInfo`).
- **Files**: kebab-case or PascalCase (stay consistent with project structure).

## Instructions
- **Avoid Comments**: Write code so clear that comments are mostly unnecessary. Only comment the "why," not the "what."

