CodingIdeas.ai

Plan-First Methodology

The Architect Prompt

Stop asking AI to "write the code." The top vibe coding communities — r/vibecoding and r/ChatGPTCoding — have converged on a Plan-First approach: clarify first, architect second, execute third. The result is fewer hallucinations, tighter scope, and code that actually ships.

Why most AI coding sessions fail

When you ask an AI to "build me an invoice app," it hallucinates scope, picks the wrong stack, and produces code you'll delete in 20 minutes. Andrej Karpathy calls the real skill context engineering — filling the AI's context window with exactly the right information at each step. The bottleneck has shifted: clear intent and structured context now matter more than fast typing.

1

Clarify

Before writing a single line — align intent

Paste this into Claude or Codex with your idea filled in. The AI asks you 5–7 questions before producing anything. This single step eliminates 80% of the hallucinations that kill vibe coding sessions.

<role> You are a Senior Full-Stack Engineer and Product Manager. You think in systems before writing a single line of code. You ask hard questions early — rework after code exists is 10× more expensive than clarifying requirements upfront. </role> <task id="step-1-clarify"> I want to build: [your idea] Ask me 5–7 clarifying questions before producing anything. Cover: - Must-have vs nice-to-have features for V1 - My skill level and preferred tools (Cursor / Windsurf / Claude Code) - Integrations I already have access to - What "done" means for the very first version - Any hard constraints (solo, weekend build, zero budget) - Anything ambiguous that could cause hallucination later <example> BAD: "Do you want this to be scalable?" GOOD: "For V1: single-user or multi-user? Multi-user requires auth roles from day one and changes the entire data model." </example> ⚠️ Do NOT start planning or writing code until I answer. Wait. </task>
2

Architect

After you answer — generate the technical spec

Once you've answered the clarifying questions, the AI produces a full Technical Specification and a phased MVP Plan. This becomes the shared context for everything that follows.

<task id="step-2-architect"> Now produce the following in order: 1. TECHNICAL SPECIFICATION System architecture (use → for data and event flow) Core data model and key entities API contract — list all routes + request/response shapes External APIs and integration points 2. MVP PLAN in three phases: SETUP — API contract, schema, seed data, auth, CI/CD ✓ Done when: app runs with demo data, zero manual setup. CORE FEATURES — minimum set that delivers value to one user DONE WHEN — one verifiable condition per feature: □ [Feature 1]: done when user sees/can do [observable thing] □ [Feature 2]: done when user sees/can do [observable thing] □ [Feature 3]: done when user sees/can do [observable thing] ✓ Done when: one user completes the full flow unassisted. STRETCH GOALS — post-launch additions, not required for V1 3. BLOCKER ANALYSIS Flag: API limits, auth complexity, scope risks, top failure modes FIRST RUN REQUIREMENT: what demo data must exist, what works on first launch without any manual config or seed scripts. <self_check> Before presenting, verify: □ Every answer I gave to clarifying questions is in the spec □ The plan is internally consistent across phases □ Top failure modes for this idea type are flagged □ V1 scope is shippable by one person in the stated timeframe □ DONE WHEN criteria are observable user behaviors, not internal states </self_check> </task>
2.5

Create Context File

Before opening your IDE — lock the context

This is the step most vibe coders skip — and why their sessions drift after 30 minutes. Karpathy calls it context engineering: filling the AI's context window with exactly the right information at every step. A context file does that automatically. Start a fresh IDE session for each phase — long threads cause model drift.

"Based on everything we've discussed, generate an AGENTS.md file (rename to CLAUDE.md for Claude Code, or .cursorrules for Cursor) that captures: - Tech stack and exact versions - Folder structure and file naming conventions - Coding rules: what to always do, what to never do — with a one-line WHY for each rule - MVP scope boundaries — features explicitly out of V1 - The phased build plan as a checklist Keep it under 150 lines — dense, not verbose. I will paste this at the top of every new IDE session."

ℹ️ AGENTS.md is the 2026 universal standard — supported by Claude Code, Cursor, Windsurf, Sourcegraph Cody, and Google Jules. Use it as-is, or rename for tool-specific compatibility.

⚠️ Start a fresh chat for each phase (SETUP → CORE FEATURES → STRETCH GOALS). Paste the context file every time. Long threads cause model drift — fresh sessions + context file = consistent output.

3

Execute

In Cursor or Windsurf — one task at a time

One task per prompt — never batch steps. Verify it works before moving on. After each step, run the Critique Loop. This is the quality gate that stops technical debt compounding.

EXECUTE PROMPT (paste for each step): "Referencing our MVP Plan, implement [Step Name] now. <constraints> - API contract first: define all routes + shapes before any handler. WHY: frontend and backend align from day one; no interface mismatches. - One task only. Stop when complete. Do not move to the next step. WHY: batching hides partial failures and makes rollback impossible. - Max 200 lines per file. Split into modules if larger. WHY: every file must fit in one context window to reason about whole. - Inline comments for non-obvious logic only. WHY: comment noise fills context and causes drift across sessions. - Output: file paths and code changes only. No prose unless I ask. WHY: explanations consume context better used for the next task. - Commit to git before starting this task and after completing it. WHY: AI changes are the hardest to untangle — a clean commit is the only reliable rollback. - If output is close but wrong — reply with a targeted diff, not a full rewrite. WHY: full rewrites discard working code. Targeted corrections preserve it. - If you produce the same broken output twice — stop and tell me. WHY: a looping AI digs deeper into the wrong direction. I will revert and re-scope. - Final step: start the app and walk the full user journey end-to-end. Confirm it works with zero manual setup before marking complete. </constraints>" CRITIQUE LOOP (run after every step — before moving on): "Review what you just built as a senior engineer doing a PR review. Check for: - Security: auth gaps, input validation, injection risks, exposed secrets - Performance: N+1 queries, missing indexes, unbounded loops - Edge cases: empty states, concurrent requests, network failures - Debt: anything painful to refactor in 3 months - Tests: is the happy path covered? Add a test if the critical path has no coverage. - Docs: does AGENTS.md / CLAUDE.md still accurately reflect what was just built? Fix all critical issues. List only what you changed."

Every idea on this site includes an Architect Prompt

Pre-filled with the idea's tech stack, architecture pattern, per-feature done-when checklist, first-run requirements, V1 scope boundaries, and known pitfalls. One click — paste straight into Claude or Cursor.

Browse ideas and get your prompt →

FAQ

How is this different from just asking AI to write the code?

Standard prompts ask the AI to immediately produce code. The Architect Prompt first asks clarifying questions, then produces a structured spec, then creates a context file before the first line is written, then executes one task at a time with a quality gate after each step. It matches how senior engineers actually work.

Which AI tools work best with this methodology?

Steps 1 and 2 work best in Claude or Codex (long context, strong at specs and planning). Step 2.5 generates your AGENTS.md context file (rename to CLAUDE.md for Claude Code, or .cursorrules for Cursor). Step 3 works best in Cursor, Windsurf, or Claude Code where the AI can read and write files directly.

What is AGENTS.md and why use it instead of CLAUDE.md?

AGENTS.md is the 2026 cross-tool standard for AI context files — agreed on by Claude Code, Cursor, Windsurf, Sourcegraph Cody, and Google Jules. Writing your context file as AGENTS.md means it is automatically picked up by any of these tools. CLAUDE.md and .cursorrules are tool-specific alternatives that work identically — just rename the file if your team uses only one tool.

What is context engineering?

A term Andrej Karpathy advocates for — the practice of filling the AI's context window with exactly the right information at each step: the spec, the plan, the constraints, the coding conventions. The context file (Step 2.5) is how you do this systematically across every session.

Why start a fresh session for each phase?

AI models drift in long conversations — they start making assumptions based on earlier context that no longer applies. Starting fresh for SETUP, CORE FEATURES, and STRETCH GOALS, and pasting your context file each time, keeps the model grounded to the plan rather than the thread history.

What is the Critique Loop?

After each build step, you ask the AI to review its own output as a senior engineer doing a PR review — checking for security gaps, performance traps, missing edge cases, test coverage on the happy path, whether the AGENTS.md is still accurate, and anything painful to refactor later. It's the quality gate that stops technical debt from compounding across the build.

Is "Architect Prompt" an official term?

Not formally. The r/vibecoding and r/ChatGPTCoding communities use variations of this pattern under different names — "Plan-First", "context engineering", "Senior Architect Mode". CodingIdeas.ai uses Architect Prompt as the unified label for this 4-step methodology.

Also: AI Coding Best Practices

20 rules for strategic AI development — mindset, prompting, workflow, and when to stop.

Read the list →

Methodology synthesised from r/vibecoding, r/ChatGPTCoding, Andrej Karpathy's context engineering writing, and the Senior Architect Mode prompt pattern from the Windsurf/Cursor community.