Project Standards
This skill provides comprehensive guidance on project-wide coding standards, conventions, and best practices that apply across the entire codebase regardless of language or framework.
When to Use This Skill
Use this skill when:
- Writing code - Ensuring consistency with project standards
- Making architectural decisions - Following established patterns
- Onboarding - Understanding project conventions
- Code review - Checking adherence to standards
- Refactoring - Maintaining consistency during changes
- Setting up new features - Following project conventions
Core Standards Areas
1. Coding Style
When to apply:
- Naming variables, functions, classes, modules, or files
- Structuring code for readability and maintainability
- Deciding on function size and single responsibility
- Removing unused code, commented-out blocks, or dead imports
- Extracting reusable logic to avoid duplication
- Applying consistent formatting and indentation
- Refactoring code for clarity and simplicity
Principles:
- Clear, descriptive names that reveal intent
- DRY (Don't Repeat Yourself) principle
- Single Responsibility Principle
- Self-documenting code through structure
- Consistent formatting across the codebase
Applies to: All code files (.py,.js, .ts,.jsx, .tsx,.vue, .rb,.go, .java,.rs, .cpp,.c, .swift,.kt)
2. Commenting Standards
When to apply:
- Deciding whether code needs a comment
- Documenting complex algorithms or non-obvious business logic
- Writing docstrings or function documentation
- Reviewing existing comments for relevance
- Removing outdated or misleading comments
- Explaining non-obvious code decisions or workarounds
Principles:
- Minimal, helpful comments
- Explain why, not what
- Keep code self-documenting through clear naming
- Comments should explain complex logic or business rules
- Avoid comments that restate what code does
- Keep comments evergreen and relevant
Applies to: All code files across the entire codebase
3. Error Handling
When to apply:
- Wrapping code in try-catch or try-except blocks
- Creating custom exception or error classes
- Implementing error boundaries (React, etc.)
- Handling HTTP errors from API calls
- Displaying user-friendly error messages
- Implementing retry logic with exponential backoff
- Cleaning up resources in finally blocks
- Deciding where to catch versus propagate errors
- Logging errors with appropriate severity levels
- Implementing circuit breakers for external services
- Handling validation errors with structured responses
Principles:
- User-friendly error messages
- Proper exception types and hierarchies
- Graceful degradation
- Comprehensive logging with context
- Resource cleanup in finally blocks
- Appropriate error propagation
- Retry logic for transient failures
Applies to: All code that may throw errors (API handlers, service functions, data processing, file operations, external integrations, network requests, database operations)
4. Input Validation
When to apply:
- Validating form inputs on the frontend
- Validating API request bodies, query parameters, and headers
- Implementing server-side validation logic
- Creating validation schemas (Zod, Yup, Pydantic, Joi)
- Sanitizing user input to prevent XSS, SQL injection
- Validating data types, formats, ranges, and required fields
- Implementing business rule validation
- Displaying validation error messages
- Writing custom validators for domain-specific rules
- Handling file upload validation
Principles:
- Validate on both client and server sides
- Use validation libraries for consistency
- Sanitize input to prevent security vulnerabilities
- Provide clear, actionable error messages
- Validate at system boundaries
- Use allowlists over blocklists
Applies to: Form components, API handlers, request validators, input sanitizers, schema definitions, validation middleware, file uploads, webhooks, external API integrations
5. Tech Stack Consistency
When to apply:
- Choosing libraries or packages for new functionality
- Implementing features using framework-specific patterns
- Setting up new services, integrations, or third-party APIs
- Configuring database connections, ORM settings, or query builders
- Adding authentication, authorization, or security features
- Setting up testing frameworks, tools, or test utilities
- Configuring deployment, CI/CD pipelines, or infrastructure
- Evaluating whether to add a new dependency
- Implementing caching, monitoring, logging, or observability
- Choosing between alternative approaches
Principles:
- Consistency with existing technology choices
- Follow framework-specific patterns and idioms
- Prefer existing tools over adding new dependencies
- Document technology decisions
- Maintain architectural consistency
Applies to: Frontend, backend, database, infrastructure, testing, deployment, third-party integrations
6. Project Conventions
When to apply:
- Organizing files and directory structure
- Writing git commit messages or PR descriptions
- Managing environment variables, configuration, and secrets
- Adding or updating project dependencies
- Setting up or modifying CI/CD workflows
- Implementing feature flags
- Updating README files or project documentation
- Establishing code review processes
- Maintaining changelogs or release notes
- Configuring linters, formatters, or pre-commit hooks
- Setting up development environments
- Managing monorepo or multi-package structures
Principles:
- Consistent file and directory organization
- Conventional commit messages
- Clear documentation
- Proper dependency management
- Automated quality checks
- Clear development workflows
Applies to: Configuration files (.env, package.json, requirements.txt, pyproject.toml, Dockerfile, docker-compose.yml, Makefile), directories (.github/, .gitlab-ci/, scripts/, docs/), documentation files (README.md, CHANGELOG.md, CONTRIBUTING.md)
Reference Files
For detailed standards documentation, load reference files as needed:
references/coding-style.md - Detailed coding style guidelines, naming conventions, formatting standards
references/commenting.md - Commenting best practices, docstring standards, when to comment
references/error-handling.md - Error handling patterns, exception hierarchies, logging strategies
references/validation.md - Validation patterns, schema definitions, security considerations
references/tech-stack.md - Technology stack reference, framework patterns, dependency guidelines
references/conventions.md - Project conventions, file structure, git workflows, CI/CD standards
When working on specific areas, load the appropriate reference file for detailed guidance.
Best Practices
Consistency First
- Follow existing patterns in the codebase
- When in doubt, match the style of surrounding code
- Maintain consistency across all files
Progressive Enhancement
- Start with simple, clear code
- Add complexity only when necessary
- Refactor for clarity and maintainability
Documentation
- Keep documentation up to date
- Document decisions and trade-offs
- Include examples in documentation
Quality Gates
- Use linters and formatters
- Run tests before committing
- Review code for standards adherence
Integration with Other Skills
- code-review: Use when reviewing code for standards adherence
- dead-code-removal: Follow coding style when cleaning up code
- debugging: Apply error handling standards when analyzing errors
- dependency-management: Follow tech stack standards when managing dependencies
1---2name: global-standards3description: Project-wide coding standards and conventions specialist. Use PROACTIVELY when writing code, making architectural decisions, or establishing project conventions. Covers coding style, commenting, error handling, validation, tech stack consistency, and project conventions across all languages and frameworks.4---56# Project Standards78This skill provides comprehensive guidance on project-wide coding standards, conventions, and best practices that apply across the entire codebase regardless of language or framework.910## When to Use This Skill1112Use this skill when:1314- **Writing code** - Ensuring consistency with project standards15- **Making architectural decisions** - Following established patterns16- **Onboarding** - Understanding project conventions17- **Code review** - Checking adherence to standards18- **Refactoring** - Maintaining consistency during changes19- **Setting up new features** - Following project conventions2021## Core Standards Areas2223### 1. Coding Style2425**When to apply:**2627- Naming variables, functions, classes, modules, or files28- Structuring code for readability and maintainability29- Deciding on function size and single responsibility30- Removing unused code, commented-out blocks, or dead imports31- Extracting reusable logic to avoid duplication32- Applying consistent formatting and indentation33- Refactoring code for clarity and simplicity3435**Principles:**3637- Clear, descriptive names that reveal intent38- DRY (Don't Repeat Yourself) principle39- Single Responsibility Principle40- Self-documenting code through structure41- Consistent formatting across the codebase4243**Applies to:** All code files (*.py,*.js, *.ts,*.jsx, *.tsx,*.vue, *.rb,*.go, *.java,*.rs, *.cpp,*.c, *.swift,*.kt)4445### 2. Commenting Standards4647**When to apply:**4849- Deciding whether code needs a comment50- Documenting complex algorithms or non-obvious business logic51- Writing docstrings or function documentation52- Reviewing existing comments for relevance53- Removing outdated or misleading comments54- Explaining non-obvious code decisions or workarounds5556**Principles:**5758- Minimal, helpful comments59- Explain why, not what60- Keep code self-documenting through clear naming61- Comments should explain complex logic or business rules62- Avoid comments that restate what code does63- Keep comments evergreen and relevant6465**Applies to:** All code files across the entire codebase6667### 3. Error Handling6869**When to apply:**7071- Wrapping code in try-catch or try-except blocks72- Creating custom exception or error classes73- Implementing error boundaries (React, etc.)74- Handling HTTP errors from API calls75- Displaying user-friendly error messages76- Implementing retry logic with exponential backoff77- Cleaning up resources in finally blocks78- Deciding where to catch versus propagate errors79- Logging errors with appropriate severity levels80- Implementing circuit breakers for external services81- Handling validation errors with structured responses8283**Principles:**8485- User-friendly error messages86- Proper exception types and hierarchies87- Graceful degradation88- Comprehensive logging with context89- Resource cleanup in finally blocks90- Appropriate error propagation91- Retry logic for transient failures9293**Applies to:** All code that may throw errors (API handlers, service functions, data processing, file operations, external integrations, network requests, database operations)9495### 4. Input Validation9697**When to apply:**9899- Validating form inputs on the frontend100- Validating API request bodies, query parameters, and headers101- Implementing server-side validation logic102- Creating validation schemas (Zod, Yup, Pydantic, Joi)103- Sanitizing user input to prevent XSS, SQL injection104- Validating data types, formats, ranges, and required fields105- Implementing business rule validation106- Displaying validation error messages107- Writing custom validators for domain-specific rules108- Handling file upload validation109110**Principles:**111112- Validate on both client and server sides113- Use validation libraries for consistency114- Sanitize input to prevent security vulnerabilities115- Provide clear, actionable error messages116- Validate at system boundaries117- Use allowlists over blocklists118119**Applies to:** Form components, API handlers, request validators, input sanitizers, schema definitions, validation middleware, file uploads, webhooks, external API integrations120121### 5. Tech Stack Consistency122123**When to apply:**124125- Choosing libraries or packages for new functionality126- Implementing features using framework-specific patterns127- Setting up new services, integrations, or third-party APIs128- Configuring database connections, ORM settings, or query builders129- Adding authentication, authorization, or security features130- Setting up testing frameworks, tools, or test utilities131- Configuring deployment, CI/CD pipelines, or infrastructure132- Evaluating whether to add a new dependency133- Implementing caching, monitoring, logging, or observability134- Choosing between alternative approaches135136**Principles:**137138- Consistency with existing technology choices139- Follow framework-specific patterns and idioms140- Prefer existing tools over adding new dependencies141- Document technology decisions142- Maintain architectural consistency143144**Applies to:** Frontend, backend, database, infrastructure, testing, deployment, third-party integrations145146### 6. Project Conventions147148**When to apply:**149150- Organizing files and directory structure151- Writing git commit messages or PR descriptions152- Managing environment variables, configuration, and secrets153- Adding or updating project dependencies154- Setting up or modifying CI/CD workflows155- Implementing feature flags156- Updating README files or project documentation157- Establishing code review processes158- Maintaining changelogs or release notes159- Configuring linters, formatters, or pre-commit hooks160- Setting up development environments161- Managing monorepo or multi-package structures162163**Principles:**164165- Consistent file and directory organization166- Conventional commit messages167- Clear documentation168- Proper dependency management169- Automated quality checks170- Clear development workflows171172**Applies to:** Configuration files (.env, package.json, requirements.txt, pyproject.toml, Dockerfile, docker-compose.yml, Makefile), directories (.github/, .gitlab-ci/, scripts/, docs/), documentation files (README.md, CHANGELOG.md, CONTRIBUTING.md)173174## Reference Files175176For detailed standards documentation, load reference files as needed:177178- **`references/coding-style.md`** - Detailed coding style guidelines, naming conventions, formatting standards179- **`references/commenting.md`** - Commenting best practices, docstring standards, when to comment180- **`references/error-handling.md`** - Error handling patterns, exception hierarchies, logging strategies181- **`references/validation.md`** - Validation patterns, schema definitions, security considerations182- **`references/tech-stack.md`** - Technology stack reference, framework patterns, dependency guidelines183- **`references/conventions.md`** - Project conventions, file structure, git workflows, CI/CD standards184185When working on specific areas, load the appropriate reference file for detailed guidance.186187## Best Practices188189### Consistency First190191- Follow existing patterns in the codebase192- When in doubt, match the style of surrounding code193- Maintain consistency across all files194195### Progressive Enhancement196197- Start with simple, clear code198- Add complexity only when necessary199- Refactor for clarity and maintainability200201### Documentation202203- Keep documentation up to date204- Document decisions and trade-offs205- Include examples in documentation206207### Quality Gates208209- Use linters and formatters210- Run tests before committing211- Review code for standards adherence212213## Integration with Other Skills214215- **code-review**: Use when reviewing code for standards adherence216- **dead-code-removal**: Follow coding style when cleaning up code217- **debugging**: Apply error handling standards when analyzing errors218- **dependency-management**: Follow tech stack standards when managing dependencies