AI as Team Member from Day 0 - A practical approach to AI-driven development
Context Hive is a development methodology and template collection that treats AI as a full team member from the very beginning of a project (Day 0 / Phase 0). Instead of using AI as a tool, we collaborate with AI through comprehensive documentation that serves as shared context.
- AI joins from Day 0: AI participates in the project from the pre-start phase, not as an afterthought
- Documentation as shared context: Vision, requirements, design, and rules serve as the foundation for AI collaboration
- Practical, not perfect: We share real experiences, including failures and limitations
- Scale limits unknown: We're honest about what we don't know yet
Context Hive is built around three key components working together:
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Phase 0: Pre-Start โ
โ โ
โ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโโโ
โ โ Vision.md โโโโRequirements โโโโDesign โโโโRules.md โโ
โ โ โ โ .md โ โ .md โ โ โโ
โ โโโโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโ โโโโโโโโโโโโ
โ โ โ โ โ โ
โ โโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโ โ
โ โผ โผ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโ
โ โ
โผ โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Hub System โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ build_graph.py โ โ
โ โ validate_context.py โ โ
โ โ gen_reading_list.py โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ Generates: โ
โ - Dependency graph (graph.json) โ
โ - Visualizations (graph.mmd) โ
โ - Reading lists per task โ
โโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Service Layer โ
โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โ โ Service A โ โ Service B โ โ
โ โ โ โ โ โ
โ โ โโapp/ โ โ โโapp/ โ โ
โ โ โโtests/ โ โ โโtests/ โ โ
โ โ โโtasks/ โ โ โโtasks/ โ โ
โ โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
-
Phase 0 (Pre-Start): Write four pillar documents
- Vision: Project goals and purpose
- Requirements: What needs to be built
- Design: How it will be built
- Rules: Development standards
-
Hub: Manages context and dependencies
- Scans service metadata (
service.meta.yaml) - Generates dependency graphs
- Creates optimized reading lists for AI
- Validates consistency
- Scans service metadata (
-
Services: Implement features with AI
- Each service declares its dependencies
- Tasks reference specific documents
- AI reads in optimal order (via reading lists)
- Humans review and iterate
Traditional approach: AI gets code snippets โ makes mistakes โ constant corrections
Context Hive: AI gets complete context โ autonomous implementation โ minimal corrections
- Read the getting started guide: docs/getting-started.md
- Try the minimal example: examples/minimal/
- Use the template: template/minimal/
- Run
pre-commit installafter cloning to enable the shared linting suite (Black, Ruff, mypy, markdownlint, codespell, prettier, etc.). - Execute
scripts/audit_codex.shto run the full codex audit locally. Results are written toreports/codex/audit.jsonandreports/codex/audit.html. - See docs/CODEX_AUDIT_GUIDE.md for audit criteria, pass/fail gates, and triage workflow.
- Getting Started - Complete beginner's guide
- Theory - Core concepts and methodology
- Applicability - When to use Context Hive
- Core Concepts - AI as team member, Hub architecture, COPA methodology
- Philosophy - Design decisions and rationale
- 5-Phase Process - Detailed development workflow
- Best Practices - Practical guidelines
- Context Hive vs. Other Approaches - How we compare to alternatives
- Contributing - How to contribute
- Hub Tools (hub/tools/) - Python scripts for managing context
build_graph.py- Generate dependency graphsvalidate_context.py- Validate context consistencygen_reading_list.py- Generate AI reading lists
- Hub Metadata (hub/meta/) - Generated graphs and reading lists
graph.json- Machine-readable dependency graphgraph.mmd- Mermaid visualizationreading_lists/- Generated reading orders for AI
- Sample Service (services/sample_service/) - Example service structure
- Service metadata (
service.meta.yaml) - Task definitions
- Implementation example
- Service metadata (
- Minimal Template (template/minimal/) - The essential 4-document starter kit
- Vision document
- Requirements document
- Design document
- Rules document
- Minimal Example (examples/minimal/) - A working FastAPI Hello World built with Context Hive
- Complete documentation set
- Implementation code
- Tests
- Init Script (scripts/init-project.sh) - Initialize a new Context Hive project
context-hive/
โโโ README.md # This file
โโโ THEORY.md # Core methodology
โโโ APPLICABILITY.md # When to use this approach
โโโ CONTRIBUTING.md # Contribution guidelines
โโโ LICENSE # License information
โโโ requirements.txt # Python dependencies
โ
โโโ docs/ # Documentation
โ โโโ getting-started.md # 30-minute tutorial
โ โโโ concepts.md # Core concepts and Hub architecture
โ โโโ philosophy.md # Design decisions and rationale
โ โโโ process.md # 5-phase development process
โ โโโ comparison.md # vs. other approaches
โ โโโ best-practices.md # Practical guidelines
โ
โโโ hub/ # Hub: Context Management System
โ โโโ README.md # Hub documentation
โ โโโ meta/ # Generated metadata
โ โ โโโ graph.json # Dependency graph (machine-readable)
โ โ โโโ graph.mmd # Dependency graph (Mermaid)
โ โ โโโ reading_lists/ # Generated AI reading lists
โ โโโ tools/ # Hub management tools
โ โโโ build_graph.py # Generate dependency graph
โ โโโ validate_context.py # Validate context consistency
โ โโโ gen_reading_list.py # Generate reading lists
โ
โโโ services/ # Service implementations
โ โโโ sample_service/ # Example service
โ โโโ README.md # Service documentation
โ โโโ service.meta.yaml # Service metadata
โ โโโ app/ # Implementation
โ โโโ tasks/ # Task definitions
โ
โโโ scripts/ # Utility scripts
โ โโโ init-project.sh # Project initialization script
โ
โโโ template/
โ โโโ minimal/ # Minimal template (4 documents)
โ โโโ README.md
โ โโโ docs/
โ โโโ templates.md
โ
โโโ examples/
โโโ minimal/ # Working example
โโโ README.md
โโโ docs/ # 4 core documents
โโโ src/ # Implementation
- Phase 0: Pre-start - AI joins before coding begins
- Documentation First - Create shared context before implementation
- Iterative Collaboration - AI and humans iterate together
- Learning from Failures - We welcome and share failure stories
Context Hive works well for:
- Greenfield projects starting from scratch
- Projects with clear business goals
- Teams open to AI collaboration
- Iterative development processes
See APPLICABILITY.md for detailed guidance.
If you want to contribute to Context Hive itself, follow these steps:
# Clone the repository
git clone https://github.com/Petsuro85/context-hive.git
cd context-hive
# Switch to develop branch
git checkout develop
# Run the bootstrap script to set up your environment
bash scripts/bootstrap_dev.sh
# This will:
# - Create a Python virtual environment
# - Install all dependencies
# - Set up pre-commit hooks
# - Run initial validationContext Hive uses a develop โ master workflow:
- develop: Active development branch where all work happens
- master: Protected production branch for public releases
Before submitting changes:
# Run full validation suite
bash scripts/validate_all.sh
# This runs:
# - Schema validation (strict mode)
# - Dependency graph generation
# - Reading list generation# Generate reading list for a service/task
bash scripts/make_readinglist.sh sample_service implement_api
# Generate release notes from commits
bash scripts/release_notes.sh
# Bootstrap development environment
bash scripts/bootstrap_dev.shPre-commit hooks automatically run on every commit to ensure code quality:
- Python: black (formatting), ruff (linting), mypy (type checking)
- Markdown: mdformat (formatting)
- General: trailing whitespace, YAML/JSON validation
If hooks fail, fix the issues and commit again.
We welcome contributions! This includes:
- Success stories and case studies
- Failure stories and lessons learned
- Template improvements
- Documentation enhancements
- Translation
See CONTRIBUTING.md for details.
MIT License - See LICENSE file for details.
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Remember: AI as team member, not as tool. Documentation as shared context, not as burden.