A comprehensive methodology for structuring AI-assisted software development around formal specifications, agent configuration, and enterprise-grade artifact management.
This repository contains four in-depth guides that form a complete framework for Spec-Driven Development (SDD) β a methodology where formal specifications are authored before any code is written, and AI coding assistants are configured to follow those specifications precisely.
The guides address four interconnected concerns:
| # | Guide | Focus | Key Question |
|---|---|---|---|
| 1 | Interacting with AI to Generate SDD Artifacts | Workflow | How do I create specs with AI? |
| 2 | Enterprise SDD β Extended Artifact Catalog | Artifacts | What artifacts does my project need? |
| 3 | Configuring AI Coding Agents for Your Project | AI Configuration | How do I make AI follow my conventions? |
| 4 | AI Use Protocol | Governance | What are the rules for using AI responsibly? |
- Developers using AI coding assistants (Gemini, Copilot, Cursor, Claude, Antigravity,etc.) who want consistent, spec-compliant output
- Tech leads establishing AI-assisted development standards for their teams
- Solo developers building portfolio or production projects with structured AI workflows
- Engineering teams scaling AI tooling across multiple contributors
Traditional Development Spec-Driven Development
βββββββββββββββββββββ βββββββββββββββββββββββ
Idea β Code β Docs Idea β Specs β Code
(docs are afterthought) (specs drive everything)
AI guesses conventions AI follows conventions
Inconsistent output Consistent, traceable output
- Specs before code β Define what and why before how
- AI as technical writer β You provide intent; AI structures it into formal specifications
- Agent configuration as onboarding β Configure AI the same way you'd onboard a new developer
- Traceability β Every line of code traces back to a specification artifact
File: Guide Interacting with AI to Generate SDD Artifacts.md
A 9-phase sequential workflow for generating a complete specification suite using AI, from initial context loading through implementation:
Phase 0: Context Loading β Give AI your project context
Phase 1: Constitution β Non-negotiable rules & principles
Phase 2: Product Requirements β Workflows & acceptance criteria
Phase 3: Data Model β ERD, entities, business rules
Phase 4: API Contract β Endpoints, schemas, error cases
Phase 5: UI/UX Specification β Design tokens, wireframes, responsive rules
Phase 6: Architecture β System diagrams, file structure, deployment
Phase 7: Implementation Plan β Phases, tasks, time estimates
Phase 8: Verification Spec β Test matrices, E2E walkthrough
Phase 9: Implementation β AI-assisted code generation from specs
- Prompt templates for each phase with structured context injection
- Review checklists to validate AI-generated specs before approval
- Anti-patterns β common mistakes when using AI for spec generation
- Artifact traceability matrix showing how specs reference each other
- SDD completeness checklist β the gate before starting implementation
- Session management β how to resume work across AI conversations
File: Guide Enterprise SDD - Extended Artifact Catalog.md
Maps the complete artifact landscape needed for production software, organized into 6 layers:
| Layer | Artifacts | Scope |
|---|---|---|
| 1. Product | Constitution, PRD, Data Model, API Contract, UI/UX, Architecture, Plan, Tasks, Verification | Core SDD specs |
| 2. Engineering Process | Git Strategy, CI/CD Pipeline, Environment Strategy, Release Management, Code Review Standards | Team workflows |
| 3. Security & Compliance | Security Spec (Auth, RBAC, OWASP), Data Governance (PII, GDPR) | Trust & compliance |
| 4. Operations | Observability, Incident Response, Performance Spec (SLOs) | Production readiness |
| 5. AI Agent Config | AGENTS.md, rules.md, skills.md, tool-specific configs | AI alignment |
| 6. Knowledge | Onboarding Guide, ADRs, Dependency Policy, Glossary | Team scaling |
- Adoption matrix β which artifacts to create based on project scale (Solo β Small Team β Enterprise)
- Full templates for each artifact with ready-to-use markdown structures
- Complete enterprise file tree showing where every artifact lives
- Phased creation order β what to create before code, before first sprint, before production, and ongoing
File: Guide Configuring AI Coding Agents for Your Project.md
A deep-dive into creating configuration files that make AI coding assistants behave consistently within your specific codebase.
| File | Purpose | Analogy |
|---|---|---|
| AGENTS.md | Who does what β scope, permissions, coordination | Org chart |
| rules.md | How code should be written β conventions & constraints | Style guide |
| skills.md | What to do β parameterized task templates | Playbook |
- rules.md anatomy β 7-section structure (Identity β Universal β Backend β Frontend β Styling β Testing β Forbidden)
- skills.md design β parameterized recipe templates with 5-part structure
- Tool-specific configs for Gemini, Copilot, Cursor, Claude, Windsurf, and Aider
- Writing effective rules β the quality spectrum from vague to precise
- Cross-tool compatibility matrix β feature support across 6 AI tools
- Anti-patterns β 6 common mistakes with concrete alternatives
- Maintenance cadence β weekly, monthly, quarterly review cycles
- Quick-start template β a 15-line rules.md to get started in 15 minutes
File: Guide AI Use Protocol.md
A governance framework defining how AI tools and services should be used across any organization or project β regardless of industry, team size, or regulatory environment.
| Tier | Category | Human Review | Example |
|---|---|---|---|
| 1 | Automation | Not required | Translation, formatting, summarization |
| 2 | Assisted Generation | Required | Code generation, documentation, UI components |
| 3 | Prohibited Use | Blocked | Autonomous system actions, sensitive data exposure |
- Usage categories β risk-tiered classification of AI tasks (Automation β Assisted Generation β Prohibited)
- Input & access restrictions β what data can and cannot be shared with AI
- Tool governance β approval process, MCP server rules, and forbidden integrations
- Decision framework β 6-question quick-check matrix before using AI
- Compliance alignment β maps to common frameworks (GDPR, SOC 2, HIPAA, PCI-DSS, ISO 27001)
- Domain customization appendix β overlay templates for Fintech, Healthcare, E-commerce, and SaaS
Note: This protocol is designed as a universal base layer. Teams in regulated industries extend it with domain-specific addendums (see Appendix A in the document).
Start with the minimum viable agent configuration from Guide 3, Appendix A:
- Create
.gemini/rules.md(or your tool's config file) - Add your project identity, 5β10 key conventions, and 5 forbidden patterns
- Start coding with AI β add one new rule every time AI gets something wrong
Follow the phased approach from Guide 1:
- Load context into AI (Phase 0)
- Generate each spec artifact sequentially (Phases 1β8)
- Review and approve each artifact before moving on
- Use approved specs as blueprints for AI-assisted implementation (Phase 9)
Use Guide 2's layered artifact map:
- Before any code: Layers 1 + 5 (Product specs + AI agent config)
- Before first sprint: Layer 2 (Engineering process) + AI Use Protocol (Guide 4)
- Before production: Layers 3 + 4 (Security + Operations)
- Ongoing: Layer 6 (Knowledge & onboarding)
Challenge Brief / Product Idea
β
ββββΆ 00-constitution.md
ββββΆ 01-product-requirements.md
ββββΆ 02-data-model-spec.md βββΆ schema.prisma
ββββΆ 03-api-contract.md βββΆ routes/*.ts
ββββΆ 04-ui-ux-spec.md βββΆ pages/*.tsx + index.css
ββββΆ 05-architecture.md βββΆ file tree + Docker
06-implementation-plan.md βββ derives from 01β05
07-task-breakdown.md βββ decomposes 06
08-verification-spec.md βββ validates 01β05
AGENTS.md + rules.md + skills.md βββ inform ALL of the above
AI Use Protocol βββ governs HOW AI is used across all of the above
Agent configs are your project's onboarding document for AI. Just as you'd give a new developer a style guide, coding standards, and architecture overview β agent configs give the same context to your AI. The difference: humans can infer; AI needs explicit instruction.
Time to write agent configs: ~1β2 hours
Time saved per AI interaction: ~5β15 minutes
Break-even after: ~10β20 interactions
Lifetime savings across team: Hundreds of hours
CC0 1.0 Universal
These guides are provided for educational and professional development purposes.
Spec-Driven Development: Because the best code starts with the best specifications.