Study Notes v3.0 — PAA Sec 2 & CCAR-F D3

Instruction-Driven
Development (IDD)

Specification-Driven Development (SDD) for production agentic engineering: living Markdown blueprints, SKILL.md 3-level progressive disclosure, GCPSkillRegistry, deterministic hooks, and agents-cli spec-to-eval CI pipelines.

Updated: April 2026 (v3.0)
Category: Foundation · Agentic SE
Reading Time: ~25 min
Author: Michaël Bettan
Test Yourself: Spec-Driven Development (IDD) Practice Quiz (33 Questions) →
01

The Problem with Ad-Hoc Prompting

Most developers using AI coding assistants today work in an ad-hoc, reactive mode: they open a chat, type a prompt like "build me a login page," accept the output, and move to the next thing. This works for simple tasks but breaks down for anything complex, team-based, or production-grade.

The result? Inconsistent outputs, lost context between sessions, no reproducibility, and code that works in isolation but fails when integrated. IDD solves this by treating AI interaction as a structured engineering process, not a casual conversation.

Inconsistency

The same prompt produces different results across sessions, models, or team members. No deterministic outputs.

Context Loss

AI forgets previous decisions. Each session starts from zero. Architectural coherence degrades over time.

No Collaboration

Prompts live in one developer's head. No shared understanding, no review process, no handoff protocol.

The Ad-Hoc Spiral

Without structure, each AI interaction accumulates subtle inconsistencies. By the time you notice, your codebase is a patchwork of individually-correct but collectively-incoherent components. This is the "death by a thousand prompts" anti-pattern.

02

What is IDD / SDD?

Instruction-Driven Development (IDD) — also called Specification-Driven Development (SDD) — is a methodology where you write detailed, structured instructions before engaging the AI. These instructions serve as the contract between human intent and AI execution.

Think of it as TDD (Test-Driven Development) but for prompts: instead of writing tests first then code, you write specifications first then let AI generate the implementation. The spec is the single source of truth — versioned, reviewed, and shared across the team.

1
Spec = Source of Truth
3×
More Reproducible
↓60%
Rework Reduction
∀
Team-Scalable

Core Philosophy of IDD

IDD vs SDD — Same Thing, Different Names

The community uses both terms interchangeably. IDD (Instruction-Driven Development) emphasizes the instructional nature of prompts. SDD (Specification-Driven Development) emphasizes the formal specification. In practice, they describe the identical workflow.

03

The IDD Workflow (Step-by-Step)

IDD follows a disciplined, phased workflow. Each phase has clear inputs, outputs, and quality gates. The methodology can be applied to a single feature or an entire project.

PHASE 1

Define

Write the instruction document with requirements, constraints, and success criteria

PHASE 2

Review

Peer review the spec for clarity, completeness, and feasibility

PHASE 3

Execute

Feed the instruction to the AI and generate the implementation

PHASE 4

Validate

Compare output against spec. Run tests, review code, check constraints

PHASE 5

Refine

Update spec based on learnings, iterate until output meets all criteria

PHASE 6

Archive

Version the spec alongside code. Document patterns for reuse

Detailed Phase Breakdown

  1. Define the Instruction: Write a structured document containing: project context, functional requirements, non-functional requirements (performance, security), technical constraints (language, framework, patterns), file structure expectations, test requirements, and acceptance criteria.
  2. Review & Validate the Spec: Have a teammate or second AI review the instruction for ambiguity, missing edge cases, contradictions, and completeness. Fix before executing.
  3. Execute with AI: Feed the instruction to your AI assistant. Use the spec as the primary context. Include relevant existing code as additional context. Ask the AI to explain its approach before generating.
  4. Validate Output Against Spec: Check every acceptance criterion. Run generated tests. Verify file structure matches spec. Check for security issues. If output diverges, determine if the spec or the output needs adjustment.
  5. Refine the Instruction: Based on what the AI got right and wrong, update the spec to be more precise. Remove ambiguity. Add constraints for areas where the AI made poor choices. This creates a feedback loop that improves future results.
  6. Archive & Reuse: Commit the instruction alongside the code. Tag it with version. Create a template library of proven instructions for common patterns.

The Golden Rule of IDD

If your instruction is ambiguous, the AI's output will be unpredictable. The quality of your specification directly determines the quality of the generated code. Invest time in the spec, save time in debugging.

04

Instruction Documents (Spec Anatomy)

The instruction document is the heart of IDD. It's not just a prompt — it's a structured specification that gives the AI everything it needs to produce consistent, high-quality output. Here's the anatomy of a well-crafted IDD instruction.

Markdown — IDD Instruction Template
# Instruction: [Feature Name]
## Version: 1.0 | Date: 2025-07-15 | Author: [Name]

## 1. Context
Project: [Project name and brief description]
Current State: [What exists, what's the starting point]
Goal: [What this instruction should produce]

## 2. Functional Requirements
- FR-01: [User can register with email and password]
- FR-02: [System sends verification email on registration]
- FR-03: [User can login and receive a JWT token]

## 3. Non-Functional Requirements
- NFR-01: Response time < 200ms for auth endpoints
- NFR-02: Passwords hashed with bcrypt (cost factor 12)
- NFR-03: Rate limiting: 5 login attempts per minute per IP

## 4. Technical Constraints
- Language: Python 3.12
- Framework: FastAPI
- Database: PostgreSQL via SQLAlchemy
- Auth: JWT with PyJWT
- Testing: pytest with >80% coverage

## 5. File Structure
src/
  auth/
    router.py     # API endpoints
    service.py    # Business logic
    models.py     # SQLAlchemy models
    schemas.py    # Pydantic schemas
  tests/
    test_auth.py  # Unit + integration tests

## 6. Acceptance Criteria
- [ ] All FR items implemented and tested
- [ ] All NFR constraints verified
- [ ] No security vulnerabilities (no hardcoded secrets)
- [ ] Code passes ruff linting with zero warnings
- [ ] README updated with setup instructions
Context Block
Gives the AI project awareness — what exists, what's the goal, and what constraints are inherited from previous decisions. This prevents the AI from making incompatible choices.
Functional Requirements
Numbered, testable statements of what the system must do. Each FR should be independently verifiable. Use "system shall" or "user can" language.
Non-Functional Requirements
Performance, security, scalability, and quality constraints. These are the guardrails that prevent the AI from taking shortcuts.
Technical Constraints
Locked-in technology choices: language version, framework, database, testing framework. Eliminates the AI's tendency to suggest whatever it "prefers."
File Structure
Explicit directory and file layout. Prevents the AI from creating its own (often inconsistent) project structure. Ensures the output fits into the existing codebase.
Acceptance Criteria
Checklist of verifiable conditions for "done." These are your quality gates — if any are unmet, the output needs refinement.
05

IDD vs Vibe Coding vs Traditional

Vibe Coding

  • Conversational, ad-hoc
  • Intent lives in the developer's head
  • Low overhead to start
  • Hard to reproduce results
  • No formal documentation
  • Best for solo, fast iterations
vs

IDD / SDD

  • Structured, specification-first
  • Intent lives in the document
  • Higher upfront investment
  • Reproducible and version-controlled
  • Formal, reviewable specs
  • Best for teams, production code
Dimension Traditional Dev Vibe Coding IDD / SDD
Planning Requirements doc / tickets Mental model + ad-hoc prompts Structured instruction document
Implementation Human writes all code AI generates, human reviews AI generates from spec, human validates
Reproducibility High (deterministic) Low (prompt-dependent) High (spec is the contract)
Team Scalability High (established processes) Low (tribal knowledge) High (shared specs)
Speed Slow (manual coding) Very fast (but fragile) Fast (after initial spec investment)
Quality Control Code review + CI Varies (often minimal) Spec review + output validation + CI
Best For Critical systems, large teams Prototypes, solo exploration Production AI-assisted development

IDD is Vibe Coding's Adult Form

IDD doesn't replace vibe coding — it matures it. Many teams start with vibe coding to explore ideas, then formalize their prompts into IDD specs once they decide to build for production. Think of it as: Vibe Coding = Prototyping → IDD = Engineering.

06

Real-World IDD Patterns

Pattern: Layered Specs

Break complex projects into layers of instructions that reference each other:

  • L0 — Project Spec: Overall architecture, tech stack, conventions
  • L1 — Module Specs: One per module (auth, billing, notifications)
  • L2 — Feature Specs: Individual features within a module
  • L3 — Task Specs: Atomic coding tasks (add endpoint, fix bug)
  • Each level inherits constraints from the level above

Pattern: Spec-Test-Code Loop

Combine IDD with TDD for maximum confidence:

  • Step 1: Write the instruction spec with acceptance criteria
  • Step 2: Generate tests first from the spec (AI writes tests)
  • Step 3: Generate implementation that passes those tests
  • Step 4: If tests fail, refine spec or implementation
  • Tests become the executable validation of your spec

Pattern: Spec as PR Template

Use the instruction document as the pull request description:

  • Every PR starts with the IDD spec that generated the code
  • Reviewers check code against spec, not just code quality
  • Spec becomes part of the git history — full traceability
  • Future developers understand why code was written this way

Pattern: Instruction Library

Build a reusable library of proven instruction templates:

  • auth-api.md — Standard authentication endpoints
  • crud-service.md — Generic CRUD service template
  • react-form.md — Form component with validation
  • data-pipeline.md — ETL pipeline specification
  • New team members can generate production-grade code from day one
IDD in the Development Lifecycle

Requirements
User stories
→

IDD Spec
Instruction doc
→

Spec Review
Peer feedback
→

AI Generation
Code + Tests
→

Validation
vs Spec
→

Merge
PR + CI/CD
07

Tools, Templates & Ecosystem

Tools That Support IDD Workflows

Spec Storage Best Practices

  • Store specs in /specs or /docs/idd directory
  • Use Markdown for portability and git-friendliness
  • Name convention: IDD-{module}-{feature}-v{version}.md
  • Version alongside code — same branch, same PR
  • Add a SPEC_INDEX.md listing all active specs

Spec Quality Checklist

  • Every requirement is testable (can verify pass/fail)
  • No ambiguous language ("appropriate," "nice," "fast")
  • Technical constraints are specific (versions, libraries)
  • File structure is explicit (no room for AI improvisation)
  • Edge cases and error handling are enumerated
  • A new team member could execute the spec without additional context

Avoid Over-Specification

There's a balance between thorough and excessive. If your spec is 10 pages for a 50-line function, you've gone too far. The spec should be proportional to complexity. For simple tasks, a few bullet points suffice. Reserve detailed specs for complex, team-critical, or security-sensitive features.

08

Agent Skills (SKILL.md), Progressive Disclosure & GCPSkillRegistry

Cramming 40 procedural runbooks or dozens of verbose MCP tool schemas directly into AGENTS.md or CLAUDE.md triggers context & tool bloat: attention degrades, latency spikes, and every trivial prompt pays for thousands of irrelevant tokens. The open Agent Skills standard (agentskills.io) packages domain expertise into modular folders (.agents/skills/<name>/SKILL.md or .claude/skills/) loaded through 3-Level Progressive Disclosure.

SKILL.MD 3-LEVEL PROGRESSIVE DISCLOSURE & GCPSKILLREGISTRY LEVEL 1 · DISCOVERY (~100 TOKENS) YAML Frontmatter at Startup • name (optional) + description (REQUIRED) • Sole semantic trigger signal for activation • Or explicit /skill-name slash command 50 installed skills = ~5k tokens total LEVEL 2 · ACTIVATION (<5,000 TOKENS) SKILL.md Body on Task Match • Loaded ONLY when intent matches description • Step-by-step SOP, flags & guardrails • Keep concise (<5k tokens recommended) 5 Patterns: Info · Wrapper · Gen · Review · Flow LEVEL 3 · EXECUTION (0 BASE TOKENS) scripts/, references/, assets/ • Read or executed strictly on demand • Non-interactive CLI (--help, NO TTY input) • Deep schemas stay out of prompt cache Deterministic code runs outside LLM weights Enterprise Distribution: GCPSkillRegistry governs org-wide Skill, SkillRevision & Publisher resources with IAM & pinned versions

Skill Design Categories

  • Domain Reference: Standards, schema contracts, and API specs referenced without mutations
  • CLI & MCP Automation: Non-interactive command wrappers and parameter presets for tools
  • Template Scaffolding: Emits standardized components and test harnesses from project templates
  • Quality & Policy Auditing: Audits diffs, configs, or specs against architectural and security rubrics
  • Multi-Phase Execution: Coordinates multi-step procedures (e.g. upgrades, migrations, or eval runs)

Authoring Rules & Exam Gotchas

  • description is mandatory: At startup the model sees only YAML frontmatter — vague descriptions prevent Level 2 activation.
  • Keep SKILL.md < 5,000 tokens: Offload large API tables to references/ so Level 2 stays sharp.
  • Black-box, non-interactive scripts/: Expose --help flags and exit codes; never block on interactive TTY prompts.
  • GCPSkillRegistry: Centralizes versioned enterprise skills (Skill, SkillRevision, Publisher) across teams instead of copy-pasting folders.
09

Enterprise Customizations & agents-cli Spec-to-Eval Workflows

Mature IDD teams separate persistent workspace conventions (Rules), on-demand procedural playbooks (Skills), 100% deterministic lifecycle guardrails (Hooks), and automated CI evaluation gates (agents-cli).

Layer Google Antigravity Claude Code Enforcement & Exam Rule
Persistent / Scoped Rules AGENTS.md / GEMINI.md + .agents/rules/*.md with snake_case trigger: (always_on, model_decision, glob, manual; ~24 KB/file, ~20k-token cap) CLAUDE.md, .claude/CLAUDE.md, ~/.claude/CLAUDE.md (@path imports) + .claude/rules/*.md YAML paths: globs Advisory LLM guidance for style & architecture. Gotcha: camelCase alwaysOn in Antigravity YAML is silently discarded!
Modular Skills .agents/skills/<name>/SKILL.md + GCPSkillRegistry .claude/skills/<name>/SKILL.md + ~/.claude/skills/ Progressive disclosure (~100t → <5kt → 0t scripts) for repeatable multi-step tasks without context bloat.
Deterministic Hooks hooks.json lifecycle command hooks settings.json (PreToolUse, PostToolUse, Stop) Zero-exception OS enforcement: PreToolUse exit code 2 blocks forbidden commands/.env edits; PostToolUse runs formatters/linters.
Spec Alignment /plan (Plan Artifact) & /grill-me (design interview) Plan Mode (Shift+Tab read-only planning) Pre-code alignment during IDD Phases 1–2 (Define → Review) before touching source files.
GOOGLE AGENTS-CLI END-TO-END SPEC-TO-EVAL PIPELINE (PAA SEC 2.1 & 4.1) 1. IDE SKILL SETUP uvx google-agents-cli setup Installs GCP skills in IDE 2. HEADLESS SCAFFOLD agents-cli create --yes && agents-cli install Always pass --yes in CI/agent 3. SPEC-TO-EVAL GATE agents-cli eval run *.evalset.json + eval_config.json rubrics 4. DEPLOY RUNTIME agents-cli deploy Agent Runtime · Cloud Run or GKE container 5. PUBLISH agents-cli publish gemini-enterprise Org catalog & IAM
Bash — Headless Spec-to-Eval CI Pipeline with agents-cli
# 1. Bootstrap official Google Cloud skills into Antigravity, Claude Code & Gemini CLI
uvx google-agents-cli setup

# 2. Headless scaffold from approved IDD spec (pass --prototype --yes)
agents-cli create billing-dispute-agent --prototype --yes
agents-cli install

# 3. Execute trajectory & rubric acceptance criteria in CI before merge
agents-cli eval run --config tests/eval/eval_config.json

# 4. Deploy & register in Gemini Enterprise once eval gates pass
agents-cli deploy --deployment-target agent_runtime --no-confirm-project
agents-cli publish gemini-enterprise --agent-runtime-id <RUNTIME_ID>
10

Key Takeaways & Self-Assessment

Key Takeaways

Audio Deep Dive & Study Downloads

Listen to the 56-minute Spec-Driven Development (IDD) audio deep dive, open the study guide PDF and sketchnote infographic in the Hub Viewer, or drill scenario-based questions on the 6-phase IDD lifecycle, SKILL.md 3-level progressive disclosure, GCPSkillRegistry, deterministic PreToolUse / PostToolUse hooks, and headless agents-cli evaluation gates.

Spec-Driven Development (IDD) (Video Walkthrough)
Spec-Driven Development (IDD): Skills, Hooks & CI Eval Gates (Podcast)
Open Study Notes & Infographic in Hub Viewer Launch Interactive IDD Practice Quiz →

Self-Assessment Questions

Q1. What are the three main problems with ad-hoc AI prompting that IDD solves?

1) Inconsistency — same prompt, different results. 2) Context loss — AI forgets previous decisions. 3) No collaboration — prompts live in one developer's head, can't be shared or reviewed.

Q2. Name the 6 sections that make up a well-structured IDD instruction document.

1) Context, 2) Functional Requirements, 3) Non-Functional Requirements, 4) Technical Constraints, 5) File Structure, 6) Acceptance Criteria.

Q3. Explain the "Spec-Test-Code Loop" pattern and why it's effective.

Write the instruction spec → generate tests from the spec first → generate implementation that passes those tests → iterate if tests fail. It's effective because tests serve as the executable validation of the spec, ensuring the AI's output meets the documented requirements.

Q4. How does IDD relate to Vibe Coding? Are they opposites?

They're not opposites — IDD is the mature evolution of vibe coding. Both use AI-assisted development, but IDD adds structure, reproducibility, and team scalability. Many teams start with vibe coding to explore, then formalize with IDD for production.

Q5. How does SKILL.md 3-Level Progressive Disclosure prevent context bloat?

Level 1 loads only YAML frontmatter (~100 tokens/skill, with required description) at startup; Level 2 loads the <5,000-token SKILL.md body only when the task matches description; Level 3 executes non-interactive scripts/ or reads references/ strictly on demand.

Q6. Why use PreToolUse hooks instead of AGENTS.md / CLAUDE.md rules for blocking destructive commands, and why pass --yes to agents-cli?

Rules are advisory prompt tokens that an LLM can ignore, whereas a PreToolUse hook returning exit code 2 deterministically blocks tool execution at the harness level. Passing --yes with explicit flags prevents headless coding agents and CI runners from hanging on interactive TTY prompts.
Study Progress — IDD, SKILL.md Progressive Disclosure & agents-cli 100%

Related Study Guides

Vibe Coding & Swarms →
Sandboxes, worktrees & CodeMender
Google Antigravity →
Plan Artifacts, rules & SKILL.md
Claude Code & SDK →
CLAUDE.md hierarchy, skills & hooks
Google ADK v2.0 →
Evalsets, rubrics & workflow agents

Practice (33 Scenario Questions)

Drill scenario-based questions on ad-hoc prompting failures, the six IDD phases, spec anatomy, SKILL.md 3-level progressive disclosure, GCPSkillRegistry, Antigravity/Claude rules & hooks, and agents-cli CI gates.

Back to the Hub Take the 33-question quiz: IDD →