A structured approach to AI-assisted software development
Maximize the effectiveness of AI coding assistants by providing context, memory, and consistent patterns
Why This Structure? β’ Quick Start β’ Directory Guide β’ Best Practices β’ Examples β’ www.aiagentskit.com
- Why This Structure?
- Directory Structure
- Quick Start by Scenario
- Directory Guide
- Development Loop
- Best Practices
- LLM Prompt Patterns
- Example Project
TL;DR: AI coding assistants are powerful, but only when given proper context. This system provides that context.
graph LR
A[Clear Context] --> E[High Quality Code]
B[Atomic Tasks] --> E
C[Session Memory] --> E
D[Consistent Patterns] --> E
| Pillar | What It Provides | Why It Matters |
|---|---|---|
| π― Clear Context | Vision, goals, and boundaries | AI understands why your code exists |
| β‘ Atomic Tasks | Well-defined, scoped work units | Fits within AI context windows |
| π§ Session Memory | Logs of decisions and implementations | AI remembers past conversations |
| π Consistent Patterns | Established conventions | AI generates code that matches your style |
Tip
Works with any AI coding assistant: Claude, GPT-4, Gemini, Cursor, GitHub Copilot, and more!
/docs
βββ _templates/ # π BASE TEMPLATES (for LLMs to generate files)
βββ 00-context/ # π― WHY and WHAT EXISTS RIGHT NOW
βββ 01-product/ # π¦ WHAT the product must do
βββ 02-features/ # π§ HOW features are designed & built
βββ 03-logs/ # π§ MEMORY (what most teams miss!)
βββ 04-process/ # π HOW to work with this system
βββ README.md # π You are here
Click to see detailed structure
docs/
βββ _templates/
β βββ README.md
β βββ 00-context/
β β βββ vision_template.md
β β βββ assumptions_template.md
β β βββ system-state_template.md
β βββ 01-product/
β β βββ prd_template.md
β βββ 02-features/
β β βββ feature-spec_template.md
β β βββ tech-design_template.md
β β βββ dev-tasks_template.md
β β βββ test-plan_template.md
β βββ 03-logs/
β βββ implementation-log_template.md
β βββ decisions-log_template.md
β βββ bug-log_template.md
β βββ validation-log_template.md
β βββ insights_template.md
βββ 00-context/
β βββ vision.md
β βββ assumptions.md
β βββ system-state.md
βββ 01-product/
β βββ prd.md
βββ 02-features/
β βββ {feature-name}/
β βββ feature-spec.md
β βββ tech-design.md
β βββ dev-tasks.md
β βββ test-plan.md
βββ 03-logs/
β βββ implementation-log.md
β βββ decisions-log.md
β βββ bug-log.md
β βββ validation-log.md
β βββ insights.md
βββ 04-process/
βββ dev-workflow.md
βββ definition-of-done.md
βββ llm-prompts.md
Note
Choose the scenario that matches your current situation. Each includes a step-by-step checklist.
π Starting a brand new application with AI assistance
β‘ Copy this template to your project root
β‘ Open 00-context/vision.md
β‘ Answer these questions:
β What problem does this solve?
β Who is the target user?
β What are the boundaries (what we will NOT build)?
β How do we measure success?β‘ Open 01-product/prd.md
β‘ List your user stories
β‘ Define acceptance criteria for each
β‘ Prioritize: P0 (must have), P1 (should have), P2 (nice to have)β‘ Create folder: 02-features/{{first-feature-name}}/
β‘ Create feature-spec.md (use template)
β‘ Create tech-design.md (architecture decisions)
β‘ Create dev-tasks.md (atomic, LLM-executable tasks)
β‘ Create test-plan.md (validation criteria)β‘ Initialize system-state.md with tech stack
β‘ Follow daily workflow in 04-process/dev-workflow.md
β‘ Start with TASK-001 from dev-tasks.mdπ¦ Adding this documentation system to an existing codebase
β‘ Open 00-context/system-state.md
β‘ Document:
β Current tech stack (frameworks, libraries, versions)
β Existing file/folder structure
β What features are built
β Current deployment setup
β Known issues and technical debtβ‘ Open 00-context/vision.md
β‘ Based on existing code, document:
β What the product does
β Who uses it
β Core principles (inferred from code patterns)
β Boundaries (what it doesn't do)β‘ Open 03-logs/decisions-log.md
β‘ Document major past decisions:
β Why was this framework chosen?
β Why this database?
β Why this architecture pattern?
β Any decisions you wish were different?β‘ For each major existing feature:
β Create 02-features/{{feature-name}}/
β Write feature-spec.md (what it does now)
β Write tech-design.md (current architecture)
β Skip dev-tasks.md (already built)
β Create test-plan.md if tests don't existβ‘ Create 02-features/{{new-feature-name}}/
β‘ Follow Scenario C workflow below[!WARNING] Don't try to document everything at once! Start with high-level docs, then add detail as you work on each feature.
β¨ Planning and building a new feature in an existing project
β‘ Create 02-features/{{feature-name}}/
β‘ Copy templates from _templates/02-features/β‘ Open feature-spec.md
β‘ Define:
β Purpose: Why this feature?
β User Intent: What is the user trying to do?
β Acceptance Criteria: How do we know it's done?
β Edge Cases: What could go wrong?
β Out of Scope: What are we NOT building?β‘ Open tech-design.md
β‘ Define:
β Component architecture
β Data models
β API changes (if any)
β Dependencies on existing code
β Performance considerationsβ‘ Open dev-tasks.md
β‘ Create atomic tasks (30-60 min each)
β‘ Each task must have:
β Clear title
β Context files to reference
β Detailed description
β Acceptance criteriaβ‘ Follow 04-process/dev-workflow.md
β‘ Complete one task at a time
β‘ Log everything in 03-logs/[!TIP] Small, atomic tasks = better AI assistance. Aim for tasks that take 30-60 minutes each.
π Investigating and fixing an issue in the codebase
β‘ Open 03-logs/bug-log.md
β‘ Create entry with:
β Bug ID (BUG-XXX)
β Description
β Reproduction steps
β Expected vs actual behavior
β Severity (Critical/High/Medium/Low)β‘ Share with AI:
β Bug description from bug-log.md
β Relevant code files
β Error messages/stack traces
β What you've already tried
β‘ Ask AI to help identify root causeβ‘ Implement the fix
β‘ Verify reproduction steps no longer reproduce bug
β‘ Test for regressions
β‘ Add a test to prevent regressionβ‘ Update bug-log.md with:
β Root cause
β Fix applied
β Prevention measures
β‘ Update implementation-log.md with changes
β‘ Commit: "fix: [description] (BUG-XXX)"[!IMPORTANT] Always document the root cause, not just the symptom. This prevents similar bugs in the future.
β»οΈ Improving code quality without changing functionality
β‘ Open 03-logs/decisions-log.md
β‘ Create ADR entry:
β What are you refactoring?
β Why? (tech debt, performance, readability)
β What's the target state?β‘ Create 02-features/refactor-{{name}}/dev-tasks.md
β‘ Break into small, safe refactoring steps
β‘ Each task should:
β Not change external behavior
β Be testable independently
β Be revertible if neededβ‘ Run tests before starting (baseline)
β‘ Refactor one task at a time
β‘ Run tests after each task
β‘ Commit after each passing testβ‘ Update system-state.md if architecture changed
β‘ Update tech-design.md if patterns changed
β‘ Log learnings in 03-logs/insights.md[!CAUTION] Never refactor without tests! If tests don't exist, write them first.
π Getting a new team member up to speed
β‘ Day 1: Context
β Read 00-context/vision.md (15 min)
β Read 00-context/system-state.md (30 min)
β Run the application locally
β Explore the codebase structure
β‘ Day 1-2: History
β Read 03-logs/decisions-log.md (understand WHY)
β Read recent entries in implementation-log.md
β Review bug-log.md for known issues
β‘ Day 2: Process
β Read 04-process/dev-workflow.md
β Read 04-process/definition-of-done.md
β Review 04-process/llm-prompts.md
β‘ Day 2-3: First Task
β Pick a P2 or good-first-issue task
β Follow the full workflow
β Ask questions (they become docs!)[!TIP] New developers should be productive within 2-3 days with this system. If not, improve the docs!
π§ Ongoing upkeep of a stable product
β‘ Review bug-log.md for new issues
β‘ Check assumptions.md - validated/invalidated?
β‘ Update system-state.md if dependencies updated
β‘ Review insights.md - learnings to action?β‘ Dependency updates (security patches)
β‘ Performance review
β‘ User feedback review (validation-log.md)
β‘ Tech debt assessment
β‘ Documentation freshness check[!NOTE] Regular maintenance prevents documentation rot. Schedule these as recurring tasks!
π― Purpose: Provides foundational context for all development work
| File | Purpose | Update Frequency | Key Audience |
|---|---|---|---|
vision.md |
Product purpose, boundaries, north star | Rarely (major pivots) | Everyone |
assumptions.md |
Risks, unknowns, and assumptions | Weekly or when validated | PMs, Leads |
system-state.md |
Current tech stack and deployment | After major changes | Developers, AI |
Important
Start every LLM conversation by referencing vision.md
π¦ Purpose: Single source of truth for requirements
| File | Purpose | Update Frequency | Key Audience |
|---|---|---|---|
prd.md |
Product requirements, user stories | As scope changes | PMs, Developers |
π Purpose: Standardized templates for AI assistants to generate consistent documents
All base templates are centralized here for easy reference:
_templates/
βββ README.md # How to use templates
βββ 00-context/
β βββ vision_template.md
β βββ assumptions_template.md
β βββ system-state_template.md
βββ 01-product/
β βββ prd_template.md
βββ 02-features/
β βββ feature-spec_template.md
β βββ tech-design_template.md
β βββ dev-tasks_template.md
β βββ test-plan_template.md
βββ 03-logs/
βββ implementation-log_template.md
βββ decisions-log_template.md
βββ bug-log_template.md
βββ validation-log_template.md
βββ insights_template.md
π€ LLM Usage: When asked to create a document, reference the appropriate template from this folder.
π§ Purpose: Feature-specific planning and implementation details
Create a new folder for each feature:
02-features/
βββ expense-entry/ # β
Example completed feature
β βββ feature-spec.md # What it does
β βββ tech-design.md # How it's built
β βββ dev-tasks.md # Implementation tasks
β βββ test-plan.md # Validation criteria
βββ {{new-feature}}/ # π Copy templates for new features
βββ ...
π§ Purpose: Provide AI assistants with "memory" across sessions
| File | Purpose | Update Frequency | Why Critical |
|---|---|---|---|
implementation-log.md |
What changed and why | After each session | AI continuity |
decisions-log.md |
Architectural decisions (ADRs) | When decisions made | Context for future |
bug-log.md |
Bugs and their fixes | When bugs found/fixed | Pattern recognition |
validation-log.md |
Post-shipping observations | After releases | Product insights |
insights.md |
Learnings for future | Ongoing | Team knowledge |
Warning
Skipping logs = amnesia. Without them, every AI conversation starts from zero!
π Purpose: Define workflows and quality standards
| File | Purpose | When to Use |
|---|---|---|
dev-workflow.md |
Daily development loop (human + LLM) | Every coding session |
definition-of-done.md |
Quality gates and checklists | Before marking tasks complete |
llm-prompts.md |
Copy-paste prompt templates | When working with AI |
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β DAILY DEV LOOP β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β β
β 1οΈβ£ CONTEXT LOAD β
β ββ Share vision.md + relevant feature docs with LLM β
β β
β 2οΈβ£ TASK SELECTION β
β ββ Pick next task from dev-tasks.md β
β β
β 3οΈβ£ IMPLEMENTATION β
β ββ Execute task with LLM assistance β
β β
β 4οΈβ£ VALIDATION β
β ββ Test against test-plan.md criteria β
β β
β 5οΈβ£ DOCUMENTATION β
β ββ Update logs (implementation, decisions, bugs) β
β β
β 6οΈβ£ COMMIT β
β ββ Clear commit message referencing task β
β β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Click to see the loop in detail
What: Provide AI with necessary background
Share these files:
- 00-context/vision.md (always)
- Relevant feature-spec.md
- Relevant tech-design.md
- Recent implementation-log.md entriesWhat: Choose an atomic, well-defined task
Good task criteria:
β
Takes 30-60 minutes
β
Has clear acceptance criteria
β
References specific files
β
Is independent (low coupling)What: Build the feature with AI assistance
Best practices:
- Start with tests (if TDD)
- Implement incrementally
- Ask AI to explain decisions
- Review generated code carefullyWhat: Verify the task is complete
Check against:
β
Acceptance criteria in dev-tasks.md
β
Test plan in test-plan.md
β
Definition of done in 04-process/What: Update logs for future sessions
Update:
- implementation-log.md (what changed)
- decisions-log.md (if architectural choice made)
- bug-log.md (if bug discovered)What: Save work with clear message
Format: type(scope): description (TASK-XXX)
Examples:
- feat(auth): add login form (TASK-012)
- fix(api): handle null user (BUG-005)
- refactor(db): extract query logic (TASK-034)| Practice | Why | Example |
|---|---|---|
| Keep vision.md concise | Under 500 words - it's an anchor, not a novel | β "Build a budgeting app for freelancers" |
| Make tasks atomic | Each task should be completable in one LLM session | β "Implement login form validation" |
| Log everything | The logs ARE your project's memory | β Update implementation-log.md after each session |
| Reference docs in prompts | Give AI context it needs | β "Based on vision.md and tech-design.md..." |
| Update system-state.md | Keep it current so LLM knows what exists | β Document new dependencies immediately |
| Anti-Pattern | Problem | Instead |
|---|---|---|
| Skip the logs | Every conversation starts from zero | β Log decisions and implementations |
| Write vague tasks | "Make it work" isn't actionable | β Be specific: "Add email validation to signup" |
| Let docs go stale | Outdated docs β confused LLM β bad code | β Update docs when code changes |
| Mix features | Creates coupling and confusion | β One feature folder per capability |
Caution
Stale docs are worse than no docs! They actively mislead AI assistants.
Placeholder Syntax:
{{file.md}}means insert content from that file
I'm working on {{PROJECT_NAME}}. Here's the context:
## Vision
{{00-context/vision.md}}
## Current Feature
{{02-features/{{feature-name}}/feature-spec.md}}
## Technical Design
{{02-features/{{feature-name}}/tech-design.md}}
## Current Task
{{02-features/{{feature-name}}/dev-tasks.md β TASK-XXX}}
Please implement this task following the patterns established in the technical design.Continuing our work on {{PROJECT_NAME}}.
## Recent Implementation
{{03-logs/implementation-log.md β latest 3 entries}}
## Next Task
{{02-features/{{feature-name}}/dev-tasks.md β TASK-XXX}}
Please continue from where we left off.I'm investigating BUG-XXX in {{PROJECT_NAME}}.
## Bug Description
{{03-logs/bug-log.md β BUG-XXX entry}}
## Relevant Code
{{path/to/file.js}}
## Error Message{{error stack trace}}
Please help identify the root cause and suggest a fix.
I need to make an architectural decision for {{PROJECT_NAME}}.
## Context
{{00-context/vision.md}}
{{00-context/system-state.md}}
## Decision Needed
{{describe the decision}}
## Options Considered
1. Option A: ...
2. Option B: ...
3. Option C: ...
Please analyze trade-offs and recommend an approach, considering our tech stack and constraints.More Prompt Patterns
Please review this code for {{FEATURE_NAME}}.
## Implementation
{{code snippet}}
## Requirements
{{02-features/{{feature-name}}/feature-spec.md β acceptance criteria}}
## Technical Design
{{02-features/{{feature-name}}/tech-design.md}}
Check for:
- Adherence to requirements
- Code quality and patterns
- Edge cases
- Performance issuesI want to refactor {{MODULE_NAME}} in {{PROJECT_NAME}}.
## Current Code
{{existing code}}
## Problems
{{what needs improvement}}
## Technical Design Patterns
{{02-features/{{feature-name}}/tech-design.md β relevant patterns}}
Please suggest a refactoring approach that maintains existing behavior while improving {{quality attribute}}.This template includes a complete example for a Personal Finance Tracker app.
Review the following files to see how each document type should be filled out:
docs/
βββ 00-context/
β βββ vision.md β See example vision
β βββ assumptions.md β See example assumptions
β βββ system-state.md β See example tech stack
βββ 01-product/
β βββ prd.md β See example user stories
βββ 02-features/
β βββ expense-entry/ β Complete feature example
β βββ feature-spec.md
β βββ tech-design.md
β βββ dev-tasks.md
β βββ test-plan.md
βββ 03-logs/
βββ implementation-log.md β See example log entries
βββ decisions-log.md β See example ADRs
βββ bug-log.md β See example bug tracking
Tip
Start by reading the example files in order. They build on each other!
| I want to... | Start here | Key files |
|---|---|---|
| π Build a new app | Scenario A | vision.md β prd.md β feature-spec.md |
| π¦ Document existing project | Scenario B | system-state.md β vision.md β decisions-log.md |
| β¨ Add a new feature | Scenario C | 02-features/{{name}}/ β follow workflow |
| π Fix a bug | Scenario D | bug-log.md β investigate β fix β document |
| β»οΈ Refactor code | Scenario E | decisions-log.md β plan β execute β test |
| π Onboard developer | Scenario F | This README β vision.md β dev-workflow.md |
| π§ Maintain project | Scenario G | Weekly checklist β monthly checklist |
Built with β€οΈ for AI-assisted development