ID ↗
CS 319 · text: pangmandorin.kamil.web.id

CS 319 · Meeting 4 of 10

The Pipeline
and the Six Documents

Spec-driven development as a gated pipeline — and the foreman's signature deliverable.

Agenda · 100 min

  1. SDD: Specify → Plan → Tasks → Implement (25')
  2. The six documents and their cross-references (25')
  3. Case: Kirana's council session output (10')
  4. Doc sprint: two one-hour drafts (25') · A4 briefing (15')

Reading: chapters 8–9

Core concept · ch 8

The four-phase gated pipeline

SPECIFY
→ spec.md
PLAN
→ plan.md
TASKS
→ tasks.md
IMPLEMENT
→ code+PRs

each arrow is a markdown artifact · each gate is a human decision (GitHub Spec Kit · BMAD · the field consensus)

The human's job at each gate

Verification and critique — not passive approval. Ask: what did the phase miss? What is ambiguous? What would I test?

The phase teams skip

Specify. It feels slow, and skipping it feels efficient — right up until Plan invents requirements and Implement ships them confidently.

Core concept · ch 9

The six documents

1 · PRD

What and why, for humans. The only doc a stakeholder reads end-to-end.

2 · System Architecture

Services, boundaries, dataflow. Where the council debates live.

3 · API Contracts

Endpoints, schemas, errors. The most load-bearing doc — skip it and every downstream team breaks.

4 · Database Schema

Tables, migrations, constraints. Changes ripple through API + tasks.

5 · UI Structure

Screens, states, empty/error cases. What the user actually experiences.

6 · Task Breakdown

The ordered, agent-sized work items everything above compiles down to.

Cross-referenced: change the schema → the API contract changes → the tasks change. The six docs are one artifact with six views. They are the proof a council did its job.

Example · one feature, six views (condensed)

CekFaktur: "refund API" — 1 hour per doc

PRD          merchants can request refunds for paid invoices ≤ 30 days old
ARCHITECTURE new service refunds, talks to invoicing + payments, async via queue
API          POST /refunds · GET /refunds/{id} · webhook refund.status_changed
             400 bad_request · 409 already_refunded · 422 window_expired
SCHEMA       refunds(id, invoice_id, amount, status[pending|approved|paid|rejected],
             reason, created_at)  + status_history(refund_id, from, to, at, actor)
UI           RequestRefundScreen: amount prefilled, ≤ validation live,
             states: idle / confirming / submitted / done | error(window)
TASKS        1 migrations  2 service core  3 endpoints  4 webhook  5 UI  6 e2e tests

Sixty minutes total, by one foreman + a council. Not perfect — cross-referenced and honest. Note how the API errors (409, 422) already encode the PRD's 30-day rule.

The failure mode · ch 9

Which missing doc breaks the most downstream?

Run the change-impact thought experiment: delete each doc the night before implementation.

  • No PRD → agents build the wrong thing beautifully. One wasted sprint.
  • No architecture → services invented ad hoc. Painful, refactorable.
  • No API contract → every producer and consumer guesses a different interface. Integration is where guesses collide — this one poisons all five other docs.
  • No tasks → work happens, but in the wrong order, in the wrong sizes.

Rule: the contract is the doc you never skip. It is also the one your verifier can check mechanically (schema validation).

Case study · part 4 of 10

Kirana's first council session — output, not vibes

Their first run of the full workflow (Describe → Council Debates → Consensus → Execute) on the refund feature. Council of four (PM, Architect, Backend, Data) produced the six documents in one evening session.

Then the verifier earned its keep: the Data specialist's schema had amount as integer rupiah; the Backend lead's contract said decimal. Deterministic schema check caught it — a mismatch that would have surfaced as a production rounding bug in a currency field. Zero vibes were involved.

Team quote for the retro: "The documents argued so we didn't have to."

Doc sprint · 25 minutes · in class

Two one-hour drafts, for real

Your feature

"Group-split: share one invoice between multiple payers."

Steps

  1. Pick two of the six documents. Choose deliberately — which two carry the most risk for this feature?
  2. Draft each in ≤10 minutes with an agent's help. You are the foreman: you review, it types.
  3. Trade with a neighbor: find one cross-reference hole (a fact one doc states and another contradicts or ignores).

Debrief: who picked the API contract? Defend your two picks in one sentence each.

Assignment A4 · due before Meeting 5

Six one-hour drafts, your own idea

Task
Take a greenfield idea (side project, student org tool, or extend Kirana). Produce all six documents — one hour each, hard cap. Agents may type; you review every line.

Deliverables
Six docs (they may be short — they must cross-reference) · a cross-reference map (which doc changes when each other doc changes) · a hole-hunt: one contradiction found and fixed, documented.

Rubric
Cross-reference integrity 40% · API contract rigor 25% · honesty of the time log 15% · hole-hunt 20%.

Next: orchestration patterns and the verifier discipline — how loops know when to stop. Read ch 10–11.