Technical Governance
How Spec-Driven Development (SDD) and documentation-first engineering shaped this project, enabling AI-assisted development with governance-driven architecture.
Documentation-First Engineering
This project was built using a Documentation-First approach, where comprehensive governance documents, architecture specifications, and engineering standards were written before and during development. These documents served as the foundation for both human decision-making and AI-assisted implementation.
The Philosophy
Rather than writing code first and documenting later, this project inverts the traditional workflow:
- Define Intent — Engineering standards, architecture decisions, and governance principles are captured in markdown documents
- Establish Governance — Clear rules, quality gates, and decision-making frameworks are documented
- Build with Guidance — Code is written with these documents as the source of truth, ensuring consistency and alignment
- AI as Co-Pilot — AI tools (like Cursor) use these documents to understand context, make informed suggestions, and maintain architectural integrity
Spec-Driven Development (SDD) in Practice
Core Governance Documents
The project's technical governance is defined through several key documents:
Engineering Standards (docs/ENGINEERING_STANDARDS.md)
A comprehensive north-star document that captures engineering intent across:
- Architectural Foundations — Modular, component-based architecture principles
- Frontend Engineering Standards — Code quality, component engineering, and design system guidelines
- Accessibility (A11y) — WCAG 2.1 AA targets, testing practices, and tooling
- Security Hardening — Runtime security, build-time checks, and authentication patterns
- Performance & Web Vitals — Core Web Vitals targets, Lighthouse thresholds, and optimization strategies
- SEO & Discoverability — Technical SEO, structured data, and content optimization
- Testing Standards — Unit, integration, and E2E testing expectations with coverage thresholds
- Design System Standards — Design tokens, component guidelines, and documentation practices
This document serves as the single source of truth for what "good" looks like in this codebase.
Solution-Agnostic Policy and SDD
- The machine-readable SDD at
/sdd.yamlis authoritative for principles, boundaries, and CI expectations. - Governance and standards are solution-agnostic: technology choices may evolve, but the principles must remain intact.
- Any change that affects architecture or cross-cutting concerns should update the SDD and relevant documentation in the same PR.
Architecture Overview (docs/ARCHITECTURE.md)
Defines the technical architecture including:
- System components and their relationships
- Technology stack decisions (Next.js, React, Tailwind, etc.)
- Content architecture (Markdown + Contentlayer)
- Deployment model (Vercel)
- Key data flows and integrations
Engineering Constitution (docs/CONSTITUTION.md)
Establishes how the repository is run and maintained:
- Principles — Single Source of Truth, Quality Over Volume, Accessibility First, SEO as a Feature
- Decision-Making — How architectural decisions are documented and made
- Change Process — PR workflow, quality gates, and CI expectations
- Coverage & Testing — Minimum thresholds (90% lines, 85% branches, 90% functions)
- Automation & Bots — Dependabot, auto-merge policies, release notes
Additional Governance Documents
- Design System (
docs/DESIGN_SYSTEM.md) — Visual design tokens, component patterns, usage guidelines - Accessibility Guidelines (
docs/ACCESSIBILITY.md) — Technical accessibility practices and tooling - SEO Guide (
docs/SEO_GUIDE.md) — SEO implementation patterns and best practices - Error Handling (
docs/ERROR_HANDLING.md) — Error boundaries, logging, and monitoring strategies - Security Policy (
docs/SECURITY_POLICY.md) — Security practices and vulnerability reporting
How AI-Assisted Development Works
Context-Aware Development
With comprehensive documentation in place, AI tools can:
- Understand Intent — By reading
ENGINEERING_STANDARDS.md, AI understands the quality bar, architectural patterns, and coding standards - Maintain Consistency — When suggesting code, AI references the design system, accessibility guidelines, and testing standards
- Enforce Governance — AI can flag deviations from documented standards and suggest corrections
- Generate Tests — Coverage thresholds and testing patterns guide AI to generate appropriate test suites
- Document Decisions — AI helps maintain documentation as code evolves
Example Workflow
When implementing a new feature:
- Reference Standards — AI reads
ENGINEERING_STANDARDS.mdto understand component patterns, accessibility requirements, and testing expectations - Check Architecture — AI consults
ARCHITECTURE.mdto ensure the implementation aligns with system design - Apply Design System — AI uses
DESIGN_SYSTEM.mdto suggest appropriate design tokens and component patterns - Generate Tests — AI creates tests that meet coverage thresholds defined in
CONSTITUTION.md - Maintain Documentation — AI helps update relevant docs if the feature introduces new patterns
Benefits of This Approach
For Development
- Faster Onboarding — New contributors (human or AI) can understand the project quickly through documentation
- Consistent Quality — Standards are explicit, not implicit, reducing variance in code quality
- Reduced Technical Debt — Decisions are documented, making it easier to understand "why" and avoid regressions
- Better AI Assistance — AI tools have rich context to provide more accurate suggestions
For Maintenance
- Clear Decision History — Architecture decisions are captured, not lost in commit messages
- Easier Refactoring — Understanding original intent helps make safe changes
- Quality Gates — CI/CD enforces documented standards automatically
- Living Documentation — Docs evolve with the codebase, staying current
For Collaboration
- Shared Understanding — Everyone (including AI) works from the same source of truth
- Explicit Trade-offs — Decisions and their rationale are documented
- Governance as Code — Standards are version-controlled and reviewable
- Transparency — Project structure and quality expectations are clear
Implementation Details
Documentation Structure
All governance documents live in the docs/ directory:
docs/
├── ENGINEERING_STANDARDS.md # North-star engineering intent
├── ARCHITECTURE.md # Technical architecture
├── CONSTITUTION.md # Repository governance
├── DESIGN_SYSTEM.md # Visual design system
├── ACCESSIBILITY.md # A11y guidelines
├── SEO_GUIDE.md # SEO practices
├── ERROR_HANDLING.md # Error management
└── SECURITY_POLICY.md # Security practices
CI/CD Integration
Documentation standards are enforced through:
- Linting — ESLint rules enforce code quality standards
- Type Checking — TypeScript strict mode ensures type safety
- Testing — Coverage thresholds enforce testing standards
- Accessibility — Automated a11y checks in CI
- Security — CodeQL and dependency scanning
- Performance — Lighthouse CI enforces performance budgets
Version Control
All documentation is:
- Version-Controlled — Tracked in Git alongside code
- Reviewable — Changes go through PR review
- Linked — Documents reference each other for context
- Living — Updated as the project evolves
Future Considerations
This documentation-first approach scales well:
- Team Growth — New team members can onboard quickly
- AI Evolution — As AI tools improve, richer context yields better results
- Knowledge Preservation — Institutional knowledge is captured, not lost
- Compliance — Standards can be audited and verified
- Tooling — Documentation can drive automated tooling and checks
Related Documentation
For developers and contributors:
- Tech Stack — Complete technology stack and tooling overview
- Engineering Standards — Comprehensive engineering intent
- Architecture Overview — Technical architecture
- Engineering Constitution — Repository governance
- Design System — Visual design tokens and patterns
- Accessibility Guidelines — Technical a11y practices
Issue Templates and Community Feedback
The repository uses structured issue templates to facilitate bug reports, feature requests, and documentation improvements:
- Bug Reports — Structured form for reporting functional issues with browser/device context
- Feature Requests — Template for proposing enhancements with use case and priority assessment
- Documentation Issues — Form for reporting documentation gaps or improvements
Issue templates ensure consistency, capture necessary context, and integrate with CI/CD workflows through automatic labeling. Security vulnerabilities should be reported privately through GitHub Security Advisories rather than public issues.
See .github/ISSUE_TEMPLATE/ for template definitions and usage guidelines.
Last Updated
This technical governance documentation was last reviewed and updated on December 2, 2025.