Skip to main content

> cat ./posts/intent-spec-plan-ai-coding-agents.md

[terminal_mode]
cat: Software Architecture|date: 2026-11-20|rt: 10 min

Intent, Spec, and Plan: The Three Markdown Files That Fix AI Coding Agents

Why chat prompts fail at scale, how structured markdown files create persistent context for AI coding agents, and the exact workflow for enterprise-grade autonomous development.

#ai#claude-code#software-architecture#engineering-standards#developer-productivity

If you have spent more than an hour coding with an autonomous agent like Claude Code, Cursor, or Hermes, you have hit the wall: context drift.

You start with a crisp prompt. Three turns later, the agent has forgotten the architectural constraints, introduced a redundant library, refactored a working module, and drifted completely away from your original product goal.

Prompt engineering is stateless. Conversations are ephemeral. To build real software with AI agents, you need persistent state files in the repository.

Here is why three simple markdown files—intent.md, spec.md, and plan.md—transform chaotic "vibe coding" into rigorous, repeatable software engineering.


1. The Anatomy of the Triad

intent.md — The "Why" (Product & Human Invariants)

Most AI prompts focus entirely on what to build. But AI models are notorious for optimizing for syntax while violating product philosophy.

intent.md captures:

  • The Core Problem: What pain point or business driver justifies this feature?
  • User Personas & Workflows: Who uses this and how does it fit into their day?
  • Non-Negotiable Invariants: What must never change (e.g., "Never delete neoll-labs Vercel project", "Strict mobile responsiveness", "Zero third-party analytics bloat").

Rule: intent.md is written by the human (or co-authored during a grilling session) and acts as the moral compass for the agent.

spec.md — The "What" (Technical Contract)

Once the intent is locked, spec.md defines the exact technical contract. It bridges human desire and machine execution.

It contains:

  • Architecture & Boundaries: Which services, APIs, and database schemas are touched.
  • Data Models: Exact TypeScript interfaces, SQL migrations, or schema definitions.
  • Acceptance Criteria: Verifiable test cases or state transitions required to call the feature done.
  • Security & Compliance: Auth rules, RLS policies, and secret management.

Rule: If a feature isn't in spec.md, the agent cannot invent it mid-flight without updating the spec.

plan.md — The "How" (Execution Roadmap)

Autonomous agents fail when given massive tasks ("build a full authentication system"). They succeed when given a deterministic checklist of micro-steps.

plan.md breaks the specification into numbered, testable increments:

  • Phase 1: Schema & DB Migrations (With verification command)
  • Phase 2: Backend API Endpoints (With curl test payload)
  • Phase 3: Frontend UI Components (With responsive checks)
  • Phase 4: End-to-End Verification (With test suite run)

2. How Claude Code Consumes the Triad

When you point Claude Code or an autonomous agent to a repository structured around these three files, the interaction changes fundamentally:

  1. Context Initialization: Upon session start, the agent reads intent.md, spec.md, and plan.md before touching a single line of source code.
  2. Self-Correction: When an error occurs (e.g., a TypeScript compilation failure or missing Supabase RLS policy), the agent references spec.md rather than guessing a patch.
  3. Incremental Checkoffs: As each item in plan.md is executed and verified with concrete tool output, the agent updates the checklist.
  4. Resilience to Interruptions: If a session crashes or you need to hand off work to another agent or human, the next session resumes instantly by reading where plan.md left off.

3. The Anti-Pattern: Chat-Driven Drift

Chat-Driven Coding (Vibe Coding)File-Driven Agentic Engineering (intent / spec / plan)
Ephemeral prompt historyPersistent, version-controlled markdown in git
Agent forgets constraints after 10 turnsAgent re-reads intent.md on every turn or sub-task
Hallucinated APIs and packagesStrict adherence to spec.md architectural boundaries
Unpredictable refactoringDeterministic execution steps in plan.md
Impossible to audit or hand offFully transparent PR history with clear intent

4. The Enterprise & European Standard

In professional software engineering—especially in regulated domains like finance, healthcare, and industrial IoT—code cannot be an accident. Every line must be traceable back to a business requirement and a security review.

Using intent.md, spec.md, and plan.md aligns naturally with compliance frameworks like the EU AI Act and strict enterprise governance:

  • Auditability: Auditors can read intent.md to see why a feature was built and spec.md to verify its technical boundaries.
  • IP Protection: Clear markdown specs prevent agents from accidentally injecting non-compliant or GPL-tainted code snippets into proprietary repositories.

Summary

You don't need more complex prompt chains or larger context windows to fix AI coding agents. You need good old-fashioned software documentation, structured so that machines can read, execute, and verify it step-by-step.

Before you prompt your next coding agent, write down your intent, define your spec, and map your plan. Your codebase will thank you.

Share this post