spec-lite 1.4.6 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/README.md +8 -4
  2. package/bin/cli.js +22 -1
  3. package/package.json +1 -1
  4. package/skills/ado-config/SKILL.md +52 -9
  5. package/skills/ado-create/SKILL.md +6 -0
  6. package/skills/artifact-audit/SKILL.md +189 -0
  7. package/skills/artifact-migrate/SKILL.md +156 -0
  8. package/skills/plan/SKILL.md +3 -2
  9. package/skills/spec-brownfield-component/SKILL.md +3 -0
  10. package/skills/spec-brownfield-feature/SKILL.md +3 -0
  11. package/skills/spec-brownfield-init/SKILL.md +2 -1
  12. package/skills/spec-frd/SKILL.md +8 -3
  13. package/skills/spec-new/SKILL.md +3 -2
  14. package/skills/spec-prd/SKILL.md +3 -1
  15. package/skills/spec-sad/SKILL.md +2 -2
  16. package/skills/spec-tech/SKILL.md +3 -2
  17. package/skills/spec-test/SKILL.md +3 -2
  18. package/skills/spec-tsd/SKILL.md +2 -1
  19. package/skills-overview.md +27 -23
  20. package/templates/integrations/plan-template.md +4 -0
  21. package/templates/integrations/spec-template.md +4 -0
  22. package/templates/integrations/tech-template.md +4 -0
  23. package/templates/integrations/techdebt-template.md +4 -0
  24. package/templates/integrations/test-template.md +4 -0
  25. package/templates/integrations/todo-template.md +4 -0
  26. package/templates/main/component/cdd-template.md +4 -0
  27. package/templates/main/component/crd-template.md +4 -0
  28. package/templates/main/domain-template.md +4 -0
  29. package/templates/main/feature/fdd-template.md +4 -0
  30. package/templates/main/feature/frd-template.md +12 -0
  31. package/templates/main/feature/tsd-template.md +4 -0
  32. package/templates/main/prd-template.md +4 -0
  33. package/templates/main/sad-template.md +4 -0
  34. package/skills/spec-frd-update/SKILL.md +0 -398
@@ -18,7 +18,7 @@ Skill này là cặp greenfield đối xứng với `/spec-brownfield-feature` (
18
18
  2. **CREATE-only** — frd.md đã tồn tại → DỪNG, redirect `/spec-new` để phân tích delta + cascade + downstream (tech/test) (Bước 1c).
19
19
 
20
20
  **Phạm vi hẹp — chủ yếu frd.md:**
21
- - ✅ Author frd.md (7 sections) cho **một** feature **chưa có frd**.
21
+ - ✅ Author frd.md (7 core sections + `Open Questions` tùy chọn) cho **một** feature **chưa có frd**.
22
22
  - ✅ *Reference* component frd phụ thuộc (Components Used) + ghi component cần-nhưng-chưa-có như **candidate**.
23
23
  - ✅ Nếu feature mục tiêu là feature mới chưa có trong Index → **register một row vào `prd.md > Features`** (side-effect hợp lệ lên prd).
24
24
  - ✅ **Cascade vocabulary lên `domain.md`** (Bước 4b — pha *mô tả hệ thống*/WHAT): glossary term + **định nghĩa entity đầy đủ** (attributes). `Owner` của entity để `TBD` cho `/spec-sad` điền ở pha *thiết kế hệ thống* (HOW). BA duyệt trước khi ghi. Đây là điểm khác với phiên bản trước (`/spec-frd` từng không đụng domain) — vocabulary sinh ra ở feature-authoring time nên seed luôn, thay vì để domain rỗng tới integration đầu tiên.
@@ -171,6 +171,8 @@ Hỏi tuần tự, từng phần — không hỏi tất cả cùng lúc. Nếu B
171
171
 
172
172
  Câu trả lời vague → hỏi lại để làm rõ (ngưỡng đo được, field cụ thể, nhánh xử lý).
173
173
 
174
+ **Open Questions — gom trong lúc interview.** Điểm nào BA chưa chốt được ngay (chờ stakeholder, phụ thuộc quyết định khác, ngưỡng/nhánh chưa rõ) → KHÔNG đoán bừa vào AC/VR. Ghi lại thành một mục trong `## Open Questions` của draft (kèm ai trả lời / khi nào), rồi tiếp tục các phần còn lại. Section này gom cả component candidate (Bước 4) lẫn câu hỏi clarify từ interview; rỗng thì xóa khi save.
175
+
174
176
  ---
175
177
 
176
178
  ### Bước 4: Xử lý component (mức reference + candidate)
@@ -221,10 +223,11 @@ Dùng `.claude/templates/main/feature/frd-template.md` làm skeleton, điền n
221
223
 
222
224
  **ID assignment** (luôn là create — frd mới): US `US-F{NNN}-001+`, Story AC `AC-F{NNN}-001+`, Feature AC `FAC-F{NNN}-001+` (counter độc lập với Story AC), VR `VR-F{NNN}-001+`. `NNN` = số của F-XXX. Flow đánh số từ 1.
223
225
 
224
- **Frontmatter** frd mới: theo template, `status: draft`, `owner: BA`, `feature_id: F-XXX`.
226
+ **Frontmatter** frd mới: theo template, `status: draft`, `owner: BA`, `feature_id: F-XXX`, `template_version` copy từ `frd-template.md` (xem `conventions.md` §7 — chỉ set lúc CREATE; thay đổi sau qua `/spec-new` không đụng version).
225
227
 
226
228
  Hiển thị **toàn bộ draft** cho user — chưa ghi file. Kèm:
227
229
  - danh sách component candidate (nếu có) và VR còn `TBD`;
230
+ - **Open Questions** còn mở (câu hỏi clarify + component candidate) để BA xác nhận hoặc giải quyết trước khi save;
228
231
  - **danh sách domain vocabulary đề xuất** (Bước 4b): glossary term mới + định nghĩa shared entity (`Owner: TBD`), để BA duyệt trước khi cascade lên `domain.md`.
229
232
 
230
233
  #### Verification Rules — quy ước sinh
@@ -344,6 +347,7 @@ Bước tiếp theo:
344
347
  - frd dùng từ không đo được trong AC ("hoạt động đúng", "nhanh", "đẹp")
345
348
  - User Stories không có persona rõ hoặc không có AC
346
349
  - Verification Rules tự điền mà chưa hỏi BA
350
+ - Đoán bừa vào AC/VR thay vì ghi điểm chưa chốt vào Open Questions
347
351
  - Tạo crd.md/cdd.md (vượt phạm vi — đó là integration time)
348
352
  - Component candidate không được surface cho architect
349
353
  - **Update frd đã tồn tại** thay vì redirect `/spec-new` (vi phạm CREATE-only)
@@ -355,7 +359,8 @@ Bước tiếp theo:
355
359
  - [ ] **Single-feature gate**: nguồn liên quan đúng 1 feature; nếu >1 đã DỪNG và mô tả rõ lý do tách + redirect `/spec-prd`
356
360
  - [ ] **Create-only gate**: frd.md của feature mục tiêu CHƯA tồn tại; nếu đã có đã redirect `/spec-new`
357
361
  - [ ] Feature mục tiêu có trong Index, HOẶC feature mới đơn lẻ đã được user đồng ý register (Bước 1b)
358
- - [ ] frd.md có đủ 7 sections (luôn create mới)
362
+ - [ ] frd.md có đủ 7 core sections (luôn create mới); `Open Questions` chứa câu hỏi clarify + component candidate còn mở, hoặc đã xóa nếu rỗng
363
+ - [ ] Frontmatter có `template_version` copy từ `frd-template.md`
359
364
  - [ ] Mỗi User Story có persona + priority + ít nhất 1 AC Given/When/Then
360
365
  - [ ] Feature AC dùng ID `FAC-F{NNN}-{seq}` (counter độc lập với `AC-F{NNN}`), Then đo được
361
366
  - [ ] Verification Rules đã confirm với BA (không tự assert); không chứa regex/code/error message; semantic type
@@ -343,7 +343,7 @@ Chỉ tiến hành Bước 7 sau khi user confirm. Nếu user yêu cầu chỉnh
343
343
 
344
344
  Tạo thư mục `.specs/integrations/{NNN}-{slug}/` nếu chưa có.
345
345
 
346
- **[7.1] Ghi spec.md** với status `approved` (không phải `draft` — human đã confirm ở Bước 6 chính là approval). Frontmatter `features` và `components` phải được điền theo những gì đã nhận diện ở Bước 2.
346
+ **[7.1] Ghi spec.md** với status `approved` (không phải `draft` — human đã confirm ở Bước 6 chính là approval). Frontmatter `features` và `components` phải được điền theo những gì đã nhận diện ở Bước 2; `template_version` lấy từ `spec-template.md` (xem `conventions.md` §7).
347
347
 
348
348
  **[7.2] Auto-apply mỗi Changes block** vào main artifact tương ứng. Thứ tự apply (để tránh forward reference): `prd.md` → `domain.md` → `sad.md` → `component/*/crd.md` → `feature/*/frd.md`.
349
349
 
@@ -352,7 +352,7 @@ Cho từng block:
352
352
  - **Operation=create:**
353
353
  - Tạo file mới tại path tương ứng
354
354
  - Nội dung = nội dung của Changes block (theo format của template gốc)
355
- - Frontmatter của artifact mới: lấy từ template (status `draft` cho artifact mới — separate lifecycle với spec.md)
355
+ - Frontmatter của artifact mới: lấy từ template, gồm `template_version` (status `draft` cho artifact mới — separate lifecycle với spec.md). `template_version` chỉ stamp ở operation=create; **operation=update KHÔNG đụng** version của artifact hiện có.
356
356
 
357
357
  - **Operation=update:**
358
358
  - Đọc artifact hiện tại
@@ -443,3 +443,4 @@ Sau khi user confirm (Bước 7):
443
443
  - [ ] Auto-apply chạy theo thứ tự prd → domain → sad → crd → frd
444
444
  - [ ] Mỗi artifact bị touched có entry mới được append vào `## Change History` (xem `conventions.md` §5.5)
445
445
  - [ ] Fail-safe: nếu apply fail thì không ghi spec.md (rollback luôn Change History entries)
446
+ - [ ] Artifact create (spec.md + frd/crd mới) có `template_version` copy từ template; artifact update giữ nguyên version cũ
@@ -279,6 +279,8 @@ Chỉ ghi file sau khi user confirm. Nếu user yêu cầu chỉnh sửa → c
279
279
 
280
280
  Nếu `domain.md` đã tồn tại với nội dung thực → không đụng tới.
281
281
 
282
+ **5b'. Stamp `template_version`:** frontmatter `prd.md` (lúc create) và `domain.md` (lúc scaffold) lấy `template_version` từ template tương ứng (xem `conventions.md` §7 Template Versioning). Lần chạy sau update `prd.md` → giữ nguyên `template_version` hiện có, KHÔNG đụng.
283
+
282
284
  **5c. Append Change History entry** vào mỗi artifact vừa ghi/scaffold (theo `conventions.md` §5.5):
283
285
 
284
286
  ```markdown
@@ -323,7 +325,7 @@ Bước tiếp theo:
323
325
 
324
326
  Trước khi kết thúc, kiểm tra:
325
327
 
326
- - [ ] Frontmatter đầy đủ và đúng schema (id, type, version, status, owner, project_name)
328
+ - [ ] Frontmatter đầy đủ và đúng schema (id, type, status, owner, project_name, `template_version`) — `template_version` copy từ template lúc create, update không đụng
327
329
  - [ ] Problem Statement từ góc nhìn business, không mention tech stack
328
330
  - [ ] Mỗi persona có: tên vai trò, mục tiêu, pain point
329
331
  - [ ] Out of Scope có ít nhất 1 item với lý do
@@ -191,7 +191,7 @@ Chỉ ghi file sau khi user confirm. Nếu user yêu cầu chỉnh sửa → c
191
191
 
192
192
  ### Bước 5: Save
193
193
 
194
- Ghi nội dung đã được confirm vào `.specs/main/sad.md`.
194
+ Ghi nội dung đã được confirm vào `.specs/main/sad.md`. Frontmatter lấy `template_version` từ `sad-template.md` lúc create (xem `conventions.md` §7); lần chạy update sau giữ nguyên, không đụng.
195
195
 
196
196
  **Change History:** Append entry vào section `## Change History` cuối `sad.md` (theo `conventions.md` §5.5):
197
197
 
@@ -246,7 +246,7 @@ Bước tiếp theo:
246
246
 
247
247
  Trước khi kết thúc, kiểm tra:
248
248
 
249
- - [ ] Frontmatter đầy đủ và đúng schema
249
+ - [ ] Frontmatter đầy đủ và đúng schema (gồm `template_version` copy từ template lúc create; update không đụng)
250
250
  - [ ] Architectural Style có lý do gắn với NFRs hoặc constraints
251
251
  - [ ] System Overview có diagram + Components table; danh sách C-XXX khớp với `prd.md > Components` (hoặc cả hai cùng rỗng nếu Component Index chưa được điền)
252
252
  - [ ] Mỗi tech stack item có lý do chọn rõ ràng
@@ -216,7 +216,7 @@ Chỉ ghi file sau khi user confirm. Nếu user yêu cầu chỉnh sửa → c
216
216
 
217
217
  ### Bước 6: Save + Auto-cascade
218
218
 
219
- **[6.1] Ghi `.specs/integrations/{slug}/tech.md`** với status `approved` (không phải `draft` — human đã confirm ở Bước 5 chính là approval). Frontmatter `features` và `components` mirror từ `spec.md`.
219
+ **[6.1] Ghi `.specs/integrations/{slug}/tech.md`** với status `approved` (không phải `draft` — human đã confirm ở Bước 5 chính là approval). Frontmatter `features` và `components` mirror từ `spec.md`; `template_version` lấy từ `tech-template.md` (xem `conventions.md` §7).
220
220
 
221
221
  **[6.2] Auto-apply mỗi Changes block** vào main artifact tương ứng. Thứ tự apply (để tránh forward reference): `sad.md` → `domain.md` → `component/*/cdd.md` → `feature/*/fdd.md`.
222
222
 
@@ -225,7 +225,7 @@ Cho từng block:
225
225
  - **Operation=create:**
226
226
  - Tạo file mới tại path tương ứng
227
227
  - Nội dung = nội dung của Changes block (theo format của template gốc — `cdd-template.md` hoặc `fdd-template.md`)
228
- - Frontmatter: lấy từ template (status `draft` cho artifact mới — separate lifecycle với tech.md)
228
+ - Frontmatter: lấy từ template, gồm `template_version` (status `draft` cho artifact mới — separate lifecycle với tech.md). `template_version` chỉ stamp ở operation=create; **operation=update KHÔNG đụng** `template_version` của artifact hiện có.
229
229
 
230
230
  - **Operation=update:**
231
231
  - Đọc artifact hiện tại
@@ -315,3 +315,4 @@ Sau khi user confirm (Bước 6):
315
315
  - [ ] Auto-apply chạy theo thứ tự sad → domain → cdd → fdd
316
316
  - [ ] Mỗi artifact bị touched có entry mới được append vào `## Change History` (conventions §5.5)
317
317
  - [ ] Fail-safe: nếu apply fail thì không ghi tech.md (rollback luôn Change History entries)
318
+ - [ ] Artifact create (tech.md + cdd/fdd mới) có `template_version` copy từ template; artifact update giữ nguyên version cũ
@@ -284,7 +284,7 @@ Chỉ tiến hành Bước 6 sau khi QC confirm.
284
284
 
285
285
  ### Bước 6: Save + Auto-cascade
286
286
 
287
- **[6.1] Ghi `.specs/integrations/{slug}/test.md`** với status `approved` (không phải `draft` — human đã confirm ở Bước 5 chính là approval). Frontmatter `features` mirror từ `spec.md`.
287
+ **[6.1] Ghi `.specs/integrations/{slug}/test.md`** với status `approved` (không phải `draft` — human đã confirm ở Bước 5 chính là approval). Frontmatter `features` mirror từ `spec.md`; `template_version` lấy từ `test-template.md` (xem `conventions.md` §7).
288
288
 
289
289
  **[6.2] Auto-apply mỗi Changes block** vào `feature/{F-XXX}/tsd.md` tương ứng. Thứ tự apply: theo thứ tự xuất hiện trong frontmatter `features` (deterministic, không có forward reference giữa các feature tsd.md). Bỏ qua feature có operation `no-op` trong Cascade Summary.
290
290
 
@@ -293,7 +293,7 @@ Cho từng block:
293
293
  - **Operation=create:**
294
294
  - Tạo file `.specs/main/feature/{F-XXX}-{slug}/tsd.md`
295
295
  - Nội dung = nội dung của Changes block (theo format `templates/main/feature/tsd-template.md`)
296
- - Frontmatter của tsd.md mới: status `draft` (separate lifecycle với integration test.md)
296
+ - Frontmatter của tsd.md mới: status `draft` + `template_version` copy từ `tsd-template.md` (separate lifecycle với integration test.md). Chỉ stamp ở operation=create; **operation=update KHÔNG đụng** version của tsd.md hiện có.
297
297
 
298
298
  - **Operation=update:**
299
299
  - Đọc tsd.md hiện tại
@@ -381,3 +381,4 @@ Sau khi QC confirm (Bước 6):
381
381
  - [ ] Mỗi tsd.md bị touched có entry mới trong `## Change History` (conventions §5.5)
382
382
  - [ ] Fail-safe: nếu apply fail thì không ghi integration test.md (rollback luôn Change History entries)
383
383
  - [ ] Mỗi feature tsd.md mới có status `draft` (separate lifecycle)
384
+ - [ ] test.md + tsd.md create có `template_version` copy từ template; tsd.md update giữ nguyên version cũ
@@ -183,7 +183,7 @@ Hiển thị draft đầy đủ — chưa ghi file.
183
183
 
184
184
  ### Bước 6: Save
185
185
 
186
- Ghi `.specs/main/feature/{F-XXX}-{slug}/tsd.md` với status `draft` (feature-level artifact có lifecycle riêng, không phải `approved` — QC còn fill placeholders nên status `draft` cho đến khi đầy đủ).
186
+ Ghi `.specs/main/feature/{F-XXX}-{slug}/tsd.md` với status `draft` (feature-level artifact có lifecycle riêng, không phải `approved` — QC còn fill placeholders nên status `draft` cho đến khi đầy đủ). Frontmatter lấy `template_version` từ `tsd-template.md` (xem `conventions.md` §7).
187
187
 
188
188
  Nếu overwrite — file backup `tsd.md.bak.{timestamp}` đã tạo ở Bước 2.
189
189
 
@@ -238,3 +238,4 @@ Trước khi ghi file:
238
238
  - [ ] Priority deterministic theo bảng 4.3
239
239
  - [ ] Nếu overwrite: tsd.md.bak.{timestamp} đã được tạo
240
240
  - [ ] QC đã confirm draft
241
+ - [ ] Frontmatter có `template_version` copy từ `tsd-template.md`
@@ -220,34 +220,35 @@ Nhóm skill dọn dẹp / migrate artifacts hiện có sau khi template được
220
220
 
221
221
  | Command | Reads | Writes |
222
222
  | --- | --- | --- |
223
- | `/spec-frd-update` | `feature/*/frd.md`, `frd-template.md` | `feature/*/frd.md`, cascade: `fdd.md`, `tsd.md`, `integrations/*/spec.md`, `tech.md`, `test.md` |
223
+ | `/artifact-audit [type]` | `.specs/**` artifacts, `.claude/templates/*-template.md` | *(báo cáo; + stamp `template_version` cho artifact legacy conform)* |
224
+ | `/artifact-migrate [path]` | `.specs/**` artifacts, `.claude/templates/*-template.md` (block `migrations`) | artifact được migrate (structure + `template_version`) |
224
225
 
225
- ### `/spec-frd-update`
226
+ ### `/artifact-audit [type]`
226
227
 
227
- Migrate frd.md hiện lên format mới nhất của `templates/main/feature/frd-template.md`. Dùng cho repo đã chạy `/spec-brownfield-feature` hoặc `/spec-new` từ trước, frd.md sinh ra theo template cũ.
228
+ Phát hiện artifact lỗi thời so với template (xem `conventions.md` §7 Template Versioning). So `template_version` của artifact với `template_version` đọc thẳng từ template tại `.claude/templates/` không manifest, không cache.
228
229
 
229
- **8 migration vectors** detect tự động:
230
+ **Scope:** argument là 1 type (`/artifact-audit frd`) hoặc list (`frd,spec`); không có arg → audit mọi type. Type resolve theo **filename** (integration artifact không có field `type`).
230
231
 
231
- | Vector | Action | Risk |
232
- |---|---|---|
233
- | V1 | Fix Mermaid syntax `[{...}]` → `["..."]` | None |
234
- | V2 | Insert "Flow numbering stable" note | None |
235
- | V3 | Rename `Feature-level AC` → `Feature AC` + 4 nhóm chuẩn | Low |
236
- | V4 | Rename `AC-F{NNN}-` (Feature AC) → `FAC-F{NNN}-` (counter riêng) + cascade refs | **HIGH** |
237
- | V5 | Insert US/AC stability notes | None |
238
- | V6 | Propose Verification Rules từ User Stories → user approve → insert | Medium |
239
- | V7 | Move `Components Consumed` → `Dependencies > Components Used` | Low |
240
- | V8 | Derive Mermaid flows từ User Stories → propose → user approve → insert | Medium |
232
+ **Phân loại mỗi artifact:**
233
+ - Có `template_version` → `==`: **up-to-date**; `!=`: **out-dated** `(vX → vY)` → migrate.
234
+ - Thiếu version (legacy) presence-check (đủ required `##` + không còn section `migrations.remove`): conform **stamp** `template_version` (có confirm); lệch → **out-dated** + tóm tắt phần thiếu.
241
235
 
242
- **Workflow:** Pre-flight git clean check discover & classify per-FRD context load apply mechanical vectors (V1/V2/V3/V5/V7) → V4 dry-run preview với cascade impact → confirm → V6 propose VR → confirm → V8 propose Flows → confirm → validate → report.
236
+ **Ranh giới:** chỉ phát hiện + stamp legacy conform. **KHÔNG migrate** đổi structure việc của `/artifact-migrate`. Bỏ qua `.specs/archive/` `.specs/removed/`.
243
237
 
244
- **Cảnh báo:**
245
- - V4 mặc định dry-run, in remap table + cascade diff trước khi ghi.
246
- - V6 luôn propose-then-approve, không auto-apply (model dễ bịa rule).
247
- - V8 luôn propose-then-approve — model derive flow từ US journey grouping, BA phải review để catch glue step bịa hoặc grouping sai.
248
- - KHÔNG tạo file `.bak` — rollback dùng `git checkout -- {file}`. Pre-flight yêu cầu working tree clean.
238
+ ### `/artifact-migrate [path]`
249
239
 
250
- **No-op safe:** nếu mọi FRD đã clean, skill báo dừng không ghi gì.
240
+ Migrate artifact lỗi thời lên structure template mới nhất, generic cho mọi type (vế **fix** đối xứng với `/artifact-audit` vế **detect**).
241
+
242
+ **Scope:** arg = 1 artifact (path) → migrate riêng nó; không arg → quét toàn bộ, migrate từng cái có confirm + skip.
243
+
244
+ **Quy trình:** pre-flight git clean → **tự chạy `/artifact-audit` classify-only (scoped)** để phát hiện out-dated (up-to-date → no-op sớm) → đọc block `migrations` của template lấy delta `add`/`remove`/`update` → dry-run + confirm → apply (set `template_version` = current; main artifact thêm Change History `manual`/migrate).
245
+
246
+ **Quy tắc:**
247
+ - **ADD** = required `##` thiếu (skeleton từ body template); section nội dung mới → interview hoặc `NEEDS_CLARIFY`, **KHÔNG bịa**.
248
+ - **REMOVE** = section trong `migrations.remove` còn sót (có confirm); giữ content tác giả khác (superset).
249
+ - **UPDATE** = section trong `migrations.update` — giữ section + ngữ nghĩa, chỉ đổi **format/cách thể hiện** (vd ASCII → Mermaid); show cũ + đề xuất mới, confirm; KHÔNG thêm/bớt thông tin. (Không presence-check được → chỉ bắt qua version compare.)
250
+ - Rename (remove+add) → hỏi carry-over nội dung.
251
+ - **Single-artifact, KHÔNG cascade.** ID remap (hiếm) → ghi ở `note`, sửa tay. Rollback dùng git (không `.bak`).
251
252
 
252
253
  ---
253
254
 
@@ -550,6 +551,7 @@ Tạo hoặc cập nhật `.claude/ado.yaml` — file config ADO dùng chung cho
550
551
  - Thông tin project
551
552
  - Team members
552
553
  - Epic ticket
554
+ - Area / Iteration path
553
555
  - Môi trường
554
556
 
555
557
  **Bước 2 — Project:**
@@ -561,7 +563,9 @@ Tạo hoặc cập nhật `.claude/ado.yaml` — file config ADO dùng chung cho
561
563
 
562
564
  **Bước 4 — Epic Ticket:** Tạo Epic mới qua MCP (title được prefix `[{project_code}]`, assignee là PE đầu tiên) hoặc nhập ID ticket có sẵn (validate qua MCP: phải là type `Epic`). Lưu `id`, `title`, `url` vào config.
563
565
 
564
- **Bước 5 — Environments:** Collect danh sách môi trường (dev / stag / prod).
566
+ **Bước 5 — Area / Iteration Path:** (tùy chọn) Collect `area_path` `iteration_path` mặc định cho ticket. Bỏ qua nếu user không nhập → ADO dùng giá trị mặc định của team.
567
+
568
+ **Bước 6 — Environments:** Collect danh sách môi trường (dev / stag / prod).
565
569
 
566
570
  **Cuối:** Ghi `.claude/ado.yaml`, đảm bảo file không bị ignore bởi `.gitignore` (thêm `!.claude/ado.yaml` nếu `.claude/` đang bị ignore).
567
571
 
@@ -581,7 +585,7 @@ Tạo hoặc cập nhật `.claude/ado.yaml` — file config ADO dùng chung cho
581
585
 
582
586
  **Bước 4 — Preview:** Hiển thị kế hoạch đầy đủ (Feature và User Story sẽ tạo, skip list) trước khi tạo bất kỳ ticket nào. Chờ user confirm.
583
587
 
584
- **Bước 5-6 — Tạo tickets:**
588
+ **Bước 5-6 — Tạo tickets:** (set `areaPath`/`iterationPath` từ `ado.yaml` nếu có)
585
589
  - Feature ticket: type `Feature`, title `[{project_code}] [{feature_id}] {feature_name}`, description từ `frd.md`. Link parent → Epic ngay sau khi tạo.
586
590
  - User Story ticket: type `User Story`, title `[{project_code}] [{feature_name}] - {US-code} — {story_title}`, description gồm câu story + ACs. Link parent → Feature ngay sau khi tạo.
587
591
  - Nếu link parent fail → retry 1 lần → nếu vẫn fail: đánh dấu `orphan` (KHÔNG xóa ticket), báo cáo cuối.
@@ -6,6 +6,10 @@ features: []
6
6
  components: []
7
7
  status: draft
8
8
  created: {YYYY-MM-DD}
9
+ template_version: 1
10
+ migrations:
11
+ - to: 1
12
+ note: "baseline"
9
13
  referenced_by:
10
14
  - conventions.md > 4. Integration Artifacts > 4.5 plan.md > Cấu trúc
11
15
  - skills/plan/SKILL.md > Output Format > plan.md
@@ -6,6 +6,10 @@ features: []
6
6
  components: []
7
7
  status: draft
8
8
  created: {YYYY-MM-DD}
9
+ template_version: 1
10
+ migrations:
11
+ - to: 1
12
+ note: "baseline"
9
13
  referenced_by:
10
14
  - conventions.md > 4. Integration Artifacts > 4.3 spec.md > Cấu trúc
11
15
  - skills/spec-new/SKILL.md > Process > Bước 5: Write — sinh draft
@@ -6,6 +6,10 @@ features: []
6
6
  components: []
7
7
  status: draft
8
8
  created: {YYYY-MM-DD}
9
+ template_version: 1
10
+ migrations:
11
+ - to: 1
12
+ note: "baseline"
9
13
  referenced_by:
10
14
  - conventions.md > 4. Integration Artifacts > 4.4 tech.md > Cấu trúc
11
15
  - skills/spec-tech/SKILL.md > Process > Bước 4: Write — sinh draft
@@ -1,6 +1,10 @@
1
1
  ---
2
2
  slug: "{slug}"
3
3
  created: {YYYY-MM-DD}
4
+ template_version: 1
5
+ migrations:
6
+ - to: 1
7
+ note: "baseline"
4
8
  referenced_by:
5
9
  - skills/review-integration/SKILL.md > Bước 2 — Luôn ghi findings vào techdebt.md
6
10
  ---
@@ -5,6 +5,10 @@ title: "{title}"
5
5
  features: []
6
6
  status: draft
7
7
  created: {YYYY-MM-DD}
8
+ template_version: 1
9
+ migrations:
10
+ - to: 1
11
+ note: "baseline"
8
12
  referenced_by:
9
13
  - conventions.md > 4. Integration Artifacts > 4.7 test.md > Cấu trúc
10
14
  - skills/spec-test/SKILL.md > Process > Bước 4: Write — sinh draft
@@ -5,6 +5,10 @@ title: "{title}"
5
5
  features: []
6
6
  components: []
7
7
  created: {YYYY-MM-DD}
8
+ template_version: 1
9
+ migrations:
10
+ - to: 1
11
+ note: "baseline"
8
12
  referenced_by:
9
13
  - conventions.md > 4. Integration Artifacts > 4.6 todo.md > Cấu trúc
10
14
  - skills/plan/SKILL.md > Output Format > todo.md
@@ -4,6 +4,10 @@ type: cdd
4
4
  status: draft
5
5
  owner: "{Tech Lead / Senior Dev}"
6
6
  component_id: "{Component ID, ví dụ C-001}"
7
+ template_version: 1
8
+ migrations:
9
+ - to: 1
10
+ note: "baseline"
7
11
  referenced_by:
8
12
  - conventions.md > 3. Main Artifacts > 3.2 Component level > cdd.md > Cấu trúc
9
13
  - skills/spec-tech/SKILL.md > Process > Cascade Proposals > component cdd.md
@@ -4,6 +4,10 @@ type: crd
4
4
  status: draft
5
5
  owner: "{BA / Tech Lead}"
6
6
  component_id: "{Component ID từ PRD Component Index, ví dụ C-001}"
7
+ template_version: 1
8
+ migrations:
9
+ - to: 1
10
+ note: "baseline"
7
11
  referenced_by:
8
12
  - conventions.md > 3. Main Artifacts > 3.2 Component level > crd.md > Cấu trúc
9
13
  - skills/spec-new/SKILL.md > Process > Bước 5: Write — sinh draft > component/{C-XXX}/crd.md
@@ -3,6 +3,10 @@ id: domain
3
3
  type: domain
4
4
  status: draft
5
5
  owner: "{BA/Domain Expert}"
6
+ template_version: 1
7
+ migrations:
8
+ - to: 1
9
+ note: "baseline"
6
10
  referenced_by:
7
11
  - conventions.md > 3. Main Artifacts > 3.1 Product level > domain.md > Cấu trúc
8
12
  - skills/spec-prd/SKILL.md > Process > Bước 5: Save (scaffold domain.md skeleton)
@@ -4,6 +4,10 @@ type: fdd
4
4
  status: draft
5
5
  owner: "{Tech Lead / Senior Dev}"
6
6
  feature_id: "{Feature ID}"
7
+ template_version: 1
8
+ migrations:
9
+ - to: 1
10
+ note: "baseline"
7
11
  referenced_by:
8
12
  - conventions.md > 3. Main Artifacts > 3.3 Feature level > fdd.md > Cấu trúc
9
13
  - skills/spec-tech/SKILL.md > Process > Bước 4: Write — sinh draft > Cascade Proposals > fdd.md
@@ -4,6 +4,10 @@ type: frd
4
4
  status: draft
5
5
  owner: "{BA}"
6
6
  feature_id: "{Feature ID từ PRD Feature Index}"
7
+ template_version: 1
8
+ migrations:
9
+ - to: 1
10
+ note: "baseline"
7
11
  referenced_by:
8
12
  - conventions.md > 3. Main Artifacts > 3.3 Feature level > frd.md > Cấu trúc
9
13
  - skills/spec-frd/SKILL.md > Process > Bước 5: Write — sinh draft
@@ -155,6 +159,14 @@ Tham chiếu đến `.specs/main/component/{C-XXX}-...`.
155
159
  | --- | --- |
156
160
  | `{C-XXX}-{component-name}` | {component này phục vụ cái gì cho feature này} |
157
161
 
162
+ ## Open Questions
163
+
164
+ <!-- Các câu hỏi cần làm rõ trong interview / với stakeholder trước khi proceed.
165
+ Cũng dùng để note component candidate chưa carve (xem skills/spec-frd).
166
+ Section required-emptyable: GIỮ heading; để trống (không có bullet) nếu không còn câu hỏi nào. -->
167
+
168
+ - [ ] {câu hỏi cần clarify} — {ai trả lời / khi nào}
169
+
158
170
  ## Change History
159
171
 
160
172
  Append-only log của các thay đổi cascade lên artifact này. Quy ước xem `conventions.md` §5.5.
@@ -5,6 +5,10 @@ status: draft
5
5
  owner: "{QC}"
6
6
  feature_id: "{Feature ID — match frd.md}"
7
7
  frd_ref: "feature/{F-XXX}-{slug}/frd.md"
8
+ template_version: 1
9
+ migrations:
10
+ - to: 1
11
+ note: "baseline"
8
12
  referenced_by:
9
13
  - conventions.md > 3. Main Artifacts > 3.3 Feature level > tsd.md > Cấu trúc
10
14
  ---
@@ -4,6 +4,10 @@ type: prd
4
4
  status: draft
5
5
  owner: "{PM/BA}"
6
6
  project_name: "{tên dự án}"
7
+ template_version: 1
8
+ migrations:
9
+ - to: 1
10
+ note: "baseline"
7
11
  referenced_by:
8
12
  - conventions.md > 3. Main Artifacts > 3.1 Product level > prd.md > Cấu trúc
9
13
  - skills/spec-prd/SKILL.md > Process > Bước 1: Kiểm tra preconditions
@@ -3,6 +3,10 @@ id: sad
3
3
  type: sad
4
4
  status: draft
5
5
  owner: "{Tech Lead / Architect}"
6
+ template_version: 1
7
+ migrations:
8
+ - to: 1
9
+ note: "baseline"
6
10
  referenced_by:
7
11
  - conventions.md > 3. Main Artifacts > 3.1 Product level > sad.md > Cấu trúc
8
12
  - skills/spec-sad/SKILL.md > Process > Bước 1: Kiểm tra preconditions