spec-lite 1.1.6 → 1.1.7

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.
@@ -0,0 +1,443 @@
1
+ # Skills Overview
2
+
3
+ ---
4
+
5
+ ## Getting Started — Greenfield
6
+
7
+ Dùng khi bắt đầu dự án mới chưa có code. Mục tiêu: bootstrap `prd.md`, `domain.md`, `sad.md` thông qua interview có cấu trúc, sau đó chuyển vào **Integration Pipeline** để implement.
8
+
9
+ | Command | Reads | Writes |
10
+ | --- | --- | --- |
11
+ | `/spec-prd` | — | `specs/main/prd.md`, `specs/main/domain.md` *(skeleton)* |
12
+ | `/spec-sad` | `prd.md`, `domain.md` | `specs/main/sad.md` |
13
+
14
+ ### `/spec-prd`
15
+
16
+ Tạo hoặc cập nhật `specs/main/prd.md` thông qua interview có cấu trúc. Ngoài ra **scaffold luôn `specs/main/domain.md` skeleton** (Glossary placeholder + Shared Entities rỗng) — domain mọc dần qua cascade từ integrations.
17
+
18
+ **Sections template** (7): Problem Statement · Target Users · Scope · Features · Components · Non-Functional Requirements · Business Constraints
19
+
20
+ **Khi file chưa tồn tại hoặc là template rỗng** → full interview tuần tự từng section.
21
+
22
+ **Khi file đã có nội dung** → quét tất cả `##` headings theo thứ tự xuất hiện trong file, hiển thị menu:
23
+ - Section thuộc template: `✓ đã có` hoặc `✗ chưa có — cần bổ sung`
24
+ - Section thừa (không có trong template): `⚠ không có trong template`
25
+ - Option `[A]` để interview tất cả sections thuộc template
26
+
27
+ Chọn số section thuộc template → interview rồi merge vào file.
28
+ Chọn số section thừa → xoá ngay.
29
+ Chọn `A` → interview tuần tự 7 sections template (sections thừa không bị đụng tới).
30
+
31
+ ---
32
+
33
+ ### `/spec-sad`
34
+
35
+ Tạo hoặc cập nhật `specs/main/sad.md`. Yêu cầu `prd.md` và `domain.md` đã tồn tại (cả hai do `/spec-prd` scaffold).
36
+
37
+ Trước khi interview, đọc `prd.md` (NFRs, constraints) và `domain.md` (glossary, shared entities) để surface assumptions và đề xuất options phù hợp khi user chưa quyết định.
38
+
39
+ **Sections template** (7): Architectural Style · System Overview · Tech Stack · Cross-Cutting Concerns · Inter-Service Communication · Infrastructure Overview · Architectural Guardrails
40
+
41
+ **Khi file chưa tồn tại** → full interview tuần tự từng section.
42
+
43
+ **Khi file đã có nội dung** → cùng cơ chế quét + menu như `/spec-prd`.
44
+
45
+ Nếu `prd.md` chưa có → dừng, yêu cầu chạy `/spec-prd` trước.
46
+
47
+ > **Lưu ý:** Architectural Guardrails là phần quan trọng nhất của SAD — skill luôn hỏi riêng về phần này khi review, vì đây là constraints mà mọi agent phải tuân theo khi sinh `tech.md`.
48
+
49
+ ---
50
+
51
+ ### Thứ tự thực hiện
52
+
53
+ ```
54
+ /spec-prd → /spec-sad
55
+
56
+ │ (có thể chạy /scaffold để khởi tạo project structure)
57
+
58
+
59
+ → Integration Pipeline
60
+ ```
61
+
62
+ ---
63
+
64
+ ## Getting Started — Brownfield
65
+
66
+ Dùng khi onboarding một project đã có code vào SDD. Mục tiêu: extract main artifacts từ codebase hiện có, sau đó chuyển vào **Integration Pipeline** để implement.
67
+
68
+ **Thứ tự bắt buộc:** `init` → `component` → `feature`
69
+
70
+ | Command | Scan | Reads | Writes |
71
+ | --- | --- | --- | --- |
72
+ | `/spec-brownfield-init [path]` | tech stack, README, auth, infra | attachments | `prd.md` *(no indexes)*, `domain.md` *(glossary only)*, `sad.md` |
73
+ | `/spec-brownfield-component [path]` | module dirs, service/controller/entity files | `prd.md`, `domain.md` | `component/{C-XXX}-*/crd.md + cdd.md`; update `prd.md` Component Index; cascade Shared Entities → `domain.md` |
74
+ | `/spec-brownfield-feature [path]` | use cases, routes, test files | `prd.md`, `domain.md`, `component/*/crd.md` | `feature/{F-XXX}-*/frd.md + fdd.md`; update `prd.md` Feature Index |
75
+
76
+ ### Phân chia trách nhiệm
77
+
78
+ Mỗi skill chịu trách nhiệm duy nhất cho phần nó scan — **không có scan nào bị lặp lại**:
79
+
80
+ | | init | component | feature |
81
+ |---|---|---|---|
82
+ | Discover what exists | product/arch level | scan module dirs → discover components | scan routes/use cases → discover features |
83
+ | Deep code scan | ✗ | ✓ files bên trong từng component | ✓ use cases, tests, call chains |
84
+ | Write back to prd.md | skeleton (no indexes) | Component Index | Feature Index |
85
+ | Cascade to domain.md | Glossary skeleton | Shared Entities | ✗ |
86
+
87
+ ### Điểm khác biệt so với greenfield
88
+
89
+ - **Scan trước, hỏi sau** — agent build structural picture từ code trước khi đặt câu hỏi.
90
+ - **Pre-filled options** — user confirm/adjust, không nhập từ đầu. Luôn có `[0] Chưa rõ → NEEDS_CLARIFY`.
91
+ - **Batch generation** — component/feature artifacts generate theo batch, review ở cuối.
92
+ - **NEEDS_CLARIFY** không block flow — có thể fill in dần sau.
93
+
94
+ ---
95
+
96
+ ### `/spec-brownfield-init [path]`
97
+
98
+ **Mục tiêu:** `prd.md` (product context, không có Component/Feature Index), `domain.md` (Glossary only), `sad.md`
99
+
100
+ **Scan**: package files → tech stack · README/docs → business context · top-level dir structure → architecture style · auth/middleware → cross-cutting concerns · docker-compose/infra → deployment info
101
+
102
+ **prd.md interview** (5 phần): Problem Statement · Target Users · Scope · NFRs · Business Constraints
103
+
104
+ Component Index và Feature Index **để placeholder** — sẽ được điền bởi skill component và feature.
105
+
106
+ **domain.md**: chỉ Glossary từ README/docs terms. Shared Entities trống — sẽ được cascade từ skill component.
107
+
108
+ **sad.md**: auto-fill từ scan + hỏi 2 câu (Guardrails + additional constraints).
109
+
110
+ ---
111
+
112
+ ### `/spec-brownfield-component [path]`
113
+
114
+ **Mục tiêu:** `crd.md` + `cdd.md` cho mỗi component + điền prd.md Component Index + cascade Shared Entities vào domain.md
115
+
116
+ **Precondition:** `prd.md` tồn tại (init đã chạy).
117
+
118
+ **Bước 1 — Discover:** scan module dirs (`src/modules/`, `services/`, `packages/`, `apps/`) → detect component candidates → present cho user confirm/adjust → assign C-XXX IDs.
119
+
120
+ **Bước 2 — Deep scan từng component:** responsibilities (service methods) · owned entities (entity files) · public interface (controller routes + events) · dependencies (imports) · business rules (validators/guards) · internal design (cho cdd.md).
121
+
122
+ **Bước 3 — Identify cross-component entities:** entities được import bởi 2+ components → candidate Shared Entities.
123
+
124
+ **Bước 4 — Generate batch:** crd.md + cdd.md cho tất cả. Batch clarification tối đa 5 câu.
125
+
126
+ **Bước 5 — Write back:** update prd.md Component Index + cascade Shared Entities vào domain.md (nếu có).
127
+
128
+ ---
129
+
130
+ ### `/spec-brownfield-feature [path]`
131
+
132
+ **Mục tiêu:** `frd.md` + `fdd.md` cho mỗi feature + điền prd.md Feature Index
133
+
134
+ **Precondition:** `prd.md` Component Index đã có entries (component skill đã chạy). fdd.md cần C-XXX IDs để mô tả inter-component flows — nếu Component Index trống thì skill dừng và yêu cầu chạy component skill trước.
135
+
136
+ **Bước 1 — Discover:** scan use case files, route groups, test describe blocks, page/screen dirs → detect feature candidates → present cho user confirm/adjust → assign F-XXX IDs.
137
+
138
+ **Bước 2 — Deep scan từng feature:** user stories (infer từ use case + routes + tests) · AC (extract từ test assertions, đánh dấu source) · components consumed (map sang C-XXX) · inter-component call chain (cho fdd.md).
139
+
140
+ **Bước 3 — Generate batch:** frd.md + fdd.md cho tất cả. Batch clarification tối đa 5 câu.
141
+
142
+ **Bước 4 — Write back:** update prd.md Feature Index.
143
+
144
+ ---
145
+
146
+ ### Thứ tự thực hiện
147
+
148
+ ```
149
+ /spec-brownfield-init [path]
150
+
151
+
152
+ /spec-brownfield-component [path]
153
+
154
+
155
+ /spec-brownfield-feature [path]
156
+
157
+
158
+ (fill in NEEDS_CLARIFY items khi có thêm context)
159
+
160
+
161
+ → Integration Pipeline
162
+ ```
163
+
164
+ ---
165
+
166
+ ## Integration Pipeline — dùng cho cả greenfield và brownfield
167
+
168
+ Sau khi main artifacts đã sẵn sàng (từ greenfield hoặc brownfield), mọi requirement mới đều đi qua pipeline này.
169
+
170
+ | Command | Reads | Writes |
171
+ | --- | --- | --- |
172
+ | `/spec-new [requirement]` | `prd.md`, `domain.md`, frd(s), crd(s) | `specs/integrations/{slug}/spec.md` |
173
+ | `/spec-tech [number]` | `sad.md`, `domain.md`, cdd(s), fdd(s), `spec.md` | `specs/integrations/{slug}/tech.md` |
174
+ | `/plan` | `spec.md`, `tech.md`, `domain.md` | `plan.md`, `todo.md` |
175
+ | `/build` | `plan.md`, `todo.md` | *(source code)* |
176
+ | `/review` | `spec.md`, `tech.md`, `plan.md`, `todo.md`, *(source code)* | *(findings report)* |
177
+
178
+ ### `/spec-new [requirement]`
179
+
180
+ Tạo `specs/integrations/{slug}/spec.md` cho một integration mới. Chạy bởi BA.
181
+
182
+ **Nếu không có argument** → đọc `prd.md`, hiển thị danh sách features có `Status = TODO`, user chọn số.
183
+
184
+ **Nếu có argument** → argument là raw requirement, dùng trực tiếp làm input.
185
+
186
+ Context load: `prd.md` + `domain.md` + `frd.md` (cho mỗi feature liên quan) + `crd.md` (cho mỗi component bị touched). Frontmatter `features` và `components` được điền theo những gì agent xác định.
187
+
188
+ **Interview** (4 phần, tuần tự): Problem Statement · Requirements · Acceptance Criteria · Out of Scope
189
+
190
+ AC tự nhóm theo bản chất integration: Feature → US → AC, hoặc Component → AC, hoặc mix.
191
+
192
+ **Cascade Proposals** đề xuất delta cho: `prd.md`, `domain.md`, `component/{C-XXX}/crd.md`, `feature/{F-XXX}/frd.md`. Component và feature mới có thể được đề xuất tạo cùng cascade (auto-pick ID + slug).
193
+
194
+ Sau khi confirm → ghi `spec.md`, cập nhật `prd.md`: Status `TODO → In Progress` (nếu liên quan feature).
195
+
196
+ ---
197
+
198
+ ### `/spec-tech [number]`
199
+
200
+ Tạo `specs/integrations/{slug}/tech.md` cho một integration. Chạy bởi DEV sau khi `spec.md` đã được approve.
201
+
202
+ **Luôn hiển thị danh sách tất cả integrations** trong `specs/integrations/`, đánh dấu `✓` những cái đã có `tech.md`. Nếu có argument → argument là số thứ tự (`1`, `001`...), chọn luôn không cần hiển thị.
203
+
204
+ Nếu integration đã có `tech.md` → hỏi confirm trước khi ghi đè.
205
+
206
+ Context load: `spec.md` + `sad.md` + `domain.md` + `cdd.md` (cho mỗi component bị touched) + `fdd.md` (cho mỗi feature liên quan).
207
+
208
+ **Interview** (4 phần, tuần tự): Solution Overview · Data Model Changes · Interface Changes · Implementation Notes
209
+
210
+ **Cascade Proposals** đề xuất delta cho: `sad.md`, `domain.md`, `component/{C-XXX}/cdd.md`, `feature/{F-XXX}/fdd.md`.
211
+
212
+ ---
213
+
214
+ ### `/plan`
215
+
216
+ Tạo `plan.md` và `todo.md` từ `spec.md` + `tech.md`. Là SDD wrapper quanh `planning-and-task-breakdown`.
217
+
218
+ **Bước 1: Xác định integration**
219
+ Quét `specs/integrations/`, hiển thị danh sách với trạng thái `spec✓/—`, `tech✓/—`, `plan✓/—`. Nếu có argument → chọn luôn. Nếu `plan.md`/`todo.md` đã tồn tại → hỏi trước khi ghi đè.
220
+
221
+ **Bước 2: Load và surface context**
222
+ Đọc `spec.md`, `tech.md`, `domain.md`. Surface tóm tắt (features, components, AC IDs, thay đổi kỹ thuật, shared entities) và assumptions để user confirm. Plan mode từ đây — chỉ đọc, không viết code.
223
+
224
+ **Bước 3: Handoff → `planning-and-task-breakdown`**
225
+ Delegate toàn bộ breakdown (dependency graph, vertical slicing, sizing) sang `planning-and-task-breakdown`. Output phải theo Output Format định nghĩa trong `skills/plan/SKILL.md`.
226
+
227
+ **Không có Cascade Proposals** — nếu phát hiện delta cần cập nhật `sad.md`/`domain.md`/component/feature artifacts → dừng, báo user, đề xuất tạo integration riêng.
228
+
229
+ ---
230
+
231
+ ### `/build`
232
+
233
+ Implement từng task trong `todo.md` theo vòng lặp TDD incremental. Chạy bởi DEV sau khi `plan.md` đã được approve.
234
+
235
+ Với mỗi task `[ ]` trong `todo.md`, lặp lại:
236
+
237
+ 1. **Load context** — đọc code, types, patterns liên quan. Hỏi: cách đơn giản nhất có thể làm việc là gì?
238
+ 2. **UI/UX check** — nếu task liên quan đến UI/UX → invoke `frontend-design` + `frontend-ui-engineering` trước khi implement.
239
+ 3. **RED** — viết test trước, chạy và xác nhận nó fail.
240
+ 4. **GREEN** — implement code tối thiểu để test pass.
241
+ 5. **Verify** — chạy `npm test` (toàn bộ suite). Nếu regression → invoke `debugging-and-error-recovery`.
242
+ 6. **Build** — chạy `npm run build`. Nếu fail → invoke `debugging-and-error-recovery`.
243
+ 7. **Commit** — atomic commit trong phạm vi task này.
244
+ 8. **Đánh dấu** — check `[x]` trong `todo.md`, chuyển task tiếp theo.
245
+
246
+ **Scope discipline** — chỉ chạm vào những gì task yêu cầu. Không refactor code liền kề, không implement task tương lai.
247
+
248
+ **Quan hệ với các skill khác:** delegates to `incremental-implementation` + `test-driven-development` · invokes `frontend-design` + `frontend-ui-engineering` (UI/UX tasks) · escalates to `debugging-and-error-recovery` (test/build failures).
249
+
250
+ ---
251
+
252
+ ### `/review`
253
+
254
+ Review implementation sau `/build` theo năm trục: correctness, readability, architecture, security, performance. Đối chiếu trực tiếp với `spec.md` và `tech.md`. Delegates to `code-review-and-quality`.
255
+
256
+ **Findings** phân loại theo severity:
257
+
258
+ | Severity | Ý nghĩa | Action |
259
+ |----------|---------|--------|
260
+ | **Critical** | Blocks merge | Security vulnerability, data loss, chức năng vỡ |
261
+ | **Important** | Phải sửa | Bug logic, vi phạm spec, architecture sai |
262
+ | **Suggestion** | Tuỳ chọn | Readability, style nhẹ |
263
+
264
+ **Verdict:**
265
+ - Có Critical/Important → dừng, không tiếp tục `/build`, sửa và re-review.
266
+ - Chỉ Suggestion hoặc không có finding → approve, tiếp tục `/build` task tiếp theo.
267
+
268
+ ---
269
+
270
+ ### Thứ tự thực hiện
271
+
272
+ ```
273
+ /spec-new [requirement]
274
+ (human review + apply cascade proposals + approve)
275
+
276
+ /spec-tech
277
+ (human review + apply cascade proposals + approve)
278
+
279
+ /plan
280
+ (human approve)
281
+
282
+ /build ←──────────────┐
283
+ │ │
284
+ /review │ (nếu Critical/Important)
285
+ │ │
286
+ [approve] ──────────┘ (nếu Suggestion only)
287
+ ```
288
+
289
+ ---
290
+
291
+ ## Cross-cutting skills
292
+
293
+ Không nằm trong pipeline chính — được `build` tự động invoke khi gặp task phù hợp.
294
+
295
+ | Skill | Vai trò | Invoke khi |
296
+ | --- | --- | --- |
297
+ | `frontend-design` | Aesthetic direction | Task tạo/sửa UI, chưa có design system |
298
+ | `frontend-ui-engineering` | Component architecture & engineering standards | Mọi task UI/UX |
299
+
300
+ ### `frontend-design`
301
+
302
+ Xác định hướng aesthetic trước khi implement. Trả lời câu hỏi: *interface này trông như thế nào và cảm giác như thế nào?*
303
+
304
+ - Chọn aesthetic direction rõ ràng và táo bạo (minimalist, brutalist, editorial, luxury...) — không để mặc định
305
+ - Typography: font đặc trưng, không dùng Inter/Roboto/Arial
306
+ - Color: palette nhất quán với accent mạnh, dùng CSS variables
307
+ - Motion: animation có chủ đích tại các điểm quan trọng (page load, hover, transition)
308
+ - Layout: bất đối xứng, overlap, grid-breaking — tránh card grid đều nhau kiểu AI
309
+
310
+ **Mục tiêu:** UI memorable và unmistakably designed — không phải AI-generated look.
311
+
312
+ ---
313
+
314
+ ### `frontend-ui-engineering`
315
+
316
+ Đảm bảo engineering quality cho mọi UI được implement. Trả lời câu hỏi: *interface này có đúng kỹ thuật không?*
317
+
318
+ - **Component architecture**: colocate file, composition over configuration, tách container/presentation
319
+ - **Accessibility (WCAG 2.1 AA)**: keyboard navigation, ARIA labels, focus management, đủ contrast
320
+ - **State management**: chọn cách đơn giản nhất (useState → lifted state → context → server state → global store)
321
+ - **Responsive**: mobile-first, test tại 320px / 768px / 1024px / 1440px
322
+ - **Loading/error/empty states**: bắt buộc — không để blank screen
323
+
324
+ **Mục tiêu:** UI production-quality — accessible, performant, không có AI aesthetic.
325
+
326
+ ---
327
+
328
+ ## ADO Integration
329
+
330
+ Nhóm skill kết nối SDD workflow với Azure DevOps — từ setup project đến tạo tickets tự động từ spec.
331
+
332
+ > `/ado-create` và `/ado-update` thực hiện **một integration mỗi lần chạy** — chọn integration ở đầu skill, toàn bộ thao tác chỉ trong phạm vi integration đó.
333
+
334
+ | Command | Reads | Writes |
335
+ | --- | --- | --- |
336
+ | `/ado-config` | `.claude/ado.yaml` *(nếu đã có)* | `.claude/ado.yaml`, `.gitignore` *(nếu cần)* |
337
+ | `/ado-create` | `.claude/ado.yaml`, `spec.md`, `frd.md` | ADO tickets, `spec.md`, `frd.md`, `prd.md` |
338
+ | `/ado-update` | `.claude/ado.yaml`, `spec.md` | ADO ticket states *(via MCP)* |
339
+
340
+ ### Thứ tự thực hiện
341
+
342
+ ```
343
+ /ado-config (một lần per project)
344
+
345
+
346
+ /ado-create (mỗi lần có integration mới được approve)
347
+
348
+
349
+ /ado-update (mỗi lần deploy/verify qua môi trường)
350
+ ```
351
+
352
+ ---
353
+
354
+ ### `/ado-config`
355
+
356
+ Tạo hoặc cập nhật `.claude/ado.yaml` — file config ADO dùng chung cho tất cả skill `/ado-*`.
357
+
358
+ **Khi file chưa tồn tại** → collect toàn bộ tuần tự.
359
+
360
+ **Khi file đã tồn tại** → hiển thị tóm tắt nội dung hiện tại, hỏi user muốn cập nhật phần nào:
361
+ - Toàn bộ từ đầu
362
+ - Thông tin project
363
+ - Team members
364
+ - Epic ticket
365
+ - Môi trường
366
+
367
+ **Bước 2 — Project:**
368
+ - Hỏi organization (tự extract nếu user paste full URL)
369
+ - Gọi MCP `core_list_projects` để list projects trong org → user chọn số thứ tự → tự điền `project_name` và `project_id`
370
+ - Đề xuất `project_code` từ tên project (ví dụ `Galaxy GCC` → `GAL-GCC`), user confirm hoặc nhập lại
371
+
372
+ **Bước 3 — Team:** Collect PE / SE / DE, mỗi role nhập email, mỗi người một dòng. PE là bắt buộc.
373
+
374
+ **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.
375
+
376
+ **Bước 5 — Environments:** Collect danh sách môi trường (dev / stag / prod).
377
+
378
+ **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).
379
+
380
+ ---
381
+
382
+ ### `/ado-create`
383
+
384
+ Đọc `spec.md` của một integration, tạo Feature và User Story tickets trên ADO, ghi ticket references trở lại vào spec artifacts.
385
+
386
+ **Prerequisite:** `.claude/ado.yaml` phải có `epic.id` (chạy `/ado-config` trước).
387
+
388
+ **Bước 1 — Current user:** Đọc `git config user.email`, tìm trong `team.*` của `ado.yaml`. Nếu không khớp → hỏi user chọn. Resolve email → ADO identity ID để dùng làm assignee.
389
+
390
+ **Bước 2 — Chọn integration:** List tất cả `specs/integrations/` kèm title và status từ frontmatter `spec.md`.
391
+
392
+ **Bước 3 — Parse spec.md:** Extract Features (`### Feature: <name> (<ID>)`) và User Stories (`#### US-FXXX-YYY — <title>`). Detect ticket đã tồn tại qua dòng `**ADO:**` ngay sau heading — đánh dấu `already_created`, bỏ qua khi tạo.
393
+
394
+ **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.
395
+
396
+ **Bước 5-6 — Tạo tickets:**
397
+ - Feature ticket: type `Feature`, title `[{project_code}] [{feature_id}] {feature_name}`, description từ `frd.md`. Link parent → Epic ngay sau khi tạo.
398
+ - 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.
399
+ - 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.
400
+
401
+ **Bước 7-9 — Ghi lại references:**
402
+ - `spec.md`: thêm dòng `**ADO:** [#ID — title](url)` ngay sau heading của mỗi Feature và User Story đã tạo thành công
403
+ - `frd.md`: append section `## ADO Tickets` (bảng Feature + User Story) hoặc append row vào bảng đã có
404
+ - `prd.md`: thêm/cập nhật cột `ADO` trong bảng Features
405
+
406
+ **Bước 10 — Tóm tắt:** Liệt kê tickets đã tạo (kèm URL), files đã cập nhật, tickets thất bại, và orphans cần link thủ công.
407
+
408
+ ---
409
+
410
+ ### `/ado-update`
411
+
412
+ Cập nhật state đồng loạt cho User Story (và tuỳ chọn Feature) tickets của một integration theo tiến trình deploy/verify qua các môi trường.
413
+
414
+ **Prerequisites:** `.claude/ado.yaml` có `environments`, tất cả tickets đã được tạo qua `/ado-create`.
415
+
416
+ **Bước 1 — Load config:** Đọc `ado.yaml`. Dừng nếu thiếu file hoặc `environments` rỗng.
417
+
418
+ **Bước 2 — Chọn integration:** List `specs/integrations/` kèm title và status.
419
+
420
+ **Bước 3 — Parse & validate:** Extract tất cả Feature và User Story tickets từ dòng `**ADO:**` trong `spec.md`. Nếu bất kỳ ticket nào chưa có → dừng, báo danh sách thiếu, yêu cầu chạy `/ado-create` trước.
421
+
422
+ **Bước 4 — Fetch state hiện tại:** Gọi song song: batch fetch state hiện tại của tất cả tickets + fetch danh sách states hợp lệ từ ADO work item type `User Story` và `Feature`. State list lấy thực tế từ ADO — **không hardcode**, **không generate từ `environments`**.
423
+
424
+ **Environment-State Filtering:** Sau khi fetch, filter bớt các state `Deploy *` / `Verify *` không tương ứng với environments trong config. ADO trả về pairs theo thứ tự (Deploy X, Verify X) — map positional: pair thứ N → `environments[N]`. Pairs có index ≥ số environments → loại. General states (New, In Progress, Done...) giữ nguyên.
425
+
426
+ **Bước 5 — Chọn state mới (User Story):** Hiển thị numbered list plain text (không dùng `AskUserQuestion` — số options có thể vượt 4). Chờ user nhập số.
427
+
428
+ **Bước 6 — Preview & cập nhật User Story:** Hiển thị từng ticket với state cũ → mới, đánh dấu "(không đổi)" cho ticket đã đúng state. Chỉ gọi API update cho ticket thực sự thay đổi. Gọi tuần tự, không dừng nếu 1 ticket fail.
429
+
430
+ **Bước 7 — Feature tickets (tuỳ chọn):** Hỏi user có muốn cập nhật Feature tickets không. Nếu có → hiển thị Feature state list, chọn, preview, cập nhật tương tự.
431
+
432
+ **Bước 8 — Tóm tắt:** Liệt kê tickets đã cập nhật, tickets không đổi, và tickets thất bại.
433
+
434
+ ---
435
+
436
+ ## Ghi chú
437
+
438
+ - Cascade proposals trong `spec.md` và `tech.md` do human review và apply thủ công — không có skill riêng.
439
+ - **Greenfield**: Component và Feature artifacts mọc dần qua cascade từ integrations — không có skill chuyên biệt để tạo.
440
+ - **Brownfield**: Component và Feature artifacts được bootstrap bởi `spec-brownfield-component` và `spec-brownfield-feature` — sau đó tiếp tục mọc qua cascade như bình thường.
441
+ - Thứ tự trong một integration: `spec-new` → `spec-tech` → `plan` → `build`.
442
+ - `frontend-design` và `frontend-ui-engineering` được `build` invoke tự động — không cần gọi thủ công.
443
+ - `**[NEEDS_CLARIFY]**` items trong brownfield artifacts không block workflow — có thể proceed và fill in dần khi có thêm context.