Vòng đời spec
Process-first specifications

Plan là contract bền vững giữa intent và code.

CafeKit xác nhận scope tại C1, viết plan.md cùng flat tasks, review findings tại C2 và để user quyết định completion tại C3.

Spec-driven development loop

CafeKit keeps the assistant moving through persistent contracts instead of relying on chat memory.

01
/cf:specs

C1 scope

Scout proportionally, resolve ambiguity, and record the user-approved scope and exclusions.

02
plan.md

Plan

Record accepted scope, constraints, decisions, ownership, dependencies, acceptance mapping, and C3 boundary.

03
task-NN-*.md

Task packets

Split work into flat packets with Outcome, Scope, Ownership, Acceptance, Dependencies, and Verification Plan.

04
adversarial findings

C2 review

The user accepts, rejects, or revises bounded findings before implementation handoff.

05
/cf:develop

Develop

Implement one unblocked task after task-aware inspection of real entrypoints and blast radius.

06
/cf:test + /cf:code-review

Proof

Run exact evidence commands, prove reachability, and reject scope drift or hidden placeholders.

07
/cf:sync

Sync

Write Status and inline Receipt only after proof, then present evidence and limitations for C3.

Lifecycle#

request
  -> C1: xác nhận outcome, scope, exclusions, constraints
  -> plan.md + flat task-NN-*.md
  -> adversarial review
  -> C2: accept, revise, hoặc KEEP named findings
  -> dừng planning
  -> invocation /cf:develop mới và rõ ràng
  -> exact verification + final inline Receipt
  -> C3: user quyết định proof và limitations đã đủ chưa

Planning không tự chạy implementation. Command, hook, reviewer hay host state không được bịa C1, C2, C3 hoặc execution proof.

Artifact contract#

specs/<feature>/
├── plan.md
├── task-01-<slug>.md
└── task-NN-<slug>.md

plan.md ghi quyết định C1, acceptance criteria, exclusions, findings decisions, dependencies và task map. Mỗi flat task sở hữu một outcome và đúng một Status:.

Mỗi task cần có:

  • outcome và boundary rõ
  • files hoặc surfaces được sở hữu
  • dependencies và blockers
  • acceptance criteria map về plan
  • exact planned verification command
  • final inline ## Receipt

Ba quyết định của user#

GateCâu hỏiTác dụng
C1Chúng ta sẽ plan chính xác điều gì?Khóa outcome, scope, exclusions, constraints và lựa chọn chưa giải quyết.
C2Plan còn gap hoặc risk quan trọng nào?User accept, yêu cầu sửa hoặc KEEP limitation có tên.
C3Kết quả hiện tại đủ tốt để đóng chưa?User xem receipts hiện tại và unresolved limitations.

Execution và proof#

/cf:develop <feature> chọn một unblocked task, scout integration path thật, chỉ implement boundary đó và chạy exact proof command. Controller là bên duy nhất ghi state và proof.

Task done cần final inline Receipt hiện tại gồm exact command, Exit: 0, Verification: PASS, runtime-derived Base/Head và fenced current output không rỗng.

NO_TESTS, zero executed tests, stale output hoặc green command không liên quan acceptance đều không pass.

Sync boundary#

/cf:sync chỉ update Status và inline Receipt đã quan sát. Nó không bịa execution, approval, readiness hay completion.

Legacy compatibility#

Packet cũ có spec.json, nested tasks/task-R*.md, task registry hoặc separate receipts tiếp tục dùng legacy adapter đã cài. New process-first Specs không author các artifact đó.