|
| 1 | +# Ambient Code Reference |
| 2 | + |
| 3 | +**AI-assisted development patterns for engineering teams.** |
| 4 | + |
| 5 | +--- |
| 6 | + |
| 7 | +## Executive Summary |
| 8 | + |
| 9 | +This repository provides battle-tested patterns for adopting AI-assisted development at scale. It answers the question every principal engineer faces: *"How do we use AI coding assistants without creating chaos?"* |
| 10 | + |
| 11 | +**Key Value Propositions:** |
| 12 | + |
| 13 | +1. **Consistency** - Every AI interaction follows the same process |
| 14 | +2. **Safety** - Human review gates prevent runaway automation |
| 15 | +3. **Productivity** - 10x speedup for routine tasks |
| 16 | +4. **Transferability** - Patterns work across tools and languages |
| 17 | + |
| 18 | +**Approach:** Standalone patterns. Adopt what you need, skip what you don't. No prescribed sequence. |
| 19 | + |
| 20 | +--- |
| 21 | + |
| 22 | +## What's Inside |
| 23 | + |
| 24 | +### Patterns (9 Total) |
| 25 | + |
| 26 | +| Pattern | Category | Effort | Impact | |
| 27 | +|---------|----------|--------|--------| |
| 28 | +| [Codebase Agent (CBA)](#cba) | Agent Behavior | Medium | High | |
| 29 | +| [Memory System](#memory) | Agent Behavior | Low | Medium | |
| 30 | +| [Self-Review Reflection](#self-review) | Agent Behavior | Low | High | |
| 31 | +| [Issue-to-PR Automation](#issue-to-pr) | GHA Automation | High | Very High | |
| 32 | +| [PR Auto-Review](#pr-review) | GHA Automation | Medium | High | |
| 33 | +| [Dependabot Auto-Merge](#dependabot) | GHA Automation | Low | Medium | |
| 34 | +| [Stale Issue Management](#stale) | GHA Automation | Low | Medium | |
| 35 | +| [Layered Architecture](#architecture) | Foundation | Low | Medium | |
| 36 | +| [Security Patterns](#security) | Foundation | Low | Medium | |
| 37 | + |
| 38 | +### Quick Start Paths |
| 39 | + |
| 40 | +=== "I want consistent AI assistance" |
| 41 | + |
| 42 | + Start with [Codebase Agent](patterns/codebase-agent.md) - one file that defines how AI works in your codebase. |
| 43 | + |
| 44 | +=== "AI keeps forgetting my conventions" |
| 45 | + |
| 46 | + Start with [Memory System](getting-started/first-cba.md#memory-system) - modular context files that persist across sessions. |
| 47 | + |
| 48 | +=== "Routine fixes take too long" |
| 49 | + |
| 50 | + Start with [Issue-to-PR Automation](patterns/issue-to-pr.md) - convert well-defined issues to PRs automatically. |
| 51 | + |
| 52 | +=== "I want to see it working first" |
| 53 | + |
| 54 | + Check out the [demo-fastapi](https://github.com/jeremyeder/demo-fastapi) repository for a working example. |
| 55 | + |
| 56 | +--- |
| 57 | + |
| 58 | +## Documentation Structure |
| 59 | + |
| 60 | +### Getting Started |
| 61 | + |
| 62 | +| Section | Purpose | Time | |
| 63 | +|---------|---------|------| |
| 64 | +| [Quickstart](quickstart.md) | 5-minute introduction to AI-assisted development | 5 min | |
| 65 | +| [Installation](getting-started/installation.md) | Set up tooling and dependencies | 15 min | |
| 66 | +| [Your First CBA](getting-started/first-cba.md) | Create your first Codebase Agent | 30 min | |
| 67 | + |
| 68 | +**What you'll learn:** How to copy the `.claude/` directory to your project and customize it for your tech stack. |
| 69 | + |
| 70 | +--- |
| 71 | + |
| 72 | +### Patterns |
| 73 | + |
| 74 | +#### Agent Behavior Patterns |
| 75 | + |
| 76 | +How AI agents behave during development. |
| 77 | + |
| 78 | +| Pattern | What It Does | Section Summary | |
| 79 | +|---------|--------------|-----------------| |
| 80 | +| [Codebase Agent](patterns/codebase-agent.md) | Defines AI behavior, capabilities, and guardrails | Agent definition structure, autonomy levels, workflow examples, capability boundaries | |
| 81 | +| [Self-Review Reflection](patterns/self-review-reflection.md) | Agent reviews own work before presenting | Reflection loop, checklist criteria, implementation prompts, anti-patterns | |
| 82 | +| [Autonomous Quality](patterns/autonomous-quality-enforcement.md) | Validates code quality before delivery | Lint loops, test verification, error budgets | |
| 83 | +| [Multi-Agent Review](patterns/multi-agent-code-review.md) | Multiple specialized agents review in parallel | Agent roles, consensus mechanisms, conflict resolution | |
| 84 | + |
| 85 | +#### GHA Automation Patterns |
| 86 | + |
| 87 | +Proactive CI/CD workflows. |
| 88 | + |
| 89 | +| Pattern | Trigger | Section Summary | |
| 90 | +|---------|---------|-----------------| |
| 91 | +| [Issue-to-PR](patterns/issue-to-pr.md) | `issues.opened` | Requirements analysis, draft PR creation, risk categories, safety gates | |
| 92 | +| [PR Auto-Review](patterns/pr-auto-review.md) | `pull_request` | AI review format, severity levels, when to block vs comment | |
| 93 | +| [Dependabot Auto-Merge](patterns/dependabot-auto-merge.md) | `pull_request` | Patch vs minor/major, CI requirements, safety conditions | |
| 94 | +| [Stale Issues](patterns/stale-issues.md) | `schedule` | Inactivity thresholds, warning periods, exempt labels | |
| 95 | + |
| 96 | +#### Foundation Patterns |
| 97 | + |
| 98 | +Enabling patterns that make AI more effective. |
| 99 | + |
| 100 | +| Pattern | Purpose | Section Summary | |
| 101 | +|---------|---------|-----------------| |
| 102 | +| [Layered Architecture](patterns/layered-architecture.md) | Code structure AI can reason about | Four layers, dependency rules, component responsibilities | |
| 103 | +| [Security Patterns](patterns/security-patterns.md) | Practical protection without over-engineering | Boundary validation, sanitization, secrets management | |
| 104 | +| [Testing Patterns](patterns/testing-patterns.md) | Test pyramid approach | Unit/integration/E2E, coverage targets, AI test generation | |
| 105 | + |
| 106 | +--- |
| 107 | + |
| 108 | +### Reference |
| 109 | + |
| 110 | +| Section | Purpose | Contents | |
| 111 | +|---------|---------|----------| |
| 112 | +| [Architecture](architecture.md) | Deep dive into architecture patterns | Data flow diagrams, layer boundaries, extension points | |
| 113 | +| [API Patterns](api-reference.md) | API design for AI-assisted development | Request/response patterns, error handling, OpenAPI | |
| 114 | +| [ADR Template](adr/template.md) | Decision record scaffolding | YYYYMMDD-title.md format, context/decision/consequences | |
| 115 | + |
| 116 | +--- |
| 117 | + |
| 118 | +### Tutorial |
| 119 | + |
| 120 | +| Section | Purpose | Time | |
| 121 | +|---------|---------|------| |
| 122 | +| [Full Tutorial](tutorial.md) | Step-by-step implementation guide | 2-4 hours | |
| 123 | + |
| 124 | +**What you'll build:** A complete AI-assisted development setup from scratch, including CBA, memory system, and GHA automations. |
| 125 | + |
| 126 | +--- |
| 127 | + |
| 128 | +### Resources |
| 129 | + |
| 130 | +| Resource | Format | Purpose | |
| 131 | +|----------|--------|---------| |
| 132 | +| [Presentation](resources/presentation.md) | Markdown | NotebookLM podcast generation, 9 features explained | |
| 133 | +| [Demo Application](resources/demo-app.md) | GitHub Repo | Working FastAPI example | |
| 134 | + |
| 135 | +--- |
| 136 | + |
| 137 | +## Navigation Guide |
| 138 | + |
| 139 | +```mermaid |
| 140 | +flowchart TD |
| 141 | + A[Start Here] --> B{What do you need?} |
| 142 | + B -->|Understand the concepts| C[Quickstart] |
| 143 | + B -->|See it working| D[Demo App] |
| 144 | + B -->|Implement patterns| E[Tutorial] |
| 145 | + B -->|Reference specific pattern| F[Patterns Index] |
| 146 | + |
| 147 | + C --> G[Your First CBA] |
| 148 | + D --> G |
| 149 | + E --> G |
| 150 | + F --> H[Choose Pattern] |
| 151 | + |
| 152 | + G --> I[Production Setup] |
| 153 | + H --> I |
| 154 | +``` |
| 155 | + |
| 156 | +--- |
| 157 | + |
| 158 | +## Design Principles |
| 159 | + |
| 160 | +1. **Standalone patterns** - No dependencies between patterns. Adopt one without adopting others. |
| 161 | +2. **Copy-paste ready** - All configurations are complete and ready to customize. |
| 162 | +3. **Human-in-the-loop** - AI assists, humans decide. Safety gates everywhere. |
| 163 | +4. **Vendor-agnostic** - Patterns work with any AI tool or none at all. |
| 164 | +5. **Minimal ceremony** - Start small, add complexity only when needed. |
| 165 | + |
| 166 | +--- |
| 167 | + |
| 168 | +## Who This Is For |
| 169 | + |
| 170 | +| Role | Benefit | |
| 171 | +|------|---------| |
| 172 | +| **Principal Engineers** | Evaluate AI adoption strategy with battle-tested patterns | |
| 173 | +| **Team Leads** | Implement consistent AI workflows across your team | |
| 174 | +| **Senior Developers** | Get productivity gains without sacrificing quality | |
| 175 | +| **Junior Developers** | Get senior-level AI assistance with guardrails | |
| 176 | + |
| 177 | +--- |
| 178 | + |
| 179 | +## Quick Links |
| 180 | + |
| 181 | +- **GitHub Repository**: [jeremyeder/reference](https://github.com/jeremyeder/reference) |
| 182 | +- **Demo Application**: [jeremyeder/demo-fastapi](https://github.com/jeremyeder/demo-fastapi) |
| 183 | +- **Original SRE Coloring Book**: [red.ht/sre-coloring-book](https://red.ht/sre-coloring-book) |
| 184 | + |
| 185 | +--- |
| 186 | + |
| 187 | +*"Stable, Secure, Performant, and Boring" - the goal is to make AI assistance invisible through excellence.* |
0 commit comments