Claude-skill-registry applying-clean-code
General syntax and naming rules to keep the codebase maintainable. Use for all code generation.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/applying-clean-code" ~/.claude/skills/majiayu000-claude-skill-registry-applying-clean-code && rm -rf "$T"
manifest:
skills/data/applying-clean-code/SKILL.mdsource content
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
overconst
. Use uppercase constants for magic numbers/IDs:let
.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."