# AI Dev Philosophy
<!--
ref: @protocol/ai-dev-philosophy
type: reference
tags: [AI development, specifications, context management, decision-making, iterative learning]
triggers: [define pivot points, create specifications, manage context, review transcripts]
trigger_prompt: When a developer is faced with uncertainty in their AI project or needs to clarify specifications and context management strategies.
version: 12
updated_at: 2026-07-14T23:23:51.241Z
-->
Explore the foundational principles guiding AI development and decision-making.
## Core Truth
AI amplifies thinking — or the lack of it. You still have to think. The agent executes; you decide what's worth executing.
## Pivot Points
A **pivot point** is a hard constraint everything else bends around.
| Pivot (protect it) | Not a pivot (let it flex) |
|---------------------|---------------------------|
| API contracts | Framework choice |
| Data model entities | File organization |
| URL structure | CI/CD pipeline |
| Auth model | CSS approach |
**Decision rule:** If changing X forces everything else to change, X is a pivot point. Spec it first. Don't let implementation pressure reshape it.
## Specs Are Pivot Points
The spec is the thing you build up to and then work downstream from. It defines the WHY and the WHAT — never the HOW.
- **Why:** The problem, the motivation, the constraints, who it's for
- **What:** The behavior, the contracts, the boundaries, success criteria
- **Not how:** Framework choice, file structure, implementation approach — those live in plans
A good spec survives multiple rewrites of the code beneath it. If your spec contains implementation detail, you've mixed levels.
**Specs are living documents.** As development progresses and lessons are learned, the spec absorbs them. Discoveries during implementation that change the WHAT go back into the spec — it's the source of truth, not a frozen artifact.
**Specs are hierarchical.** A parent spec is a routing table: one-liner per area, linking to child specs that go deep. This prevents context flood — load the parent to orient, drill into a child only when working in that area.
**Decision rule:** Before coding, ask: "Is the spec clear enough that someone else could plan the implementation?" If not, the spec needs work — don't push uncertainty downstream into code.
## The Chunk Size Principle
The scaffold matters more than the model. Plans are the scaffold; models are interchangeable workers.
**Decision rule:** Could an 8K-context model complete this single step? If not, decompose further. Every step should be self-contained and verifiable without needing the rest of the plan in context.
## Context is the Only Lever
You cannot make the model smarter. You can only:
1. **Put better tokens in** — fetch the right protocol, read the right files
2. **Remove worse tokens** — drop completed work, stale context, verbose output
3. **Organize for retrieval** — indexes, summaries, progressive detail
**Decision rule:** When output quality drops, don't retry — fix the context. At ~40% context usage, diminishing returns begin. Compress or spawn a subagent.
## Plans Over Code
A bad plan produces a hundred bad lines. Bad research produces a wrong direction entirely.
**Decision rule:** Invest review effort at highest leverage. Review order: research findings → plan → code. Don't code-review your way out of a bad plan.
## Uncertainty is Data
Make assumptions explicit. Flag certainty (HIGH/MED/LOW). Stop on LOW-certainty load-bearing assumptions — validate before building on them.
**Decision rule:** If you're guessing about something the rest of the plan depends on, that's a blocker, not a TODO.
## Trajectory Compounds
Bad trajectory: correction → mistake → correction → mistake. Each fix introduces new drift.
**Decision rule:** If you've course-corrected 3+ times in the same area, save learnings, discard the trajectory, and start fresh. Sunk cost doesn't justify compounding errors.
## Formality Matches Uncertainty
Scale process to uncertainty, not complexity. A well-understood 5000-line refactor needs less ceremony than a 50-line change in unfamiliar territory.
**Decision rule:** High uncertainty → checkpoint with user, research first, explicit assumptions. Low uncertainty → proceed autonomously, verify after.
## Sub-Agents Are Context Control
The entire reason for a sub-agent is to control context. Two directions:
1. **Clean entry** — take only the context a sub-task needs, leaving the main thread's baggage behind. The sub-agent starts lean and focused.
2. **Clean exit** — let a sub-task read 50 files, explore dead ends, and accumulate noise, then return a 10-line summary. The main context never sees the mess.
This is why role-based agents ("frontend agent", "backend agent") fail — they accumulate context with no exit strategy. Task-based agents ("find auth patterns", "analyze refactoring impact") have a clear deliverable and a natural debrief point.
**Mastering the debrief is the leverage.** A good sub-agent prompt specifies what to return: file paths, a summary, a recommendation, a decision. A bad one says "look into X" and dumps everything back.
**Decision rule:** If a task would bloat your context with exploration you won't need after, or if your current context is irrelevant to the sub-task, spawn an agent. Brief it with just enough context to execute. Debrief it for just the insight you need.
## Transcripts Are a Gold Mine
Claude Code and OpenClaw log full transcripts at the system level. This happens automatically — you don't need to generate logs from within the conversation. Know that it's happening.
The leverage is in going back. Periodically audit and mine those transcripts:
- **Corrections:** Where did the agent go wrong? Why? What guardrail was missing?
- **Patterns:** What decisions keep recurring? Extract them into protocols.
- **Scaffolding:** What context was missing? What assumptions broke? What chunk size worked? Future sessions get smarter from past sessions.
A context window dies when the session ends. The transcript lives forever and can be searched, audited, and harvested indefinitely.
**Decision rule:** Ensure transcripts are being captured (they are in Claude Code and OpenClaw by default). Budget time to review them. Feed insights back into protocols and specs — this is how the system gets smarter over time. See `@protocol/extract`.
---
*Related: `@content/youtube/yifan-bth/how-to-prompt-cursor-windsurf-copilot-to-get-reliable-output` · `@content/youtube/yifan-bth/windsurf-vs-cursor-in-depth-ai-code-editor-comparison` · `@content/youtube/yifan-bth/the-complete-claude-code-workflow-90-skip-this` · `@content/youtube/steph-france/i-build-ai-agents-for-4-businesses-none-of-them-use-teams` · `@content/youtube/cole-medin/11-more-tiny-coding-agent-fixes-with-a-stupid-amount-of-payoff-learn-these-now`*
---
*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*
*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*