Think before you build. A universal protocol that makes AI coding agents design before they code.
Website ·
Protocol Spec ·
v1.0.0
Preflight defines 5 mandatory phases every agent completes before writing code: Orient, Clarify, Approach, Confirm, Execute. It works with any AI coding agent — no runtime, no API key, one file.
AI coding agents jump straight to implementation. They write code before reading the codebase, skip exploring alternatives, and don't confirm intent. This wastes tokens, produces wrong solutions, and creates rework.
Preflight fixes this with a lightweight prompt-based protocol that works across every major agent driver.
bash <(curl -fsSL https://raw.githubusercontent.com/AgentGuardHQ/preflight/main/install.sh)The installer detects which AI agent drivers you use and copies the appropriate config file.
bash <(curl -fsSL https://raw.githubusercontent.com/AgentGuardHQ/preflight/main/install.sh) --driver claude-codeCopy the driver file for your agent into your project:
| Driver | Copy this file | To this location |
|---|---|---|
| Claude Code | drivers/claude-code/preflight.md |
.claude/commands/preflight.md |
| Codex (OpenAI) | drivers/codex/AGENTS.md |
Append to AGENTS.md |
| Gemini CLI | drivers/gemini/GEMINI.md |
Append to GEMINI.md |
| Goose | drivers/goose/.goosehints |
Append to .goosehints |
| GitHub Copilot | drivers/copilot/.github/copilot-instructions.md |
Append to .github/copilot-instructions.md |
| Cursor | drivers/cursor/.cursor/rules/preflight.mdc |
.cursor/rules/preflight.mdc |
See PROTOCOL.md for the full specification.
| Phase | What the agent does |
|---|---|
| 1. Orient | Read relevant files, docs, recent changes. Understand what exists. |
| 2. Clarify | Ask questions until purpose, constraints, and success criteria are clear. |
| 3. Approach | Propose 2-3 approaches with trade-offs and a recommendation. |
| 4. Confirm | Present the plan. No code until approved. |
| 5. Execute | Write the code. |
- Phases 1-4 produce zero code changes. Reading is encouraged, writing is not.
- Task-scoped. Each new task triggers a fresh pass. Continuing the same task doesn't re-trigger.
- Scales down, never off. Even a one-line fix runs all 5 phases — each can be one sentence.
- Simple task — bug fix with minimal Preflight (~30 seconds)
- Complex task — feature with full design flow
- Autonomous agent — Tier C agent self-confirming against a ticket
See CONTRIBUTING.md for how to add support for additional AI coding agents.
| Repo | Role |
|---|---|
| AgentGuard | Governance — policy enforcement, telemetry, invariants |
| Octi Pulpo | Coordination — pipeline controller, model routing |
| ShellForge | Orchestration — multi-runtime agent execution |
| Preflight | Protocol — universal design-before-you-build standard |
| Extensions | Drivers, integrations, policies, example swarms |
MIT — see LICENSE.
Created by the AgentGuard team.