Core Philosophy¶
The Prime Directive¶
Documentation equals code. No documentation, no code.
Principle 1: Docs = Code¶
The Rule¶
Every piece of code MUST have corresponding documentation. This is not optional—it is the foundation of how we work.
Before Writing Code¶
- Write or update the specification in
docs/specs/ - Ensure architecture diagrams in
docs/architecture/reflect your changes - Check
docs/adrs/for relevant past decisions
After Writing Code¶
- Update
docs/history/with a handoff record - Verify all documentation is synchronized with implementation
- Document any deviations from the original spec
Documentation Types¶
| Code Change | Required Documentation |
|---|---|
| New feature | Spec + Architecture update |
| Bug fix | Note in history, update spec if needed |
| Refactor | Architecture update, ADR if significant |
| Dependency change | ADR required |
Principle 2: The CEO Model¶
Hierarchy¶
When working on complex tasks, agents operate in a hierarchical model:
CEO Agent (Initiator)
├── Worker Agent 1 (Subtask A)
├── Worker Agent 2 (Subtask B)
└── Worker Agent 3 (Subtask C)
CEO Responsibilities¶
- Decompose the task into subtasks
- Delegate to specialized workers
- Synthesize results
- Make final decisions
- Ensure documentation compliance
Worker Responsibilities¶
- Execute assigned subtasks
- Report progress and blockers
- Request clarification when needed
- Follow all protocols strictly
Communication¶
- Workers report to CEO, not to each other
- CEO maintains context across all workers
- Handoffs between workers go through CEO
Principle 3: First Principles Reasoning¶
The Process¶
Before implementing anything:
- Understand - What is the actual problem?
- Decompose - Break into fundamental components
- Research - Gather relevant information
- Plan - Create a step-by-step approach
- Validate - Check plan against requirements
- Execute - Implement with continuous verification
Anti-Patterns to Avoid¶
❌ Copying code without understanding
❌ Assuming solutions based on pattern matching
❌ Implementing without a plan
❌ Skipping research phase
❌ Ignoring edge cases
Thinking Process¶
Document your reasoning explicitly:
## Reasoning
### Problem Understanding
[What I understand the problem to be]
### Key Constraints
[Limitations and requirements]
### Approach
[My planned solution and why]
### Risks
[What could go wrong]
### Validation
[How I will verify success]
Principle 4: Synchronization¶
The Sync Workflow¶
After completing any work:
- Review all files changed
- Update corresponding documentation
- Record handoff in
docs/history/ - Verify no documentation drift
Documentation Drift¶
Documentation drift occurs when code and docs become out of sync. This is a critical failure.
To prevent drift:
- Always update docs in the same PR as code
- Review docs during code review
- Automate checks where possible
Checklist Before Completing Work¶
- [ ] Spec reflects implementation
- [ ] Architecture diagrams are accurate
- [ ] ADRs are current
- [ ] Handoff recorded in history
- [ ] No undocumented assumptions
Summary¶
- Write docs first, then code
- CEO delegates, workers execute
- Reason from first principles, not patterns
- Keep everything synchronized, always