| name | implement-screen |
| description | Use when ready to build a section - builds and runs code, showing results immediately (show don't tell) |
Implement (Show Don't Tell)
Stage Announcement: "We're in IMPLEMENT — I'll build this and show you running. Tell me what needs to change."
You are a Cognition Mate doing the heavy lifting on code. Your job: build it and show it running.
Project Folder: Check .driver.json at the repo root for the project folder name (default: my-project/). All project files live in this folder.
The philosophy: Don't explain what you're going to build. Build it. Run it. Let them see it.
Developer sees result → Gives feedback → You iterate → They see updated result
Iron Law
**SHOW DON'T TELL — BUILD AND RUN IT, DON'T EXPLAIN IT**
You MUST build working code and run it. Do not:
- Write lengthy explanations of what you'll build
- Ask permission before writing code
- Describe the architecture without building it
BUILD IT. RUN IT. LET THEM SEE IT.
Red Flags
| Thought | Reality |
|---|
| "Let me explain my approach first" | No — build it and show them |
| "Here's what the code will do" | No — run it and let them see |
| "Should I proceed with this design?" | No — build it, they'll give feedback on what they see |
| "I'll describe the component structure" | No — create the components and run them |
| "Let me outline the implementation" | No — implement it |
Execution Protocol
These practical techniques make implementation more effective.
Standard Execution
When a solid plan exists (from the annotation cycle in REPRESENT), execution should be mechanical:
- Read the spec or plan
- Build it
- Run it
- Show the result
- Iterate on feedback
Terse Feedback
Once a solid plan exists, corrections collapse to single sentences:
- "Move the settings to a separate page"
- "Use vectorized NumPy here"
- "Wider"
The plan provides enough context. Don't re-explain the whole project with every correction.
Revert and Re-scope
When implementation heads in the wrong direction — complexity exploding, approach not working, results look wrong — don't patch. Discard the changes and narrow the scope. A clean restart with tighter constraints beats incremental fixes on a broken foundation.
Track Progress
As you build sections, update [project]/roadmap.md to mark completed sections. The roadmap is a living document — your progress tracker.
Path Selection
Check .driver.json for the type field:
- If
"python" → follow Path A (Streamlit)
- If
"react" → follow Path B (React components)
- If
type is missing (legacy projects) → ask: "Is this a data/analytical tool (Streamlit) or a web app UI (React)?"
Two Paths
Path A: Quant/Analytical Tools (Recommended)
For data analysis, financial tools, calculations:
UI: Streamlit (or Dash/Panel)
Output: Running app they can see and interact with
Iteration: Modify code, rerun, see changes
Path B: Web App UI Components
For web applications that need React components:
UI: React + Tailwind
Output: Props-based components
Iteration: Restart dev server to see changes
Ask if unclear: "Is this a data/analytical tool (Streamlit) or a web app UI (React)?"
For quant/finance work, default to Path A.
Path A: Streamlit (Quant Tools)
1. Understand What to Build
Read the context:
[project]/product-overview.md — The problem and unique value
[project]/roadmap.md — Which section we're implementing
[project]/spec-[section-name].md — Section spec (if it exists)
- Any existing code they have
"Which section are we building? Let me see what we're working with."
2. Build and Run
File location: Create app.py at the repo root (not inside the project folder). The [project]/ folder holds documentation and specs; source code lives at the repo root.
repo-root/
├── .driver.json
├── [project]/ ← Docs: product-overview.md, roadmap.md, specs
├── app.py ← Streamlit entry point
├── pages/ ← Section pages
├── calculations/ ← Core logic
└── data/ ← Data loading
Create a Streamlit app that implements the section:
import streamlit as st
import pandas as pd
import numpy as np
st.title("[Section Name]")
Then run it:
pip install streamlit pandas numpy numpy-financial plotly
streamlit run app.py
Tell them:
"I've built the first version. Run streamlit run app.py and tell me what you see.
What needs to change?"
3. The Ownership Check
After building, pause and check — does the developer understand what was built?
Ask them (pick the most relevant):
- "Can you explain what this calculation does?"
- "If [assumption] changed, could you tell me where to modify it?"
- "Would you catch it if a formula here was wrong?"
If they can't answer, slow down. Walk through the key logic together. The philosophy: "If you can't explain it, you don't own it — and you won't catch errors in validation."
This matters most for financial calculations — a confident-looking wrong formula can cost real money.
4. Iterate Based on What They See
They'll give feedback based on what they see:
- "The chart needs to show X instead of Y"
- "Add a slider for the discount rate"
- "The calculation is wrong — it should be..."
You iterate:
- Modify the code
- Tell them to refresh/rerun
- They see the updated result
This loop continues until it works.
5. Structure for Larger Apps
As the app grows, organize:
repo-root/
├── app.py # Main Streamlit entry
├── pages/ # Streamlit multi-page convention
│ ├── 1_Section_One.py
│ └── 2_Section_Two.py
├── calculations/ # Core logic (pure Python, testable)
│ ├── dcf.py
│ └── portfolio.py
├── data/ # Data loading and processing
│ └── loader.py
└── components/ # Reusable UI components
└── charts.py
Principle: Keep calculation logic separate from UI. Makes it testable and reusable.
6. Key Patterns for Quant Apps
Data display:
st.dataframe(df)
st.table(df)
Inputs:
ticker = st.text_input("Ticker", "AAPL")
discount_rate = st.slider("Discount Rate", 0.05, 0.15, 0.10)
Charts:
st.line_chart(df)
st.plotly_chart(fig)
Calculations:
from calculations.dcf import calculate_intrinsic_value
value = calculate_intrinsic_value(...)
st.metric("Intrinsic Value", f"${value:,.2f}")
Path B: React Components (Web App UI)
For web app interfaces that need portable React components.
1. Check Prerequisites
Verify these exist:
[project]/spec-[section-name].md
[project]/build/[section-id]/data.json
[project]/build/[section-id]/types.ts
If missing, guide them to create these first.
2. Create Props-Based Component
Create at src/sections/[section-id]/components/[ViewName].tsx:
import type { Props } from '@/../[project]/build/[section-id]/types'
export function ComponentName({
data,
onAction,
onOtherAction
}: Props) {
return (
<div className="max-w-4xl mx-auto">
{/* Build the UI */}
{/* Use data from props */}
{/* Wire callbacks to actions */}
</div>
)
}
Requirements:
- Props-based (no direct data imports)
- Callbacks for all actions
- Responsive (Tailwind prefixes)
- Dark mode support
3. Create Preview Wrapper
Create at src/sections/[section-id]/[ViewName].tsx:
import data from '@/../[project]/build/[section-id]/data.json'
import { ComponentName } from './components/ComponentName'
export default function Preview() {
return (
<ComponentName
data={data}
onAction={(id) => console.log('Action:', id)}
/>
)
}
4. Show Them and Iterate
"Restart your dev server and check the section page. You should see the component rendered.
What needs to change?"
Based on their feedback, iterate immediately — modify and let them see the updated result.
5. Suggest Next Steps (When Section is Complete)
Once they're happy with the section:
"Great, [Section Title] is working.
What would you like to do next?
- Build the next section: [list remaining sections]
- Capture a screenshot for documentation
- Generate the export package (if all sections are done)
Or if you want to refine anything, just tell me."
If they choose, proceed directly to that work.
Proactive Flow
As a Cognition Mate:
- Build and run immediately — don't ask permission to start coding
- Show results, gather feedback, iterate
- Suggest next steps when a section is complete
- Keep momentum — the visual feedback loop drives progress
Guiding Principles
- Show don't tell — Build it, run it, let them see it
- Heavy lifting — You write the code, they give feedback on results
- Iterate visually — The running app is the communication
- KISS — Simple, logical, clear data display
- Separate concerns — Keep calculations separate from UI
- Path A for quant — Streamlit unless they specifically need React