@relipa/ai-flow-kit 0.2.0-beta.0 → 0.2.0-beta.2
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.
- package/bin/aiflow.js +64 -4
- package/custom/rules/output-language.md +36 -0
- package/custom/skills/automation-testing/SKILL.md +1 -1
- package/custom/skills/ba-skills/skill-ba-build-business-rules-v1.md +2 -0
- package/custom/skills/ba-skills/skill-ba-initial-analysis-template-v1.md +7 -5
- package/custom/skills/ba-skills/skill-ba-initial-analysis-v1.md +8 -1
- package/custom/skills/ba-skills/skill-ba-mermaid-flowchart-v1.md +2 -0
- package/custom/skills/ba-skills/skill-ba-qna-template-v1.md +6 -5
- package/custom/skills/ba-skills/skill-ba-qna-v1.md +19 -5
- package/custom/skills/ba-skills/skill-ba-ui-prototype-v1.md +2 -0
- package/custom/skills/ba-skills/skill-ba-write-uc-spec-v1.md +2 -0
- package/custom/skills/coverage-check/SKILL.md +2 -0
- package/custom/skills/create-system-requirement/SKILL.md +115 -33
- package/custom/skills/deploy-model/SKILL.md +2 -0
- package/custom/skills/design-experiment/SKILL.md +2 -0
- package/custom/skills/evaluate-model/SKILL.md +2 -0
- package/custom/skills/evidence-aggregation/SKILL.md +2 -0
- package/custom/skills/execute-flow/SKILL.md +2 -0
- package/custom/skills/explore-data/SKILL.md +2 -0
- package/custom/skills/frame-ml-problem/SKILL.md +2 -0
- package/custom/skills/gate-review/SKILL.md +2 -0
- package/custom/skills/generate-spec/SKILL.md +2 -0
- package/custom/skills/generate-test-report/SKILL.md +2 -0
- package/custom/skills/generate-testcase/SKILL.md +2 -0
- package/custom/skills/impact-analysis/SKILL.md +2 -0
- package/custom/skills/improve-algorithm/SKILL.md +2 -0
- package/custom/skills/ingest-data/SKILL.md +117 -3
- package/custom/skills/log-bug/SKILL.md +2 -0
- package/custom/skills/pr-impact-analysis/SKILL.md +2 -0
- package/custom/skills/read-study-requirement/SKILL.md +13 -7
- package/custom/skills/report-customer/SKILL.md +6 -2
- package/custom/skills/retest-orchestration/SKILL.md +2 -0
- package/custom/skills/review-plan/SKILL.md +2 -0
- package/custom/skills/script-sync/SKILL.md +1 -1
- package/custom/skills/test-analysis/SKILL.md +2 -0
- package/custom/skills/test-skills/rules/qa-writing-standards.md +2 -2
- package/custom/skills/train-model/SKILL.md +2 -0
- package/custom/templates/shared/create-spec-workflow.md +93 -31
- package/custom/templates/shared/create-testcase-workflow.md +32 -1
- package/custom/templates/shared/gate-workflow.md +15 -0
- package/docs/common/CHANGELOG.md +23 -0
- package/package.json +1 -1
- package/scripts/create-score-excel.js +4 -111
- package/scripts/init.js +24 -1
- package/scripts/link-resolver.js +101 -4
- package/scripts/task.js +25 -8
- package/scripts/ticket-writer.js +247 -0
- package/scripts/use.js +141 -0
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
|
|
|
@@ -211,7 +212,8 @@ program
|
|
|
211
212
|
Examples:
|
|
212
213
|
$ ak fetch-links "https://company.backlog.com/view/PROJ-10"
|
|
213
214
|
$ ak fetch-links "https://company.backlog.com/view/PROJ-10#comment-456"
|
|
214
|
-
$ ak fetch-links "https://company.backlog.com/document/
|
|
215
|
+
$ ak fetch-links "https://company.backlog.com/document/0193b335c62173de9547bab5dd0b5324" Backlog Document (ingest-data)
|
|
216
|
+
$ ak fetch-links "https://company.backlog.com/document/PROJ/e/0193b335c62173de9547bab5dd0b5324" Backlog Document share link (newer format)
|
|
215
217
|
$ ak fetch-links "https://company.backlog.com/alias/wiki/1234" Backlog Wiki (ingest-data)
|
|
216
218
|
$ ak fetch-links "https://company.atlassian.net/browse/PROJ-10"
|
|
217
219
|
$ ak fetch-links "https://company.atlassian.net/browse/PROJ-10?focusedCommentId=789"
|
|
@@ -238,6 +240,61 @@ Exit codes:
|
|
|
238
240
|
}
|
|
239
241
|
});
|
|
240
242
|
|
|
243
|
+
// ── backlog-projects ─────────────────────────────────────────
|
|
244
|
+
program
|
|
245
|
+
.command('backlog-projects')
|
|
246
|
+
.description('List Backlog projects in the configured space, and which one is the default for manually-created tasks')
|
|
247
|
+
.option('--json', 'output as JSON (for headless callers, e.g. the VS Code extension)')
|
|
248
|
+
.action((options) => {
|
|
249
|
+
useCommand.listBacklogProjectsCommand(options);
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
// ── backlog-set-default-project ──────────────────────────────
|
|
253
|
+
program
|
|
254
|
+
.command('backlog-set-default-project <id> <key>')
|
|
255
|
+
.description('Set the default Backlog project for tasks created manually (ak use --manual)')
|
|
256
|
+
.action((id, key) => {
|
|
257
|
+
useCommand.setDefaultBacklogProjectCommand(id, key);
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// ── jira-projects ─────────────────────────────────────────────
|
|
261
|
+
program
|
|
262
|
+
.command('jira-projects')
|
|
263
|
+
.description('List Jira projects visible to the configured account, and the default for task-creation')
|
|
264
|
+
.option('--json', 'output as JSON (for headless callers, e.g. the VS Code extension)')
|
|
265
|
+
.action((options) => {
|
|
266
|
+
useCommand.listJiraProjectsCommand(options);
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
// ── jira-set-default-project ─────────────────────────────────
|
|
270
|
+
program
|
|
271
|
+
.command('jira-set-default-project <key>')
|
|
272
|
+
.description('Set the default Jira project for tasks created from Meeting Minutes/QnA (ingest-data Gate 3)')
|
|
273
|
+
.action((key) => {
|
|
274
|
+
useCommand.setDefaultJiraProjectCommand(key);
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
// ── tasks (Vấn đề 5 — sinh task từ feedback/meeting minutes) ──
|
|
278
|
+
const tasksCmd = program.command('tasks').description('Turn an AI-proposed, PM-approved task list into real tickets (ingest-data Gate 3)');
|
|
279
|
+
|
|
280
|
+
tasksCmd
|
|
281
|
+
.command('create-tickets <file>')
|
|
282
|
+
.description('Create Backlog/Jira tickets from a JSON task list — see scripts/ticket-writer.js for the input shape')
|
|
283
|
+
.option('--json', 'machine-readable output only')
|
|
284
|
+
.action((file, options) => {
|
|
285
|
+
ticketWriterCommand.createTicketsCommand(file, options);
|
|
286
|
+
});
|
|
287
|
+
|
|
288
|
+
// ── credentials ───────────────────────────────────────────────
|
|
289
|
+
const credentialsCmd = program.command('credentials').description('Manage supplementary credentials (WRITE keys, default projects) not covered by `ak init --adapter`');
|
|
290
|
+
|
|
291
|
+
credentialsCmd
|
|
292
|
+
.command('set <key> <value>')
|
|
293
|
+
.description(`Save a credential value (allowed keys: ${ticketWriterCommand.SETTABLE_CREDENTIAL_KEYS.join(', ')})`)
|
|
294
|
+
.action((key, value) => {
|
|
295
|
+
ticketWriterCommand.setCredentialCommand(key, value);
|
|
296
|
+
});
|
|
297
|
+
|
|
241
298
|
// ── prompt ────────────────────────────────────────────────────
|
|
242
299
|
program
|
|
243
300
|
.command('prompt [type]')
|
|
@@ -528,13 +585,14 @@ function checkAndInstallAiflowGlobal() {
|
|
|
528
585
|
// ── gate (telemetry for gate workflow events) ─────────────────
|
|
529
586
|
program
|
|
530
587
|
.command('gate <number> <action>')
|
|
531
|
-
.description('Log a gate workflow event (start|approved) — called by AI during gate workflow')
|
|
588
|
+
.description('Log a gate workflow event (start|approved|skip) — called by AI during gate workflow')
|
|
532
589
|
.option('--ticket <id>', 'ticket ID')
|
|
533
590
|
.option('--ai-tool <tool>', 'AI tool name')
|
|
591
|
+
.option('--reason <text>', 'why this gate was skipped (only used with action=skip)')
|
|
534
592
|
.action((number, action, options) => {
|
|
535
593
|
const gateNum = parseInt(number);
|
|
536
594
|
if (isNaN(gateNum) || gateNum < 1 || gateNum > 5) return;
|
|
537
|
-
if (!['start', 'approved'].includes(action)) return;
|
|
595
|
+
if (!['start', 'approved', 'skip'].includes(action)) return;
|
|
538
596
|
|
|
539
597
|
if (action === 'start') {
|
|
540
598
|
console.log(chalk.cyan(`\n [aiflow] Gate ${gateNum} environment check:`));
|
|
@@ -554,7 +612,7 @@ program
|
|
|
554
612
|
|
|
555
613
|
// Keep task-state.json currentGate in sync (silent — never blocks the AI)
|
|
556
614
|
if (ticketId) {
|
|
557
|
-
updateTaskGateState(ticketId, gateNum, action).catch(() => {});
|
|
615
|
+
updateTaskGateState(ticketId, gateNum, action, { reason: options.reason }).catch(() => {});
|
|
558
616
|
}
|
|
559
617
|
|
|
560
618
|
if (action === 'approved') {
|
|
@@ -562,6 +620,8 @@ program
|
|
|
562
620
|
console.log(chalk.yellow(` Pro-Tip: To avoid context pollution, it's recommended to start a fresh chat session.`));
|
|
563
621
|
console.log(chalk.gray(` Run: aiflow task next${ticketId ? ` --ticket ${ticketId}` : ''} to save progress,`));
|
|
564
622
|
console.log(chalk.gray(` then open a NEW chatbox and type "continue".\n`));
|
|
623
|
+
} else if (action === 'skip') {
|
|
624
|
+
console.log(chalk.cyan(`\n Gate ${gateNum} skipped${options.reason ? `: ${options.reason}` : ''}`));
|
|
565
625
|
}
|
|
566
626
|
});
|
|
567
627
|
|
|
@@ -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
|
+
```
|
|
@@ -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
|
-
-
|
|
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).
|
|
@@ -22,9 +22,11 @@ Mẫu tài liệu này được sử dụng để trình bày kết quả phân
|
|
|
22
22
|
|
|
23
23
|
## 5. Bảng Phân Tích Khoảng Trống & Giả Định (Gap & Assumption Analysis)
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
| :-: | :--- | :--- | :--- | :--- | :--- |
|
|
27
|
-
| 1 | *Ví dụ: Nhập Password* | *Mật khẩu được che giấu* | *Có nút show/hide mật khẩu hay không? Đăng nhập sai bao nhiêu lần thì khóa?* | *Mặc định không hiển thị nút show/hide. Cho phép nhập sai tối đa 5 lần.* | *Xem Q&A_01* |
|
|
28
|
-
| 2 | | | | | |
|
|
25
|
+
*Chỉ liệt kê các Gap còn **Open** (chưa Confirmed) — Gap đã Confirmed được tích hợp thẳng vào mục 1-4 phía trên, không giữ lại ở bảng này. Cột Mức độ ảnh hưởng: 🔴 Blocking (chặn gate tiếp theo) / 🟡 Non-blocking (được phép defer, có marker `[PENDING - QA-ID]`).*
|
|
29
26
|
|
|
30
|
-
|
|
27
|
+
| # | Tính năng/Luồng nghiệp vụ | Hiện trạng mô tả thô | Khoảng trống (Gap) / Sự mơ hồ phát hiện | Giả định của BA (Assumption) | Mức độ ảnh hưởng | Đề xuất giải pháp / Q&A ID tương ứng |
|
|
28
|
+
| :-: | :--- | :--- | :--- | :--- | :-: | :--- |
|
|
29
|
+
| 1 | *Ví dụ: Nhập Password* | *Mật khẩu được che giấu* | *Có nút show/hide mật khẩu hay không? Đăng nhập sai bao nhiêu lần thì khóa?* | *Chưa có giả định — cần khách hàng xác nhận số lần khóa vì ảnh hưởng luồng chính* | 🔴 Blocking | *Xem [PENDING - QA-01]* |
|
|
30
|
+
| 2 | *Ví dụ: Thông báo lỗi* | *Không nêu rõ text lỗi* | *Text thông báo lỗi cụ thể là gì?* | *Tạm dùng text mặc định, có thể đổi sau* | 🟡 Non-blocking | *Xem [PENDING - QA-02]* |
|
|
31
|
+
|
|
32
|
+
*Lưu ý: Bảng này là cơ sở quan trọng nhất để tạo ra danh sách câu hỏi Q&A chuẩn xác cho khách hàng. Số dòng phải phản ánh đúng số Gap thực tế tìm được — không rút gọn cho "gọn tài liệu" nếu vẫn còn Gap chưa được hỏi.*
|
|
@@ -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:**
|
|
@@ -30,14 +32,19 @@ Kỹ năng này giúp Business Analyst (hoặc Agent) quét, đọc hiểu và c
|
|
|
30
32
|
- Nếu để trống thì hệ thống xử lý thế nào? Có thông báo lỗi gì không?
|
|
31
33
|
- Có quy tắc nghiệp vụ (Business rules) ngầm định nào không?
|
|
32
34
|
- Luồng thay thế (Alternative flows) hoặc luồng lỗi (Exception flows) là gì?
|
|
35
|
+
|
|
36
|
+
Số lượng Gap tìm được phải tăng theo độ phức tạp thực tế của yêu cầu — KHÔNG dừng lại khi "cảm thấy đủ" hoặc đã đạt một số lượng quen thuộc (ví dụ 5-6 điểm) nếu còn trường/luồng/actor chưa được đối chiếu hết qua 4 câu hỏi trên. Với yêu cầu nhiều màn hình/nhiều actor/tích hợp hệ thống khác, quét từng màn hình/actor riêng biệt rồi tổng hợp, không gộp tắt.
|
|
37
|
+
Với mỗi Gap, gắn nhãn mức độ ảnh hưởng ngay: 🔴 **Blocking** (ảnh hưởng cấu trúc dữ liệu, luồng chính, phân quyền/bảo mật, hoặc quyết định khó đảo ngược) hoặc 🟡 **Non-blocking** (chi tiết UI/text, giá trị mặc định có thể đổi sau, luồng hiếm gặp).
|
|
33
38
|
- **Bước 4: Soạn dự thảo Kết quả phân tích ban đầu:**
|
|
34
|
-
Áp dụng template phân tích ban đầu (`skill-ba-initial-analysis-template-v1.md`) để điền thông tin và lập bảng Gap/Assumption.
|
|
39
|
+
Áp dụng template phân tích ban đầu (`skill-ba-initial-analysis-template-v1.md`) để điền thông tin và lập bảng Gap/Assumption, kèm cột Mức độ ảnh hưởng cho mỗi Gap.
|
|
35
40
|
|
|
36
41
|
## 4. Checklist kiểm tra (Checklist for Verification)
|
|
37
42
|
- [ ] Đã xác định rõ Mục tiêu hệ thống/chức năng chưa? (Hệ thống giải quyết bài toán gì?)
|
|
38
43
|
- [ ] Đã làm rõ tất cả các Tác nhân (Actors) tham gia chưa?
|
|
39
44
|
- [ ] Đã bóc tách hết các trường thông tin (Inputs) được liệt kê trong tài liệu thô chưa?
|
|
40
45
|
- [ ] Đã ghi nhận rõ ràng danh sách các điểm mơ hồ hoặc thiếu thông tin dưới dạng **Gap/Assumption** chưa?
|
|
46
|
+
- [ ] Số lượng Gap tìm được có phản ánh đúng độ phức tạp thực tế (nhiều màn hình/actor/luồng → nhiều Gap hơn), không bị gò về một số cố định không?
|
|
47
|
+
- [ ] Mỗi Gap đã có nhãn Mức độ ảnh hưởng (🔴 Blocking / 🟡 Non-blocking) chưa?
|
|
41
48
|
- [ ] Không tự tiện bổ sung các tính năng ngoài phạm vi yêu cầu của khách hàng khi chưa có thảo luận/Q&A.
|
|
42
49
|
|
|
43
50
|
## 5. Output mong đợi (Expected Output)
|
|
@@ -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`.
|
|
@@ -6,16 +6,17 @@ Mẫu tài liệu dùng để trình bày danh sách câu hỏi Q&A và theo dõ
|
|
|
6
6
|
|
|
7
7
|
# Tài liệu Q&A: [Tên Chức Năng]
|
|
8
8
|
|
|
9
|
-
*Tài liệu này dùng để theo dõi các vấn đề nghiệp vụ cần làm rõ giữa đội ngũ dự án và khách hàng. Trạng thái bao gồm: **Open** (Đang chờ phản hồi), **Confirmed** (Đã thống nhất).*
|
|
9
|
+
*Tài liệu này dùng để theo dõi các vấn đề nghiệp vụ cần làm rõ giữa đội ngũ dự án và khách hàng. Trạng thái bao gồm: **Open** (Đang chờ phản hồi), **Confirmed** (Đã thống nhất). Mức độ ảnh hưởng: 🔴 **Blocking** (chưa trả lời thì không thể tiến gate tiếp theo), 🟡 **Non-blocking** (có thể defer, output sẽ giữ marker `[PENDING - QA-ID]` tại vị trí liên quan).*
|
|
10
10
|
|
|
11
11
|
## Danh sách câu hỏi Q&A
|
|
12
12
|
|
|
13
|
-
| ID | Chức năng / Màn hình | Nội dung yêu cầu hiện tại | Câu hỏi / Điểm chưa rõ | Đề xuất giải pháp (Options) | Câu trả lời của Khách hàng | Trạng thái |
|
|
14
|
-
| :-: | :--- | :--- | :--- | :--- | :--- | :-: |
|
|
15
|
-
| **QA-01** | *Đăng nhập* | *Có text link đổi mật khẩu* | *Text link này sẽ dẫn sang URL cụ thể nào? Hệ thống tự sinh OTP gửi mail hay chuyển sang màn nhập email?* | *- Option A: Chuyển sang URL `/forgot-password` để nhập Email nhận link reset.<br>- Option B: Hiển thị popup nhập SĐT nhận OTP.* | *Khách hàng phản hồi: Chọn Option A, link URL là `/forgot-password`* | **Confirmed** |
|
|
16
|
-
| **QA-02** | | | | | | **Open** |
|
|
13
|
+
| ID | Chức năng / Màn hình | Nội dung yêu cầu hiện tại | Câu hỏi / Điểm chưa rõ | Đề xuất giải pháp (Options) | Mức độ ảnh hưởng | Câu trả lời của Khách hàng | Trạng thái |
|
|
14
|
+
| :-: | :--- | :--- | :--- | :--- | :-: | :--- | :-: |
|
|
15
|
+
| **QA-01** | *Đăng nhập* | *Có text link đổi mật khẩu* | *Text link này sẽ dẫn sang URL cụ thể nào? Hệ thống tự sinh OTP gửi mail hay chuyển sang màn nhập email?* | *- Option A: Chuyển sang URL `/forgot-password` để nhập Email nhận link reset.<br>- Option B: Hiển thị popup nhập SĐT nhận OTP.* | 🔴 Blocking | *Khách hàng phản hồi: Chọn Option A, link URL là `/forgot-password`* | **Confirmed** |
|
|
16
|
+
| **QA-02** | *Đăng nhập* | *Thông báo lỗi khi sai mật khẩu* | *Câu chữ thông báo lỗi cụ thể là gì?* | *- Option A: "Email hoặc mật khẩu không đúng."<br>- Option B: Ý kiến khác...* | 🟡 Non-blocking | *Chưa trả lời — khách hàng cần hỏi lại team Marketing* | **Open** |
|
|
17
17
|
|
|
18
18
|
---
|
|
19
19
|
## Lịch sử cập nhật tài liệu
|
|
20
20
|
*Sau mỗi lần nhận phản hồi, BA cập nhật bảng trên và ghi nhận lịch sử tại đây:*
|
|
21
21
|
- **Ngày [dd/mm/yyyy]:** Nhận phản hồi lần 1 từ khách hàng cho câu hỏi QA-01. Cập nhật trạng thái sang **Confirmed** và chỉnh sửa tài liệu Phân tích bản đầu tương ứng.
|
|
22
|
+
- **Ngày [dd/mm/yyyy]:** QA-02 (🟡 Non-blocking) vẫn **Open** — BA đã xác nhận tiếp tục sang gate kế tiếp, đánh dấu `[PENDING - QA-02]` trong Analysis tại mục thông báo lỗi đăng nhập.
|
|
@@ -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:**
|
|
@@ -12,15 +14,24 @@ Kỹ năng này giúp BA thiết kế các câu hỏi rõ ràng, khách quan và
|
|
|
12
14
|
|
|
13
15
|
## 3. Quy trình thực hiện (Step-by-step Process)
|
|
14
16
|
- **Bước 1: Chuyển đổi Gap thành câu hỏi Q&A:**
|
|
15
|
-
Từ danh sách khoảng trống phát hiện ở bước Phân tích ban đầu, chuyển mỗi dòng thành một câu hỏi Q&A cụ thể.
|
|
16
|
-
- **Bước 2:
|
|
17
|
+
Từ danh sách khoảng trống phát hiện ở bước Phân tích ban đầu, chuyển mỗi dòng thành một câu hỏi Q&A cụ thể. Số lượng câu hỏi phải phản ánh đúng số Gap thực tế — không tự giới hạn theo một số cố định (ví dụ luôn dừng ở 5-6 câu) bất kể yêu cầu đơn giản hay phức tạp. Nếu phát sinh Gap mới trong lúc soạn câu hỏi (đọc kỹ hơn thấy còn điểm mơ hồ), bổ sung ngay câu hỏi mới, không bỏ qua để "gọn danh sách".
|
|
18
|
+
- **Bước 2: Gắn nhãn mức độ ảnh hưởng (Blocking/Non-blocking):**
|
|
19
|
+
Trước khi chuẩn hóa câu hỏi, gắn nhãn:
|
|
20
|
+
- 🔴 **Blocking** — ảnh hưởng cấu trúc dữ liệu, luồng chính (happy path), phân quyền/bảo mật, hoặc quyết định kiến trúc khó đảo ngược sau khi code.
|
|
21
|
+
- 🟡 **Non-blocking** — chi tiết UI/text, giá trị mặc định có thể đổi sau, alternative/exception flow hiếm gặp.
|
|
22
|
+
Nhãn này quyết định câu hỏi có bắt buộc phải Confirmed trước khi qua gate tiếp theo hay được phép defer.
|
|
23
|
+
- **Bước 3: Chuẩn hóa câu hỏi theo mẫu `@skill-ba-qna-template-v1.md`:**
|
|
17
24
|
- Xác định phân vùng nghiệp vụ (Module/Screen).
|
|
18
25
|
- Trích dẫn yêu cầu hiện tại (Current Status/Requirement).
|
|
19
26
|
- Nêu rõ vấn đề mơ hồ.
|
|
20
27
|
- Đưa ra các giải pháp đề xuất (Options) cùng giả định của BA.
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
-
|
|
28
|
+
- Điền cột Mức độ ảnh hưởng (🔴 Blocking / 🟡 Non-blocking) đã gắn ở Bước 2.
|
|
29
|
+
- **Bước 4: Nhận phản hồi và Cập nhật (Process Responses):**
|
|
30
|
+
- Khi nhận được câu trả lời: Đọc kỹ để đảm bảo câu trả lời đã giải quyết triệt để câu hỏi.
|
|
31
|
+
- Đã rõ ràng → đánh dấu **Confirmed**, cập nhật thông tin đó trực tiếp vào tài liệu phân tích hiện tại, xóa marker `[PENDING - QA-ID]` liên quan nếu có.
|
|
32
|
+
- Chưa rõ ràng / khách hàng chưa trả lời được ngay:
|
|
33
|
+
- 🟡 Non-blocking → giữ **Open** (deferred), tiếp tục các câu khác/gate tiếp theo bình thường, ghi marker `[PENDING - QA-ID]` tại vị trí nội dung liên quan trong tài liệu.
|
|
34
|
+
- 🔴 Blocking → giữ **Open** nhưng cảnh báo rõ cho BA lý do đây là blocking và hệ quả nếu bỏ qua trước khi cho phép gate tiếp theo tiến hành; không tự hạ nhãn xuống Non-blocking để né cảnh báo.
|
|
24
35
|
- Ghi nhận lịch sử thay đổi để Dev/Test nắm được lý do thay đổi logic.
|
|
25
36
|
|
|
26
37
|
## 4. Checklist kiểm tra (Checklist for Verification)
|
|
@@ -28,7 +39,10 @@ Kỹ năng này giúp BA thiết kế các câu hỏi rõ ràng, khách quan và
|
|
|
28
39
|
- [ ] Câu hỏi có sử dụng từ ngữ trung lập, không mang tính áp đặt ý kiến chủ quan của BA không?
|
|
29
40
|
- [ ] Có đưa ra các phương án gợi ý (Option A, Option B...) cho các vấn đề phức tạp để khách hàng dễ lựa chọn không?
|
|
30
41
|
- [ ] Các thuật ngữ viết tắt trong câu hỏi có được giải thích rõ không?
|
|
42
|
+
- [ ] Mỗi câu hỏi đã có nhãn Mức độ ảnh hưởng (🔴 Blocking / 🟡 Non-blocking) chưa?
|
|
43
|
+
- [ ] Số lượng câu hỏi có phản ánh đúng độ phức tạp thực tế của yêu cầu, không bị gò về một số cố định không?
|
|
31
44
|
- [ ] Đã cập nhật đúng và đầy đủ tất cả câu trả lời của khách hàng vào tài liệu phân tích chưa? (Không bỏ sót bất kỳ điểm chốt nào).
|
|
45
|
+
- [ ] Mọi nội dung phụ thuộc câu hỏi còn Open đã có marker `[PENDING - QA-ID]` tại đúng vị trí, chưa bị tự suy diễn để lấp đầy?
|
|
32
46
|
|
|
33
47
|
## 5. Output mong đợi (Expected Output)
|
|
34
48
|
- File danh sách câu hỏi Q&A định dạng markdown, cấu trúc thống nhất dựa theo `@skill-ba-qna-template-v1.md`, đặt tên theo chuẩn: `QnA-Log_v(m).md` trong thư mục `02.BA-Specs/02.QnA/[functionId]/`.
|
|
@@ -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
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
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, BEFORE the first coding ticket.
|
|
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
4
|
keywords: system requirement, uc spec, functionId, trace, acceptance test, exception handling, business rule, matching, version sync
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -21,9 +21,10 @@ keywords: system requirement, uc spec, functionId, trace, acceptance test, excep
|
|
|
21
21
|
|
|
22
22
|
**Hand-off from coding Gate 1 Pre-flight** (`read-study-requirement`, Step 0) when:
|
|
23
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
|
|
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`.
|
|
25
26
|
|
|
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.
|
|
27
28
|
|
|
28
29
|
---
|
|
29
30
|
|
|
@@ -58,7 +59,8 @@ Same methodology as `read-study-requirement` Step 1 (steps 4–5), reused here:
|
|
|
58
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).
|
|
59
60
|
- **If GitNexus MCP available:** `gitnexus: query()` / `gitnexus: context()` for the relevant area — same token-saving shortcut as `read-study-requirement`.
|
|
60
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.
|
|
61
|
-
- Identify **existing data model / API surface** touched by this UC (tables, DTOs, endpoints) — feeds Section 6 of the output.
|
|
62
|
+
- Identify **existing data model / API surface** touched by this UC (tables, DTOs, endpoints) — feeds Section 6.1 of the output.
|
|
63
|
+
- Identify whether this UC integrates with any system **outside** the app's own UI/DB (third-party API, webhook, message queue, etc.) — the UC Spec won't describe this since it's UI/flow-focused; if found, feeds Section 6.3. If there's none, skip Section 6.3 entirely rather than leaving it as empty boilerplate.
|
|
62
64
|
|
|
63
65
|
This step exists so System Requirement reflects what the system *can actually do today*, not just what the UC Spec says in the abstract.
|
|
64
66
|
|
|
@@ -72,18 +74,32 @@ For every row in the UC Spec's Main Flow, Alternative/Exception Flows, and Busin
|
|
|
72
74
|
- **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.
|
|
73
75
|
- **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).
|
|
74
76
|
- **Exception & Error Handling** — one per Exception Flow, using the error-handling convention found in Step 2.
|
|
75
|
-
- **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
|
+
- **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). Tag each scenario with the Requirement IDs it exercises (**Requirement Coverage**) so QA can trace AT → FR/VR/ER without re-reading the whole document.
|
|
76
78
|
|
|
77
79
|
**`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.
|
|
78
80
|
|
|
79
|
-
|
|
81
|
+
#### Writing style & layering (applies to every item in Sections 1–4)
|
|
82
|
+
|
|
83
|
+
Every item is a stack of layers, each aimed at a different reader — write each layer, don't blend them:
|
|
84
|
+
|
|
85
|
+
1. **Requirement** — the system behavior in plain business language. No framework names, class names, method names, or library calls (`Rule::unique`, `FormRequest`, `Middleware`, `permission_handle()`, enum class names, etc.). PM/BA must be able to read this layer alone and understand what the system does.
|
|
86
|
+
- ❌ `Rule::unique(...)` → ✅ "The system validates that the Tag name is unique among active Tags."
|
|
87
|
+
- ❌ `permission_handle()` → ✅ "Only users with CREATE permission can create Tags."
|
|
88
|
+
- When a technical concept (e.g. an enum) has a business meaning, state the business impact first (e.g. "Newly created Tags are assigned the default status PENDING") and put the raw technical value in Implementation Reference as a `Tech Reference:` line — **never invent or assume what an enum/status value means in business terms unless the BA has confirmed it**; if unconfirmed, ask in Step 4 or leave it as the raw value with a Gap/Assumption tag. Every `Tech Reference:` line also gets a row in Section 6.2 (Glossary / Term Mapping) — write it once there, don't leave it scattered only inside individual items.
|
|
89
|
+
2. **System Behavior** — how the system processes it, still in plain language (conditions, order of checks, what triggers what). This is what BA/Tester use to write test cases.
|
|
90
|
+
3. **Error Response** (Validation Rules and Exception & Error Handling only) — the expected result for Tester: keep the HTTP status code (never drop it — Tester needs it), paired with a friendly label and the user-facing message, e.g. `HTTP 422 (Validation Error) — "..."`.
|
|
91
|
+
4. **Implementation Reference** — file/class/method/framework rule, for Developer cross-check only. This is where all the technical detail from Step 2 belongs — it never appears in layers 1–2.
|
|
92
|
+
|
|
93
|
+
Keep each layer short — one requirement, one behavior, one result. If a sentence needs 2–3 clauses to say, split it into separate `Requirement` / `System Behavior` / `Result` lines instead of one long sentence.
|
|
94
|
+
|
|
95
|
+
Classify every item as **Gap** (missing entirely) / **Assumption** (inferred, unconfirmed) / **Decision** (a choice made and confirmed during Q&A) / **Deviation** (implementation differs from what the UC Spec states) — only when one of these applies. A plain fact (explicit in UC Spec or confirmed in code) needs no tag; do not mark every item "Fact" by default, since a Requirement is a fact unless flagged otherwise. This replaces the old Fact/Assumption/Gap convention from `read-study-requirement` Step 1.75 for this skill's output — `read-study-requirement` itself is unaffected.
|
|
80
96
|
|
|
81
97
|
---
|
|
82
98
|
|
|
83
99
|
### Step 4: Clarify via Q&A (ask until Confirmed) [Gate 1]
|
|
84
100
|
|
|
85
101
|
- Ask **one question at a time**, prioritizing unresolved Assumptions/Gaps from Step 3.
|
|
86
|
-
- **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
|
|
102
|
+
- **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 unresolved Gap in Section 7 rather than guessing.
|
|
87
103
|
- Do NOT invoke `superpowers:brainstorming` (same reason as `read-study-requirement`: its terminal state bypasses this gate's approval).
|
|
88
104
|
- All Gaps Confirmed → present a short Gate 1 summary, wait for DEV to run `aiflow task next` before continuing to Step 5.
|
|
89
105
|
|
|
@@ -121,6 +137,16 @@ Save to `AK-Docs/02.BA-Specs/00.Requirements/[functionId]/System-Requirement_v{N
|
|
|
121
137
|
|
|
122
138
|
---
|
|
123
139
|
|
|
140
|
+
## Executive Summary
|
|
141
|
+
- **Purpose:** [1 sentence — what this document covers and why it exists]
|
|
142
|
+
- **Implementation status:** [e.g. Not started / In progress / Matches UC Spec v{N}]
|
|
143
|
+
- **Key deviations from UC Spec:** [bullet list of Deviation-tagged items, or "None identified"]
|
|
144
|
+
- **Action needed from BA:** [bullet list of unresolved Gaps/Assumptions needing BA input, or "None — ready for Dev handoff"]
|
|
145
|
+
|
|
146
|
+
> This section alone should give PM/BA the full picture in about 30 seconds — everything below is supporting detail for BA/Tester/Dev.
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
124
150
|
## 0. Traceability Matrix
|
|
125
151
|
| UC Reference (Flow / BR) | System Requirement Item(s) |
|
|
126
152
|
|---|---|
|
|
@@ -129,49 +155,95 @@ Save to `AK-Docs/02.BA-Specs/00.Requirements/[functionId]/System-Requirement_v{N
|
|
|
129
155
|
| BR1.1 | VR-01 |
|
|
130
156
|
|
|
131
157
|
## 1. Functional Requirements
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
158
|
+
|
|
159
|
+
Each item below is layered: **Requirement** (business language, for PM/BA) → **System Behavior** (for BA/Tester) → **Implementation Reference** (for Dev, technical detail only — never appears in the layers above it).
|
|
160
|
+
|
|
161
|
+
### FR-01: [short business-behavior title]
|
|
162
|
+
- **Requirement:** [system behavior in business language, no framework/class/method names]
|
|
163
|
+
- **System Behavior:** [how the system processes it — conditions, order of checks]
|
|
164
|
+
- **Traced UC Ref:** Main Flow #3
|
|
165
|
+
- **Classification:** [Gap | Assumption | Decision | Deviation — omit this line if it's a plain fact]
|
|
166
|
+
- **Implementation Reference:** [file:line / class / method]
|
|
167
|
+
|
|
168
|
+
<!-- repeat FR-02, FR-03, ... in the same block format -->
|
|
135
169
|
|
|
136
170
|
## 2. Non-Functional Requirements
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
171
|
+
|
|
172
|
+
### NFR-01: [short title]
|
|
173
|
+
- **Requirement:** [business language — e.g. performance/security expectation]
|
|
174
|
+
- **System Behavior:** [how it's enforced, in plain language]
|
|
175
|
+
- **Traced UC Ref:** BR3.1
|
|
176
|
+
- **Classification:** [Gap | Assumption | Decision | Deviation — omit if plain fact]
|
|
177
|
+
- **Implementation Reference:** [file:line / class / method]
|
|
140
178
|
|
|
141
179
|
## 3. Business Rules → Validation Rules
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
180
|
+
|
|
181
|
+
### VR-01: [short title]
|
|
182
|
+
- **Requirement:** [e.g. "Tag name must be unique among active Tags."]
|
|
183
|
+
- **System Behavior:** [e.g. "The system checks the Tag name against all active Tags before saving."]
|
|
184
|
+
- **Error Response:** HTTP 422 (Validation Error) — "[user-facing message]"
|
|
185
|
+
- **Traced UC BR:** BR1.1
|
|
186
|
+
- **Classification:** [Gap | Assumption | Decision | Deviation — omit if plain fact]
|
|
187
|
+
- **Implementation Reference:** [e.g. `Rule::unique(...)` in `StoreTagRequest`]
|
|
145
188
|
|
|
146
189
|
## 4. Exception & Error Handling
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
190
|
+
|
|
191
|
+
### ER-01: [trigger condition, in business language]
|
|
192
|
+
- **Requirement:** [e.g. "Only users with CREATE permission can create Tags."]
|
|
193
|
+
- **System Behavior:** [e.g. "The request is rejected because the caller lacks the required permission."]
|
|
194
|
+
- **Error Response:** HTTP 403 (Forbidden) — "[user-facing message]"
|
|
195
|
+
- **Traced Exception Flow:** Exception Flow B
|
|
196
|
+
- **Classification:** [Gap | Assumption | Decision | Deviation — omit if plain fact]
|
|
197
|
+
- **Implementation Reference:** [existing error code/class/middleware]
|
|
150
198
|
|
|
151
199
|
## 5. Acceptance Test Scenarios
|
|
152
200
|
### AT-01: [Scenario] (Main Flow)
|
|
153
201
|
- **Given** ...
|
|
154
202
|
- **When** ...
|
|
155
203
|
- **Then** ...
|
|
204
|
+
- **Requirement Coverage:** FR-01, FR-03
|
|
156
205
|
|
|
157
206
|
### AT-02: [Scenario] (Exception Flow B)
|
|
158
|
-
...
|
|
207
|
+
- **Given** ...
|
|
208
|
+
- **When** ...
|
|
209
|
+
- **Then** ...
|
|
210
|
+
- **Requirement Coverage:** VR-01, ER-01
|
|
159
211
|
|
|
160
212
|
## 6. Existing System Context
|
|
161
|
-
### Related Modules / Files
|
|
162
|
-
| File | Role | Current Behavior |
|
|
163
|
-
|---|---|---|
|
|
164
213
|
|
|
165
|
-
###
|
|
166
|
-
|
|
214
|
+
### 6.1 System Areas Summary
|
|
215
|
+
Summary only — deeper implementation detail belongs in each item's **Implementation Reference** above, not here.
|
|
216
|
+
|
|
217
|
+
| Area | Summary |
|
|
218
|
+
|---|---|
|
|
219
|
+
| API | ... |
|
|
220
|
+
| Model | ... |
|
|
221
|
+
| Validation | ... |
|
|
222
|
+
| Migration | ... |
|
|
223
|
+
| Test | ... |
|
|
224
|
+
|
|
225
|
+
### 6.2 Glossary / Term Mapping
|
|
226
|
+
Every `Tech Reference:` used in Sections 1–4 gets one row here — a single place to look up what a business term maps to in code, instead of hunting through every item. Only include terms with a BA-confirmed business meaning (Decision) or the BA-unconfirmed raw value tagged accordingly — never a guessed meaning.
|
|
227
|
+
|
|
228
|
+
| Business Term | Technical Reference | Classification |
|
|
167
229
|
|---|---|---|
|
|
230
|
+
| [e.g. "default status PENDING"] | `TagStatusEnum::PENDING` | Decision (BA-confirmed [date]) / Assumption (unconfirmed) |
|
|
231
|
+
|
|
232
|
+
### 6.3 External System Interfaces *(optional — include only if this UC integrates with a system outside the app's own UI/DB, e.g. third-party API, webhook, message queue)*
|
|
233
|
+
The UC Spec describes UI/business flow, not external integration contracts — capture those here when they exist. Omit this subsection entirely if the UC has no external interface.
|
|
234
|
+
|
|
235
|
+
| Interface | Direction | Protocol/Format | Note |
|
|
236
|
+
|---|---|---|---|
|
|
237
|
+
| [e.g. Payment Gateway API] | Outbound | REST/JSON | ... |
|
|
238
|
+
|
|
239
|
+
## 7. Assumptions / Gaps / Decisions / Deviations
|
|
240
|
+
Only items tagged Gap / Assumption / Decision / Deviation land here — a plain fact is the default, unmarked state of every item above and is not repeated in this table.
|
|
168
241
|
|
|
169
|
-
## 7. Facts / Assumptions / Gaps
|
|
170
242
|
| Type | Item | Resolution |
|
|
171
243
|
|---|---|---|
|
|
172
244
|
|
|
173
|
-
## 8.
|
|
174
|
-
[Question asked → answer received → date. Unresolved Gaps stay listed here, never silently dropped.]
|
|
245
|
+
## 8. Decision Log
|
|
246
|
+
[Question asked → decision/answer received → date. Unresolved Gaps stay listed here, never silently dropped. (Renamed from "Open Questions Log" — every entry here already has an answer; unresolved items are Gaps, tracked in Section 7.)]
|
|
175
247
|
|
|
176
248
|
## 9. Change Log
|
|
177
249
|
| Date | Ticket | Change | Note |
|
|
@@ -179,6 +251,8 @@ Save to `AK-Docs/02.BA-Specs/00.Requirements/[functionId]/System-Requirement_v{N
|
|
|
179
251
|
| [YYYY-MM-DD] | — | Initial creation from UC Spec v{N} | |
|
|
180
252
|
```
|
|
181
253
|
|
|
254
|
+
Output language: auto-detect from the ticket/task input — see `custom/rules/output-language.md` (Vietnamese input → Vietnamese output; otherwise English).
|
|
255
|
+
|
|
182
256
|
---
|
|
183
257
|
|
|
184
258
|
### Step 7: Present for Approval [Gate 2]
|
|
@@ -198,11 +272,12 @@ Coverage:
|
|
|
198
272
|
Open Gaps: [N] ← must be 0 to approve
|
|
199
273
|
|
|
200
274
|
Please review — matching 1-1 with UC Spec v{N} is the point of this document.
|
|
201
|
-
→ Type APPROVED (then run `aiflow task next`) to close this task and
|
|
202
|
-
|
|
275
|
+
→ Type APPROVED (then run `aiflow task next`) to close this task and clear
|
|
276
|
+
the Gate 1 warning for tickets on this functionId
|
|
203
277
|
→ Or provide feedback to update
|
|
204
278
|
|
|
205
|
-
⚠️
|
|
279
|
+
⚠️ Until this task is APPROVED, coding Gate 1 for this functionId will keep
|
|
280
|
+
showing a non-blocking warning (it does not cancel).
|
|
206
281
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
207
282
|
```
|
|
208
283
|
|
|
@@ -225,7 +300,7 @@ This does not bump `System-Requirement-Version` — the version stays tied to th
|
|
|
225
300
|
| Concern | Handled by |
|
|
226
301
|
|---|---|
|
|
227
302
|
| Source code investigation methodology | `read-study-requirement` Step 1 pattern (reused inline) / GitNexus MCP |
|
|
228
|
-
|
|
|
303
|
+
| Gap/Assumption/Decision/Deviation classification | This skill (inline, Step 3 — output-only convention, distinct from `read-study-requirement` Step 1.75's Fact/Assumption/Gap) |
|
|
229
304
|
| Q&A loop (one question at a time, no fabrication) | This skill (inline) |
|
|
230
305
|
| UC Spec structure/content | `skill-ba-uc-template-v1.md` (read-only reference, never edited by this skill) |
|
|
231
306
|
| Split decision | This skill (Step 5) |
|
|
@@ -245,4 +320,11 @@ This does not bump `System-Requirement-Version` — the version stays tied to th
|
|
|
245
320
|
- ✅ **MUST** read the full UC Spec (Step 1) before drafting anything.
|
|
246
321
|
- ✅ **MUST** investigate source code (Step 2) before drafting Exception/Error Handling or Existing System Context.
|
|
247
322
|
- ✅ **MUST** carry the mandatory `UC-Spec-Version` header on the master file.
|
|
248
|
-
- ✅ **MUST**
|
|
323
|
+
- ✅ **MUST** surface a ⚠️ non-blocking warning (never a cancel) from the Gate 1 Pre-flight check until this skill reaches APPROVED.
|
|
324
|
+
- ✅ **MUST** write the `Requirement` and `System Behavior` layer of every FR/NFR/VR/ER item in business language — no framework, class, or method names (those belong only in `Implementation Reference`).
|
|
325
|
+
- ✅ **MUST** keep the HTTP status code in every `Error Response` line, paired with a friendly label and the user-facing message (e.g. `HTTP 422 (Validation Error) — "..."`) — never drop the code for readability.
|
|
326
|
+
- ✅ **MUST** tag each Acceptance Test with its `Requirement Coverage` (the FR/VR/ER IDs it exercises).
|
|
327
|
+
- ❌ **DO NOT** tag every item "Fact" — a plain fact is the unmarked default; only tag `Gap`, `Assumption`, `Decision`, or `Deviation` when one applies.
|
|
328
|
+
- ❌ **DO NOT** state or assume the business meaning of an enum/status value (e.g. what `PENDING` "means" for the business) unless the BA has confirmed it — reference the raw technical value in `Implementation Reference` and tag it `Assumption` or `Gap` until confirmed.
|
|
329
|
+
- ✅ **MUST** mirror every `Tech Reference:` used in Sections 1–4 as a row in Section 6.2 (Glossary / Term Mapping) — don't leave the mapping only inside individual items.
|
|
330
|
+
- ❌ **DO NOT** include Section 6.3 (External System Interfaces) when the UC has no integration outside the app's own UI/DB — omit the subsection entirely rather than leaving an empty table.
|
|
@@ -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.
|