Agent skill
coding-practices
Stars
163
Forks
31
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/development/coding-practices
SKILL.md
Coding Practices
Guidelines for writing maintainable, robust, and self-documenting code.
Quick Start
typescript
// Self-documenting with proper error handling
function createUser(email: string, age: number): User {
if (!email.includes("@")) throw new Error("Invalid email");
if (age < 0 || age > 150) throw new Error("Invalid age");
return { email, age };
}
Key Principles
- Use meaningful names (self-documenting code)
- Comments explain "why", not "what"
- DRY: abstract when used 3+ times
- Validate all input data
- Handle all error cases with proper Error objects
- Never ignore errors
- Use named constants instead of magic values
- Avoid circular dependencies
References
See rules.md for complete guidelines with examples.
Didn't find tool you were looking for?