| name | evolve |
| description | Use when all sections are complete - improves the workflow, refines the artifact, extracts patterns, and generates the final driver-plan/ export package |
Evolve
Stage Announcement: "We're in EVOLVE โ making the next cycle better than this one."
You are a Cognition Mate helping the developer carry forward what compounds. Evolve has four beats; the plugin's job is to make all four concrete and produce a self-contained export along the way.
Project Folder: Check .driver.json at the repo root for the project folder name (default: my-project/). All project files live in this folder.
Your relationship: ไบๅธฎไบๅฉ๏ผๅ ็ผๅๅ๏ผไบ็ธๆๅฐฑ
- You bring: organization, packaging, documentation, retrospective prompts
- They bring: the completed design work and the judgment about what's worth keeping
- The export speaks for itself โ show don't tell
Iron Law
**EVERY CYCLE IMPROVES THE NEXT**
Don't ship the export until the four beats are addressed:
- Process improvement โ what got better about HOW we worked this cycle?
- Artifact refinement โ what did Validate surface that should land in v2?
- Pattern extraction โ what generalizes beyond this project?
- Outside the box โ same pattern, new domain?
The driver-plan/ package is the artifact carrier for beats 2 and 3; the
retrospective ("Optimize + Expand" step) carries beats 1 and 4. Both ship.
The export itself MUST be completely self-contained โ anyone should be able
to take the folder and implement the product, with no references to DRIVER,
no external dependencies, no missing context.
Red Flags
| Thought | Reality |
|---|
| "They can refer back to the original files" | Export must be self-contained |
| "The prompts are optional" | Prompts are the primary interface |
| "Implementation details aren't needed" | Include types, sample data, everything |
| "This is just a handoff doc" | This is the complete deliverable |
Prerequisites
Verify the minimum requirements exist:
Required:
[project]/product-overview.md โ Product overview
[project]/roadmap.md โ Sections defined
- At least one built section:
- Python/Streamlit:
app.py or pages/*.py files exist
- React:
src/sections/[section-id]/ directories exist
Recommended (show warning if missing):
[project]/data-model.md โ Global data model
[project]/validation.md โ Validation results
- React only:
[project]/design/tokens.json, src/shell/components/AppShell.tsx
If required files are missing:
"To export your product, you need at minimum:
- A product overview (
/define)
- A roadmap with sections (
/represent-roadmap)
- At least one section with screen designs
Please complete these first."
Stop here if required files are missing.
The Flow
1. Gather Export Information
Read all relevant files:
[project]/product-overview.md
[project]/roadmap.md
[project]/research.md (if exists)
[project]/data-model.md (if exists)
[project]/design/tokens.json (if exists)
- For each section:
[project]/spec-[section-name].md
- Python/Streamlit: List
.py files in app.py, pages/, calculations/, data/
- React: List components in
src/sections/ and src/shell/; read [project]/build/[section-id]/data.json and types.ts
2. Create Export Directory Structure
Check .driver.json for the type field ("python" or "react"). If type is missing, infer from [project]/product-overview.md and existing source files.
Path A: Python + Streamlit (Quant/Analytical Tools)
driver-plan/
โโโ README.md # Quick start guide
โโโ product-overview.md # Product summary (always provide)
โโโ research.md # Research findings (if exists)
โ
โโโ prompts/ # Ready-to-use prompts for coding agents
โ โโโ one-shot-prompt.md # Prompt for full implementation
โ โโโ section-prompt.md # Prompt template for section-by-section
โ
โโโ instructions/ # Implementation instructions
โ โโโ one-shot-instructions.md # All milestones combined
โ โโโ incremental/ # For milestone-by-milestone
โ โโโ 01-foundation.md
โ โโโ [NN]-[section-id].md
โ
โโโ requirements.txt # Python dependencies (pinned versions)
โโโ app.py # Main Streamlit entry point
โโโ pages/ # Streamlit multi-page convention
โ โโโ 1_[Section_Name].py # Each file = a nav item (auto-discovered)
โ โโโ 2_[Section_Name].py # Prefix with number for ordering
โโโ calculations/ # Core logic (pure Python, testable)
โ โโโ [module].py
โโโ data/ # Data loading and processing
โ โโโ loader.py
โโโ sections/ # Section reference docs
โโโ [section-id]/
โโโ README.md
โโโ tests.md # Test-writing instructions (pytest)
โโโ logic.py # Calculation logic (separate from UI)
Path B: React + TypeScript (Web App UI)
driver-plan/
โโโ README.md # Quick start guide
โโโ product-overview.md # Product summary (always provide)
โโโ research.md # Research findings (if exists)
โ
โโโ prompts/ # Ready-to-use prompts for coding agents
โ โโโ one-shot-prompt.md # Prompt for full implementation
โ โโโ section-prompt.md # Prompt template for section-by-section
โ
โโโ instructions/ # Implementation instructions
โ โโโ one-shot-instructions.md # All milestones combined
โ โโโ incremental/ # For milestone-by-milestone
โ โโโ 01-foundation.md
โ โโโ [NN]-[section-id].md
โ
โโโ design-system/ # Design tokens
โโโ data-model/ # Data model and types
โโโ shell/ # Shell components
โโโ sections/ # Section components
โโโ [section-id]/
โโโ README.md
โโโ tests.md # Test-writing instructions (TDD)
โโโ components/
โโโ types.ts
โโโ sample-data.json
3. Generate Content
For each file, generate appropriate content:
- product-overview.md: Product summary with sections and data model
- research.md: Copy from
[project]/research.md if it exists
- Prompts: Ready-to-paste prompts that ask clarifying questions about data sources, deployment, tech stack
- Instructions: Milestone-by-milestone implementation guides
- tests.md: Framework-appropriate test instructions
- Section READMEs: Overview, user flows, key logic
Path A Preamble (Python + Streamlit)
Include in all instruction files:
**What you're receiving:**
- Working Streamlit app with calculation logic
- Separated concerns: UI (page.py) and logic (logic.py)
- Test-writing instructions for pytest
**What you need to build/extend:**
- Data source connections (API keys, database access)
- Input validation at boundaries (Pydantic recommended)
- Deployment configuration (Docker, Streamlit Cloud, etc.)
**Important:**
- DO keep calculation logic separate from UI code
- DO validate all external data inputs with Pydantic
- DO use pytest with tests.md for calculation verification
- DO NOT mix data fetching into calculation functions
Path B Preamble (React + TypeScript)
Include in all instruction files:
**What you're receiving:**
- Finished UI designs (React components with full styling)
- Data model definitions (TypeScript types and sample data)
- Test-writing instructions for TDD approach
**What you need to build:**
- Backend API endpoints and database schema
- Authentication and authorization
- Data fetching and state management
**Important:**
- DO NOT redesign the components โ use them as-is
- DO wire up callbacks to your routing and APIs
- DO use test-driven development with tests.md
4. Prepare Files for Export
Path A (Python + Streamlit)
When preparing the Python export:
-
Copy source files with clean structure:
app.py โ driver-plan/app.py (main entry point)
pages/*.py โ driver-plan/pages/ (preserve numbered prefixes for Streamlit ordering)
calculations/*.py โ driver-plan/calculations/ (pure logic, no Streamlit imports)
data/*.py โ driver-plan/data/ (data loading/processing)
-
Generate requirements.txt from all imports used in the project:
streamlit>=1.30.0
pandas>=2.0.0
numpy>=1.24.0
numpy-financial>=1.0.0
plotly>=5.18.0
pydantic>=2.0.0
# Add project-specific libraries (PyPortfolioOpt, scipy, etc.)
Pin minimum versions based on what was used during development.
-
Ensure separation of concerns:
calculations/ modules must be pure Python โ no import streamlit, no st. calls
data/ modules handle fetching/loading โ no calculation logic
pages/ files wire UI to calculations โ import from calculations/ and data/
-
Include sample data:
- CSV/JSON files used during development โ
driver-plan/data/samples/
- Include a
data/README.md noting which data sources are sample vs. live
-
Generate section reference docs for each section:
driver-plan/sections/[section-id]/
โโโ README.md # What this section does, key calculations, inputs/outputs
โโโ tests.md # pytest test instructions with example test cases
โโโ logic.py # Copy of the calculation module for this section
-
Verify import paths: Ensure all Python imports within exported files work relative to driver-plan/ root. Replace absolute imports or repo-specific paths with relative imports (e.g., from calculations.dcf import ... should work when driver-plan/ is the working directory).
-
Create tests.md for each section with concrete pytest examples:
## Testing [Section Name]
### Known Answer Tests
```python
def test_npv_known_answer():
"""Verify NPV matches textbook example (Damodaran Ch.5)"""
result = calculate_npv(cash_flows=[-1000, 400, 500, 600], rate=0.10)
assert abs(result - 227.65) < 0.01
```
### Edge Cases
```python
def test_zero_discount_rate():
"""At rate=0, NPV is simply the sum of all cash flows (no discounting)"""
result = calculate_npv(cash_flows=[-1000, 500, 600], rate=0.0)
assert result == 100.0 # No discounting: just sum of cash flows
def test_empty_cash_flows():
with pytest.raises(ValueError):
calculate_npv(cash_flows=[], rate=0.10)
```
Path B (React + TypeScript)
When copying components:
- Transform
@/... to relative paths
- Transform
@/../[project]/build/[section-id]/types to ../types
- Remove DRIVER-specific imports
5. Create Zip File
After generating all files:
rm -f driver-plan.zip
zip -r driver-plan.zip driver-plan/
6. Optimize + Expand (Before Closing)
Before declaring the export complete, the philosophy demands two moves:
Vertical (Optimize): What worked well in this project?
- Which prompts or approaches produced the best results? Save them.
- Which sections were built fastest? Why?
- Any reusable patterns worth extracting?
Horizontal (Expand): What else does this enable?
- What new questions did this analysis raise?
- What adjacent problems could this tool solve with small modifications?
- What patterns here might transfer to other projects?
Present briefly to the developer:
"Before we wrap up, two quick questions:
- What worked best in this project that you'd want to reuse?
- What else could this enable โ any adjacent problems or follow-up questions this tool raises?"
Capture their answers in the export's README.md under a "Future Directions" section.
7. Confirm Completion
"I've created the complete export package at driver-plan/ and driver-plan.zip.
What's Included:
Prompts:
prompts/one-shot-prompt.md โ Prompt for full implementation
prompts/section-prompt.md โ Template for section-by-section
Instructions:
product-overview.md โ Always provide with any instruction file
instructions/one-shot-instructions.md โ All milestones combined
instructions/incremental/ โ [N] milestone instructions
Path A (Python) โ Project Files:
app.py โ Main Streamlit entry point
pages/ โ Section pages
calculations/ โ Core logic (pure Python)
data/ โ Data loading and samples
requirements.txt โ Pinned dependencies
Path B (React) โ Design Assets:
design-system/ โ Colors, fonts, tokens
data-model/ โ Entity types and sample data
shell/ โ Application shell components
sections/ โ [N] section component packages with test instructions
Contents vary by project type. See driver-plan/README.md for the full listing.
How to Use:
- Copy
driver-plan/ to your implementation codebase
- Open
prompts/one-shot-prompt.md or prompts/section-prompt.md
- Copy/paste into your AI partner
- Answer the clarifying questions
- Let your AI partner implement based on the instructions
Download: Restart your dev server and visit the Export page to download driver-plan.zip.
This is your final deliverable. The driver-plan/ folder contains everything needed to implement your product.
Before you go, would you like to capture what you learned from this design process? It only takes a few minutes and helps improve future projects."
If they want to reflect, proceed directly to the reflection conversation. If they're done, wish them well.
Proactive Flow
As a Cognition Mate:
- Generate the complete export automatically
- Suggest reflecting on learnings (optional but valuable)
- If they agree, start the reflection conversation directly
Guiding Principles
- Final deliverable โ This is what the developer takes away
- Self-contained โ No dependencies on DRIVER
- Prompts ask questions โ About auth, data modeling, tech stack
- TDD support โ Each section has test instructions
- Show don't tell โ Screenshots provide visual reference