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 PROACTIVELY4 when writing code, making architectural decisions, or establishing project conventions.5 Covers coding style, commenting, error handling, validation, tech stack consistency,6 and project conventions across all languages and frameworks.7author: Joseph OBrien8status: unpublished9updated: '2025-12-23'10version: 1.0.111tag: skill12type: skill13---1415# Project Standards1617This skill provides comprehensive guidance on project-wide coding standards, conventions, and best practices that apply across the entire codebase regardless of language or framework.1819## When to Use This Skill2021Use this skill when:2223- **Writing code** - Ensuring consistency with project standards24- **Making architectural decisions** - Following established patterns25- **Onboarding** - Understanding project conventions26- **Code review** - Checking adherence to standards27- **Refactoring** - Maintaining consistency during changes28- **Setting up new features** - Following project conventions2930## Core Standards Areas3132### 1. Coding Style3334**When to apply:**3536- Naming variables, functions, classes, modules, or files37- Structuring code for readability and maintainability38- Deciding on function size and single responsibility39- Removing unused code, commented-out blocks, or dead imports40- Extracting reusable logic to avoid duplication41- Applying consistent formatting and indentation42- Refactoring code for clarity and simplicity4344**Principles:**4546- Clear, descriptive names that reveal intent47- DRY (Don't Repeat Yourself) principle48- Single Responsibility Principle49- Self-documenting code through structure50- Consistent formatting across the codebase5152**Applies to:** All code files (*.py,*.js, *.ts,*.jsx, *.tsx,*.vue, *.rb,*.go, *.java,*.rs, *.cpp,*.c, *.swift,*.kt)5354### 2. Commenting Standards5556**When to apply:**5758- Deciding whether code needs a comment59- Documenting complex algorithms or non-obvious business logic60- Writing docstrings or function documentation61- Reviewing existing comments for relevance62- Removing outdated or misleading comments63- Explaining non-obvious code decisions or workarounds6465**Principles:**6667- Minimal, helpful comments68- Explain why, not what69- Keep code self-documenting through clear naming70- Comments should explain complex logic or business rules71- Avoid comments that restate what code does72- Keep comments evergreen and relevant7374**Applies to:** All code files across the entire codebase7576### 3. Error Handling7778**When to apply:**7980- Wrapping code in try-catch or try-except blocks81- Creating custom exception or error classes82- Implementing error boundaries (React, etc.)83- Handling HTTP errors from API calls84- Displaying user-friendly error messages85- Implementing retry logic with exponential backoff86- Cleaning up resources in finally blocks87- Deciding where to catch versus propagate errors88- Logging errors with appropriate severity levels89- Implementing circuit breakers for external services90- Handling validation errors with structured responses9192**Principles:**9394- User-friendly error messages95- Proper exception types and hierarchies96- Graceful degradation97- Comprehensive logging with context98- Resource cleanup in finally blocks99- Appropriate error propagation100- Retry logic for transient failures101102**Applies to:** All code that may throw errors (API handlers, service functions, data processing, file operations, external integrations, network requests, database operations)103104### 4. Input Validation105106**When to apply:**107108- Validating form inputs on the frontend109- Validating API request bodies, query parameters, and headers110- Implementing server-side validation logic111- Creating validation schemas (Zod, Yup, Pydantic, Joi)112- Sanitizing user input to prevent XSS, SQL injection113- Validating data types, formats, ranges, and required fields114- Implementing business rule validation115- Displaying validation error messages116- Writing custom validators for domain-specific rules117- Handling file upload validation118119**Principles:**120121- Validate on both client and server sides122- Use validation libraries for consistency123- Sanitize input to prevent security vulnerabilities124- Provide clear, actionable error messages125- Validate at system boundaries126- Use allowlists over blocklists127128**Applies to:** Form components, API handlers, request validators, input sanitizers, schema definitions, validation middleware, file uploads, webhooks, external API integrations129130### 5. Tech Stack Consistency131132**When to apply:**133134- Choosing libraries or packages for new functionality135- Implementing features using framework-specific patterns136- Setting up new services, integrations, or third-party APIs137- Configuring database connections, ORM settings, or query builders138- Adding authentication, authorization, or security features139- Setting up testing frameworks, tools, or test utilities140- Configuring deployment, CI/CD pipelines, or infrastructure141- Evaluating whether to add a new dependency142- Implementing caching, monitoring, logging, or observability143- Choosing between alternative approaches144145**Principles:**146147- Consistency with existing technology choices148- Follow framework-specific patterns and idioms149- Prefer existing tools over adding new dependencies150- Document technology decisions151- Maintain architectural consistency152153**Applies to:** Frontend, backend, database, infrastructure, testing, deployment, third-party integrations154155### 6. Project Conventions156157**When to apply:**158159- Organizing files and directory structure160- Writing git commit messages or PR descriptions161- Managing environment variables, configuration, and secrets162- Adding or updating project dependencies163- Setting up or modifying CI/CD workflows164- Implementing feature flags165- Updating README files or project documentation166- Establishing code review processes167- Maintaining changelogs or release notes168- Configuring linters, formatters, or pre-commit hooks169- Setting up development environments170- Managing monorepo or multi-package structures171172**Principles:**173174- Consistent file and directory organization175- Conventional commit messages176- Clear documentation177- Proper dependency management178- Automated quality checks179- Clear development workflows180181**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)182183## Reference Files184185For detailed standards documentation, load reference files as needed:186187- **`references/coding-style.md`** - Detailed coding style guidelines, naming conventions, formatting standards188- **`references/commenting.md`** - Commenting best practices, docstring standards, when to comment189- **`references/error-handling.md`** - Error handling patterns, exception hierarchies, logging strategies190- **`references/validation.md`** - Validation patterns, schema definitions, security considerations191- **`references/tech-stack.md`** - Technology stack reference, framework patterns, dependency guidelines192- **`references/conventions.md`** - Project conventions, file structure, git workflows, CI/CD standards193194When working on specific areas, load the appropriate reference file for detailed guidance.195196## Best Practices197198### Consistency First199200- Follow existing patterns in the codebase201- When in doubt, match the style of surrounding code202- Maintain consistency across all files203204### Progressive Enhancement205206- Start with simple, clear code207- Add complexity only when necessary208- Refactor for clarity and maintainability209210### Documentation211212- Keep documentation up to date213- Document decisions and trade-offs214- Include examples in documentation215216### Quality Gates217218- Use linters and formatters219- Run tests before committing220- Review code for standards adherence221222## Integration with Other Skills223224- **code-review**: Use when reviewing code for standards adherence225- **dead-code-removal**: Follow coding style when cleaning up code226- **debugging**: Apply error handling standards when analyzing errors227- **dependency-management**: Follow tech stack standards when managing dependencies