|
| 1 | +# AI-First Development Principles - Technical Specifications |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This directory contains comprehensive technical specifications for all 44 AI-First Development Architecture Principles. Each principle has its own detailed document with concrete examples, implementation guidance, anti-patterns, and cross-references to related principles. |
| 6 | + |
| 7 | +**Purpose**: Provide both developers and AI agents with detailed, actionable guidance on implementing AI-first development practices. These specs bridge the gap between high-level principles and day-to-day implementation decisions. |
| 8 | + |
| 9 | +## Quick Start |
| 10 | + |
| 11 | +### For Developers |
| 12 | + |
| 13 | +1. Browse the [Principle Index](#principle-index) below |
| 14 | +2. Read the principle spec that applies to your current task |
| 15 | +3. Review the Good/Bad examples for your scenario |
| 16 | +4. Use the Implementation Checklist before committing code |
| 17 | +5. Follow cross-references to understand related principles |
| 18 | + |
| 19 | +### For AI Agents |
| 20 | + |
| 21 | +These specifications are designed for AI consumption: |
| 22 | +- Each spec is self-contained and can be used independently |
| 23 | +- Code examples are syntactically correct and ready to adapt |
| 24 | +- Cross-references help navigate the principle system |
| 25 | +- Checklists provide concrete validation criteria |
| 26 | +- Anti-patterns help avoid common failure modes |
| 27 | + |
| 28 | +## Principle Index |
| 29 | + |
| 30 | +### People (6 principles) |
| 31 | + |
| 32 | +1. [Small AI-first working groups](principles/people/01-small-ai-first-working-groups.md) |
| 33 | +2. [Strategic human touchpoints only](principles/people/02-strategic-human-touchpoints.md) |
| 34 | +3. [Prompt engineering as core skill](principles/people/03-prompt-engineering-as-core-skill.md) |
| 35 | +4. [Test-based verification over code review](principles/people/04-test-based-verification.md) |
| 36 | +5. [Conversation-driven development](principles/people/05-conversation-driven-development.md) |
| 37 | +6. [Human escape hatches always available](principles/people/06-human-escape-hatches.md) |
| 38 | + |
| 39 | +### Process (13 principles) |
| 40 | + |
| 41 | +7. [Regenerate, don't edit](principles/process/07-regenerate-dont-edit.md) |
| 42 | +8. [Contract-first everything](principles/process/08-contract-first-everything.md) |
| 43 | +9. [Tests as the quality gate](principles/process/09-tests-as-quality-gate.md) |
| 44 | +10. [Git as safety net](principles/process/10-git-as-safety-net.md) |
| 45 | +11. [Continuous validation with fast feedback](principles/process/11-continuous-validation-fast-feedback.md) |
| 46 | +12. [Incremental processing as default](principles/process/12-incremental-processing-default.md) |
| 47 | +13. [Parallel exploration by default](principles/process/13-parallel-exploration-default.md) |
| 48 | +14. [Context management as discipline](principles/process/14-context-management-discipline.md) |
| 49 | +15. [Git-based everything](principles/process/15-git-based-everything.md) |
| 50 | +16. [Docs define, not describe](principles/process/16-docs-define-not-describe.md) |
| 51 | +17. [Prompt versioning and testing](principles/process/17-prompt-versioning-testing.md) |
| 52 | +18. [Contract evolution with migration paths](principles/process/18-contract-evolution-migration.md) |
| 53 | +19. [Cost and token budgeting](principles/process/19-cost-token-budgeting.md) |
| 54 | + |
| 55 | +### Technology (18 principles) |
| 56 | + |
| 57 | +20. [Self-modifying AI-first codebase](principles/technology/20-self-modifying-ai-first-codebase.md) |
| 58 | +21. [Limited and domain-specific by design](principles/technology/21-limited-domain-specific-design.md) |
| 59 | +22. [Separation of concerns through layered virtualization](principles/technology/22-layered-virtualization.md) |
| 60 | +23. [Protected self-healing kernel](principles/technology/23-protected-self-healing-kernel.md) |
| 61 | +24. [Long-running agent processes](principles/technology/24-long-running-agent-processes.md) |
| 62 | +25. [Simple interfaces by design](principles/technology/25-simple-interfaces-design.md) |
| 63 | +26. [Stateless by default](principles/technology/26-stateless-by-default.md) |
| 64 | +27. [Disposable components everywhere](principles/technology/27-disposable-components.md) |
| 65 | +28. [CLI-first design](principles/technology/28-cli-first-design.md) |
| 66 | +29. [Tool ecosystems as extensions](principles/technology/29-tool-ecosystems-extensions.md) |
| 67 | +30. [Observability baked in](principles/technology/30-observability-baked-in.md) |
| 68 | +31. [**Idempotency by design**](principles/technology/31-idempotency-by-design.md) ✨ *Example Spec* |
| 69 | +32. [Error recovery patterns built in](principles/technology/32-error-recovery-patterns.md) |
| 70 | +33. [Graceful degradation by design](principles/technology/33-graceful-degradation.md) |
| 71 | +34. [Feature flags as deployment strategy](principles/technology/34-feature-flags-deployment.md) |
| 72 | +35. [Least-privilege automation with scoped permissions](principles/technology/35-least-privilege-automation.md) |
| 73 | +36. [Dependency pinning and security scanning](principles/technology/36-dependency-pinning-security.md) |
| 74 | +37. [Declarative over imperative](principles/technology/37-declarative-over-imperative.md) |
| 75 | + |
| 76 | +### Governance & Operations (7 principles) |
| 77 | + |
| 78 | +38. [Access control and compliance as first-class](principles/governance/38-access-control-compliance.md) |
| 79 | +39. [Metrics and evaluation everywhere](principles/governance/39-metrics-evaluation-everywhere.md) |
| 80 | +40. [Knowledge stewardship and institutional memory](principles/governance/40-knowledge-stewardship-memory.md) |
| 81 | +41. [Adaptive sandboxing with explicit approvals](principles/governance/41-adaptive-sandboxing.md) |
| 82 | +42. [Data governance and privacy controls](principles/governance/42-data-governance-privacy.md) |
| 83 | +43. [Model lifecycle management](principles/governance/43-model-lifecycle-management.md) |
| 84 | +44. [Self-serve recovery with known-good snapshots](principles/governance/44-self-serve-recovery-snapshots.md) |
| 85 | + |
| 86 | +## How to Use These Specifications |
| 87 | + |
| 88 | +### During Design |
| 89 | + |
| 90 | +When architecting a new feature or system: |
| 91 | +1. Identify which principles apply to your design decisions |
| 92 | +2. Read those principle specs in full |
| 93 | +3. Review Related Principles sections to understand dependencies |
| 94 | +4. Apply the Implementation Checklists to your design |
| 95 | +5. Document which principles guided your choices |
| 96 | + |
| 97 | +### During Implementation |
| 98 | + |
| 99 | +When writing code: |
| 100 | +1. Keep relevant principle specs open for reference |
| 101 | +2. Use the Good/Bad examples as patterns to follow or avoid |
| 102 | +3. Check your code against the Implementation Checklist |
| 103 | +4. Add comments referencing which principles you're following |
| 104 | + |
| 105 | +### During Code Review |
| 106 | + |
| 107 | +When reviewing code (human or AI): |
| 108 | +1. Use checklists as review criteria |
| 109 | +2. Identify anti-patterns from the Common Pitfalls sections |
| 110 | +3. Suggest improvements based on Good examples |
| 111 | +4. Ensure cross-cutting concerns (like idempotency, observability) are addressed |
| 112 | + |
| 113 | +### When Something Goes Wrong |
| 114 | + |
| 115 | +When debugging issues: |
| 116 | +1. Check relevant Common Pitfalls sections |
| 117 | +2. Verify implementation against checklists |
| 118 | +3. Review Related Principles for systemic issues |
| 119 | +4. Update the principle spec if you discover new pitfalls |
| 120 | + |
| 121 | +## File Structure |
| 122 | + |
| 123 | +``` |
| 124 | +ai-first-principles/ |
| 125 | +├── README.md # This file |
| 126 | +├── TEMPLATE.md # Template for creating new specs |
| 127 | +├── PROGRESS.md # Tracking completion status |
| 128 | +├── cross-reference-index.md # Map of principle relationships |
| 129 | +└── principles/ |
| 130 | + ├── people/ # Human-focused principles |
| 131 | + ├── process/ # Workflow and methodology principles |
| 132 | + ├── technology/ # Technical implementation principles |
| 133 | + └── governance/ # Policy and operations principles |
| 134 | +``` |
| 135 | + |
| 136 | +## Contributing |
| 137 | + |
| 138 | +### Creating a New Specification |
| 139 | + |
| 140 | +1. Copy `TEMPLATE.md` |
| 141 | +2. Follow the naming convention: `{number}-{kebab-case-name}.md` |
| 142 | +3. Fill in all sections with specific, actionable content |
| 143 | +4. Include 3-5 pairs of Good/Bad code examples |
| 144 | +5. Add cross-references to 3-6 related principles |
| 145 | +6. Create 8-12 checklist items |
| 146 | +7. Update `PROGRESS.md` and `cross-reference-index.md` |
| 147 | + |
| 148 | +### Quality Standards |
| 149 | + |
| 150 | +Each specification must have: |
| 151 | +- Clear plain-language definition (1-2 sentences) |
| 152 | +- AI-specific rationale (why this matters for AI agents) |
| 153 | +- 4-6 concrete implementation approaches |
| 154 | +- 3-5 Good/Bad example pairs with real, runnable code |
| 155 | +- 3-6 related principles with relationship explanations |
| 156 | +- 5-7 common pitfalls with concrete examples |
| 157 | +- Tools organized by category with specific features noted |
| 158 | +- 8-12 actionable checklist questions |
| 159 | + |
| 160 | +See [Principle #31 - Idempotency by Design](principles/technology/31-idempotency-by-design.md) as the reference implementation. |
| 161 | + |
| 162 | +## Cross-Reference System |
| 163 | + |
| 164 | +Principles are interconnected. The [cross-reference index](cross-reference-index.md) shows: |
| 165 | +- **Dependencies**: Principles that require others |
| 166 | +- **Enablers**: Principles that make others possible |
| 167 | +- **Synergies**: Principles that work better together |
| 168 | +- **Conflicts**: Principles that trade off against each other |
| 169 | +- **Complements**: Principles addressing related concerns |
| 170 | + |
| 171 | +Always check cross-references when implementing a principle to understand the full context. |
| 172 | + |
| 173 | +## Maintenance |
| 174 | + |
| 175 | +### Version Control |
| 176 | + |
| 177 | +This specification library is versioned: |
| 178 | +- **v1.0**: Initial 44 principle specs |
| 179 | +- Updates tracked in git history |
| 180 | +- Breaking changes require major version bump |
| 181 | + |
| 182 | +### Updates |
| 183 | + |
| 184 | +When updating a principle spec: |
| 185 | +1. Verify all cross-references remain valid |
| 186 | +2. Update related principle specs if relationships change |
| 187 | +3. Add new tools/frameworks as they emerge |
| 188 | +4. Document new pitfalls as they're discovered |
| 189 | +5. Keep examples current with modern practices |
| 190 | + |
| 191 | +### Feedback |
| 192 | + |
| 193 | +Found an error? Have a better example? Discovered a new pitfall? |
| 194 | +- Open an issue describing the problem |
| 195 | +- Provide specific suggestions for improvement |
| 196 | +- Include concrete examples if proposing new content |
| 197 | + |
| 198 | +## Related Documentation |
| 199 | + |
| 200 | +- [AMPLIFIER_SELF_IMPROVEMENT_PHILOSOPHY.md](../AMPLIFIER_SELF_IMPROVEMENT_PHILOSOPHY.md) - High-level principles overview |
| 201 | +- [IMPLEMENTATION_PHILOSOPHY.md](../ai_context/IMPLEMENTATION_PHILOSOPHY.md) - Ruthless simplicity guidelines |
| 202 | +- [MODULAR_DESIGN_PHILOSOPHY.md](../ai_context/MODULAR_DESIGN_PHILOSOPHY.md) - Bricks and studs architecture |
| 203 | + |
| 204 | +--- |
| 205 | + |
| 206 | +**Status**: In Progress (1/44 principles completed) |
| 207 | +**Last Updated**: 2025-09-30 |
| 208 | +**Target Completion**: TBD |
0 commit comments