@relipa/ai-flow-kit 0.1.5-beta.0 → 0.1.5-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.
- package/custom/rules/project-conventions.md +67 -51
- package/custom/skills/gate-review/SKILL.md +1 -1
- package/custom/skills/generate-spec/SKILL.md +99 -99
- package/custom/skills/read-study-requirement/SKILL.md +7 -5
- package/custom/skills/review-plan/SKILL.md +194 -194
- package/custom/templates/shared/create-testcase-workflow.md +21 -9
- package/custom/templates/shared/gate-workflow.md +61 -8
- package/custom/templates/tools/claude.md +13 -13
- package/custom/templates/tools/copilot.md +12 -12
- package/custom/templates/tools/cursor.md +12 -12
- package/custom/templates/tools/gemini.md +22 -22
- package/custom/templates/tools/generic.md +17 -17
- package/docs/common/AIFLOW.md +10 -10
- package/docs/common/CHANGELOG.md +5 -0
- package/docs/common/ai-integration.md +53 -53
- package/docs/common/workflows/bug-fix.md +126 -126
- package/docs/common/workflows/feature.md +123 -123
- package/package.json +1 -1
- package/scripts/hooks/session-start.js +9 -5
- package/scripts/task.js +69 -22
|
@@ -1,51 +1,67 @@
|
|
|
1
|
-
# Project Conventions (Override Skill Defaults)
|
|
2
|
-
|
|
3
|
-
> **MANDATORY:** These rules override ANY upstream skill default (including `writing-plans`, `generate-spec`, and all superpowers skills).
|
|
4
|
-
> Read this file before writing any output file during the Gate Workflow.
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
##
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
|
13
|
-
|
|
14
|
-
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
-
|
|
1
|
+
# Project Conventions (Override Skill Defaults)
|
|
2
|
+
|
|
3
|
+
> **MANDATORY:** These rules override ANY upstream skill default (including `writing-plans`, `generate-spec`, and all superpowers skills).
|
|
4
|
+
> Read this file before writing any output file during the Gate Workflow.
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## DEV Workflow Output Paths (`04.Coding/`)
|
|
9
|
+
|
|
10
|
+
Áp dụng cho taskType: `feature` · `bug-fix` · `refactor` · `investigation` · `documentation`.
|
|
11
|
+
|
|
12
|
+
| Output | Path | Note |
|
|
13
|
+
|--------|------|------|
|
|
14
|
+
| Requirement doc | `04.Coding/01.Requirements/[functionId]/[ticketId].md` | Gate 1 output |
|
|
15
|
+
| Implementation plan | `04.Coding/02.Plans/[functionId]/[ticketId].md` | Gate 2 output — **NOT** `docs/superpowers/plans/` |
|
|
16
|
+
| TDD Notes (test list + notes) | `04.Coding/03.TDD-Notes/[functionId]/[ticketId].md` | Gate 3 output |
|
|
17
|
+
| Self-review / Summary | `04.Coding/04.Reviews/[functionId]/[ticketId].md` | Gate 4 output |
|
|
18
|
+
| PR description | `04.Coding/05.Pull-Requests/[functionId]/[ticketId].md` | Gate 5 output |
|
|
19
|
+
| Tracker | `04.Coding/00.Overview/_Index.md` | Update mỗi gate: `F-ID \| Ticket \| Dev \| Gate \| PR` |
|
|
20
|
+
|
|
21
|
+
> **Override:** The `writing-plans` skill defaults to `docs/superpowers/plans/<filename>.md`.
|
|
22
|
+
> In this project, **always save plans to `04.Coding/02.Plans/[functionId]/[ticketId].md` instead.**
|
|
23
|
+
|
|
24
|
+
### functionId & ticketId
|
|
25
|
+
|
|
26
|
+
- `[functionId]` là mã định danh chức năng **do dự án quy định** (ví dụ `F-001_User-Login`, `AD06`, `UC-LOGIN`) — không ép format.
|
|
27
|
+
- Được xác định BẮT BUỘC ở Gate 1 Pre-flight: từ `functionId`/`screenId` trong `.aiflow/context/current.json` → suy từ file UC Spec input (nội dung hoặc đường dẫn thư mục, ví dụ `02.BA-Specs/04.UC-Specs/[functionId]/`) rồi **hỏi DEV xác nhận** → cuối cùng mới hỏi DEV cung cấp trực tiếp.
|
|
28
|
+
- KHÔNG ĐƯỢC ghi output khi chưa có functionId.
|
|
29
|
+
- `[ticketId]` lấy từ `taskId` trong `.aiflow/context/current.json` (ví dụ `TICKET-100`). Một feature có nhiều ticket → folder theo functionId, file theo ticketId.
|
|
30
|
+
|
|
31
|
+
### Legacy
|
|
32
|
+
|
|
33
|
+
- ❌ Đường dẫn cũ `plan/[ticket-id]/requirement.md`, `plan/[ticket-id]/plan.md`, `plan/[ticket-id]/summary.md` đã **DEPRECATED** — không được ghi output mới vào `plan/`.
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
## Execution Handoff Message
|
|
38
|
+
|
|
39
|
+
When `writing-plans` skill says to announce the saved path, use the **actual path**:
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
Plan complete and saved to `04.Coding/02.Plans/[functionId]/[ticketId].md`. Two execution options: ...
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Do NOT copy the hardcoded path from the skill template (`docs/superpowers/plans/`).
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Checklist Before Writing Any File
|
|
50
|
+
|
|
51
|
+
Before saving any requirement, plan, TDD-notes, review, or PR file, verify:
|
|
52
|
+
|
|
53
|
+
- [ ] `functionId` đã được xác định/xác nhận ở Gate 1 Pre-flight
|
|
54
|
+
- [ ] `[ticketId]` is read from `.aiflow/context/current.json`
|
|
55
|
+
- [ ] Output path follows the table above — NOT the skill's default path, NOT the legacy `plan/` folder
|
|
56
|
+
- [ ] Directory `04.Coding/<section>/[functionId]/` exists or will be created
|
|
57
|
+
- [ ] Tracker `04.Coding/00.Overview/_Index.md` được cập nhật sau khi gate hoàn thành
|
|
58
|
+
- [ ] Announced path in the handoff message matches the actual saved path
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Other Conventions
|
|
63
|
+
|
|
64
|
+
- **Review checklist:** `custom/rules/review-checklist.md`
|
|
65
|
+
- **Code style:** `custom/rules/code-style.md`
|
|
66
|
+
- **Naming:** `custom/rules/naming.md`
|
|
67
|
+
- **Folder structure reference:** `docs/internal/Coding-Structure.md` · `docs/internal/Project-Structure.md`
|
|
@@ -55,7 +55,7 @@ When generating the output for a gate (e.g. `requirement.md` or `plan.md`), foll
|
|
|
55
55
|
3. If the JSON file does not exist, initialize it by writing an empty array `[]` (or `{ "comments": [] }`) to it. This ensures that the CLI verification commands do not fail due to a missing file when there are no comments.
|
|
56
56
|
|
|
57
57
|
### Step 2: Write the gate output file
|
|
58
|
-
Write the gate output file (e.g. `
|
|
58
|
+
Write the gate output file (e.g. `04.Coding/01.Requirements/[functionId]/[ticketId].md`, `04.Coding/02.Plans/[functionId]/[ticketId].md`, or `docs/ak-[project]/...`) as specified by the gate instructions.
|
|
59
59
|
|
|
60
60
|
### Step 3: Display gate pause message
|
|
61
61
|
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: generate-spec
|
|
3
|
-
description: Gate 2 — After DEV approves the requirement document (Gate 1), AI creates a detailed implementation plan using TDD approach. This is the bridge between requirement and code.
|
|
4
|
-
keywords: spec, plan, implementation, tdd, coding plan
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# Implementation Plan — Gate 2
|
|
8
|
-
|
|
9
|
-
> **GATE 2: Runs after Gate 1 (requirement document) has been APPROVED by DEV.**
|
|
10
|
-
>
|
|
11
|
-
> Principle: AI uses the approved requirement document to create a detailed implementation plan with TDD steps. DEV confirms the plan before coding begins.
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## Conditions to Enter Gate 2
|
|
16
|
-
|
|
17
|
-
- ✅ Gate 1 APPROVED — `
|
|
18
|
-
- ✅ Requirement document includes: requirements, solution, impact analysis, estimate
|
|
19
|
-
|
|
20
|
-
## Fast Mode Output Rules (CRITICAL)
|
|
21
|
-
|
|
22
|
-
When updating `
|
|
23
|
-
- **Keep it extremely short.**
|
|
24
|
-
- Add a bullet point indicating Gate 2 plan is ready.
|
|
25
|
-
- **DO NOT copy the entire plan.md into summary.md.**
|
|
26
|
-
|
|
27
|
-
---
|
|
28
|
-
|
|
29
|
-
## Process
|
|
30
|
-
|
|
31
|
-
### Step 1: Read Approved Requirement
|
|
32
|
-
|
|
33
|
-
Read `
|
|
34
|
-
|
|
35
|
-
### Step 2: Create Implementation Plan
|
|
36
|
-
|
|
37
|
-
**INVOKE:** `superpowers:writing-plans`
|
|
38
|
-
|
|
39
|
-
Create a detailed step-by-step plan based on the requirement document:
|
|
40
|
-
|
|
41
|
-
```markdown
|
|
42
|
-
## Implementation Plan
|
|
43
|
-
|
|
44
|
-
### Task Breakdown (TDD Order)
|
|
45
|
-
|
|
46
|
-
| # | Task | File | Test First? | Dependencies |
|
|
47
|
-
|---|------|------|-------------|--------------|
|
|
48
|
-
| 1 | Write test for [scenario] | [test file] | ✅ | None |
|
|
49
|
-
| 2 | Implement [component] | [source file] | — | Task 1 |
|
|
50
|
-
| 3 | Write test for [scenario] | [test file] | ✅ | Task 2 |
|
|
51
|
-
| ... | ... | ... | ... | ... |
|
|
52
|
-
|
|
53
|
-
### Test Commands
|
|
54
|
-
```bash
|
|
55
|
-
[specific test commands for this project]
|
|
56
|
-
```
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Step 3: GATE 2 — Present Plan & Start Coding
|
|
60
|
-
|
|
61
|
-
```markdown
|
|
62
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
63
|
-
⏸️ GATE 2: IMPLEMENTATION PLAN READY
|
|
64
|
-
|
|
65
|
-
Based on the approved requirement document, here is the coding plan:
|
|
66
|
-
|
|
67
|
-
[Show task breakdown summary]
|
|
68
|
-
|
|
69
|
-
**Total tasks:** [N]
|
|
70
|
-
**Test-first tasks:** [N]
|
|
71
|
-
|
|
72
|
-
Ready to start coding?
|
|
73
|
-
Type **"APPROVED"** to begin implementation.
|
|
74
|
-
Type feedback to adjust the plan.
|
|
75
|
-
|
|
76
|
-
⚠️ I will NOT write code until I receive "APPROVED".
|
|
77
|
-
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### Step 4: Handle Feedback
|
|
81
|
-
|
|
82
|
-
**If DEV provides feedback:**
|
|
83
|
-
→ Update the implementation plan
|
|
84
|
-
→ Re-display GATE 2 prompt
|
|
85
|
-
|
|
86
|
-
**If DEV types "APPROVED":**
|
|
87
|
-
→ Proceed to Gate 3 (Code Generation with TDD)
|
|
88
|
-
→ Follow the task breakdown order exactly
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Mandatory Rules
|
|
93
|
-
|
|
94
|
-
- ❌ **DO NOT** start coding until "APPROVED" is received for the plan
|
|
95
|
-
- ❌ **DO NOT** deviate from the approved requirement document
|
|
96
|
-
- ✅ **MUST** use TDD order: test first, then implementation
|
|
97
|
-
- ✅ **MUST** invoke `superpowers:writing-plans` for plan creation
|
|
98
|
-
- ✅ **MUST** show clear task breakdown before getting approval
|
|
99
|
-
- ❌ **DO NOT** include `git commit`, `git add`, or any git operations in the plan. The developer manages commits manually.
|
|
1
|
+
---
|
|
2
|
+
name: generate-spec
|
|
3
|
+
description: Gate 2 — After DEV approves the requirement document (Gate 1), AI creates a detailed implementation plan using TDD approach. This is the bridge between requirement and code.
|
|
4
|
+
keywords: spec, plan, implementation, tdd, coding plan
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Implementation Plan — Gate 2
|
|
8
|
+
|
|
9
|
+
> **GATE 2: Runs after Gate 1 (requirement document) has been APPROVED by DEV.**
|
|
10
|
+
>
|
|
11
|
+
> Principle: AI uses the approved requirement document to create a detailed implementation plan with TDD steps. DEV confirms the plan before coding begins.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Conditions to Enter Gate 2
|
|
16
|
+
|
|
17
|
+
- ✅ Gate 1 APPROVED — `04.Coding/01.Requirements/[functionId]/[ticketId].md` reviewed and approved by DEV
|
|
18
|
+
- ✅ Requirement document includes: requirements, solution, impact analysis, estimate
|
|
19
|
+
|
|
20
|
+
## Fast Mode Output Rules (CRITICAL)
|
|
21
|
+
|
|
22
|
+
When updating `04.Coding/04.Reviews/[functionId]/[ticketId].md` in **fast mode**:
|
|
23
|
+
- **Keep it extremely short.**
|
|
24
|
+
- Add a bullet point indicating Gate 2 plan is ready.
|
|
25
|
+
- **DO NOT copy the entire plan.md into summary.md.**
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Process
|
|
30
|
+
|
|
31
|
+
### Step 1: Read Approved Requirement
|
|
32
|
+
|
|
33
|
+
Read `04.Coding/01.Requirements/[functionId]/[ticketId].md` — use the chosen approach, file list, and testing plan as input.
|
|
34
|
+
|
|
35
|
+
### Step 2: Create Implementation Plan
|
|
36
|
+
|
|
37
|
+
**INVOKE:** `superpowers:writing-plans`
|
|
38
|
+
|
|
39
|
+
Create a detailed step-by-step plan based on the requirement document:
|
|
40
|
+
|
|
41
|
+
```markdown
|
|
42
|
+
## Implementation Plan
|
|
43
|
+
|
|
44
|
+
### Task Breakdown (TDD Order)
|
|
45
|
+
|
|
46
|
+
| # | Task | File | Test First? | Dependencies |
|
|
47
|
+
|---|------|------|-------------|--------------|
|
|
48
|
+
| 1 | Write test for [scenario] | [test file] | ✅ | None |
|
|
49
|
+
| 2 | Implement [component] | [source file] | — | Task 1 |
|
|
50
|
+
| 3 | Write test for [scenario] | [test file] | ✅ | Task 2 |
|
|
51
|
+
| ... | ... | ... | ... | ... |
|
|
52
|
+
|
|
53
|
+
### Test Commands
|
|
54
|
+
```bash
|
|
55
|
+
[specific test commands for this project]
|
|
56
|
+
```
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Step 3: GATE 2 — Present Plan & Start Coding
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
63
|
+
⏸️ GATE 2: IMPLEMENTATION PLAN READY
|
|
64
|
+
|
|
65
|
+
Based on the approved requirement document, here is the coding plan:
|
|
66
|
+
|
|
67
|
+
[Show task breakdown summary]
|
|
68
|
+
|
|
69
|
+
**Total tasks:** [N]
|
|
70
|
+
**Test-first tasks:** [N]
|
|
71
|
+
|
|
72
|
+
Ready to start coding?
|
|
73
|
+
Type **"APPROVED"** to begin implementation.
|
|
74
|
+
Type feedback to adjust the plan.
|
|
75
|
+
|
|
76
|
+
⚠️ I will NOT write code until I receive "APPROVED".
|
|
77
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Step 4: Handle Feedback
|
|
81
|
+
|
|
82
|
+
**If DEV provides feedback:**
|
|
83
|
+
→ Update the implementation plan
|
|
84
|
+
→ Re-display GATE 2 prompt
|
|
85
|
+
|
|
86
|
+
**If DEV types "APPROVED":**
|
|
87
|
+
→ Proceed to Gate 3 (Code Generation with TDD)
|
|
88
|
+
→ Follow the task breakdown order exactly
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## Mandatory Rules
|
|
93
|
+
|
|
94
|
+
- ❌ **DO NOT** start coding until "APPROVED" is received for the plan
|
|
95
|
+
- ❌ **DO NOT** deviate from the approved requirement document
|
|
96
|
+
- ✅ **MUST** use TDD order: test first, then implementation
|
|
97
|
+
- ✅ **MUST** invoke `superpowers:writing-plans` for plan creation
|
|
98
|
+
- ✅ **MUST** show clear task breakdown before getting approval
|
|
99
|
+
- ❌ **DO NOT** include `git commit`, `git add`, or any git operations in the plan. The developer manages commits manually.
|
|
@@ -30,11 +30,13 @@ Check `mode` in `.aiflow/context/current.json` before starting:
|
|
|
30
30
|
|
|
31
31
|
## Fast Mode Output Rules (CRITICAL)
|
|
32
32
|
|
|
33
|
-
When creating `
|
|
33
|
+
When creating `04.Coding/04.Reviews/[functionId]/[ticketId].md` during Gate 1:
|
|
34
34
|
- You must create the `summary.md` file after Gate 1 is APPROVED, to track session progress.
|
|
35
35
|
- Keep `summary.md` concise. Only include short bullet points tracking Gates.
|
|
36
36
|
- Do not write verbose implementation details in `summary.md` at Gate 1.
|
|
37
37
|
|
|
38
|
+
> **Path variables:** `[functionId]` (mã chức năng do dự án quy định, ví dụ `F-001_User-Login`, `AD06`) và `[ticketId]` (= `taskId` trong `.aiflow/context/current.json`) được xác định ở **Gate 1 Pre-flight Bước 0** của workflow — ưu tiên lấy từ context, sau đó suy từ file UC Spec input (nội dung/đường dẫn) rồi hỏi DEV xác nhận. KHÔNG ghi bất kỳ file output nào khi chưa có functionId.
|
|
39
|
+
|
|
38
40
|
0. **Pre-flight — Sync with remote** (before reading any source file):
|
|
39
41
|
- Run `git status --porcelain` to check for uncommitted changes.
|
|
40
42
|
- Working tree clean → run `git pull --ff-only` to fetch the latest code.
|
|
@@ -46,7 +48,7 @@ When creating `plan/[ticket-id]/summary.md` during Gate 1:
|
|
|
46
48
|
3. Q&A: Ask at most **ONE** question if there is a blocking ambiguity.
|
|
47
49
|
If the ticket + source file names make intent clear → skip Q&A entirely.
|
|
48
50
|
Wait for answer before writing the requirement doc.
|
|
49
|
-
4. Output `
|
|
51
|
+
4. Output `04.Coding/01.Requirements/[functionId]/[ticketId].md` with **3 sections only**:
|
|
50
52
|
|
|
51
53
|
```markdown
|
|
52
54
|
# Requirement: [Ticket ID] — [Title]
|
|
@@ -152,7 +154,7 @@ After the developer confirms the design direction (Step 2), extend with:
|
|
|
152
154
|
|
|
153
155
|
### Step 4: Write Requirement Document
|
|
154
156
|
|
|
155
|
-
Save to `
|
|
157
|
+
Save to `04.Coding/01.Requirements/[functionId]/[ticketId].md`:
|
|
156
158
|
|
|
157
159
|
```markdown
|
|
158
160
|
# Requirement: [Ticket ID] — [Title]
|
|
@@ -282,7 +284,7 @@ Save to `plan/[ticket-id]/requirement.md`:
|
|
|
282
284
|
⏸️ GATE 1: REQUIREMENT DOCUMENT READY
|
|
283
285
|
|
|
284
286
|
Ticket: [ticket-id] — [title]
|
|
285
|
-
File:
|
|
287
|
+
File: 04.Coding/01.Requirements/[functionId]/[ticketId].md
|
|
286
288
|
|
|
287
289
|
Summary:
|
|
288
290
|
Type: [feature / bug-fix / refactor]
|
|
@@ -330,5 +332,5 @@ Please review the requirement document.
|
|
|
330
332
|
- ❌ **DO NOT** skip impact analysis and effort estimate
|
|
331
333
|
- ✅ **MUST** run `git status` + `git pull --ff-only` (Pre-flight) before reading source code, when working tree is clean
|
|
332
334
|
- ✅ **MUST** read source code before Q&A begins
|
|
333
|
-
- ✅ **MUST** save `
|
|
335
|
+
- ✅ **MUST** save `04.Coding/01.Requirements/[functionId]/[ticketId].md`
|
|
334
336
|
- ✅ **MUST** display Gate 1 prompt and wait for `APPROVED`
|