A documentation framework for AI-assisted feature development — from discovery to delivery in 5 structured phases.
A battle-tested process for building features using AI assistants (Claude, Cursor, ChatGPT, etc.). Instead of ad-hoc prompting, this framework guides you through:
- Discovery — Clarifying requirements through structured Q&A
- Design — Creating technical specifications
- Contracts — Defining machine-readable interfaces (JSON schemas)
- Execution — Parallel development with agent briefs
- Merge — Integration, testing, and retrospectives
-
Clone this repo into your project:
git clone https://github.com/YOUR_USERNAME/feature-lifecycle-kit.git docs/AICompanion
-
Attach
FEATURE_LIFECYCLE.mdto your AI assistant -
Tell the AI:
"I want to build a user authentication system"
-
Follow the guided 5-phase process
Download individual templates from the templates/ folder and adapt them.
feature-lifecycle-kit/
├── README.md # You're here
├── FEATURE_LIFECYCLE.md # THE MAIN PROCESS DOCUMENT ⭐
├── CODING_CONVENTIONS.md # Standards template (customize)
│
├── templates/ # Templates for each phase
│ ├── MILESTONE_README_TEMPLATE.md
│ ├── PLANNING_QA_TEMPLATE.md # Phase 1: Discovery
│ ├── DESIGN_DOC_TEMPLATE.md # Phase 2: Design
│ ├── DATA_FLOW_TEMPLATE.md # Phase 3: Contracts
│ ├── AGENT_BRIEF_TEMPLATE.md # Phase 4: Execution
│ ├── E2E_VERIFICATION_TEMPLATE.md # Phase 4: Verification
│ ├── MERGE_AGENT_BRIEF_TEMPLATE.md # Phase 5: Merge
│ └── RETROSPECTIVE_TEMPLATE.md # Phase 5: Lessons learned
│
├── tickets/
│ └── TICKET_GUIDELINES.md # How to write implementation tickets
│
├── contracts/
│ └── schemas/ # Your JSON schemas go here
│
├── milestones/ # Your features go here
│
├── merge-notes/ # Agent outputs go here
│
└── examples/ # Example completed documents
┌────────────────────────────────────────────────────────────────────────────────────┐
│ FEATURE LIFECYCLE │
├────────────────────────────────────────────────────────────────────────────────────┤
│ │
│ Phase 1 Phase 2 Phase 3 Phase 4 Phase 5 │
│ DISCOVERY → DESIGN → CONTRACTS → EXECUTION → MERGE │
│ (1-2 hours) (2-4 hours) (1-2 hours) (multi-day) (2-4 hours) │
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Q&A │ → │ Design │ → │ Schemas │ → │ Agent │ → │ Merge │ │
│ │ Session │ │ Doc │ │ + Flow │ │ Briefs │ │ + Test │ │
│ └─────────┘ └─────────┘ └─────────┘ └─────────┘ └─────────┘ │
│ ↓ ↓ ↓ ↓ ↓ │
│ PLANNING_QA.md DESIGN.md contracts/ agent briefs retrospective │
│ schemas/*.json + tickets │
│ │
└────────────────────────────────────────────────────────────────────────────────────┘
| Phase | Input | AI Creates | Output Location |
|---|---|---|---|
| 1. Discovery | Feature description | Q&A document | milestones/{feature}/ |
| 2. Design | Q&A decisions | Design document | milestones/{feature}/ |
| 3. Contracts | Design doc | JSON schemas + Data flow | contracts/schemas/ |
| 4. Execution | Design + Contracts | Agent briefs + Tickets | milestones/{feature}/briefs/ |
| 5. Merge | Agent outputs | Integration + Retrospective | merge-notes/ |
Attach FEATURE_LIFECYCLE.md to your conversation:
You: "I want to build a payment processing system"
AI: Will ask ~15 clarifying questions about:
- Primary use case and user journey
- Data storage requirements
- UI/UX expectations
- Integration points
- Error handling
- Performance requirements
Then creates structured documentation at each phase.
The framework supports multiple AI agents working in parallel:
- AI creates separate briefs:
AGENT1_BACKEND_BRIEF.md,AGENT2_FRONTEND_BRIEF.md - Open separate AI windows/sessions
- Drop each brief into its own session
- Agents work independently
- Merge agent integrates the work
| Problem | How This Framework Solves It |
|---|---|
| Vague requirements | Phase 1 Q&A forces clarity |
| Integration mismatches | Phase 3 contracts define exact interfaces |
| "It works on my machine" | Phase 4 includes E2E verification |
| Knowledge silos | Phase 5 retrospectives capture learnings |
| Scope creep | Design doc defines what's IN and OUT |
- CODING_CONVENTIONS.md — Update naming conventions, folder structure
- Templates — Add/remove sections for your workflow
- Contracts — Define your event types, API patterns
For larger projects, add per-domain documentation:
backend/app/{domain}/
├── CONTEXT.md # Purpose, scope, invariants
├── MODEL.md # Entities, aggregates
├── PLAYBOOK.md # How-to guides
└── AGENT_RULES.md # What AI can edit
| Template | Use When |
|---|---|
PLANNING_QA_TEMPLATE |
Starting any new feature |
DESIGN_DOC_TEMPLATE |
Defining technical architecture |
DATA_FLOW_TEMPLATE |
Complex backend ↔ frontend flows |
AGENT_BRIEF_TEMPLATE |
Parallel development with multiple agents |
MERGE_AGENT_BRIEF_TEMPLATE |
Integrating work from multiple sources |
RETROSPECTIVE_TEMPLATE |
After completing any feature |
- Don't skip phases — Each phase catches different issues
- Create contracts early — JSON schemas prevent 75% of integration bugs
- Use agent briefs — Parallel work dramatically speeds development
- Do retrospectives — Compound learnings across features
- Keep templates updated — Evolve based on what you learn
MIT License — use freely, adapt for your needs.
Found an improvement? PRs welcome!
- Add examples to
examples/ - Improve templates
- Share your adaptations
Originally developed for the WellnessCompanion project