code-quality

motlin's avatarfrom motlin

Code quality guidelines. ALWAYS use skill for ANY code changes.

⭐0stars🔀1forks📁View on GitHub🕐Updated Dec 22, 2025

When & Why to Use This Skill

This Claude skill enforces high-standard code quality guidelines to ensure consistency, readability, and robustness in software development. It provides strict rules for TypeScript typing, error handling, naming conventions, and file management, helping developers and AI agents produce production-ready code that avoids common pitfalls like defensive programming and legacy fallbacks.

Use Cases

  • Standardizing TypeScript Development: Automatically enforces strict typing by avoiding union types and utilizing schema-based input validation for better type safety.
  • Refining Error Handling Logic: Ensures the codebase uses proactive error throwing instead of silent logging or defensive try/catch blocks to maintain predictable execution flows.
  • Maintaining Naming Consistency: Prevents the use of cryptic abbreviations, ensuring all variables and functions have descriptive, full-word names for improved long-term maintainability.
  • Optimizing Project Structure: Guides the AI to prefer editing existing files over creating new ones and requires user confirmation for new documentation, keeping the repository clean and organized.
namecode-quality
descriptionCode quality guidelines. ALWAYS use skill for ANY code changes.

Code Quality Guidelines

Don't write forgiving code

  • Don't permit multiple input formats
    • In TypeScript, this means avoiding Union Type (the | in types)
  • Use preconditions
    • Use schema libraries
    • Assert that inputs match expected formats
    • When expectations are violated, throw, don't log
  • Don't add defensive try/catch blocks
    • Usually we let exceptions propagate out
  • Don't keep legacy code paths as fallbacks
    • Remove old code instead of keeping it around for compatibility

Naming Conventions

  • Don't use abbreviations or acronyms
    • Choose number instead of num and greaterThan instead of gt

File Management

  • Prefer editing an existing file to creating a new one
  • Confirm with the user before creating any new markdown files

Style

  • Emoji and unicode characters are welcome
    • Use them at the beginning of comments, commit messages, and in headers in docs