SDD Resume (/sdd-resume)
Output language: All output mirrors the language of the invoking prompt. Vietnamese prompt → Vietnamese output; English prompt → English output. Canonical tokens (PENDING HUMAN REVIEW, PENDING, APPROVED, BLOCKED), file paths, and CLI commands are language-invariant.
Dùng khi bắt đầu phiên mới để quét task dở dang và nạp lại feature context.
Tham số
--feature=<feature-slug>: Tùy chọn; feature cần tiếp tục. Không truyền thì quét .sdd/features/ tìm TASKS.md có [/] hoặc task [ ] đầu tiên.
Quy trình
- Quét feature/task dở dang trong
.sdd/features/.
- Đọc
CONTEXT.md, SPEC.md, Architecture Profile theo Architecture Profile Protocol, PLAN.md, TASKS.md, .sdd/shared_context.md và ## Current Handoff State nếu có.
- Báo feature, task đã xong/tổng số, task tiếp theo, Intent/DoD, approved scope/file boundary, active contract version, profile version/binding, state-change category/checkpoint, exact command, review state, exact next decision/command và unresolved blocker. Detect active Dispatch Record và báo dispatch ID/state, selected task grant ID/attempt/route/state/consumption state, dispatcher-issued consumer reference, atomic execution claim evidence, consumer/consumption evidence, worker references và runtime evidence.
- Với legacy high-risk feature thiếu metadata, dừng và yêu cầu Human disposition: chấp nhận evidence hiện tại hoặc yêu cầu targeted update. Không retroactively invalidate artifact chỉ vì format cũ.
- Dispatch RETRY_PENDING retry-only qua
/sdd-dispatch --feature={feature-slug} --retry sau khi revalidate immutable task boundary, contract/profile/checkpoint, dispatch approval và observed runtime evidence.
- Dispatch
RUNNING bị gián đoạn hoặc BLOCKED chỉ resume qua /sdd-dispatch --feature={feature-slug} --resume sau khi Lead resolves evidence, closes old record and creates new PLANNED record. ESCALATED cần Human disposition explicit authorizing recovery trước --resume; changed immutable inputs cần batch approval mới.
- Không giả định Agent ID, host task mirror hoặc permission của session cũ còn tồn tại.
- Chỉ đề xuất
/sdd-dispatch --feature={feature-slug} --agent-execution=<direct|orchestrated> khi task scope, required binding, exact verification command, review state, required checkpoint và contract ownership đều hợp lệ. /add-execute --dispatch-record=<reference> --dispatch-grant=<grant-id> --dispatch-consumer=<consumer-ref> chỉ được gọi khi matching feature/task grant là DISPATCHED/UNCONSUMED và consumer reference khớp; consumed hoặc non-eligible grant chỉ route qua dispatcher --resume hoặc --retry khi đủ điều kiện. Orchestrated worker còn cần immutable packet.
- Nếu profile binding/review/checkpoint còn
PENDING, contract drift, hoặc blocker chưa resolve, báo blocker theo protocol; không đề xuất execution command suy đoán.
AI Recommendation và Human Final Review
Sau khi khôi phục context, tạo canonical recommendation từ .claude/skills/_shared/ai-review-protocol.md, gồm task tiếp theo, active contract version, approved scope, pending checkpoint, evidence gap, unresolved blocker và exact resume command. Lưu trong TASKS.md hoặc .sdd/reviews/resume-<slug>.md với PENDING HUMAN REVIEW. Không gọi /sdd-dispatch hoặc /add-execute trước khi Human reviewer có thẩm quyền ghi APPROVED khi checkpoint required; Agent không tự approve resume scope.
1---2name: sdd-resume3description: Khôi phục ngữ cảnh feature dở dang từ TASKS.md, SPEC.md và Architecture Profile4---56# SDD Resume (`/sdd-resume`)78**Output language:** All output mirrors the language of the invoking prompt. Vietnamese prompt → Vietnamese output; English prompt → English output. Canonical tokens (`PENDING HUMAN REVIEW`, `PENDING`, `APPROVED`, `BLOCKED`), file paths, and CLI commands are language-invariant.910Dùng khi bắt đầu phiên mới để quét task dở dang và nạp lại feature context.1112## Tham số1314- `--feature=<feature-slug>`: Tùy chọn; feature cần tiếp tục. Không truyền thì quét `.sdd/features/` tìm `TASKS.md` có `[/]` hoặc task `[ ]` đầu tiên.1516## Quy trình17181. Quét feature/task dở dang trong `.sdd/features/`.192. Đọc `CONTEXT.md`, `SPEC.md`, Architecture Profile theo [Architecture Profile Protocol](../_shared/architecture-profile-protocol.md), `PLAN.md`, `TASKS.md`, `.sdd/shared_context.md` và `## Current Handoff State` nếu có.203. Báo feature, task đã xong/tổng số, task tiếp theo, Intent/DoD, approved scope/file boundary, active contract version, profile version/binding, state-change category/checkpoint, exact command, review state, exact next decision/command và unresolved blocker. Detect active Dispatch Record và báo dispatch ID/state, selected task grant ID/attempt/route/state/consumption state, dispatcher-issued consumer reference, atomic execution claim evidence, consumer/consumption evidence, worker references và runtime evidence.214. Với legacy high-risk feature thiếu metadata, dừng và yêu cầu Human disposition: chấp nhận evidence hiện tại hoặc yêu cầu targeted update. Không retroactively invalidate artifact chỉ vì format cũ.225. Dispatch RETRY_PENDING retry-only qua `/sdd-dispatch --feature={feature-slug} --retry` sau khi revalidate immutable task boundary, contract/profile/checkpoint, dispatch approval và observed runtime evidence.236. Dispatch `RUNNING` bị gián đoạn hoặc `BLOCKED` chỉ resume qua `/sdd-dispatch --feature={feature-slug} --resume` sau khi Lead resolves evidence, closes old record and creates new `PLANNED` record. `ESCALATED` cần Human disposition explicit authorizing recovery trước `--resume`; changed immutable inputs cần batch approval mới.247. Không giả định Agent ID, host task mirror hoặc permission của session cũ còn tồn tại.258. Chỉ đề xuất `/sdd-dispatch --feature={feature-slug} --agent-execution=<direct|orchestrated>` khi task scope, required binding, exact verification command, review state, required checkpoint và contract ownership đều hợp lệ. `/add-execute --dispatch-record=<reference> --dispatch-grant=<grant-id> --dispatch-consumer=<consumer-ref>` chỉ được gọi khi matching feature/task grant là `DISPATCHED`/`UNCONSUMED` và consumer reference khớp; consumed hoặc non-eligible grant chỉ route qua dispatcher `--resume` hoặc `--retry` khi đủ điều kiện. Orchestrated worker còn cần immutable packet.269. Nếu profile binding/review/checkpoint còn `PENDING`, contract drift, hoặc blocker chưa resolve, báo blocker theo protocol; không đề xuất execution command suy đoán.2728## AI Recommendation và Human Final Review2930Sau khi khôi phục context, tạo canonical recommendation từ `.claude/skills/_shared/ai-review-protocol.md`, gồm task tiếp theo, active contract version, approved scope, pending checkpoint, evidence gap, unresolved blocker và exact resume command. Lưu trong `TASKS.md` hoặc `.sdd/reviews/resume-<slug>.md` với `PENDING HUMAN REVIEW`. Không gọi `/sdd-dispatch` hoặc `/add-execute` trước khi Human reviewer có thẩm quyền ghi `APPROVED` khi checkpoint required; Agent không tự approve resume scope.