Documentation-First Development
Documentation-first development means every implementation starts from a written specification, not a verbal prompt. The AI produces structured documentation first, and only writes code from that documentation. This is the single most effective pattern for consistent, high-quality AI-assisted development.
The problem it solves
Section titled “The problem it solves”AI coding assistants have a default behaviour that undermines quality:
- Premature implementation — Given a task, AI jumps straight to code. The first attempt becomes the final attempt, with all its assumptions baked in.
- Inconsistent results — The same prompt produces different implementations across sessions. Without a specification, there is no stable reference point.
- Context loss between sessions — Session 1 makes architectural decisions. Session 2 starts from zero. Those decisions are lost unless they were written down.
- Unvalidated assumptions — AI makes dozens of implicit decisions (data structures, error handling, API boundaries) without surfacing them for review.
The result: code that works for the demo case, breaks on edge cases, and has to be rewritten when requirements become clearer.
The solution
Section titled “The solution”Document first. Code second. All implementation happens from documentation.
Research & Document → Review & Strengthen → Implement from DocsThe documentation phase produces structured outputs that serve as implementation inputs. The code phase consumes those outputs. The two phases are separated — often across different AI sessions, different tools, or different days.
The four documentation outputs
Section titled “The four documentation outputs”| Output | Purpose | When to use |
|---|---|---|
| Executive Summary | Architecture overview, key decisions, trade-offs | Start of any project or major feature |
| Specification | Detailed technical spec with interfaces and constraints | Before implementing any non-trivial feature |
| Implementation Plan | Test cases first, then ordered implementation steps | Before any coding session |
| Research Report | Findings, comparisons, evidence-based recommendations | When evaluating options or investigating unknowns |
Executive Summary
Section titled “Executive Summary”A technical-focus document covering architecture, key decisions, and trade-offs. This is not a business document — it is a technical briefing that establishes the boundaries of the system.
An executive summary should answer:
- What is being built and why?
- What are the key architectural decisions?
- What trade-offs were made and why?
- What are the constraints (technical, resource, timeline)?
Specification
Section titled “Specification”Detailed technical documentation with clear interfaces, data structures, error handling, and constraints. A specification is precise enough that an AI coding assistant can implement from it without asking clarifying questions.
Key elements:
- Interface definitions (inputs, outputs, error cases)
- Data structures with types and constraints
- State transitions and lifecycle
- Dependencies and integration points
- What is explicitly out of scope
Implementation Plan
Section titled “Implementation Plan”Test cases first, then natural language implementation steps. These are covered in detail on the Implementation Plans page.
Research Report
Section titled “Research Report”Evidence-based findings from investigation. A research report presents what was found, what was compared, and what is recommended — with reasoning.
Structure:
- Question or problem statement
- Methodology (what was investigated and how)
- Findings (factual, with evidence)
- Comparison (if evaluating options)
- Recommendation (with reasoning and caveats)
What you do NOT do during the documentation phase
Section titled “What you do NOT do during the documentation phase”| Action | Why not |
|---|---|
| Write large code blocks | Code is an implementation detail — it belongs in the implementation phase |
| Implement features directly | Implementing without a spec means validating against nothing |
| Skip documentation for “simple” tasks | Simple tasks have a way of becoming complex; the spec catches this early |
| Include aspirational language | Document what IS, not what WILL BE. “Production-ready” is meaningless in a spec |
| Mix documentation and implementation | Switching between modes produces worse results in both |
The documentation phase is about thinking, not typing code. The AI is doing design work, not implementation work.
Why this works with AI specifically
Section titled “Why this works with AI specifically”AI has two distinct strengths that this workflow exploits:
AI is excellent at producing structured documentation. Given clear prompts and constraints, AI generates thorough specifications, identifies edge cases, surfaces assumptions, and organises information into structured formats. This is arguably where AI provides the most value — not in the code itself, but in the thinking that precedes it.
Structured documentation is excellent input for AI implementation. When the coding phase begins, the AI has explicit context: interfaces are defined, test cases are written, edge cases are enumerated, constraints are documented. The implementation becomes a translation exercise, not a design exercise.
AI Strength: Analysis & Structure → Documentation OutputDocumentation Output → AI Strength: Translation & ImplementationThe feedback loop is deliberate. AI produces documentation that AI is optimised to consume. The human reviews and strengthens the documentation in between — catching blind spots that AI alone would miss.
The handoff
Section titled “The handoff”Documentation produced in the research phase becomes the input for the implementation phase:
| Phase | Tool | Produces | Consumes |
|---|---|---|---|
| Research | Conversational AI | Executive summaries, specs, plans, reports | Requirements, questions, constraints |
| Review | Different AI or human review | Strengthened documentation | Draft documentation |
| Implementation | CLI-based AI coding tool | Working code with tests | Reviewed documentation |
The implementation phase begins with the AI reading the specification and implementation plan. The invocation is explicit:
“Let’s use Jimmy’s Workflow to execute this plan”
This triggers the PRE-FLIGHT phase, which uses the documentation as its context inventory.
Integration with Jimmy’s Workflow
Section titled “Integration with Jimmy’s Workflow”Documentation-first development feeds directly into Jimmy’s Workflow v2.1:
| Workflow phase | Documentation input |
|---|---|
| PRE-FLIGHT | Reads the specification — checks that all interfaces, dependencies, and requirements are available |
| IMPLEMENT | Follows the implementation plan step by step |
| VALIDATE | Tests against the success criteria defined in the plan |
| CHECKPOINT | Records completion against the specification |
Without documentation-first, PRE-FLIGHT has nothing to check against. The AI invents requirements as it goes. With documentation-first, PRE-FLIGHT becomes a genuine verification step — does the AI have everything the spec says it needs?
When to scale down
Section titled “When to scale down”Not every task needs a full specification. Use the decision table:
| Task type | Documentation level | Example |
|---|---|---|
| New feature or system | Full: executive summary + spec + implementation plan | Building an authentication system |
| Significant change | Spec + implementation plan | Refactoring data layer to new pattern |
| Moderate change | Implementation plan only | Adding a new API endpoint to existing pattern |
| Bug fix | Inline description in commit/PR | Fixing off-by-one error in pagination |
| Trivial change | None | Fixing a typo |
The threshold: if the task involves decisions that a future session would need to understand, document it.
Further reading
Section titled “Further reading”- Implementation Plans — How to write AI-optimised implementation plans
- External Research — Two-pronged research methodology using multiple AI systems
- Documentation Standards — The 7 principles for AI-optimised documentation
- Jimmy’s Workflow v2.1 — The validation system that consumes documentation