Context Driven Development
by @wpank
Treat project context as a managed artifact alongside code. Use structured context documents (product.md, tech-stack.md, workflow.md) to enable consistent AI interactions and team alignment. Essential for projects using AI-assisted development.
clawhub install context-driven-developmentπ About This Skill
name: context-driven-development model: reasoning version: 2.0.0 description: > Treat project context as a managed artifact alongside code. Use structured context documents (product.md, tech-stack.md, workflow.md) to enable consistent AI interactions and team alignment. Essential for projects using AI-assisted development. tags: [context, documentation, ai-alignment, team-workflow, methodology]
Context-Driven Development
Treat project context as a first-class artifact managed alongside code. Instead of relying on ad-hoc prompts or scattered documentation, establish a persistent, structured foundation that informs all AI interactions.
Installation
OpenClaw / Moltbot / Clawbot
npx clawhub@latest install context-driven-development
WHAT This Skill Does
Creates and maintains a set of context documents that:
WHEN to Use
Use for:
Skip for:
Keywords: context, project setup, documentation, AI alignment, team workflow, product vision, tech stack
Core Philosophy
Context precedes code.
Living documentation.
Single source of truth.
AI alignment.
1. Context precedes code β Define what you're building and how before implementation 2. Living documentation β Context artifacts evolve with the project 3. Single source of truth β One canonical location for each type of information 4. AI alignment β Consistent context produces consistent AI behavior
The Workflow
Context β Spec & Plan β Implement
1. Context Phase: Establish or verify project context artifacts exist and are current 2. Specification Phase: Define requirements and acceptance criteria for work units 3. Planning Phase: Break specifications into phased, actionable tasks 4. Implementation Phase: Execute tasks following established workflow patterns
The Context Documents
product.md β WHAT and WHY
Purpose: Captures product vision, goals, target users, and business context.
Contents:
Update when:
tech-stack.md β WITH WHAT
Purpose: Documents technology choices, dependencies, and architectural decisions.
Contents:
Update when:
workflow.md β HOW to Work
Purpose: Establishes development practices, quality gates, and team workflows.
Contents:
Update when:
tracks.md β WHAT'S HAPPENING
Purpose: Registry of all work units with status and metadata.
Contents:
Update when:
Directory Structure
context/
βββ product.md # Product vision and goals
βββ tech-stack.md # Technology choices
βββ workflow.md # Development practices
βββ tracks.md # Work unit registry
βββ styleguides/ # Language-specific conventions
βββ python.md
βββ typescript.md
βββ ...
Setup: New Project (Greenfield)
For new projects, create all artifacts from scratch:
1. Create context/product.md:
- Define the problem you're solving
- Describe target users
- List core features for v1
- Define success metrics
2. Create context/tech-stack.md:
- Choose languages and frameworks
- Document key dependencies with versions
- Specify infrastructure targets
- List development tools
3. Create context/workflow.md:
- Define branching strategy
- Set commit conventions
- Establish testing requirements
- Document deployment process
4. Create context/tracks.md:
- Start with empty registry
- Add work units as they're created
Setup: Existing Project (Brownfield)
For existing codebases, extract context from what exists:
1. Analyze the codebase: - Read package.json, requirements.txt, go.mod, etc. - Look at existing README and docs - Check git history for patterns
2. Create context/tech-stack.md:
- Document discovered dependencies
- Note infrastructure from configs (Docker, CI, etc.)
3. Create context/product.md:
- Infer product purpose from code
- Document current feature set
- Note any README content
4. Create context/workflow.md:
- Document existing practices
- Note any established patterns
Maintenance Principles
Keep Artifacts Synchronized
Changes in one artifact should reflect in related documents:
Update tech-stack.md When Adding Dependencies
Before adding any new dependency: 1. Check if existing dependencies solve the need 2. Document the rationale for new dependencies 3. Add version constraints 4. Note any configuration requirements
Verify Context Before Implementation
Before starting any work: 1. Read all context artifacts 2. Flag any outdated information 3. Propose updates before proceeding 4. Confirm context accuracy
Validation Checklist
Before starting implementation, validate:
Product Context:
Technical Context:
Workflow Context:
Anti-Patterns
| Anti-Pattern | Problem | Fix | |--------------|---------|-----| | Stale Context | Documents become outdated and misleading | Update context as part of each track's completion | | Context Sprawl | Information scattered across multiple locations | Use defined artifact structure; resist new document types | | Implicit Context | Relying on knowledge not captured in artifacts | If referenced repeatedly, add to appropriate artifact | | Over-Specification | Context so detailed it's impossible to maintain | Keep focused on decisions affecting AI behavior and team alignment |
Session Continuity
Starting a New Session
1. Read context/product.md to orient yourself 2. Check context/tracks.md for active work 3. Read relevant track specs for current task 4. Verify context artifacts are current
Ending a Session
1. Update track status with current progress 2. Note any blockers or decisions made 3. Commit in-progress work with clear status 4. Update tracks.md if status changed
Benefits
Team Alignment:
AI Consistency:
Institutional Memory:
NEVER Do
1. NEVER start implementation without reading context β context precedes code 2. NEVER add dependencies without updating tech-stack.md β keep the source of truth current 3. NEVER let context documents get stale β update them as part of completing work 4. NEVER scatter context across ad-hoc documents β use the defined structure 5. NEVER assume AI remembers previous sessions β context must be in artifacts 6. NEVER skip context for "quick" changes β small changes compound into drift