@relipa/ai-flow-kit 0.1.9 → 0.2.0-beta.1

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 (55) hide show
  1. package/README.md +65 -0
  2. package/bin/aiflow.js +74 -4
  3. package/custom/rules/output-language.md +36 -0
  4. package/custom/rules/project-conventions.md +16 -0
  5. package/custom/skills/automation-testing/SKILL.md +1 -1
  6. package/custom/skills/ba-skills/skill-ba-build-business-rules-v1.md +2 -0
  7. package/custom/skills/ba-skills/skill-ba-initial-analysis-v1.md +2 -0
  8. package/custom/skills/ba-skills/skill-ba-mermaid-flowchart-v1.md +2 -0
  9. package/custom/skills/ba-skills/skill-ba-qna-v1.md +2 -0
  10. package/custom/skills/ba-skills/skill-ba-ui-prototype-v1.md +2 -0
  11. package/custom/skills/ba-skills/skill-ba-write-uc-spec-v1.md +2 -0
  12. package/custom/skills/coverage-check/SKILL.md +2 -0
  13. package/custom/skills/create-system-requirement/SKILL.md +252 -0
  14. package/custom/skills/deploy-model/SKILL.md +2 -0
  15. package/custom/skills/design-experiment/SKILL.md +2 -0
  16. package/custom/skills/evaluate-model/SKILL.md +2 -0
  17. package/custom/skills/evidence-aggregation/SKILL.md +2 -0
  18. package/custom/skills/execute-flow/SKILL.md +2 -0
  19. package/custom/skills/explore-data/SKILL.md +2 -0
  20. package/custom/skills/frame-ml-problem/SKILL.md +2 -0
  21. package/custom/skills/gate-review/SKILL.md +2 -0
  22. package/custom/skills/generate-spec/SKILL.md +2 -0
  23. package/custom/skills/generate-test-report/SKILL.md +2 -0
  24. package/custom/skills/generate-testcase/SKILL.md +2 -0
  25. package/custom/skills/impact-analysis/SKILL.md +2 -0
  26. package/custom/skills/improve-algorithm/SKILL.md +2 -0
  27. package/custom/skills/ingest-data/SKILL.md +226 -0
  28. package/custom/skills/log-bug/SKILL.md +2 -0
  29. package/custom/skills/pr-impact-analysis/SKILL.md +2 -0
  30. package/custom/skills/read-study-requirement/SKILL.md +41 -2
  31. package/custom/skills/report-customer/SKILL.md +6 -2
  32. package/custom/skills/retest-orchestration/SKILL.md +2 -0
  33. package/custom/skills/review-plan/SKILL.md +2 -0
  34. package/custom/skills/script-sync/SKILL.md +1 -1
  35. package/custom/skills/test-analysis/SKILL.md +2 -0
  36. package/custom/skills/test-skills/rules/qa-writing-standards.md +2 -2
  37. package/custom/skills/train-model/SKILL.md +2 -0
  38. package/custom/templates/shared/create-testcase-workflow.md +32 -1
  39. package/custom/templates/shared/gate-workflow.md +64 -0
  40. package/docs/common/BA-Specs-Structure.md +3 -0
  41. package/docs/common/CHANGELOG.md +39 -0
  42. package/docs/common/Docs-Management-Flow.md +1 -1
  43. package/docs/common/INDEX.md +1 -0
  44. package/docs/common/Memory-Architecture-v1.0.md +1 -0
  45. package/docs/common/Project-Structure.md +5 -2
  46. package/package.json +1 -1
  47. package/scripts/create-score-excel.js +4 -111
  48. package/scripts/detect.js +22 -0
  49. package/scripts/hooks/session-start.js +1 -0
  50. package/scripts/init.js +24 -1
  51. package/scripts/link-resolver.js +194 -7
  52. package/scripts/prompt.js +144 -0
  53. package/scripts/task.js +22 -6
  54. package/scripts/ticket-writer.js +247 -0
  55. package/scripts/use.js +402 -135
package/README.md CHANGED
@@ -188,6 +188,63 @@ ak use PROJ-33 (taskType: testcase) → claude
188
188
 
189
189
  ---
190
190
 
191
+ ## Create System Requirement Flow
192
+
193
+ ```
194
+ ak use PROJ-33 (taskType: create-system-requirement) → claude
195
+
196
+
197
+ ⛩️ GATE 1 — Investigate UC & Draft [AI + BA/Dev]
198
+ AI resolve UC Spec version hiện tại của functionId
199
+ AI đọc source code + convention error-handling hiện có
200
+ AI dịch từng Flow step + Business Rule → FR/NFR/Validation Rules/Exception Handling
201
+ AI viết Acceptance Test scenarios (Given/When/Then) — mọi item trace về đúng UC, không tự suy diễn
202
+ Q&A từng câu một tới khi hết Gap chưa rõ → "APPROVED"
203
+ │ APPROVED
204
+
205
+ ⛩️ GATE 2 — Finalize & Approve [AI + BA/Dev]
206
+ AI quyết định single-file vs split (mặc định 1 file 1-1 với UC Spec,
207
+ chỉ split khi có tín hiệu đo được — fan-out business rule/module, quá nhiều flow, ~400 dòng)
208
+ AI ghi AK-Docs/02.BA-Specs/00.Requirements/[functionId]/System-Requirement_v{N}.md
209
+ (N khớp đúng version UC Spec đã trace, ghi trong header `UC-Spec-Version`)
210
+ Review → "APPROVED"
211
+
212
+
213
+ DONE — Coding Gate 1 (read-study-requirement) mới được phép chạy cho functionId này
214
+ ```
215
+
216
+ > **Entry point:** `ak use PROJ-33` → chọn taskType **"📐 Create System Requirement"** trong danh sách. Đây là bước bắt buộc, chạy 1 lần cho mỗi `functionId` (không phải mỗi ticket) — Coding Gate 1 sẽ tự chặn (`⏸️ Gate 1 cancelled`) nếu System Requirement chưa tồn tại hoặc chưa khớp UC Spec version hiện tại.
217
+
218
+ ---
219
+
220
+ ## Ingest Data Flow
221
+
222
+ ```
223
+ ak use <link hoặc paste text> (taskType: ingest-data) → claude
224
+
225
+
226
+ ⛩️ GATE 1 — Fetch, Classify, Draft [AI + PM/BrSE/Comtor]
227
+ Input: Backlog ticket/comment/Document/Wiki link · Jira ticket/comment link ·
228
+ SharePoint link (chưa có connector — fallback paste text) · text thô
229
+ AI resolve nguồn: `ak fetch-links <url>` (nếu là link) hoặc dùng text trực tiếp
230
+ AI phân loại: QnA-Log / Meetings-Log / Confirmations-Log (hỏi lại nếu chưa rõ)
231
+ AI soạn draft đầy đủ — kèm Nguồn / functionId / Người tổng hợp / Người approve tại nguồn
232
+ Hiển thị draft nguyên văn, lặp sửa theo yêu cầu tới khi → "APPROVED"
233
+ │ APPROVED
234
+
235
+ ⛩️ GATE 2 — Branch + Merge Request [AI, chờ xác nhận từng bước]
236
+ Ghi entry vào AK-Docs/01.QnA/{QnA-Log,Meetings-Log,Confirmations-Log}.md
237
+ `ak docs branch [functionId] [ticketId] --yes` — chỉ chạy sau khi user xác nhận
238
+ `ak docs submit --title "..." --yes` — chỉ chạy sau khi user xác nhận
239
+
240
+
241
+ DONE — chờ PM review & merge MR vào main (không tự merge)
242
+ ```
243
+
244
+ > **Entry point:** `ak use` → chọn taskType **"📥 Ingest Data"**, hoặc `ak use "<backlog/jira-url>"` rồi chọn taskType tương ứng. SharePoint chưa fetch được nội dung thật — paste trực tiếp nội dung comment/tài liệu vào chat thay vì dán link (xem `docs/internal/PM Workflow_v1.0.md` "Vấn đề 4").
245
+
246
+ ---
247
+
191
248
  ## Installation
192
249
 
193
250
  ```bash
@@ -590,6 +647,14 @@ Then run `ak update` or `ak sync-skills` to apply.
590
647
 
591
648
  > Summary of major changes per version. See full details in [CHANGELOG.md](docs/common/CHANGELOG.md).
592
649
 
650
+ ### v0.2.0 — 2026-08-04
651
+ - **New `create-system-requirement` task type (2-Gate):** bridges a UC Spec (BA) into a Dev-facing System Requirement scoped to a `functionId` (not a ticket) — Gate 1 investigates the UC + source code and drafts FR/NFR/Validation Rules/Exception Handling + Given/When/Then acceptance tests, Gate 2 finalizes and writes `AK-Docs/02.BA-Specs/00.Requirements/[functionId]/System-Requirement_v{N}.md`. Coding Gate 1 (`read-study-requirement`) now **blocks** with a Step 0 pre-check if this document is missing or stale against the current UC Spec version. See [Create System Requirement Flow](#create-system-requirement-flow).
652
+ - **New `ingest-data` task type (2-Gate) — for PM/BrSE/Comtor:** ingest a Backlog ticket/comment/Document/Wiki link, a Jira link, a SharePoint link, or pasted text into `AK-Docs/01.QnA/{QnA-Log,Meetings-Log,Confirmations-Log}.md`. Gate 1 fetches + classifies + drafts the entry for self-review; Gate 2 opens the branch + Merge Request via the existing `ak docs branch`/`ak docs submit`. SharePoint has no connector yet (no Microsoft Graph API/OAuth) — falls back to pasted text. See [Ingest Data Flow](#ingest-data-flow) and `docs/internal/PM Workflow_v1.0.md`.
653
+ - **`ak fetch-links` / `link-resolver.js` now fetch Backlog Document and Wiki links**, not just ticket/comment — `fetchBacklogDocument`, `fetchBacklogDocumentComment`, `fetchBacklogWiki`. Auto-resolution from a ticket description (`ak use`) still only follows ticket/comment links, capped at 5 — Document/Wiki/SharePoint are explicit single-URL lookups only.
654
+ - **`ak use` now captures `projectId`/`projectKey`** from the loaded Backlog/Jira ticket (`.aiflow/context/current.json` and `.aiflow/state.json`) — a first step toward letting a future "create ticket" flow default to the right Backlog/Jira project instead of asking every time.
655
+ - Fixed: **`ak use`'s "Task type:" selector crashed** (`CATEGORY_COLOR[cat] is not a function`) whenever it rendered the **"📐 Create System Requirement"** entry — the `"Dev"` category had no color mapping. Added.
656
+ - `docs/common/Docs-Management-Flow.md`'s branch+MR flow now explicitly covers `AK-Docs/01.QnA/`, not just `02.BA-Specs/`/`03.Testing/`/`04.Coding/`/`99.Memory/`.
657
+
593
658
  ### v0.1.9 — 2026-08-04
594
659
  - **Codex (OpenAI) support — `ak init --env codex`:** One install covers all three local Codex surfaces, which share the same `CODEX_HOME` config, skills and MCP setup: the **VS Code extension**, **Codex mode in the ChatGPT desktop app**, and the **`codex` CLI**. Generates `AGENTS.md`, `.codex/skills/` (all kit skills, auto-discovered — the kit's `SKILL.md` layout is already Codex-compatible), `.codex/config.toml` (MCP servers mirrored from `.mcp.json`), and `.aiflow/instructions/`.
595
660
  - **Four Codex entry-point skills:** `/ak-coding`, `/ak-create-spec`, `/ak-create-testcase`, `/ak-ask` — the same workflows Claude Code exposes as slash commands.
package/bin/aiflow.js CHANGED
@@ -22,6 +22,7 @@ const { record } = require('../scripts/telemetry/record');
22
22
  const { updateTaskGateState } = require('../scripts/task');
23
23
  const scaffoldPlaywrightCommand = require('../scripts/scaffold-playwright');
24
24
  const docsBranchCommand = require('../scripts/docs-branch');
25
+ const ticketWriterCommand = require('../scripts/ticket-writer');
25
26
  const semver = require('semver');
26
27
  const { execSync: execSyncChild, spawnSync } = require('child_process');
27
28
 
@@ -170,6 +171,11 @@ program
170
171
  .option('--cto <id>', 'load comments up to ID N', parseInt)
171
172
  .option('-F, --fast', 'fast mode: minimal Q&A, concise requirement doc (Default)')
172
173
  .option('-U, --full', 'full mode: force complete analysis with Q&A (default)')
174
+ .option('--task-type <type>', 'skip the interactive Task type prompt (e.g. feature, bug-fix)')
175
+ .option('--title <title>', 'manual entry: skip the interactive Title prompt')
176
+ .option('--description <description>', 'manual entry: skip the interactive Description prompt')
177
+ .option('--ticket-id <id>', 'manual entry: skip the interactive Ticket ID prompt')
178
+ .option('--preview', 'fetch a ticket/URL target and print its context as JSON to stdout — no save, no prompts')
173
179
  .addHelpText('after', `
174
180
  Examples:
175
181
  $ ak use PROJ-33 Single ticket (primary only)
@@ -180,6 +186,12 @@ Examples:
180
186
  $ ak use --file task.md Load from local file
181
187
  $ ak use --manual Manual entry
182
188
 
189
+ Non-interactive entry (v0.3.0+, for scripting/GUI callers):
190
+ $ ak use --manual --task-type feature --title "x" --description "y"
191
+ Manual entry, zero prompts
192
+ $ ak use PROJ-33 --task-type bug-fix Skip the Task type prompt after fetch
193
+ $ ak use PROJ-33 --preview Fetch only — print context JSON, no save/prompts
194
+
183
195
  Auto link resolution (v0.1.0+):
184
196
  Backlog/Jira URLs in the primary ticket description are auto-fetched and added
185
197
  to supplementaryContext[]. Comment links (#comment-456 or ?focusedCommentId=456)
@@ -195,17 +207,20 @@ Related:
195
207
  // ── fetch-links ───────────────────────────────────────────────
196
208
  program
197
209
  .command('fetch-links <url>')
198
- .description('Fetch a backlog/jira link and output SupplementaryContext JSON to stdout. Used by AI at runtime.')
210
+ .description('Fetch a backlog/jira/sharepoint link and output SupplementaryContext JSON to stdout. Used by AI at runtime.')
199
211
  .addHelpText('after', `
200
212
  Examples:
201
213
  $ ak fetch-links "https://company.backlog.com/view/PROJ-10"
202
214
  $ ak fetch-links "https://company.backlog.com/view/PROJ-10#comment-456"
215
+ $ ak fetch-links "https://company.backlog.com/document/98765" Backlog Document (ingest-data)
216
+ $ ak fetch-links "https://company.backlog.com/alias/wiki/1234" Backlog Wiki (ingest-data)
203
217
  $ ak fetch-links "https://company.atlassian.net/browse/PROJ-10"
204
218
  $ ak fetch-links "https://company.atlassian.net/browse/PROJ-10?focusedCommentId=789"
219
+ $ ak fetch-links "https://company.sharepoint.com/sites/proj/doc.docx" → { sourceType: "unsupported" }, no connector yet
205
220
 
206
221
  Exit codes:
207
- 0 Success — JSON written to stdout
208
- 1 URL not recognised, or fetch failed (error on stderr)
222
+ 0 Success — JSON written to stdout (including the SharePoint "unsupported" stub)
223
+ 1 URL not recognised at all, or fetch failed (error on stderr)
209
224
  `)
210
225
  .action(async (url) => {
211
226
  const { fetchLink } = require('../scripts/link-resolver');
@@ -214,7 +229,7 @@ Exit codes:
214
229
  try {
215
230
  const result = await fetchLink(url, credentials);
216
231
  if (!result) {
217
- process.stderr.write(`Not a recognized backlog/jira URL: ${url}\n`);
232
+ process.stderr.write(`Not a recognized backlog/jira/sharepoint URL: ${url}\n`);
218
233
  process.exit(1);
219
234
  }
220
235
  process.stdout.write(JSON.stringify(result, null, 2) + '\n');
@@ -224,6 +239,61 @@ Exit codes:
224
239
  }
225
240
  });
226
241
 
242
+ // ── backlog-projects ─────────────────────────────────────────
243
+ program
244
+ .command('backlog-projects')
245
+ .description('List Backlog projects in the configured space, and which one is the default for manually-created tasks')
246
+ .option('--json', 'output as JSON (for headless callers, e.g. the VS Code extension)')
247
+ .action((options) => {
248
+ useCommand.listBacklogProjectsCommand(options);
249
+ });
250
+
251
+ // ── backlog-set-default-project ──────────────────────────────
252
+ program
253
+ .command('backlog-set-default-project <id> <key>')
254
+ .description('Set the default Backlog project for tasks created manually (ak use --manual)')
255
+ .action((id, key) => {
256
+ useCommand.setDefaultBacklogProjectCommand(id, key);
257
+ });
258
+
259
+ // ── jira-projects ─────────────────────────────────────────────
260
+ program
261
+ .command('jira-projects')
262
+ .description('List Jira projects visible to the configured account, and the default for task-creation')
263
+ .option('--json', 'output as JSON (for headless callers, e.g. the VS Code extension)')
264
+ .action((options) => {
265
+ useCommand.listJiraProjectsCommand(options);
266
+ });
267
+
268
+ // ── jira-set-default-project ─────────────────────────────────
269
+ program
270
+ .command('jira-set-default-project <key>')
271
+ .description('Set the default Jira project for tasks created from Meeting Minutes/QnA (ingest-data Gate 3)')
272
+ .action((key) => {
273
+ useCommand.setDefaultJiraProjectCommand(key);
274
+ });
275
+
276
+ // ── tasks (Vấn đề 5 — sinh task từ feedback/meeting minutes) ──
277
+ const tasksCmd = program.command('tasks').description('Turn an AI-proposed, PM-approved task list into real tickets (ingest-data Gate 3)');
278
+
279
+ tasksCmd
280
+ .command('create-tickets <file>')
281
+ .description('Create Backlog/Jira tickets from a JSON task list — see scripts/ticket-writer.js for the input shape')
282
+ .option('--json', 'machine-readable output only')
283
+ .action((file, options) => {
284
+ ticketWriterCommand.createTicketsCommand(file, options);
285
+ });
286
+
287
+ // ── credentials ───────────────────────────────────────────────
288
+ const credentialsCmd = program.command('credentials').description('Manage supplementary credentials (WRITE keys, default projects) not covered by `ak init --adapter`');
289
+
290
+ credentialsCmd
291
+ .command('set <key> <value>')
292
+ .description(`Save a credential value (allowed keys: ${ticketWriterCommand.SETTABLE_CREDENTIAL_KEYS.join(', ')})`)
293
+ .action((key, value) => {
294
+ ticketWriterCommand.setCredentialCommand(key, value);
295
+ });
296
+
227
297
  // ── prompt ────────────────────────────────────────────────────
228
298
  program
229
299
  .command('prompt [type]')
@@ -0,0 +1,36 @@
1
+ # Ngôn ngữ Output — Auto-detect theo Input
2
+
3
+ > File này là quy tắc dùng chung cho **tất cả** các skill trong `custom/skills/` (BA, Dev, QA, ML) có sinh file markdown output (requirement, plan, test-analysis, checklist, testcase, report, review, UC Spec, v.v.).
4
+ > Mọi skill sinh markdown output PHẢI đọc file này trước khi viết, thay cho việc mặc định cố định tiếng Anh hoặc tiếng Việt.
5
+
6
+ ## Quy tắc
7
+
8
+ Ngôn ngữ của output PHẢI khớp với ngôn ngữ của input — không dùng một ngôn ngữ mặc định cố định cho mọi task.
9
+
10
+ **Xác định ngôn ngữ input theo thứ tự ưu tiên** (dùng nguồn đầu tiên có sẵn):
11
+
12
+ 1. Tester/dev chỉ định rõ ngôn ngữ output (ví dụ: "viết bằng tiếng Anh giúp tôi") → dùng đúng ngôn ngữ đó, bỏ qua các bước dưới.
13
+ 2. Title + description của ticket đang xử lý — từ `.aiflow/context/current.json` (fetch qua Backlog/Jira, hoặc nhập qua `ak use --manual`).
14
+ 3. Nếu skill đang mở rộng/tiếp nối một tài liệu đã có sẵn (UC Spec, System Requirement, plan, testcase set của gate trước) và không có ticket text mới — dùng ngôn ngữ của tài liệu đó.
15
+
16
+ **Kết luận:**
17
+ - Input chủ yếu là **tiếng Việt** (có dấu, từ vựng tiếng Việt) → viết **toàn bộ** output bằng tiếng Việt: heading, mô tả, tóm tắt, câu hỏi clarify, nội dung bảng, v.v.
18
+ - Ngược lại (tiếng Anh hoặc ngôn ngữ khác) → **mặc định tiếng Anh**.
19
+
20
+ Nếu một task có nhiều gate (Gate 1 → Gate N) hoặc nhiều phase, ngôn ngữ được xác định **một lần** ở bước đầu tiên (đọc ticket/input) và giữ nguyên xuyên suốt các gate/phase sau, trừ khi tester/dev đổi ý.
21
+
22
+ ## Không đổi ngôn ngữ (giữ nguyên bất kể input)
23
+
24
+ - Code, command, file path, tên biến/hàm/class/API.
25
+ - Table column headers / field keys mang tính cấu trúc, dùng để tham chiếu chéo giữa các gate (ví dụ `TC_ID`, `Priority`, `Status`, `Gate N`) — theo quy ước hiện có ở `custom/skills/test-skills/rules/qa-writing-standards.md`.
26
+ - Từ khóa điều khiển flow: `APPROVED`, `RETEST`, tên skill, tên file/thư mục chuẩn (`test-analysis.md`, `checklist.md`, ...).
27
+ - Ticket ID, YAML frontmatter keys.
28
+
29
+ ## Cách trích dẫn quy tắc này trong một SKILL.md
30
+
31
+ Thêm 1 dòng ngắn ngay gần bước xác định output đầu tiên của skill:
32
+
33
+ ```
34
+ Output language: auto-detect từ ticket/task input — xem `custom/rules/output-language.md`
35
+ (input tiếng Việt → output tiếng Việt; ngược lại mặc định tiếng Anh).
36
+ ```
@@ -50,6 +50,22 @@
50
50
 
51
51
  ---
52
52
 
53
+ ## ingest-data Workflow Output Paths (`AK-Docs/01.QnA/`)
54
+
55
+ Áp dụng cho taskType `ingest-data` (PM/BrSE/Comtor ingest communication — xem `.claude/skills/ingest-data/SKILL.md`). Khác với các taskType coding/gen-doc ở trên: **không** ghi vào `04.Coding/`, và **không** theo cấu trúc `[functionId]/[ticketId].md` — cả 3 file dưới đây là log dùng chung, phẳng, cho toàn dự án (append entry mới, không tạo file theo ticket):
56
+
57
+ | Log | Path | Ghi khi nào |
58
+ |---|---|---|
59
+ | QnA-Log | `AK-Docs/01.QnA/QnA-Log.md` | Trao đổi hỏi-đáp thông thường (file có sẵn — thêm cột `Nguồn` nếu chưa có) |
60
+ | Meetings-Log | `AK-Docs/01.QnA/Meetings-Log.md` | Tổng hợp 1 buổi họp — tạo file nếu chưa có |
61
+ | Confirmations-Log | `AK-Docs/01.QnA/Confirmations-Log.md` | Mốc khách CHỐT chính thức — tạo file nếu chưa có |
62
+
63
+ `functionId` cho Gate 2 (đặt tên branch `feature/[functionId]/[ticketId]`) vẫn theo đúng quy tắc "functionId & ticketId" ở trên — không suy ra được thì dùng `general` (tương tự gen-doc dùng `AD-HOC`).
64
+
65
+ > **Chưa đổi tên thư mục** `01.QnA/` thành `01.Communications/` như phương án đang chờ PM chốt trong `docs/internal/PM Workflow_v1.0.md` — giữ nguyên tên hiện có để không phá vỡ project đang chạy; đổi tên (nếu PM chốt) là 1 task migration riêng.
66
+
67
+ ---
68
+
53
69
  ## Execution Handoff Message
54
70
 
55
71
  When `writing-plans` skill says to announce the saved path, use the **actual path**:
@@ -235,5 +235,5 @@ Xem report:
235
235
 
236
236
  - **Gate trước khi sinh code** (Phase 2) là bắt buộc — tránh sinh sai hàng loạt.
237
237
  - **Selector phải đến từ DOM thật** (Phase 3) — đây là lý do tồn tại của skill này.
238
- - Viết test case, tên test, comment bằng **tiếng Việt** cho khớp draft của tester.
238
+ - Tên test, comment viết theo ngôn ngữ của draft test case của tester (xem `custom/rules/output-language.md`) — draft tiếng Việt tiếng Việt, draft tiếng Anh → tiếng Anh.
239
239
  - Nếu app yêu cầu đăng nhập trước, hỏi tester credentials test (đừng hardcode tài khoản thật).
@@ -3,6 +3,8 @@
3
3
  ## 1. Mục đích (Purpose)
4
4
  Kỹ năng này giúp BA bóc tách, chuẩn hóa và đặc tả các quy tắc nghiệp vụ (Business Rules - BR) của hệ thống một cách chặt chẽ nhất. Các quy tắc nghiệp vụ được định nghĩa chi tiết tại đây sẽ là căn cứ trực tiếp để lập trình viên viết code logic (backend/frontend) và kiểm thử viên viết các kịch bản kiểm thử (Test Cases), đảm bảo bao phủ toàn bộ các trường hợp biên và ngoại lệ.
5
5
 
6
+ Ngôn ngữ output: auto-detect theo ngôn ngữ của ticket/task input — xem `custom/rules/output-language.md` (input tiếng Việt → output tiếng Việt; ngược lại mặc định tiếng Anh).
7
+
6
8
  ## 2. Kiến thức cần có (Prerequisite Knowledge)
7
9
  - **Các loại Business Rules phổ biến:**
8
10
  - *Validation Rules (Quy tắc kiểm tra dữ liệu):* Bao gồm kiểm tra rỗng (Required), kiểm tra định dạng (Format - Regex, Email, số điện thoại), kiểm tra độ dài/giới hạn (Length/Range), và kiểm tra ràng buộc chéo giữa các trường (Dependency validation - ví dụ: Ngày kết thúc phải sau Ngày bắt đầu).
@@ -3,6 +3,8 @@
3
3
  ## 1. Mục đích (Purpose)
4
4
  Kỹ năng này giúp Business Analyst (hoặc Agent) quét, đọc hiểu và cấu trúc hóa các yêu cầu thô được cung cấp bởi khách hàng hoặc các stakeholders. Mục tiêu là phân tách rõ ràng giữa các thông tin thực tế (Facts) và các giả định (Assumptions), phát hiện các khoảng trống nghiệp vụ (Gaps), và tạo cơ sở cho việc lập danh sách câu hỏi làm rõ (Q&A) cũng như dự thảo spec ban đầu.
5
5
 
6
+ Ngôn ngữ output: auto-detect theo ngôn ngữ của ticket/task input — xem `custom/rules/output-language.md` (input tiếng Việt → output tiếng Việt; ngược lại mặc định tiếng Anh).
7
+
6
8
  ## 2. Kiến thức cần có (Prerequisite Knowledge)
7
9
  - **Tư duy phân tích (Analytical Thinking):** Khả năng chia nhỏ một yêu cầu lớn thành các luồng nghiệp vụ nhỏ và các thành phần cấu thành.
8
10
  - **Phân biệt Fact vs. Assumption:**
@@ -3,6 +3,8 @@
3
3
  ## 1. Mục đích (Purpose)
4
4
  Kỹ năng này giúp BA chuyển đổi các đặc tả luồng nghiệp vụ văn bản (Main flow, Alternative flows, Exception flows) thành một sơ đồ hoạt động trực quan (Activity Diagram) sử dụng mã nguồn Mermaid. Sơ đồ này giúp lập trình viên nắm bắt luồng đi tổng thể của hệ thống một cách tức thì và giúp kiểm thử viên xác minh các nhánh rẽ của kịch bản.
5
5
 
6
+ Ngôn ngữ output: auto-detect theo ngôn ngữ của ticket/task input — xem `custom/rules/output-language.md` (input tiếng Việt → output tiếng Việt; ngược lại mặc định tiếng Anh).
7
+
6
8
  ## 2. Kiến thức cần có (Prerequisite Knowledge)
7
9
  - **Cấu trúc biểu đồ Flowchart trong Mermaid:**
8
10
  - Khai báo hướng biểu đồ: Dùng `graph TD` (Top-Down - từ trên xuống) hoặc `graph LR` (Left-to-Right - từ trái sang phải). Đối với quy trình nghiệp vụ phần mềm, khuyến nghị dùng `graph TD`.
@@ -3,6 +3,8 @@
3
3
  ## 1. Mục đích (Purpose)
4
4
  Kỹ năng này giúp BA thiết kế các câu hỏi rõ ràng, khách quan và chuyên nghiệp để gửi tới khách hàng/stakeholders nhằm làm rõ các khoảng trống nghiệp vụ (Gaps). Đồng thời, hướng dẫn cách tiếp nhận câu trả lời để cập nhật tài liệu phân tích một cách nhất quán, tránh hiểu sai hoặc tự ý giả định thông tin.
5
5
 
6
+ Ngôn ngữ output: auto-detect theo ngôn ngữ của ticket/task input — xem `custom/rules/output-language.md` (input tiếng Việt → output tiếng Việt; ngược lại mặc định tiếng Anh).
7
+
6
8
  ## 2. Kiến thức cần có (Prerequisite Knowledge)
7
9
  - **Kỹ năng giao tiếp bằng văn bản (Written Communication):** Sử dụng câu từ ngắn gọn, lịch sự, đi thẳng vào vấn đề.
8
10
  - **Kỹ thuật đặt câu hỏi mở và đóng:**
@@ -3,6 +3,8 @@
3
3
  ## 1. Mục đích (Purpose)
4
4
  Kỹ năng này hướng dẫn BA thiết kế và hiện thực hóa giao diện người dùng (UI mockup/prototype) dưới dạng mã nguồn HTML/CSS tự chứa (self-contained). Prototype giúp khách hàng hình dung trực quan luồng đi của màn hình, đồng thời giúp lập trình viên và kiểm thử viên xác định chính xác cấu trúc trang, ID của các phần tử và vị trí hiển thị lỗi.
5
5
 
6
+ Ngôn ngữ output: auto-detect theo ngôn ngữ của ticket/task input — xem `custom/rules/output-language.md` (input tiếng Việt → output tiếng Việt; ngược lại mặc định tiếng Anh).
7
+
6
8
  ## 2. Kiến thức cần có (Prerequisite Knowledge)
7
9
  - **HTML5 Semantic Tags:** Sử dụng các thẻ ngữ nghĩa như `<header>`, `<main>`, `<section>`, `<nav>`, `<form>`, `<input>`, `<button>`, `<label>` để trang web có cấu trúc chuẩn SEO và dễ kiểm thử.
8
10
  - **Vanilla CSS Layouts:** Thành thạo Flexbox và CSS Grid để dựng bố cục nhanh chóng, đáp ứng tốt trên các kích thước màn hình khác nhau (Responsive).
@@ -3,6 +3,8 @@
3
3
  ## 1. Mục đích (Purpose)
4
4
  Kỹ năng này giúp BA chuyển hóa toàn bộ các thông tin yêu cầu nghiệp vụ đã được thống nhất sau quá trình Q&A thành một tài liệu Đặc tả Use Case (Use Case Spec) hoàn chỉnh. Tài liệu này là "nguồn sự thật duy nhất" (Single Source of Truth) giúp đội ngũ Dev lập trình chính xác và đội ngũ Test thiết kế toàn bộ kịch bản kiểm thử (Test Cases/Scripts).
5
5
 
6
+ Ngôn ngữ output: auto-detect theo ngôn ngữ của ticket/task input — xem `custom/rules/output-language.md` (input tiếng Việt → output tiếng Việt; ngược lại mặc định tiếng Anh).
7
+
6
8
  ## 2. Kiến thức cần có (Prerequisite Knowledge)
7
9
  - **Cấu trúc Use Case chuẩn:** Hiểu rõ các thành phần của một Use Case Spec bao gồm: Thông tin chung, Mô tả màn hình, Mô tả thành phần UI, Luồng hoạt động (Activity Flow) và Quy tắc nghiệp vụ (Business Rules).
8
10
  - **Cách mô tả Luồng xử lý (Flow):**
@@ -93,6 +93,8 @@ Consolidate toàn bộ TCs (sau khi apply actions) vào **1 file duy nhất**:
93
93
 
94
94
  Lưu `test-plan/test-cases/final-testcases.md`:
95
95
 
96
+ Ngôn ngữ output: auto-detect theo ngôn ngữ của ticket/testcase input — xem `custom/rules/output-language.md` và `custom/skills/test-skills/rules/qa-writing-standards.md` (input tiếng Việt → output tiếng Việt; ngược lại mặc định tiếng Anh; tiêu đề cột bảng vẫn giữ tiếng Anh).
97
+
96
98
  ```markdown
97
99
  # Final Test Cases — [Feature Name]
98
100
 
@@ -0,0 +1,252 @@
1
+ ---
2
+ name: create-system-requirement
3
+ description: Bridges UC Spec (BA, Gate 4) to Dev — investigates source code and translates the UC into System Requirement (Functional/Non-Functional Requirements, Business Rules → Validation Rules, Exception/Error Handling, Acceptance Tests). Runs once per functionId per UC Spec version, ideally BEFORE the first coding ticket. Gate 1 (`read-study-requirement`) warns (non-blocking) if this is missing or out of sync with the current UC Spec version — this skill is how DEV closes that gap.
4
+ keywords: system requirement, uc spec, functionId, trace, acceptance test, exception handling, business rule, matching, version sync
5
+ ---
6
+
7
+ # Create System Requirement — Bridge Gate (before Gate 1)
8
+
9
+ > **Runs once per functionId per UC Spec version — NOT per ticket.**
10
+ >
11
+ > Principle: System Requirement is the Dev-facing translation of UC Spec (User Requirement). It must trace 1-1 to a specific UC Spec version, cover the full UC (flows, business rules, exceptions, acceptance criteria), and never invent content the UC Spec doesn't support. If anything is unclear, ask until it's Confirmed — do not guess.
12
+
13
+ ---
14
+
15
+ ## Trigger
16
+
17
+ `create-system-requirement` is its own **task type** — 2 gates, selectable in the "Task type:" prompt of `ak use` (or auto-detected by `aiflow prompt "..."` — see `scripts/detect.js`). It is not invoked inline from within a coding ticket's session; it runs as its own task, tied to the `functionId` (not to a coding ticket).
18
+
19
+ - **Gate 1** = Steps 0–4 below (resolve UC Spec, investigate source code, draft, Q&A until every Gap is Confirmed).
20
+ - **Gate 2** = Steps 5–7 below (split decision, write output, present for APPROVED).
21
+
22
+ **Hand-off from coding Gate 1 Pre-flight** (`read-study-requirement`, Step 0) when:
23
+ - No `System-Requirement_v*.md` exists yet for this `functionId`, **or**
24
+ - The existing one's `UC-Spec-Version` header does not match the UC Spec's current version, **or**
25
+ - It exists and matches but its `Status` header is not `✅ Approved`.
26
+
27
+ Any of these → coding Gate 1 shows a ⚠️ non-blocking warning and **continues** (it does not cancel). DEV can close the gap at any point — before or after the current ticket — by starting a new task with `ak use`, picking **"📐 Create System Requirement"** at the Task type prompt, and running it through both gates to APPROVED.
28
+
29
+ ---
30
+
31
+ ## Steps
32
+
33
+ > Steps 0–4 = **Gate 1** (investigate & draft). Steps 5–7 = **Gate 2** (finalize & approve). Run `aiflow task next` between them like any other gated task.
34
+
35
+ ### Step 0: Pre-flight — Resolve functionId & Versions [Gate 1]
36
+
37
+ 0. `git status --porcelain` → clean tree → `git pull --ff-only`; dirty tree → skip pull, notify DEV (same rule as `read-study-requirement` Step 1.0).
38
+ 1. Resolve `functionId` from `.aiflow/context/current.json` (or ask DEV once if absent).
39
+ 2. Locate the current UC Spec: `AK-Docs/02.BA-Specs/04.UC-Specs/[functionId]/UC-Spec_v{N}.md` (highest non-archived version). **Not found → STOP.** Tell DEV the UC Spec must exist and be BA-signed-off before System Requirement can be created — this skill never fabricates a UC.
40
+ 3. Check `AK-Docs/02.BA-Specs/00.Requirements/[functionId]/System-Requirement_v*.md`:
41
+ - **None exists** → Mode = `CREATE` (go to Step 1).
42
+ - **Exists, `UC-Spec-Version` matches current UC Spec version** → nothing to do — this task is not needed; tell DEV the coding Gate 1 (`read-study-requirement`) can proceed directly.
43
+ - **Exists, `UC-Spec-Version` is older** → Mode = `RESYNC` (go to Step 1, but Step 3 diffs against the existing file instead of starting blank).
44
+
45
+ ---
46
+
47
+ ### Step 1: Read UC Spec (full) [Gate 1]
48
+
49
+ Read all 5 sections of the UC Spec end-to-end — General Info + Main/Alternative/Exception Flows, Screen Description, UI Components, Activity Diagram, Business Rules (BR1 Validation / BR2 Saving / BR3 Authorization, or whatever domains the BA defined). Do not skim — every Functional Requirement, Validation Rule, Exception, and Acceptance Test written later must trace back to something read here.
50
+
51
+ `RESYNC` mode: also read the previous `System-Requirement_v{N-1}.md` in full — it's the diff baseline for Step 3.
52
+
53
+ ---
54
+
55
+ ### Step 2: Investigate Source Code [Gate 1]
56
+
57
+ Same methodology as `read-study-requirement` Step 1 (steps 4–5), reused here:
58
+ - Read `CLAUDE.md` for architecture/conventions.
59
+ - Find modules/files that implement or would implement this UC's Main Flow (existing feature being extended, or nearest analogous feature for a new one).
60
+ - **If GitNexus MCP available:** `gitnexus: query()` / `gitnexus: context()` for the relevant area — same token-saving shortcut as `read-study-requirement`.
61
+ - Identify **existing error-handling conventions** (error code format, message structure, exception class hierarchy) — the Exception & Error Handling section (Step 4 below) must reuse these, not invent a new convention.
62
+ - Identify **existing data model / API surface** touched by this UC (tables, DTOs, endpoints) — feeds Section 6 of the output.
63
+
64
+ This step exists so System Requirement reflects what the system *can actually do today*, not just what the UC Spec says in the abstract.
65
+
66
+ ---
67
+
68
+ ### Step 3: Draft Content — Translate UC → System Requirement [Gate 1]
69
+
70
+ For every row in the UC Spec's Main Flow, Alternative/Exception Flows, and Business Rules, produce at least one corresponding item below, and record the UC reference it came from. Nothing goes into the draft without a traced source (UC Spec) or a confirmed answer from DEV — no invented content.
71
+
72
+ - **Functional Requirements** — one per distinct system behavior in Main/Alternative Flow steps.
73
+ - **Non-Functional Requirements** — from BR3-type rules (security, authz) or explicit constraints in the UC Spec / ticket context; do not invent performance/scale numbers that aren't stated anywhere — mark as Gap and ask instead.
74
+ - **Business Rules → Validation Rules** — translate each BR into a concrete system-level rule, cross-referenced with the existing pattern found in Step 2 (or flagged if no existing pattern applies).
75
+ - **Exception & Error Handling** — one per Exception Flow, using the error-handling convention found in Step 2.
76
+ - **Acceptance Test Scenarios** — Given/When/Then, at least one per Main Flow outcome + one per Alternative/Exception Flow. This is the concrete deliverable requested by proposal #1 (acceptance tests generated from the spec, not copied from the ticket).
77
+
78
+ **`RESYNC` mode:** diff the new UC Spec version against the previous one section by section; carry forward unchanged items, mark changed/removed items, draft new items only for the delta. Never silently drop an item without noting why in the Change Log.
79
+
80
+ Classify every item as **Fact** (explicit in UC Spec or confirmed in code) / **Assumption** (inferred, unconfirmed) / **Gap** (missing entirely) — same convention as `read-study-requirement` Step 1.75.
81
+
82
+ ---
83
+
84
+ ### Step 4: Clarify via Q&A (ask until Confirmed) [Gate 1]
85
+
86
+ - Ask **one question at a time**, prioritizing unresolved Assumptions/Gaps from Step 3.
87
+ - **Do not run `aiflow task next` into Gate 2 while any Gap remains unresolved.** This is the hard rule from proposal #7 — no fabrication, no "reasonable default" for missing UC content. If DEV genuinely cannot answer (needs BA), stop and record it as an open item in Section 8 rather than guessing.
88
+ - Do NOT invoke `superpowers:brainstorming` (same reason as `read-study-requirement`: its terminal state bypasses this gate's approval).
89
+ - All Gaps Confirmed → present a short Gate 1 summary, wait for DEV to run `aiflow task next` before continuing to Step 5.
90
+
91
+ ---
92
+
93
+ ### Step 5: Decide Single File vs Split [Gate 2]
94
+
95
+ **Default: one file.** `System-Requirement_v{N}.md` mirrors `UC-Spec_v{N}.md` 1-1 — most UCs stay a single, reviewable document. Split is the exception, triggered by any ONE of:
96
+
97
+ | Signal | Threshold | Split by |
98
+ |---|---|---|
99
+ | Business-rule domain fan-out | 2+ BR domains (e.g. Validation, Authorization) each with 8+ concrete rules, touching different system layers | One sub-file per domain |
100
+ | Module/service fan-out | Step 2 investigation shows 3+ separately deployable modules/services with little shared logic (e.g. separate microservice + separate batch job) | One sub-file per module |
101
+ | Flow-count overload | 6+ Alternative/Exception flows AND draft would exceed ~300 lines | Split Exception & Error Handling into its own sub-file; keep Functional Requirements + Acceptance Tests together |
102
+ | Size ceiling | Draft exceeds ~400 lines even without the above | Split along whichever axis (domain or module) holds the most content — never split by raw line count alone with no semantic seam |
103
+
104
+ **Anti-pattern — do not split for this, escalate instead:** if the UC Spec itself reads like 2+ independent use cases bundled together (no shared Business Rule, no shared data entity, could be tested/shipped separately) → **stop, do not split System Requirement to cope.** Flag to BA that the UC Spec's granularity may need revisiting (per the kit's own convention, 1 UC should be 1 Function-ID). Splitting Dev's document to paper over a BA-side granularity problem just hides it.
105
+
106
+ **When split occurs:** keep one master `System-Requirement_v{N}.md` as the index — holds header/metadata, the full Traceability Matrix, links to each sub-file, and the Change Log. Sub-files: `System-Requirement_v{N}_[Domain].md` (e.g. `_Validation.md`, `_BackendAPI.md`). The mandatory `UC-Spec-Version` header lives on the master file only.
107
+
108
+ ---
109
+
110
+ ### Step 6: Write Output [Gate 2]
111
+
112
+ Save to `AK-Docs/02.BA-Specs/00.Requirements/[functionId]/System-Requirement_v{N}.md` (`N` = the UC Spec version this was traced against — **not** an independent counter):
113
+
114
+ ```markdown
115
+ # System Requirement: [functionId] — [Feature Name]
116
+
117
+ **Date:** [YYYY-MM-DD]
118
+ **System-Requirement-Version:** v{N}
119
+ **UC-Spec-Version:** [functionId] @ v{N} <!-- MANDATORY — the 1-1 matching anchor -->
120
+ **Source UC Spec:** AK-Docs/02.BA-Specs/04.UC-Specs/[functionId]/UC-Spec_v{N}.md
121
+ **Status:** ⏸️ Waiting for Approval
122
+
123
+ ---
124
+
125
+ ## 0. Traceability Matrix
126
+ | UC Reference (Flow / BR) | System Requirement Item(s) |
127
+ |---|---|
128
+ | Main Flow step 3 | FR-01 |
129
+ | Exception Flow B | FR-05, ER-02 |
130
+ | BR1.1 | VR-01 |
131
+
132
+ ## 1. Functional Requirements
133
+ | ID | Requirement | Traced UC Ref | Type |
134
+ |---|---|---|---|
135
+ | FR-01 | ... | Main Flow #3 | Fact |
136
+
137
+ ## 2. Non-Functional Requirements
138
+ | ID | Requirement | Traced UC Ref | Type |
139
+ |---|---|---|---|
140
+ | NFR-01 | ... | BR3.1 | Fact |
141
+
142
+ ## 3. Business Rules → Validation Rules
143
+ | ID | System-level Rule | Traced UC BR | Existing Code Pattern |
144
+ |---|---|---|---|
145
+ | VR-01 | ... | BR1.1 | [file:line] |
146
+
147
+ ## 4. Exception & Error Handling
148
+ | ID | Trigger Condition | System Behavior | Traced Exception Flow | Error Convention Used |
149
+ |---|---|---|---|---|
150
+ | ER-01 | ... | ... | Exception Flow B | [existing error code/class] |
151
+
152
+ ## 5. Acceptance Test Scenarios
153
+ ### AT-01: [Scenario] (Main Flow)
154
+ - **Given** ...
155
+ - **When** ...
156
+ - **Then** ...
157
+
158
+ ### AT-02: [Scenario] (Exception Flow B)
159
+ ...
160
+
161
+ ## 6. Existing System Context
162
+ ### Related Modules / Files
163
+ | File | Role | Current Behavior |
164
+ |---|---|---|
165
+
166
+ ### Data / API Impact
167
+ | Entity / Endpoint | Change Type | Note |
168
+ |---|---|---|
169
+
170
+ ## 7. Facts / Assumptions / Gaps
171
+ | Type | Item | Resolution |
172
+ |---|---|---|
173
+
174
+ ## 8. Open Questions Log
175
+ [Question asked → answer received → date. Unresolved Gaps stay listed here, never silently dropped.]
176
+
177
+ ## 9. Change Log
178
+ | Date | Ticket | Change | Note |
179
+ |---|---|---|---|
180
+ | [YYYY-MM-DD] | — | Initial creation from UC Spec v{N} | |
181
+ ```
182
+
183
+ Output language: auto-detect from the ticket/task input — see `custom/rules/output-language.md` (Vietnamese input → Vietnamese output; otherwise English).
184
+
185
+ ---
186
+
187
+ ### Step 7: Present for Approval [Gate 2]
188
+
189
+ ```
190
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
191
+ ⏸️ GATE 2: SYSTEM REQUIREMENT READY
192
+
193
+ FunctionId: [functionId]
194
+ UC Spec: v{N} (AK-Docs/02.BA-Specs/04.UC-Specs/[functionId]/UC-Spec_v{N}.md)
195
+ File: AK-Docs/02.BA-Specs/00.Requirements/[functionId]/System-Requirement_v{N}.md
196
+ Mode: CREATE | RESYNC
197
+
198
+ Coverage:
199
+ Functional Requirements: [N] Acceptance Tests: [N]
200
+ Validation Rules: [N] Exception Handling: [N]
201
+ Open Gaps: [N] ← must be 0 to approve
202
+
203
+ Please review — matching 1-1 with UC Spec v{N} is the point of this document.
204
+ → Type APPROVED (then run `aiflow task next`) to close this task and clear
205
+ the Gate 1 warning for tickets on this functionId
206
+ → Or provide feedback to update
207
+
208
+ ⚠️ Until this task is APPROVED, coding Gate 1 for this functionId will keep
209
+ showing a non-blocking warning (it does not cancel).
210
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
211
+ ```
212
+
213
+ - Any Gap still open → cannot approve; go back to Step 4 (re-open Gate 1).
214
+ - DEV feedback → update draft → re-show prompt.
215
+ - `APPROVED` → write `Status: ✅ Approved`, task is done — coding Gate 1 unlocks.
216
+
217
+ ---
218
+
219
+ ### Step 8: Later Update (invoked from inside coding Gate 1, not standalone)
220
+
221
+ `read-study-requirement` Step 3 (end of Gate 1, per ticket) may discover a case, rule, or exception that the UC Spec supports but the current System Requirement missed. That step **proposes** an addition — presents the diff to DEV, does not write directly — and on confirmation appends it to the master file's relevant section plus a `Change Log` row (`Ticket: [ticketId]`). This skill owns the template/contract for that row; `read-study-requirement` owns triggering it.
222
+
223
+ This does not bump `System-Requirement-Version` — the version stays tied to the UC Spec version. Only a new UC Spec version triggers `RESYNC` (Step 0).
224
+
225
+ ---
226
+
227
+ ## What This Skill Delegates vs Owns
228
+
229
+ | Concern | Handled by |
230
+ |---|---|
231
+ | Source code investigation methodology | `read-study-requirement` Step 1 pattern (reused inline) / GitNexus MCP |
232
+ | Fact/Assumption/Gap classification | This skill (inline, same convention as `read-study-requirement` Step 1.75) |
233
+ | Q&A loop (one question at a time, no fabrication) | This skill (inline) |
234
+ | UC Spec structure/content | `skill-ba-uc-template-v1.md` (read-only reference, never edited by this skill) |
235
+ | Split decision | This skill (Step 5) |
236
+ | Mid-ticket addition proposals | `read-study-requirement` Step 3 triggers; this skill owns the write contract |
237
+ | Gate/approval mechanics | This skill (Step 7) |
238
+
239
+ ---
240
+
241
+ ## Mandatory Rules
242
+
243
+ - ❌ **DO NOT** create System Requirement content that isn't traced to the UC Spec or a DEV-confirmed answer — no invented Functional Requirements, error messages, or NFR numbers.
244
+ - ❌ **DO NOT** proceed to Step 5 while any Gap is unresolved.
245
+ - ❌ **DO NOT** split into multiple files unless a Step 5 threshold is actually met — default is one file.
246
+ - ❌ **DO NOT** split to paper over a UC Spec that bundles multiple independent use cases — escalate to BA instead.
247
+ - ❌ **DO NOT** run this skill if the UC Spec isn't BA-signed-off yet — this skill never substitutes for missing UC Spec content.
248
+ - ❌ **DO NOT** bump `System-Requirement-Version` independently of the UC Spec version.
249
+ - ✅ **MUST** read the full UC Spec (Step 1) before drafting anything.
250
+ - ✅ **MUST** investigate source code (Step 2) before drafting Exception/Error Handling or Existing System Context.
251
+ - ✅ **MUST** carry the mandatory `UC-Spec-Version` header on the master file.
252
+ - ✅ **MUST** surface a ⚠️ non-blocking warning (never a cancel) from the Gate 1 Pre-flight check until this skill reaches APPROVED.
@@ -73,6 +73,8 @@ Update the model card drafted at Gate 4 with:
73
73
 
74
74
  The model card is the primary audit document for the deployed model.
75
75
 
76
+ Output language: auto-detect from the ticket/task input — see `custom/rules/output-language.md` (Vietnamese input → Vietnamese output; otherwise English).
77
+
76
78
  ### 6. Create the PR
77
79
 
78
80
  Invoke `superpowers:requesting-code-review`. Open a PR that includes: serving code, model card, monitoring plan, and any pipeline changes. Link the ticket. Reference the eval report and the registered artifact version in the PR description.
@@ -73,6 +73,8 @@ An open-ended experiment loop with no stopping rule is out of scope for a gated
73
73
 
74
74
  Write all of the above to `AK-Docs/04.Coding/02.Plans/[functionId]/[ticketId].md` (see `custom/rules/ml-conventions.md` — do NOT use the legacy `plan/[ticket-id]/` path). The document must be self-contained: a developer who did not attend the framing discussion should be able to reproduce the full experiment sequence from the plan alone.
75
75
 
76
+ Output language: auto-detect from the ticket/task input — see `custom/rules/output-language.md` (Vietnamese input → Vietnamese output; otherwise English).
77
+
76
78
  ---
77
79
 
78
80
  ## Completion Checklist
@@ -78,6 +78,8 @@ Output `AK-Docs/04.Coding/04.Reviews/[functionId]/[ticketId].md` (see `custom/ru
78
78
 
79
79
  Draft a model card covering: intended use, training data description, evaluation metrics and their context, known limitations, and owner/contact.
80
80
 
81
+ Output language: auto-detect from the ticket/task input — see `custom/rules/output-language.md` (Vietnamese input → Vietnamese output; otherwise English).
82
+
81
83
  ---
82
84
 
83
85
  ## Completion Checklist