project-standards

Provides project coding standards and architectural principles on-demand. Automatically invoked when implementing features, writing code, or making technical decisions. Reads constitution.md to ensure all code aligns with project principles.

⭐2stars🔀1forks📁View on GitHub🕐Updated Dec 8, 2025⬇️2downloads

When & Why to Use This Skill

This Claude skill acts as an automated architectural guardian and compliance officer for software development. By referencing a project-specific 'constitution.md', it ensures that all code implementations, technical decisions, and refactoring efforts align with predefined architectural principles such as TDD, SOLID, and security-first protocols. It bridges the gap between high-level design requirements and low-level code execution, maintaining consistency across complex codebases.

Use Cases

  • Enforcing Test-Driven Development (TDD) by ensuring tests are authored and validated before feature implementation.
  • Aligning new component development with SOLID principles and specific project architectural patterns to prevent technical debt.
  • Automating security compliance checks, such as verifying input validation schemas and ensuring secrets are managed via environment variables.
  • Standardizing observability across services by mandating structured logging, health check endpoints, and distributed tracing metrics.
  • Providing a unified source of truth for specialized sub-agents (frontend, backend, or QA) to ensure cross-functional architectural consistency.
nameproject-standards
descriptionProvides project coding standards and architectural principles on-demand. Automatically invoked when implementing features, writing code, or making technical decisions. Reads constitution.md to ensure all code aligns with project principles.

Project Standards Skill

You are implementing code in a project that follows specific architectural principles and coding standards defined in the project constitution.

When to Invoke This Skill

Claude should use this skill when:

  • Writing or modifying code
  • Making architectural decisions
  • Implementing tasks from tasks.md
  • Reviewing code for compliance
  • Setting up new components or services

How to Use

  1. Read the constitution to understand project principles:

    Read: .specify/memory/constitution.md
    
  2. Apply principles during implementation:

    • TDD: Write tests first, ensure they fail, then implement
    • SOLID: Follow single responsibility, dependency injection
    • Security: No hardcoded secrets, validate all inputs
    • Observability: Add logging, metrics, tracing
  3. Check compliance before marking tasks complete

Key Principles Summary

Test-Driven Development (TDD)

  • Write tests BEFORE implementation code
  • Tests must FAIL initially (Red phase)
  • Implement to make tests pass (Green phase)
  • Refactor after passing (Refactor phase)
  • 100% test pass rate required (enforced by test-gate.sh)

SOLID Architecture

  • Single Responsibility: One reason to change per class/module
  • Open/Closed: Extend via interfaces, don't modify
  • Liskov Substitution: Implementations substitutable for abstractions
  • Interface Segregation: Many focused interfaces
  • Dependency Inversion: Depend on abstractions, inject implementations

Security-First

  • Secrets in environment variables or secret managers only
  • Input validation with strict schemas (Pydantic, Zod)
  • Parameterized queries only (no string interpolation for SQL)
  • Row-Level Security (RLS) for multi-tenant data
  • Rate limiting on all API endpoints

Code Quality

  • Type hints/annotations required
  • Linting must pass (ruff, ESLint)
  • Docstrings for public APIs
  • Meaningful variable/function names

Observability

  • Structured JSON logging with correlation IDs
  • Health check endpoints (/health, /ready, /live)
  • Metrics for critical operations
  • Distributed tracing for cross-service calls

Integration with Sub-Agents

When working as a specialized sub-agent:

For backend-api-engineer

  • Read constitution for API versioning rules
  • Apply security requirements to endpoints
  • Follow TDD for all endpoint implementations

For frontend-react-engineer

  • Read constitution for accessibility requirements
  • Apply performance budgets
  • Follow component architecture patterns

For openapi-spec-author

  • Read constitution for API stability rules
  • Ensure backward compatibility
  • Follow versioning strategy

For integration-tester

  • Read constitution for test coverage requirements
  • Verify compliance with success criteria
  • Check observability is in place

Quick Reference

Before implementing, ask yourself:

  1. Did I write the test first? (TDD)
  2. Is this class doing only one thing? (SRP)
  3. Are secrets externalized? (Security)
  4. Is there logging/metrics? (Observability)
  5. Are inputs validated? (Security)
  6. Does this align with the constitution? (Compliance)

Full Constitution Access

For complete details, read:

.specify/memory/constitution.md

This contains:

  • All 8 core principles with detailed requirements
  • Security requirements and data protection rules
  • Compliance standards (SOC 2, HIPAA, GDPR)
  • Performance targets and SLOs
  • Development workflow and CI/CD gates