@relipa/ai-flow-kit 0.1.3 → 0.1.4

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 (66) hide show
  1. package/README.md +253 -91
  2. package/bin/aiflow.js +49 -1
  3. package/custom/skills/ba-skills/skill-ba-phan-tich-ban-dau-v1.md +44 -0
  4. package/custom/skills/ba-skills/skill-ba-prototype-v1.md +35 -0
  5. package/custom/skills/ba-skills/skill-ba-qa-template-v1.md +21 -0
  6. package/custom/skills/ba-skills/skill-ba-qa-v1.md +35 -0
  7. package/custom/skills/ba-skills/skill-ba-template-phan-tich-ban-dau-v1.md +30 -0
  8. package/custom/skills/ba-skills/skill-ba-template-uc-v1.md +83 -0
  9. package/custom/skills/ba-skills/skill-ba-ve-luong-mermaid-v1.md +35 -0
  10. package/custom/skills/ba-skills/skill-ba-viet-spec-uc-v1.md +38 -0
  11. package/custom/skills/ba-skills/skill-ba-xay-dung-business-rules-v1.md +39 -0
  12. package/custom/skills/execute-flow/SKILL.md +27 -36
  13. package/custom/skills/gate-review/SKILL.md +119 -0
  14. package/custom/skills/generate-test-report/SKILL.md +1 -1
  15. package/custom/skills/generate-testcase/SKILL.md +50 -11
  16. package/custom/skills/generate-testcase/templates/testcase.md +50 -59
  17. package/custom/skills/test-analysis/SKILL.md +37 -3
  18. package/custom/skills/test-skills/categories/00-core/00.01.requirement-analysis.md +111 -0
  19. package/custom/skills/test-skills/categories/00-core/00.02.risk-analysis.md +24 -0
  20. package/custom/skills/test-skills/categories/00-core/00.03.test-scenario-builder.md +90 -0
  21. package/custom/skills/test-skills/categories/00-core/00.04.testcase-review.md +68 -0
  22. package/custom/skills/test-skills/categories/01-test-design/01.01.boundary-value-analysis.md +30 -0
  23. package/custom/skills/test-skills/categories/01-test-design/01.02.equivalence.partitioning.md +27 -0
  24. package/custom/skills/test-skills/categories/01-test-design/01.03.decision-table.md +26 -0
  25. package/custom/skills/test-skills/categories/01-test-design/01.04.state.transition.md +26 -0
  26. package/custom/skills/test-skills/categories/01-test-design/01.05.pairwise.md +25 -0
  27. package/custom/skills/test-skills/categories/01-test-design/01.06.error-guessing.md +28 -0
  28. package/custom/skills/test-skills/categories/02-ui-testing/02.01.UI-layout.md +29 -0
  29. package/custom/skills/test-skills/categories/02-ui-testing/02.02.form-validation.md +57 -0
  30. package/custom/skills/test-skills/categories/02-ui-testing/02.03.navigation.md +27 -0
  31. package/custom/skills/test-skills/categories/02-ui-testing/02.04.localization.md +27 -0
  32. package/custom/skills/test-skills/categories/02-ui-testing/02.05.accessibility.md +27 -0
  33. package/custom/skills/test-skills/categories/03-business-testing/03.01.CRUD-testing.md +51 -0
  34. package/custom/skills/test-skills/categories/03-business-testing/03.02.workflow-testing.md +44 -0
  35. package/custom/skills/test-skills/categories/03-business-testing/03.03.permission-testing.md +41 -0
  36. package/custom/skills/test-skills/categories/03-business-testing/03.04.dependency-validation.md +40 -0
  37. package/custom/skills/test-skills/categories/03-business-testing/03.05.notification-testing.md +43 -0
  38. package/custom/skills/test-skills/categories/03-business-testing/03.06.calculation.testing.md +44 -0
  39. package/custom/skills/test-skills/categories/04-data-testing/04.01.database-testing.md +43 -0
  40. package/custom/skills/test-skills/categories/04-data-testing/04.02.import-export-testing.md +43 -0
  41. package/custom/skills/test-skills/categories/04-data-testing/04.03.data-mapping.md +39 -0
  42. package/custom/skills/test-skills/categories/04-data-testing/04.04.duplicate-handling.md +39 -0
  43. package/custom/skills/test-skills/categories/04-data-testing/04.05.migration.md +42 -0
  44. package/custom/skills/test-skills/categories/05-integration/05.01.API-testing.md +37 -0
  45. package/custom/skills/test-skills/categories/05-integration/05.02.third-party-integration.md +36 -0
  46. package/custom/skills/test-skills/categories/05-integration/05.03.batch-processing.md +38 -0
  47. package/custom/skills/test-skills/categories/05-integration/05.04.file-upload-download.md +40 -0
  48. package/custom/skills/test-skills/categories/08-domain-skills/CMS.md +34 -0
  49. package/custom/skills/test-skills/categories/08-domain-skills/Ecommerce.md +35 -0
  50. package/custom/skills/test-skills/categories/99-review/99.01.coverage-review.md +35 -0
  51. package/custom/skills/test-skills/categories/99-review/99.02.knowledge-learning.md +34 -0
  52. package/custom/skills/test-skills/categories/99-review/99.03.repository-update.md +33 -0
  53. package/custom/skills/test-skills/categories/99-review/99.04.change-history.md +38 -0
  54. package/custom/skills/test-skills/rules/Directory_and_Naming_Convention.md +257 -0
  55. package/custom/skills/test-skills/rules/QA_Writing_Standards.md +49 -0
  56. package/custom/skills/test-skills/template/template_testcase.md +83 -0
  57. package/custom/templates/shared/create-spec-workflow.md +435 -0
  58. package/custom/templates/shared/create-testcase-workflow.md +470 -0
  59. package/custom/templates/shared/gate-workflow.md +122 -16
  60. package/docs/common/CHANGELOG.md +47 -0
  61. package/package.json +2 -2
  62. package/scripts/create-score-excel.js +17 -7
  63. package/scripts/init.js +48 -1
  64. package/scripts/review.js +128 -0
  65. package/scripts/update.js +4 -1
  66. package/scripts/use.js +22 -16
package/README.md CHANGED
@@ -10,18 +10,21 @@ Developers only need a single command to load ticket context → AI automaticall
10
10
 
11
11
  | Problem | Solution |
12
12
  |--------|-----------|
13
- | Multi-step, complex installation | `aiflow init` — 1 command to set up everything |
14
- | Need long prompts for AI to understand | `aiflow use PROJ-33` — AI automatically reads from ticket |
13
+ | Multi-step, complex installation | `ak init` — 1 command to set up everything |
14
+ | Need long prompts for AI to understand | `ak use PROJ-33` — AI automatically reads from ticket |
15
15
  | Too many templates, not sure which to use | AI auto-detects task type and selects the appropriate skill |
16
16
  | New plugins (superpowers, MCP...) require manual setup | Package auto-sets up hooks, skills, and MCP on init |
17
17
  | Missing investigation / bug reproduction flow | Skill `investigate-bug` (inherits systematic-debugging) |
18
18
  | Missing impact analysis flow | Skill `impact-analysis` |
19
19
  | Hard to resume tasks | **State Resumption**: Unified `plan/` docs, `task-summary.md` progress tracking, and intelligent session continuity (automatic Gate 3 resumption). |
20
+ | BA writing specs without a structured workflow | `ak use PROJ-33` (taskType: spec) → AI follows 4-gate BA workflow (Q&A → Prototype → UC Spec) |
21
+ | QA creating test cases manually without structure | `ak use PROJ-33` (taskType: testcase) → AI follows 4-gate QA workflow (Analysis → Scenarios → Detailed TCs → Review) |
22
+ | Gate transitions happen without formal approval | Gate review protocol — each gate requires explicit `APPROVED` before AI advances to the next gate |
20
23
 
21
24
  ## Documentation & Guides
22
25
 
23
26
  > [!TIP]
24
- > After running `aiflow init`, documentation files are automatically copied to `.aiflow/docs/` in your project for easy access.
27
+ > After running `ak init`, documentation files are automatically copied to `.aiflow/docs/` in your project for easy access.
25
28
 
26
29
  - **[Quick Start Guide](https://github.com/example/ai-flow-kit/blob/main/docs/common/QUICK_START.md)** — Step-by-step instructions for developers.
27
30
  - **[Full Workflow (5 Gates)](https://github.com/example/ai-flow-kit/blob/main/docs/common/AIFLOW.md)** — In-depth look at the Gate process.
@@ -31,14 +34,14 @@ Developers only need a single command to load ticket context → AI automaticall
31
34
 
32
35
  ---
33
36
 
34
- ## Overview Flow
37
+ ## Coding Flow
35
38
 
36
39
  ```
37
40
  PM writes ticket on Backlog/Jira
38
41
 
39
42
 
40
43
  ⛩️ GATE 1 — AI Analyze Requirement [AI + DEV]
41
- aiflow use PROJ-33 → claude
44
+ ak use PROJ-33 → claude
42
45
  AI loads ticket + reads source code
43
46
  AI asks clarifying questions (max 1 in Fast mode)
44
47
  AI outputs: plan/PROJ-33/requirement.md (Lite in Fast mode)
@@ -70,11 +73,126 @@ PM writes ticket on Backlog/Jira
70
73
 
71
74
  ---
72
75
 
76
+ ## Execute Test Flow
77
+
78
+ ```
79
+ ak execute PROJ-44 (or ./testcases.md or ak execute)
80
+
81
+
82
+ ⛩️ GATE 1 — Pre-flight & Work Plan [AI + QA]
83
+ Parse TC file → verify ak-test/{repo}/ exists
84
+ Check BASE_URL env var + playwright.config.ts
85
+ Create execution work plan
86
+ QA reviews → "APPROVED"
87
+ │ APPROVED
88
+
89
+ ⛩️ GATE 2 — Script Sync [AI]
90
+ Hash-based TC↔script sync
91
+ Generate new / update changed / skip unchanged
92
+ Uses Playwright MCP for selectors — never fabricates
93
+ │ Scripts synced
94
+
95
+ ⛩️ GATE 3 — Execute & Evidence [AI + QA]
96
+ Run: npx playwright test
97
+ Organize evidence per run-{N}/: screenshots, trace.zip, result.md
98
+ Auto-draft bug files for failed TCs
99
+ Support RETEST: [TC_ID] loop
100
+ QA reviews → "APPROVED"
101
+ │ APPROVED
102
+
103
+ ⛩️ GATE 4 — Report & Bug Logging [AI + QA]
104
+ Generate testreport.md with Go/No-Go recommendation
105
+ Log each failed TC to Jira/Backlog — interactive confirm per bug
106
+ QA reviews → "APPROVED"
107
+
108
+
109
+ DONE
110
+ ```
111
+
112
+ > **Entry points:** `ak execute PROJ-44` (from ticket) · `ak execute ./testcases/AD10.md` (from file) · `ak execute` (manual — AI asks for TC file path)
113
+
114
+ ---
115
+
116
+ ## Create Spec Flow
117
+
118
+ ```
119
+ ak use PROJ-33 (taskType: spec) → claude
120
+
121
+
122
+ ⛩️ GATE 1 — Phân tích Yêu cầu Ban đầu [AI + BA]
123
+ AI đọc ticket, phân tích yêu cầu, phân loại Facts vs Assumptions
124
+ AI phát hiện Gaps và tạo danh sách câu hỏi Q&A cần làm rõ
125
+ BA review Q&A → "APPROVED"
126
+ │ APPROVED
127
+
128
+ ⛩️ GATE 2 — Q&A Loop & Confirm [AI + BA]
129
+ AI cập nhật phân tích theo từng câu trả lời của BA
130
+ AI re-check Q&A đến khi tất cả được xác nhận (Confirmed)
131
+ BA xác nhận toàn bộ Q&A → "APPROVED"
132
+ │ APPROVED
133
+
134
+ ⛩️ GATE 3 — Prototype Design [AI + BA]
135
+ AI tạo HTML/CSS prototype cho các màn hình chính
136
+ BA review UI flow → "APPROVED"
137
+ │ APPROVED
138
+
139
+ ⛩️ GATE 4 — UC Spec hoàn chỉnh [AI + BA]
140
+ AI tạo đầy đủ UC Spec document (flows, business rules, validations)
141
+ BA review → "APPROVED"
142
+
143
+
144
+ DONE
145
+ ```
146
+
147
+ > **Entry point:** `ak use PROJ-33` → chọn taskType **"spec"** trong danh sách — AI tự động khởi chạy BA workflow.
148
+
149
+ ---
150
+
151
+ ## Create Testcase Flow
152
+
153
+ ```
154
+ ak use PROJ-33 (taskType: testcase) → claude
155
+
156
+
157
+ ⛩️ GATE 1 — Phân tích Yêu cầu & Rủi ro [AI + QA]
158
+ AI đọc ticket/spec, phân tích scope và rủi ro
159
+ AI đọc source code để tìm validation rules và business logic ẩn
160
+ AI đặt câu hỏi làm rõ yêu cầu
161
+ QA review → "APPROVED"
162
+ │ APPROVED
163
+
164
+ ⛩️ GATE 2 — Xây dựng Scenarios & Checklist [AI + QA]
165
+ AI generate checklist theo nhóm (Functional, Non-functional, Data, Regression)
166
+ AI kiểm tra Dev Artifacts (PR diff) để bổ sung regression TCs
167
+ AI output: test-plan/checklist.md
168
+ QA review → "APPROVED"
169
+ │ APPROVED
170
+
171
+ ⛩️ GATE 3 — Thiết kế Test Case chi tiết [AI + QA]
172
+ AI tạo bảng test case đầy đủ (TC_ID, Steps, Expected Result)
173
+ AI áp dụng kỹ thuật: BVA, Equivalence Partitioning, Decision Table
174
+ AI output: test-plan/test-cases/
175
+ QA review → "APPROVED"
176
+ │ APPROVED
177
+
178
+ ⛩️ GATE 4 — Review & Tối ưu [AI + QA]
179
+ AI review coverage, loại bỏ duplicate, bổ sung edge cases còn thiếu
180
+ AI export final test case set: test-plan/test-cases/final-testcases.md
181
+ QA review → "APPROVED"
182
+
183
+
184
+ DONE
185
+ ```
186
+
187
+ > **Entry point:** `ak use PROJ-33` → chọn taskType **"testcase"** trong danh sách — AI tự động khởi chạy QA workflow.
188
+
189
+ ---
190
+
73
191
  ## Installation
74
192
 
75
193
  ```bash
76
- # Stable version
77
- npm install -g @relipa/ai-flow-kit
194
+ # Stable version (latest)
195
+ npm install -g @relipa/ai-flow-kit@latest
78
196
 
79
197
  # Beta version (recommend for newest features)
80
198
  npm install -g @relipa/ai-flow-kit@beta
@@ -89,32 +207,40 @@ npm uninstall -g @relipa/ai-flow-kit
89
207
 
90
208
  | Command | Description |
91
209
  |---------|-------------|
92
- | `aiflow init` | Setup framework, adapters, and multi-AI rules. |
93
- | `aiflow use <ticket...>` | Load context from one or more tickets/files. First target is primary; rest become supplementary. |
94
- | `aiflow execute <target>` | **QA:** Execute test cases — load TC file, sync Playwright scripts, run and collect evidence. |
95
- | `aiflow fetch-links <url>` | Fetch a Backlog/Jira link and print SupplementaryContext JSON (used by AI at runtime). |
96
- | `aiflow task` | Manage multiple tasks — pause, switch, resume. |
97
- | `aiflow task next` | Finalize gate approval and prepare for fresh session. |
98
- | `aiflow prompt` | Generate tool-optimized prompts (`--env cursor`). |
99
- | `aiflow sync-skills` | Manually synchronize AI Instruction files with local custom skills. |
100
- | `aiflow telemetry` | Manage telemetry tracking (enable/disable/status). |
101
- | `aiflow guide` | View integrated multi-AI integration guide. |
102
-
103
- ### `aiflow init`
210
+ | `ak init` | Setup framework, adapters, and multi-AI rules. |
211
+ | `ak use <ticket...>` | Load context from one or more tickets/files. First target is primary; rest become supplementary. |
212
+ | `ak execute <target>` | **QA:** Execute test cases — load TC file, sync Playwright scripts, run and collect evidence. |
213
+ | `ak fetch-links <url>` | Fetch a Backlog/Jira link and print SupplementaryContext JSON (used by AI at runtime). |
214
+ | `ak task` | Manage multiple tasks — pause, switch, resume. |
215
+ | `ak task next` | Finalize gate approval and prepare for fresh session. |
216
+ | `ak prompt` | Generate tool-optimized prompts (`--env cursor`). |
217
+ | `ak sync-skills` | Manually synchronize AI Instruction files with local custom skills. |
218
+ | `ak telemetry` | Manage telemetry tracking (enable/disable/status). |
219
+ | `ak guide` | View integrated multi-AI integration guide. |
220
+ | `ak doctor` | Check setup health and token savings status. |
221
+ | `ak update` | Update skills, rules, and templates to the latest version. |
222
+ | `ak remove` | Remove ai-flow-kit scaffolding from project. |
223
+ | `ak detect "<description>"` | Auto-detect task type from a description string. |
224
+ | `ak validate <file>` | Validate code output against team rules. |
225
+ | `ak memory` | Save/search team knowledge base. |
226
+ | `ak context` | Manage saved contexts (show/list/save/load/delete/clear). |
227
+ | `ak gate <n> start\|approved` | Log gate transitions — called automatically by AI. |
228
+
229
+ ### `ak init`
104
230
 
105
231
  Initial setup for the project. Run once per project.
106
232
 
107
233
  ```bash
108
234
  # Single framework + adapter
109
- aiflow init --framework spring-boot --adapter backlog
235
+ ak init --framework spring-boot --adapter backlog
110
236
 
111
237
  # Enable token savings tools
112
- aiflow init --with-rtk # RTK: compress bash outputs (60–90% reduction)
113
- # aiflow init --with-gitnexus # GitNexus: code intelligence (waits for index)
114
- # aiflow init --with-gitnexus --no-wait # GitNexus: index in background
238
+ ak init --with-rtk # RTK: compress bash outputs (60–90% reduction)
239
+ # ak init --with-gitnexus # GitNexus: code intelligence (waits for index)
240
+ # ak init --with-gitnexus --no-wait # GitNexus: index in background
115
241
 
116
242
  # Multiple frameworks and adapters
117
- aiflow init --framework spring-boot,reactjs --adapter backlog,jira
243
+ ak init --framework spring-boot,reactjs --adapter backlog,jira
118
244
  ```
119
245
 
120
246
  **What gets automatically set up:**
@@ -142,37 +268,37 @@ aiflow init --framework spring-boot,reactjs --adapter backlog,jira
142
268
 
143
269
  ---
144
270
 
145
- ### `aiflow execute <target>`
271
+ ### `ak execute <target>`
146
272
 
147
273
  Execute test cases from a Backlog/Jira ticket, a TC file, or manually. The AI syncs Playwright scripts, runs them, collects evidence, and generates a test report.
148
274
 
149
275
  ```bash
150
276
  # From a ticket (taskType must be "execute")
151
- aiflow execute PROJ-44
277
+ ak execute PROJ-44
152
278
 
153
279
  # From a TC file directly
154
- aiflow execute ./testcases/AD10.md
280
+ ak execute ./testcases/AD10.md
155
281
 
156
282
  # Manual — AI asks for TC file path
157
- aiflow execute
283
+ ak execute
158
284
  ```
159
285
 
160
286
  **What happens (4-gate Execute Flow):**
161
- 1. **Gate 1 — Pre-flight:** Parse TC file, verify `ak-test/{repo}/` exists, check `BASE_URL` and `playwright.config.ts`
287
+ 1. **Gate 1 — Pre-flight:** Parse TC file, verify `ak-test/{repo}/` exists, check `BASE_URL` and `playwright.config.ts` — QA reviews → `APPROVED`
162
288
  2. **Gate 2 — Script Sync:** Hash-based TC↔script sync — gen new, update changed, skip unchanged (never fabricates selectors — uses Playwright MCP)
163
- 3. **Gate 3 — Execute & Evidence:** Run Playwright, organize evidence per `run-{N}/`, update TC file R1/R2 columns
164
- 4. **Gate 4 — Report & Bug Logging:** Generate `testreport.md`, ask per-bug Jira confirmation
289
+ 3. **Gate 3 — Execute & Evidence:** Run Playwright, organize evidence per `run-{N}/`, update TC file R1/R2 columns — QA reviews → `APPROVED`
290
+ 4. **Gate 4 — Report & Bug Logging:** Generate `testreport.md`, ask per-bug Jira confirmation — QA reviews → `APPROVED`
165
291
 
166
292
  > **Multi-AI:** Works with Claude, Gemini, Cursor, Copilot — the execute-flow skill is loaded via `ak init`/`ak up`.
167
293
 
168
294
  ---
169
295
 
170
- ### `aiflow sync-skills`
296
+ ### `ak sync-skills`
171
297
 
172
298
  Synchronize AI instruction files (`CLAUDE.md`, `GEMINI.md`, etc.) and Skills without upgrading the package version.
173
299
 
174
300
  ```bash
175
- aiflow sync-skills
301
+ ak sync-skills
176
302
  ```
177
303
 
178
304
  **Features:**
@@ -182,59 +308,59 @@ aiflow sync-skills
182
308
 
183
309
  ---
184
310
 
185
- ### `aiflow use <ticket...>`
311
+ ### `ak use <ticket...>`
186
312
 
187
313
  Load ticket context into `.aiflow/context/current.json`. Accepts **one or more targets** (ticket ID, Backlog/Jira URL, or local file). The first target becomes the **primary context**; any additional targets are appended as **`supplementaryContext[]`** for AI to read alongside the primary.
188
314
 
189
315
  ```bash
190
316
  # Single target (backward compatible)
191
- aiflow use PROJ-33
192
- aiflow use https://mycompany.backlog.com/view/PROJ-33
317
+ ak use PROJ-33
318
+ ak use https://mycompany.backlog.com/view/PROJ-33
193
319
 
194
320
  # Multiple targets — primary + supplementary
195
- aiflow use PROJ-33 PROJ-10 docs/arch.md
321
+ ak use PROJ-33 PROJ-10 docs/arch.md
196
322
  # PROJ-33 drives Gate 1; PROJ-10 + docs/arch.md become supplementary context
197
323
 
198
324
  # Backlog / Jira ticket
199
- aiflow use PROJ-123
325
+ ak use PROJ-123
200
326
 
201
327
  # Comments
202
- aiflow use PROJ-33 --with-comments
203
- aiflow use PROJ-33 --comments-last 5
204
- aiflow use PROJ-33 --comments-from 3
328
+ ak use PROJ-33 --with-comments
329
+ ak use PROJ-33 --comments-last 5
330
+ ak use PROJ-33 --comments-from 3
205
331
 
206
332
  # Manual input
207
- aiflow use --manual
333
+ ak use --manual
208
334
 
209
335
  # Load from local file (JSON or plain text)
210
- aiflow use --file task.md # Auto-generates taskId from filename & prompts for taskType
336
+ ak use --file task.md # Auto-generates taskId from filename & prompts for taskType
211
337
 
212
338
  # Modes (Fast is default)
213
- aiflow use PROJ-33 # Fast Mode: skip Q&A, target < 5 min
214
- aiflow use PROJ-33 --full # Full Mode: deep analysis with Q&A
339
+ ak use PROJ-33 # Fast Mode: skip Q&A, target < 5 min
340
+ ak use PROJ-33 --full # Full Mode: deep analysis with Q&A
215
341
 
216
342
  # Save with custom name
217
- aiflow use PROJ-33 --save sprint-42-bug
343
+ ak use PROJ-33 --save sprint-42-bug
218
344
  ```
219
345
 
220
346
  > **New in v0.1.0 — Auto Link Resolution:** When the primary ticket description contains Backlog/Jira URLs, `ak use` automatically fetches them and stores results in `supplementaryContext[]`. Comment links (`#comment-456` or `?focusedCommentId=456`) fetch **only that comment**. Capped at 5 auto-resolved links per `use` to keep loads fast.
221
347
 
222
348
  ---
223
349
 
224
- ### `aiflow fetch-links <url>`
350
+ ### `ak fetch-links <url>`
225
351
 
226
352
  Fetch a single Backlog/Jira link and print a `SupplementaryContext` JSON object to stdout. Intended for AI runtime use inside the `read-study-requirement` skill when a link is found in the ticket description that wasn't already resolved at `use` time.
227
353
 
228
354
  ```bash
229
355
  # Backlog ticket → full ticket JSON
230
- aiflow fetch-links "https://company.backlog.com/view/PROJ-10"
356
+ ak fetch-links "https://company.backlog.com/view/PROJ-10"
231
357
 
232
358
  # Backlog comment → that single comment only
233
- aiflow fetch-links "https://company.backlog.com/view/PROJ-10#comment-456"
359
+ ak fetch-links "https://company.backlog.com/view/PROJ-10#comment-456"
234
360
 
235
361
  # Jira ticket / comment
236
- aiflow fetch-links "https://company.atlassian.net/browse/PROJ-10"
237
- aiflow fetch-links "https://company.atlassian.net/browse/PROJ-10?focusedCommentId=789"
362
+ ak fetch-links "https://company.atlassian.net/browse/PROJ-10"
363
+ ak fetch-links "https://company.atlassian.net/browse/PROJ-10?focusedCommentId=789"
238
364
  ```
239
365
 
240
366
  Output schema:
@@ -257,47 +383,47 @@ Exits non-zero with a stderr message if the URL is not a recognised Backlog/Jira
257
383
 
258
384
  ---
259
385
 
260
- ### `aiflow task`
386
+ ### `ak task`
261
387
 
262
388
  Manage multiple tasks — pause a task, switch to another, and resume later while keeping full progress.
263
389
 
264
390
  ```bash
265
- aiflow task status # show active task and pending tasks
266
- aiflow task list # list all saved tasks
267
- aiflow task pause # pause current task (saves context + gate progress)
268
- aiflow task pause --note "waiting for API spec" # pause with a note
269
- aiflow task switch PROJ-99 # pause current + switch to another task
270
- aiflow task resume PROJ-33 # resume a paused task (restores context + gate state)
271
- aiflow task reset PROJ-33 # reset to Gate 1 (keeps ticket context, clears progress)
272
- aiflow task remove PROJ-33 # permanently delete all saved data for the task
273
- aiflow task next # approve current gate + prepare for fresh session
274
- aiflow task next --ticket PROJ-33 # same, but specify ticket explicitly
391
+ ak task status # show active task and pending tasks
392
+ ak task list # list all saved tasks
393
+ ak task pause # pause current task (saves context + gate progress)
394
+ ak task pause --note "waiting for API spec" # pause with a note
395
+ ak task switch PROJ-99 # pause current + switch to another task
396
+ ak task resume PROJ-33 # resume a paused task (restores context + gate state)
397
+ ak task reset PROJ-33 # reset to Gate 1 (keeps ticket context, clears progress)
398
+ ak task remove PROJ-33 # permanently delete all saved data for the task
399
+ ak task next # approve current gate + prepare for fresh session
400
+ ak task next --ticket PROJ-33 # same, but specify ticket explicitly
275
401
  ```
276
402
 
277
403
  **Use case — switching tasks mid-flow:**
278
404
 
279
405
  ```bash
280
406
  # Working on PROJ-33 at Gate 2...
281
- aiflow task pause # pauses and saves PROJ-33 progress
407
+ ak task pause # pauses and saves PROJ-33 progress
282
408
 
283
- aiflow use PROJ-99 # loads urgent task (auto-pauses current)
284
- claude # AI starts Gate 1 for PROJ-99
409
+ ak use PROJ-99 # loads urgent task (auto-pauses current)
410
+ claude # AI starts Gate 1 for PROJ-99
285
411
 
286
412
  # Done with PROJ-99, resuming PROJ-33
287
- aiflow task resume PROJ-33 # restores context
288
- claude # AI resumes from Gate 2 automatically
413
+ ak task resume PROJ-33 # restores context
414
+ claude # AI resumes from Gate 2 automatically
289
415
  ```
290
416
 
291
417
  Task state (context + gate progress) is saved in `.aiflow/tasks/<taskId>/`.
292
418
 
293
419
  ---
294
420
 
295
- ### `aiflow doctor`
421
+ ### `ak doctor`
296
422
 
297
423
  Check if the setup is complete.
298
424
 
299
425
  ```bash
300
- aiflow doctor
426
+ ak doctor
301
427
  ```
302
428
 
303
429
  ```
@@ -311,34 +437,34 @@ aiflow doctor
311
437
 
312
438
  ---
313
439
 
314
- ### `aiflow update`
440
+ ### `ak update`
315
441
 
316
442
  Update skills, rules, and templates to the latest version.
317
443
 
318
444
  ```bash
319
- aiflow update
445
+ ak update
320
446
  ```
321
447
 
322
448
  ---
323
449
 
324
- ### `aiflow validate <file>`
450
+ ### `ak validate <file>`
325
451
 
326
452
  Validate code output against team rules.
327
453
 
328
454
  ```bash
329
- aiflow validate src/Payment.java --ruleset strict
455
+ ak validate src/Payment.java --ruleset strict
330
456
  ```
331
457
 
332
458
  ---
333
459
 
334
- ### `aiflow memory`
460
+ ### `ak memory`
335
461
 
336
462
  Save/search team knowledge.
337
463
 
338
464
  ```bash
339
- aiflow memory save "payment-flow" "Payment flow description..."
340
- aiflow memory search "payment"
341
- aiflow memory list
465
+ ak memory save "payment-flow" "Payment flow description..."
466
+ ak memory search "payment"
467
+ ak memory list
342
468
  ```
343
469
 
344
470
  ---
@@ -354,6 +480,10 @@ aiflow memory list
354
480
  | `generate-spec` | "new feature", "spec", "design" | Write technical specs, integrates `brainstorming` |
355
481
  | `report-customer` | "customer report", "incident" | Write incident reports for Customer Service |
356
482
  | `figma-to-component` | "figma", "design", "generate component" | Read Figma design → generate React/Next.js App Router/Vue/Angular component. [Workflow guide](docs/common/workflows/figma.md) |
483
+ | `generate-testcase` | "create testcase", "test case", "QA checklist" | Generate detailed test cases from requirements (4-phase: Analysis → Checklist → TC Table → Review) |
484
+ | `execute-flow` | "execute test", "run test", taskType: execute | 4-gate test execution orchestrator with Playwright MCP |
485
+ | `create-spec` | taskType: spec | BA 4-gate UC Spec workflow (Q&A → Prototype → UC Spec) |
486
+ | `create-testcase` | taskType: testcase | QA 4-gate testcase creation workflow (Analysis → Scenarios → TCs → Review) |
357
487
 
358
488
  ### Superpowers skills (upstream, inherited from obra/superpowers)
359
489
 
@@ -436,7 +566,7 @@ ai-flow-kit/
436
566
 
437
567
  **Custom skill:** create `custom/skills/<name>/SKILL.md`
438
568
 
439
- Then run `aiflow update` or `aiflow sync-skills` to apply.
569
+ Then run `ak update` or `ak sync-skills` to apply.
440
570
 
441
571
  ---
442
572
 
@@ -445,8 +575,8 @@ Then run `aiflow update` or `aiflow sync-skills` to apply.
445
575
  | Environment | Experience | Notes |
446
576
  |-----------|------------|---------|
447
577
  | Claude Code CLI (`claude`) | ⭐⭐⭐⭐⭐ | Full auto — skills, hook, automatically loaded context |
448
- | Claude Extension (VS Code) | ⭐⭐⭐ | `aiflow prompt <type>` → copy paste |
449
- | Antigravity / Cursor | ⭐⭐⭐ | `aiflow prompt <type>` → copy paste |
578
+ | Claude Extension (VS Code) | ⭐⭐⭐ | `ak prompt <type>` → copy paste |
579
+ | Antigravity / Cursor | ⭐⭐⭐ | `ak prompt <type>` → copy paste |
450
580
 
451
581
  ---
452
582
 
@@ -454,6 +584,38 @@ Then run `aiflow update` or `aiflow sync-skills` to apply.
454
584
 
455
585
  > Summary of major changes per version. See full details in [CHANGELOG.md](docs/common/CHANGELOG.md).
456
586
 
587
+ ### v0.1.4 — 2026-06-29
588
+ - **Create Spec Flow (4-Gate BA Workflow):** New `taskType: "spec"` — Q&A Analysis → Prototype Design → UC Spec. AI follows UCflow process guided by `ba-skills/` sub-skills.
589
+ - **Create Testcase Flow (4-Gate QA Workflow):** New `taskType: "testcase"` — Requirement Analysis → Scenario Building → Detailed TC Design → Review & Optimize. AI applies BVA, Equivalence Partitioning, Decision Table techniques.
590
+ - **BA Skills Library:** New `ba-skills/` skill set covering initial analysis, Q&A generation, business rules, UC spec writing, and Mermaid flow diagrams.
591
+ - **Test Skills Library:** New `test-skills/` skill set with 20+ sub-skills covering UI testing, business testing, data testing, integration testing, and domain-specific (CMS, E-commerce) test patterns.
592
+ - **Gate Review Protocol:** Explicit QA/BA `APPROVED` required at each gate before AI advances — eliminates silent gate skipping.
593
+ - **`gate-review` skill:** New orchestration skill that enforces the gate review protocol across all workflow types (coding, execute, spec, testcase).
594
+ - Documentation: README updated with Coding Flow, Create Spec Flow, Create Testcase Flow diagrams; `aiflow` CLI alias fully renamed to `ak` throughout.
595
+
596
+ ### v0.1.3 — 2026-06-18
597
+ - **Execute Test Flow (4-Gate):** New `ak execute` command + `execute-flow` skill — Pre-flight → Script Sync → Execute & Evidence → Report & Bug Logging.
598
+ - **`script-sync` skill:** Hash-based TC↔Playwright script sync — gen new, update changed, skip unchanged. Uses MCP browser tools for selectors, never fabricates.
599
+ - **`ak execute` command** (`ak ex` alias): Standalone QA entry point — accepts ticket ID, TC file path, or interactive mode.
600
+ - **▶️ Execute Test** added to `ak use` type selector; `taskType: "execute"` routes AI to execute-flow skill automatically.
601
+ - **Playwright harness scaffold** (`ak scaffold playwright`): Creates full `ak-test/{repo}/` structure with config, fixtures, and page objects.
602
+ - Fixes: `screenId` casing ambiguity, `--reporter` flag overriding config reporters, Gate 1 missing `playwright.config.ts` check.
603
+
604
+ ### v0.1.2 — 2026-06-13
605
+ - **Testing Workflow (4-Gate):** New `taskType: "testing"` — Test Analysis → Test Planning → Test Execution → Test Report. AI auto-routes skill per gate.
606
+ - **`python-ml` framework:** Supports scikit-learn / PyTorch / TensorFlow / MLflow / Wandb. Auto-detected from `requirements.txt` / `pyproject.toml`.
607
+ - **Task type selector in `ak use`:** Interactive list after loading ticket — auto-detects and pre-selects task type.
608
+ - **Critical fix — `update`/`init` not updating CLAUDE.md/GEMINI.md:** Fixed 3 compounding causes (`framework` singular vs. plural, missing `force: true`, per-file confirm dialogs).
609
+ - **Backup before overwrite:** AI instruction files backed up to `.aiflow/bk/YYYY-MM-DD_HH-MM_<filename>` before any overwrite.
610
+ - **`ak update` no longer wipes `.claude/`:** Now clears only `.claude/skills/`, preserving `settings.json` and hooks.
611
+
612
+ ### v0.1.1 — 2026-06-08
613
+ - **Ubuntu/Linux clipboard in `ak prompt`:** Auto-detects display server (Wayland/X11) and package manager — offers to install clipboard tool if missing.
614
+ - **`figma-to-component` image detection & export:** Scans node tree for image nodes, exports to `public/assets/figma/`, renders with `<Image>`/`<img>`.
615
+ - **`figma-to-component` MCP pre-check (Step 0):** Verifies MCP connected before running; stops with setup instructions if not.
616
+ - **`figma-to-component` CSS tooling detection:** Branches on Tailwind / CSS Modules / styled-components / vanilla CSS; maps Figma Styles/Variables to existing tokens.
617
+ - **Critical fix — `figma-to-component` source/installed divergence:** Synced both copies to canonical version with correct tool names and 4-tier framework detection.
618
+
457
619
  ### v0.1.0 — 2026-05-28
458
620
  - Multi-target `ak use` — load multiple tickets/files in a single call (primary + supplementary).
459
621
  - Auto link resolution — auto-fetch Backlog/Jira URLs found in the ticket description (capped at 5 links).
@@ -477,47 +639,47 @@ Then run `aiflow update` or `aiflow sync-skills` to apply.
477
639
  - v0.0.8-beta.1: Actually removed auto-commit + added PreToolUse hook blocking `git commit/add/push`.
478
640
 
479
641
  ### v0.0.7 — 2026-05-08
480
- - `aiflow use --file` auto-generates `taskId` from filename + interactive `taskType` prompt.
642
+ - `ak use --file` auto-generates `taskId` from filename + interactive `taskType` prompt.
481
643
  - Auto-generates `task-summary.md` at each gate transition.
482
644
  - Added NestJS and PHP Plain framework support.
483
- - New `aiflow sync-skills` command.
645
+ - New `ak sync-skills` command.
484
646
  - Marker-based update for `CLAUDE.md`, `GEMINI.md`, `.cursorrules`.
485
647
  - Auto-manages `.gitignore` for generated files.
486
648
 
487
649
  ### v0.0.6 — 2026-04-29
488
650
  - **Fast Mode** enabled by default (reduced Q&A, single-session implementation).
489
- - New `aiflow task` command group (status/list/pause/switch/resume).
651
+ - New `ak task` command group (status/list/pause/switch/resume).
490
652
  - Integrated RTK token compression (60–90% savings).
491
653
  - `--file` loader supports plain-text input.
492
654
 
493
655
  ### v0.0.5 — 2026-04-23
494
656
  - Telemetry MVP — opt-in tracking, HMAC-SHA256 signed payload, no prompt content logged.
495
- - New `aiflow gate <n> <action>` command for AI to call automatically on gate transitions.
496
- - Safe overwrite flow in `aiflow init` (backs up existing files before overwrite).
657
+ - New `ak gate <n> <action>` command for AI to call automatically on gate transitions.
658
+ - Safe overwrite flow in `ak init` (backs up existing files before overwrite).
497
659
 
498
660
  ### v0.0.1 — 2026-04-13
499
- - Initial release: `aiflow` CLI, 5-Gate workflow, 7 custom skills, support for Claude Code / Gemini / Copilot.
661
+ - Initial release: `ak` CLI, 5-Gate workflow, 7 custom skills, support for Claude Code / Gemini / Copilot.
500
662
 
501
663
  ---
502
664
 
503
665
  ## Troubleshooting
504
666
 
505
- **`aiflow` not found:**
667
+ **`ak` not found:**
506
668
  ```bash
507
- npm install -g @relipa/ai-flow-kit
669
+ npm install -g @relipa/ai-flow-kit@latest
508
670
  ```
509
671
 
510
672
  **Backlog load fails:**
511
673
  ```bash
512
- aiflow doctor
674
+ ak doctor
513
675
  # Re-setup credentials
514
- aiflow init --adapter backlog
676
+ ak init --adapter backlog
515
677
  ```
516
678
 
517
679
  **Skills not loading in Claude:**
518
680
  ```bash
519
681
  # Ensure init was run outside Claude terminal (session-start hook needs restart)
520
- aiflow doctor
682
+ ak doctor
521
683
  ```
522
684
 
523
685
  See more: [docs/common/troubleshooting.md](./docs/common/troubleshooting.md)
package/bin/aiflow.js CHANGED
@@ -503,6 +503,53 @@ program
503
503
  }
504
504
  });
505
505
 
506
+ // ── review ────────────────────────────────────────────────────
507
+ const reviewCmd = program.command('review').description('Gate review file operations');
508
+
509
+ reviewCmd
510
+ .command('check')
511
+ .description('Check review file state — called by AI before accepting APPROVED')
512
+ .requiredOption('-g, --gate <n>', 'gate number (string — supports sub-phases like 2a, 2b)')
513
+ .requiredOption('-t, --ticket <id>', 'ticket ID')
514
+ .action(async (opts) => {
515
+ const { checkReviewFile } = require('../scripts/review');
516
+ const result = await checkReviewFile(opts.gate, opts.ticket);
517
+
518
+ if (!result.exists) {
519
+ console.log(chalk.red(`\n ✗ Review file not found for gate ${opts.gate}, ticket ${opts.ticket}`));
520
+ console.log(chalk.gray(` Expected: .aiflow/review/gate-${opts.gate}-${opts.ticket}.md`));
521
+ console.log(chalk.yellow(' → Re-generate the review file before accepting APPROVED.\n'));
522
+ process.exit(1);
523
+ }
524
+
525
+ if (result.passed) {
526
+ console.log(chalk.green(`\n ✅ All ${result.total} items checked — gate can proceed\n`));
527
+ process.exit(0);
528
+ }
529
+
530
+ const pendingCount = result.unchecked.length + result.commented.length;
531
+ console.log(chalk.red(`\n ❌ Review incomplete — ${pendingCount} item(s) pending:\n`));
532
+
533
+ if (result.commented.length > 0) {
534
+ console.log(chalk.yellow(' Items with comments (need AI revision):'));
535
+ result.commented.forEach(({ item, comment }) => {
536
+ console.log(chalk.yellow(` • ${item}`));
537
+ console.log(chalk.gray(` Comment: "${comment}"`));
538
+ });
539
+ if (result.unchecked.length > 0) console.log('');
540
+ }
541
+
542
+ if (result.unchecked.length > 0) {
543
+ console.log(chalk.red(' Items unchecked (no comment — please check or add a comment):'));
544
+ result.unchecked.forEach(item => {
545
+ console.log(chalk.red(` • ${item}`));
546
+ });
547
+ }
548
+
549
+ console.log(chalk.gray('\n → Check all items in the review file, then type APPROVED again.\n'));
550
+ process.exit(1);
551
+ });
552
+
506
553
  // ── remove ────────────────────────────────────────────────────
507
554
  program
508
555
  .command('remove')
@@ -531,7 +578,7 @@ program
531
578
  .description('Manually synchronize AI Instruction files with local custom skills')
532
579
  .action(async () => {
533
580
  const projectDir = process.cwd();
534
- const { setupFramework, AI_TOOL_FILES, ensureAiflowGitignored } = require('../scripts/init');
581
+ const { setupFramework, AI_TOOL_FILES, ensureAiflowGitignored, setupClaudeCommands } = require('../scripts/init');
535
582
  const fs = require('fs-extra');
536
583
  const path = require('path');
537
584
  const chalk = require('chalk');
@@ -551,6 +598,7 @@ program
551
598
  for (const fw of frameworks) {
552
599
  await setupFramework(projectDir, fw, frameworks.length > 1, selectedTools, { force: true });
553
600
  }
601
+ await setupClaudeCommands(projectDir);
554
602
  await ensureAiflowGitignored(projectDir);
555
603
  console.log(chalk.green('✨ Sync completed!'));
556
604
  });