This skill enforces readable, secure JavaScript code by applying the clean-code gates, preventing over-engineering and hallucination-prone outputs.
npx playbooks add skill xenitv1/claude-code-maestro --skill clean-code
<domain_overview>
> Philosophy: This skill is the FOUNDATION - it applies to ALL other skills. Every piece of code must pass these gates.
ALGORITHMIC ELEGANCE MANDATE (CRITICAL): Never prioritize "clever" code over readable, intent-revealing engineering. AI-generated code often fails by introducing unnecessary abstractions or using vague naming conventions that obscure logic. You MUST use intent-revealing names for every variable and function. Any implementation that increases cognitive complexity without a proportional gain in performance or scalability must be rejected. Avoid "Hype-Driven Development"—proven patterns trump trending but unstable frameworks.
</domain_overview>
<iron_laws>
1. NO HALLUCINATED PACKAGES - Verify before import
2. NO LAZY PLACEHOLDERS - Code must be runnable
3. NO SECURITY SHORTCUTS - Production-ready defaults
4. NO OVER-ENGINEERING - Simplest solution first
</iron_laws>
<security_protocols>
LLMs hallucinate packages that sound real but don't exist.
npm search or pip show for unfamiliar packages^ or ~ for critical deps2025 AI Package Risks:
Frontend Security:
| Forbidden | Required |
|-----------|----------|
| dangerouslySetInnerHTML | DOMPurify sanitization |
| Inline event handlers | Event delegation |
| eval(), new Function() | Static code only |
| Storing tokens in localStorage | httpOnly cookies |
Backend Security:
| Forbidden | Required |
|-----------|----------|
| CORS: * | Explicit origin whitelist |
| Raw SQL strings | Parameterized queries |
| chmod 777 | Principle of least privilege |
| Hardcoded secrets | Environment variables + validation |
API Security (2025):
</security_protocols>
<modularity_and_placeholder_rules>
Forbidden Patterns:
// ❌ BANNED
// TODO: Implement this
// ... logic goes here
function placeholder() { }
throw new Error('Not implemented');
Required:
The 50/300 Rule:
SOLID Principles:
| Principle | Quick Check |
|-----------|-------------|
| Single Responsibility | Does this do ONE thing? |
| Open/Closed | Can I extend without modifying? |
| Liskov Substitution | Can subtypes replace parent? |
| Interface Segregation | Are interfaces minimal? |
| Dependency Inversion | Do I depend on abstractions? |
</modularity_and_placeholder_rules>
<complexity_and_dependencies>
Native First:
// ❌ Don't install is-odd
npm install is-odd
// ✅ Use native
const isOdd = n => n % 2 !== 0;
Anti-Patterns:
YAGNI: You Aren't Gonna Need It. Build for today's requirements.
Freshness Check:
npm outdated # Check for updates
npm audit # Check for vulnerabilities
The CVE Brake:
2025 Recommended:
| Category | Recommended |
|----------|-------------|
| Validation | zod, valibot |
| HTTP | ky, ofetch |
| State | zustand, jotai |
| ORM | drizzle, prisma |
| Auth | lucia, better-auth |
</complexity_and_dependencies>
<ai_era_protocols>
When Building AI Features:
When AI is Writing Code:
</ai_era_protocols>
<audit_and_reference>
Before committing ANY code:
npm audit clean)any)---
| When Using... | Clean Code Adds... |
|---------------|-------------------|
| @frontend-design | Security defaults, no eval, CSP awareness |
| @backend-design | Input validation, no raw SQL, Zero Trust |
| @tdd-mastery | No placeholders (tests enforce completeness) |
| @planning-mastery | Modularity guides task breakdown |
| @brainstorming | SOLID/YAGNI guide architecture decisions |
| @debug-mastery | Logging standards, no silent failures |
</audit_and_reference>
Weekly roundup of top Claude Code skills, MCP servers, and AI coding tips.