Preflight
v1.0.0 — OPEN SOURCE

Think before you build.

A universal protocol that makes AI coding agents design before they code. 5 phases. 6 drivers. Zero dependencies.

$ bash <(curl -fsSL .../preflight/install.sh) click to copy
5
Phases
6
Drivers
0
Dependencies

The Problem

Agents skip architecture

Most AI coding agents go straight from prompt to code. This causes wrong implementations, wasted tokens, and rework.

Without Preflight
prompt → code → wrong → rework → code → wrong → rework
With Preflight
prompt → orient → clarify → approach → confirm → code

The Protocol

5 mandatory phases

Every task triggers a fresh Preflight pass. Phases scale with complexity but are never skipped.

Phase 01

Orient

Read relevant files, docs, and recent changes. Understand what exists before proposing anything.

Phase 02

Clarify

Ask questions until purpose, constraints, and success criteria are clear. One question at a time.

Phase 03

Approach

Propose 2-3 approaches with trade-offs and a recommendation. Consider alternatives before committing.

Phase 04

Confirm

Present the plan and wait for approval. No code until confirmed. The last checkpoint before execution.

Phase 05

Execute

Now write the code. This is the first phase where files are created or modified.


Drivers

Works with every agent

One protocol, six reference implementations. Each translates the 5 phases into the driver's native format.

Claude Code
.claude/commands/preflight.md
Codex (OpenAI)
AGENTS.md
Gemini CLI
GEMINI.md
Goose
.goosehints
GitHub Copilot
.github/copilot-instructions.md
Cursor
.cursor/rules/preflight.mdc

Scaling

Adapts to every tier

Not all agents operate at the same level. Preflight scales depth to match responsibility.

Tier A

Architect

Deep orient. Challenges assumptions. 2-3 approaches with architectural trade-offs. Presents design to human. Writes specs, not code.

Tier B

Senior Engineer

Moderate orient. Focused clarification. 2-3 implementation approaches. Presents plan for approval. Writes code.

Tier C

Executor

Light orient. Checks spec completeness. One approach with rationale. Self-confirms against acceptance criteria. Writes code.


In Practice

Minimum viable Preflight

Even a Tier C agent on a simple ticket runs all 5 phases. It takes seconds, not minutes.

Tier C agent — well-specified ticket
ORIENT "I read the ticket and the 3 files it references." 2s
CLARIFY "The spec covers all acceptance criteria — no gaps." 1s
APPROACH "I'll add the handler in api/foo.go and test in api/foo_test.go." 1s
CONFIRM "Plan logged. Proceeding." 0s
EXECUTE writes code

No plan, no code.

Install Preflight in your project and your AI agents will think before they build. Every time.

View on GitHub Read the Protocol