@relipa/ai-flow-kit 0.0.9-beta.1 → 0.1.0-beta.0
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/README.md +109 -13
- package/bin/aiflow.js +525 -475
- package/custom/mcp-presets/figma-desktop.json +9 -9
- package/custom/rules/project-conventions.md +51 -51
- package/custom/skills/read-study-requirement/SKILL.md +22 -3
- package/custom/templates/shared/gate-workflow.md +13 -12
- package/custom/templates/tools/gemini.md +22 -22
- package/docs/common/CHANGELOG.md +44 -1
- package/docs/common/QUICK_START.md +47 -0
- package/docs/common/cli-reference.md +60 -8
- package/docs/common/workflows/figma.md +105 -105
- package/package.json +10 -3
- package/scripts/create-score-excel.js +354 -0
- package/scripts/guide.js +2 -0
- package/scripts/hooks/session-start.js +315 -295
- package/scripts/hooks/session-stop.js +122 -122
- package/scripts/init.js +17 -2
- package/scripts/link-resolver.js +179 -0
- package/scripts/use.js +117 -11
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
{
|
|
2
|
-
"mcpServers": {
|
|
3
|
-
"figma": {
|
|
4
|
-
"command": "npx",
|
|
5
|
-
"args": ["-y", "@figma/mcp-server"],
|
|
6
|
-
"env": {}
|
|
7
|
-
}
|
|
8
|
-
}
|
|
9
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"figma": {
|
|
4
|
+
"command": "npx",
|
|
5
|
+
"args": ["-y", "@figma/mcp-server"],
|
|
6
|
+
"env": {}
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -1,51 +1,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
|
-
## Plan Output Paths
|
|
9
|
-
|
|
10
|
-
| Output | Path | Note |
|
|
11
|
-
|--------|------|------|
|
|
12
|
-
| Requirement doc | `plan/[ticket-id]/requirement.md` | Gate 1 output |
|
|
13
|
-
| Implementation plan | `plan/[ticket-id]/plan.md` | Gate 2 output — **NOT** `docs/superpowers/plans/` |
|
|
14
|
-
| Summary | `plan/[ticket-id]/summary.md` | Gate 4 output |
|
|
15
|
-
|
|
16
|
-
> **Override:** The `writing-plans` skill defaults to `docs/superpowers/plans/<filename>.md`.
|
|
17
|
-
> In this project, **always save plans to `plan/[ticket-id]/plan.md` instead.**
|
|
18
|
-
>
|
|
19
|
-
> The `[ticket-id]` comes from `.aiflow/context/current.json`.
|
|
20
|
-
> If no ticket context exists, use a descriptive slug: `plan/<feature-name>/plan.md`.
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
|
-
## Execution Handoff Message
|
|
25
|
-
|
|
26
|
-
When `writing-plans` skill says to announce the saved path, use the **actual path**:
|
|
27
|
-
|
|
28
|
-
```
|
|
29
|
-
Plan complete and saved to `plan/[ticket-id]/plan.md`. Two execution options: ...
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
Do NOT copy the hardcoded path from the skill template (`docs/superpowers/plans/`).
|
|
33
|
-
|
|
34
|
-
---
|
|
35
|
-
|
|
36
|
-
## Checklist Before Writing Any File
|
|
37
|
-
|
|
38
|
-
Before saving any plan, requirement, or summary file, verify:
|
|
39
|
-
|
|
40
|
-
- [ ] Output path follows the table above — NOT the skill's default path
|
|
41
|
-
- [ ] `[ticket-id]` is read from `.aiflow/context/current.json`
|
|
42
|
-
- [ ] Directory `plan/[ticket-id]/` exists or will be created
|
|
43
|
-
- [ ] Announced path in the handoff message matches the actual saved path
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
## Other Conventions
|
|
48
|
-
|
|
49
|
-
- **Review checklist:** `custom/rules/review-checklist.md`
|
|
50
|
-
- **Code style:** `custom/rules/code-style.md`
|
|
51
|
-
- **Naming:** `custom/rules/naming.md`
|
|
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
|
+
## Plan Output Paths
|
|
9
|
+
|
|
10
|
+
| Output | Path | Note |
|
|
11
|
+
|--------|------|------|
|
|
12
|
+
| Requirement doc | `plan/[ticket-id]/requirement.md` | Gate 1 output |
|
|
13
|
+
| Implementation plan | `plan/[ticket-id]/plan.md` | Gate 2 output — **NOT** `docs/superpowers/plans/` |
|
|
14
|
+
| Summary | `plan/[ticket-id]/summary.md` | Gate 4 output |
|
|
15
|
+
|
|
16
|
+
> **Override:** The `writing-plans` skill defaults to `docs/superpowers/plans/<filename>.md`.
|
|
17
|
+
> In this project, **always save plans to `plan/[ticket-id]/plan.md` instead.**
|
|
18
|
+
>
|
|
19
|
+
> The `[ticket-id]` comes from `.aiflow/context/current.json`.
|
|
20
|
+
> If no ticket context exists, use a descriptive slug: `plan/<feature-name>/plan.md`.
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Execution Handoff Message
|
|
25
|
+
|
|
26
|
+
When `writing-plans` skill says to announce the saved path, use the **actual path**:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Plan complete and saved to `plan/[ticket-id]/plan.md`. Two execution options: ...
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Do NOT copy the hardcoded path from the skill template (`docs/superpowers/plans/`).
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Checklist Before Writing Any File
|
|
37
|
+
|
|
38
|
+
Before saving any plan, requirement, or summary file, verify:
|
|
39
|
+
|
|
40
|
+
- [ ] Output path follows the table above — NOT the skill's default path
|
|
41
|
+
- [ ] `[ticket-id]` is read from `.aiflow/context/current.json`
|
|
42
|
+
- [ ] Directory `plan/[ticket-id]/` exists or will be created
|
|
43
|
+
- [ ] Announced path in the handoff message matches the actual saved path
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Other Conventions
|
|
48
|
+
|
|
49
|
+
- **Review checklist:** `custom/rules/review-checklist.md`
|
|
50
|
+
- **Code style:** `custom/rules/code-style.md`
|
|
51
|
+
- **Naming:** `custom/rules/naming.md`
|
|
@@ -35,6 +35,11 @@ When creating `plan/[ticket-id]/summary.md` during Gate 1:
|
|
|
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
|
+
0. **Pre-flight — Sync with remote** (before reading any source file):
|
|
39
|
+
- Run `git status --porcelain` to check for uncommitted changes.
|
|
40
|
+
- Working tree clean → run `git pull --ff-only` to fetch the latest code.
|
|
41
|
+
- Uncommitted changes detected → SKIP pull and notify DEV: `⚠️ Uncommitted changes detected — skipping git pull. Analysing local state.`
|
|
42
|
+
- `git pull --ff-only` fails (branch diverged from remote) → notify DEV: `⚠️ Local branch diverged from remote — skipping pull. Resolve manually before next ticket.` Then continue with local state.
|
|
38
43
|
1. Read `.aiflow/context/current.json` — ticket title, description, acceptance criteria
|
|
39
44
|
2. Identify **directly affected files** from ticket text and file names only.
|
|
40
45
|
DO NOT trace data flow or read unrelated source files.
|
|
@@ -77,15 +82,28 @@ When creating `plan/[ticket-id]/summary.md` during Gate 1:
|
|
|
77
82
|
|
|
78
83
|
### Step 1: Load Ticket & Read Source Code
|
|
79
84
|
|
|
85
|
+
0. **Pre-flight — Sync with remote** (run BEFORE reading any source file):
|
|
86
|
+
- Run `git status --porcelain` first. Empty output = clean working tree.
|
|
87
|
+
- Clean working tree → run `git pull --ff-only` to pull the latest code from remote. This guarantees the analysis is based on current source, not stale local state.
|
|
88
|
+
- Uncommitted changes → SKIP pull and notify DEV: `⚠️ Uncommitted changes detected — skipping git pull. Analysing local state.`
|
|
89
|
+
- `git pull --ff-only` fails because the branch has diverged → notify DEV: `⚠️ Local branch diverged from remote — skipping pull. Resolve manually before next ticket.` Continue with local state.
|
|
90
|
+
- Repo has no remote tracking branch (detached HEAD or local-only branch) → skip silently and proceed.
|
|
80
91
|
1. Read `.aiflow/context/current.json` — ticket info from Backlog/Jira
|
|
81
|
-
2.
|
|
82
|
-
|
|
92
|
+
2. **Supplementary Context:** If `current.json` has a `supplementaryContext[]` array, read each item and integrate it as supporting context for your analysis. Items may be:
|
|
93
|
+
- `[ticket]` — linked tickets (related features, dependencies, parent tickets)
|
|
94
|
+
- `[comment]` — specific comments from PM/QA/stakeholders
|
|
95
|
+
- `[file]` — architecture docs, business logic specs, API references
|
|
96
|
+
- `[text]` — any other supplementary information
|
|
97
|
+
|
|
98
|
+
If you encounter a backlog/jira URL in the ticket description that is **not** already in `supplementaryContext[]`, run `ak fetch-links <url>` and use the JSON output in your analysis without saving.
|
|
99
|
+
3. Read `CLAUDE.md` — understand project architecture, tech stack, conventions
|
|
100
|
+
4. Read related source files — trace data flow, identify patterns, dependencies
|
|
83
101
|
- **If GitNexus MCP is available** (`.mcp.json` has `gitnexus` entry): invoke GitNexus MCP tools instead of reading files directly — one call returns full context without multi-file exploration:
|
|
84
102
|
- `gitnexus: context("ClassName")` → 360° view of a symbol (dependencies, callers, methods)
|
|
85
103
|
- `gitnexus: query("keyword or description")` → hybrid search across codebase
|
|
86
104
|
- Saves ~50% of token cost at this step vs reading files manually
|
|
87
105
|
- **If task is a Bug Fix:** Invoke `superpowers:systematic-debugging` to trace root cause before proposing fixes.
|
|
88
|
-
|
|
106
|
+
5. Read ticket comments — additional context from PM/team
|
|
89
107
|
|
|
90
108
|
Do this investigation **before** asking any questions. Come prepared.
|
|
91
109
|
|
|
@@ -310,6 +328,7 @@ Please review the requirement document.
|
|
|
310
328
|
- ❌ **DO NOT** proceed past Step 2 if design is not confirmed by developer
|
|
311
329
|
- ❌ **DO NOT** write code at any point in this skill
|
|
312
330
|
- ❌ **DO NOT** skip impact analysis and effort estimate
|
|
331
|
+
- ✅ **MUST** run `git status` + `git pull --ff-only` (Pre-flight) before reading source code, when working tree is clean
|
|
313
332
|
- ✅ **MUST** read source code before Q&A begins
|
|
314
333
|
- ✅ **MUST** save `plan/[ticket-id]/requirement.md`
|
|
315
334
|
- ✅ **MUST** display Gate 1 prompt and wait for `APPROVED`
|
|
@@ -17,20 +17,21 @@ You have superpowers. When a ticket context exists in `.aiflow/context/current.j
|
|
|
17
17
|
|
|
18
18
|
AI actively reads ticket + source code to understand the requirement:
|
|
19
19
|
1. Read `.aiflow/context/current.json` — ticket info
|
|
20
|
-
2.
|
|
21
|
-
3.
|
|
22
|
-
4.
|
|
20
|
+
2. **Pre-flight: sync with remote** — run `git status --porcelain`; if working tree is clean, run `git pull --ff-only` to pull the latest source from remote. Skip the pull (with a `⚠️` notice to DEV) if there are uncommitted changes, the branch has diverged, or no remote tracking branch exists.
|
|
21
|
+
3. Read source code — architecture, related files, data flow
|
|
22
|
+
4. If anything is unclear — ask ONE question at a time, wait for reply
|
|
23
|
+
5. Output `plan/[ticket-id]/requirement.md` with:
|
|
23
24
|
- Requirements summary, source code analysis
|
|
24
25
|
- Proposed solution and approach
|
|
25
26
|
- Impact analysis, effort estimate, testing plan
|
|
26
|
-
|
|
27
|
+
6. Display "GATE 1: Requirement doc ready" → wait for **APPROVED**
|
|
27
28
|
|
|
28
29
|
> **Tip:** If auto-start doesn't trigger, the developer can start this gate by typing: **"start"**, **"Gate 1"** or **"Analyze ticket"**.
|
|
29
30
|
|
|
30
31
|
DO NOT just check format — **understand the content and propose solutions**.
|
|
31
32
|
|
|
32
|
-
> **Telemetry:** Run `ak gate 1 start --ticket [ticket-id]` when starting this gate (auto-start or when developer types "start"/"Gate 1").
|
|
33
|
-
> Run `ak gate 1 approved --ticket [ticket-id]` immediately when APPROVED is received.
|
|
33
|
+
> **Telemetry:** Run `ak gate 1 start --ticket [ticket-id]` when starting this gate (auto-start or when developer types "start"/"Gate 1"). Run as-is — do NOT append shell redirects like `2>$null` or `>/dev/null`.
|
|
34
|
+
> Run `ak gate 1 approved --ticket [ticket-id]` immediately when APPROVED is received. Run as-is — do NOT append shell redirects.
|
|
34
35
|
|
|
35
36
|
---
|
|
36
37
|
|
|
@@ -43,8 +44,8 @@ DO NOT just check format — **understand the content and propose solutions**.
|
|
|
43
44
|
- Display: "GATE 2 PAUSED: type APPROVED to start coding".
|
|
44
45
|
- CODE WILL NOT BE GENERATED until "APPROVED" is received.
|
|
45
46
|
|
|
46
|
-
> **Telemetry:** Run `ak gate 2 start --ticket [ticket-id]` when starting this gate.
|
|
47
|
-
> Run `ak gate 2 approved --ticket [ticket-id]` immediately when APPROVED is received.
|
|
47
|
+
> **Telemetry:** Run `ak gate 2 start --ticket [ticket-id]` when starting this gate. Run as-is — do NOT append shell redirects.
|
|
48
|
+
> Run `ak gate 2 approved --ticket [ticket-id]` immediately when APPROVED is received. Run as-is — do NOT append shell redirects.
|
|
48
49
|
|
|
49
50
|
---
|
|
50
51
|
|
|
@@ -57,7 +58,7 @@ Only runs after Gate 2 has been APPROVED.
|
|
|
57
58
|
- Write tests FIRST — run to confirm FAIL -> implement -> PASS.
|
|
58
59
|
- Bug fix EXTRA: `superpowers:systematic-debugging` + `investigate-bug` skill first.
|
|
59
60
|
|
|
60
|
-
> **Telemetry:** Run `ak gate 3 start --ticket [ticket-id]` when starting this gate.
|
|
61
|
+
> **Telemetry:** Run `ak gate 3 start --ticket [ticket-id]` when starting this gate. Run as-is — do NOT append shell redirects.
|
|
61
62
|
|
|
62
63
|
---
|
|
63
64
|
|
|
@@ -75,8 +76,8 @@ Then: "GATE 4 PAUSED: type APPROVED or BUG: [description]"
|
|
|
75
76
|
- Coding bug -> fix -> repeat Gate 4.
|
|
76
77
|
- Requirement bug -> return to Gate 1.
|
|
77
78
|
|
|
78
|
-
> **Telemetry:** Run `ak gate 4 start --ticket [ticket-id]` when starting this gate.
|
|
79
|
-
> Run `ak gate 4 approved --ticket [ticket-id]` immediately when APPROVED is received.
|
|
79
|
+
> **Telemetry:** Run `ak gate 4 start --ticket [ticket-id]` when starting this gate. Run as-is — do NOT append shell redirects.
|
|
80
|
+
> Run `ak gate 4 approved --ticket [ticket-id]` immediately when APPROVED is received. Run as-is — do NOT append shell redirects.
|
|
80
81
|
|
|
81
82
|
---
|
|
82
83
|
|
|
@@ -87,4 +88,4 @@ Only runs after Gate 4 has been APPROVED.
|
|
|
87
88
|
**INVOKE:** `superpowers:requesting-code-review`
|
|
88
89
|
Guide on creating a Pull Request with the ticket link.
|
|
89
90
|
|
|
90
|
-
> **Telemetry:** Run `ak gate 5 start --ticket [ticket-id]` when starting this gate.
|
|
91
|
+
> **Telemetry:** Run `ak gate 5 start --ticket [ticket-id]` when starting this gate. Run as-is — do NOT append shell redirects.
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
# Gemini AI System Instructions
|
|
2
|
-
|
|
3
|
-
You are an expert AI assistant specialized in this project's stack. Follow the Gate Workflow and Team Rules strictly.
|
|
4
|
-
|
|
5
|
-
> **Important:** When starting a session, always read `.aiflow/context/current.json` to load ticket context and check the `plan/` directory for existing progress.
|
|
6
|
-
|
|
7
|
-
If no instructions are automatically followed, wait for the developer to type **"start"** or **"Gate 1"** to start the analysis.
|
|
8
|
-
|
|
9
|
-
## Interaction Rules:
|
|
10
|
-
- **COLLABORATIVE SKILLS:** When a skill (like `read-study-requirement`) says to "ask one question at a time", you MUST stop and wait for the developer's reply before proceeding.
|
|
11
|
-
- **NEVER BATCH QUESTIONS:** Only ask one question per message.
|
|
12
|
-
- **WAIT FOR APPROVAL:** Do not move to the next Gate until you receive "APPROVED".
|
|
13
|
-
- **PROJECT CONVENTIONS:** Before writing any output file (plan, requirement, summary), read `custom/rules/project-conventions.md`. These rules override upstream skill defaults.
|
|
14
|
-
|
|
15
|
-
## Telemetry Command (detect once, use everywhere)
|
|
16
|
-
|
|
17
|
-
Before the first gate, run this to detect the correct `ak` command for your environment:
|
|
18
|
-
```bash
|
|
19
|
-
command -v ak >/dev/null 2>&1 && echo "USE: ak" || echo "USE: ak.cmd"
|
|
20
|
-
```
|
|
21
|
-
Use whichever prints (e.g. `ak` on native Linux/Mac/Windows, `ak.cmd` on WSL without ak installed).
|
|
22
|
-
All `ak gate ...` examples below assume the detected command. Substitute accordingly.
|
|
1
|
+
# Gemini AI System Instructions
|
|
2
|
+
|
|
3
|
+
You are an expert AI assistant specialized in this project's stack. Follow the Gate Workflow and Team Rules strictly.
|
|
4
|
+
|
|
5
|
+
> **Important:** When starting a session, always read `.aiflow/context/current.json` to load ticket context and check the `plan/` directory for existing progress.
|
|
6
|
+
|
|
7
|
+
If no instructions are automatically followed, wait for the developer to type **"start"** or **"Gate 1"** to start the analysis.
|
|
8
|
+
|
|
9
|
+
## Interaction Rules:
|
|
10
|
+
- **COLLABORATIVE SKILLS:** When a skill (like `read-study-requirement`) says to "ask one question at a time", you MUST stop and wait for the developer's reply before proceeding.
|
|
11
|
+
- **NEVER BATCH QUESTIONS:** Only ask one question per message.
|
|
12
|
+
- **WAIT FOR APPROVAL:** Do not move to the next Gate until you receive "APPROVED".
|
|
13
|
+
- **PROJECT CONVENTIONS:** Before writing any output file (plan, requirement, summary), read `custom/rules/project-conventions.md`. These rules override upstream skill defaults.
|
|
14
|
+
|
|
15
|
+
## Telemetry Command (detect once, use everywhere)
|
|
16
|
+
|
|
17
|
+
Before the first gate, run this to detect the correct `ak` command for your environment:
|
|
18
|
+
```bash
|
|
19
|
+
command -v ak >/dev/null 2>&1 && echo "USE: ak" || echo "USE: ak.cmd"
|
|
20
|
+
```
|
|
21
|
+
Use whichever prints (e.g. `ak` on native Linux/Mac/Windows, `ak.cmd` on WSL without ak installed).
|
|
22
|
+
All `ak gate ...` examples below assume the detected command. Substitute accordingly.
|
package/docs/common/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,37 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
7
7
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
|
-
## [0.0
|
|
10
|
+
## [0.1.0] - 2026-05-28
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Multi-target `ak use`** — `ak use` now accepts variadic targets so multiple sources can be loaded in a single call. The first target becomes the primary context (drives Gate 1); the rest are appended to `current.json` as `supplementaryContext[]`. Targets can be ticket IDs, Backlog/Jira URLs, or local files.
|
|
15
|
+
```bash
|
|
16
|
+
ak use PROJ-33 PROJ-10 docs/arch.md
|
|
17
|
+
# PROJ-33 = primary, PROJ-10 + docs/arch.md = supplementary
|
|
18
|
+
```
|
|
19
|
+
Backward compatible: `ak use PROJ-33` (single target) behaves exactly as before.
|
|
20
|
+
- **Auto link resolution** — When the primary ticket's description contains Backlog/Jira URLs, `ak use` now auto-fetches them and appends to `supplementaryContext[]`. AI no longer misses linked context. Capped at **5 auto-resolved links per `use`** to keep loads fast; per-link errors are caught and logged without aborting the command.
|
|
21
|
+
- **Comment-aware link resolution** — Comment URLs are resolved to that **single comment** instead of fetching the whole ticket. Recognised patterns:
|
|
22
|
+
- Backlog: `https://*.backlog.com/view/PROJ-10#comment-456`
|
|
23
|
+
- Jira: `https://*.atlassian.net/browse/PROJ-10?focusedCommentId=456`
|
|
24
|
+
- **`ak fetch-links <url>` command** — Standalone command that fetches a single Backlog/Jira URL and prints a `SupplementaryContext` JSON object to stdout. Used by the `read-study-requirement` skill at runtime when AI encounters a link in the ticket description that wasn't already resolved at `use` time.
|
|
25
|
+
```bash
|
|
26
|
+
ak fetch-links "https://company.backlog.com/view/PROJ-10#comment-456"
|
|
27
|
+
```
|
|
28
|
+
- **`supplementaryContext[]` schema in `current.json`** — New top-level array; each item has shape `{ sourceType: 'ticket'|'comment'|'file'|'text', sourceUrl?, sourcePath?, ticketId?, commentId?, title?, description?, content?, author?, date? }`. Persisted across sessions and consumed by the SessionStart hook.
|
|
29
|
+
- **SessionStart hook renders supplementary block** — `scripts/hooks/session-start.js` now emits a `**Supplementary Context (N source(s)):**` section in the AI context prompt, one line per item, content truncated at 1000 chars to keep token cost bounded.
|
|
30
|
+
- **`read-study-requirement` skill integrates supplementary context** — Gate 1 instruction file (custom + installed `.claude/skills/`) now has an explicit step to read `supplementaryContext[]` and use `ak fetch-links` for any unresolved links found while analysing the ticket.
|
|
31
|
+
- **`scripts/link-resolver.js` module** — New CommonJS module that owns all URL classification and HTTPS fetching for Backlog/Jira. Exports: `classifyLink`, `scanLinks`, `fetchBacklogTicket`, `fetchBacklogComment`, `fetchJiraTicket`, `fetchJiraComment`, `fetchLink`, `resolveLinks`. Accepts credentials as parameters to keep `use.js` free of circular imports.
|
|
32
|
+
- **Jest test suite** — Added Jest 30 as a dev dependency with `testMatch: ["<rootDir>/tests/**/*.test.js"]` to scope discovery to project tests (skips `upstream/tests/`). Suite includes `tests/smoke.test.js` and 20 unit tests in `tests/link-resolver.test.js` covering URL classification, scan, dedup, per-adapter fetch paths, and `resolveLinks` error isolation.
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- **`use.js` exports as named const** — `module.exports` shifted from anonymous function to `useCommand` with a `loadCredentials` property attached, so other modules (CLI `fetch-links` handler) can reuse credential loading without re-implementing it. External call shape (`useCommand(targets, options)`) unchanged for backward compatibility.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## [0.0.9] - 2026-05-25
|
|
11
41
|
|
|
12
42
|
### Added
|
|
13
43
|
|
|
@@ -17,11 +47,24 @@ Versioning follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
|
17
47
|
- **4-tier framework detection in `figma-to-component` skill** — Detection order: (1) `CLAUDE.md` identifier → (2) project file scan (`app/` dir, `angular.json`, `nuxt.config.*`) → (3) fallback to Next.js/React. Previously only supported React and Vue.
|
|
18
48
|
- **Figma workflow guide** — New developer guide at [`docs/common/workflows/figma.md`](figma.md) covering prerequisites (REST API vs Desktop), how to get node URLs, trigger commands, expected output format, review checklist, and troubleshooting table.
|
|
19
49
|
- **MCP presets documentation** — Added full Figma REST API and Figma Desktop sections to [`custom/mcp-presets/README.md`](../../custom/mcp-presets/README.md), including a side-by-side comparison table.
|
|
50
|
+
- **`ak gate N start|approved` auto-syncs task state** — Calling `ak gate 1 start --ticket PROJ-33` now automatically advances `currentGate` in `task-state.json`, removing the need to always call `ak task next` for gate tracking. `approved` records the approval timestamp and advances to the next gate. Uses `Math.max()` guard to never regress gate progress.
|
|
51
|
+
- **Session telemetry enrichment** — `session.start` now captures the active AI model name and user email from config. `session.stop` records model, input/output token counts, and a prompt summary extracted from the session transcript (`transcript_path` in hookData).
|
|
52
|
+
- **`project-conventions.md`** — New mandatory override file at `custom/rules/project-conventions.md`. Enforces that Gate 2 plans are always saved to `plan/[ticket-id]/plan.md` (overriding the skill default `docs/superpowers/plans/`). Includes a checklist and path table for all Gate outputs.
|
|
53
|
+
- **Gate workflow: explicit plan output path** — Gate 2 instruction in `gate-workflow.md` now explicitly states that the plan must be saved to `plan/[ticket-id]/plan.md`, with a note that the `writing-plans` skill default path is overridden.
|
|
54
|
+
- **WSL clipboard support in `ak prompt`** — `ak prompt` now correctly copies output to the Windows clipboard when running inside WSL using `powershell.exe Set-Clipboard`. Previously fell through to `xclip`/`xsel` which are unavailable on WSL without extra setup.
|
|
55
|
+
- **`appscript.js`** — Google Apps Script source for the self-hosted telemetry backend. Receives HMAC-signed events from the `ak` CLI, validates them, and appends rows to Google Sheets.
|
|
56
|
+
- **Telemetry `record()` returns result object** — `record()` now returns `{ok: true}` on success or `{ok: false, reason, error}` on failure, enabling `ak gate` and `ak telemetry log` to display ✓ / ⚠ feedback per event.
|
|
57
|
+
- **`ak init` remembers previous framework selection** — Re-running `ak init` in an already-configured project now pre-selects the previously chosen frameworks (read from `.aiflow/state.json`) instead of falling back to auto-detection. A "Previously selected: ..." hint is shown above the checkbox list.
|
|
20
58
|
|
|
21
59
|
### Fixed
|
|
22
60
|
|
|
23
61
|
- **Critical: `figma-to-component` skill used non-existent tool names** — The skill referenced `figma_get_file_nodes`, `figma_get_file_styles`, `figma_get_file_components`, and `figma_get_image` — none of which exist in `figma-developer-mcp` or any other MCP package, causing the skill to silently fail on every run. Replaced with the correct tools: `get_figma_data(fileKey, nodeId, depth=2)` and `download_figma_images(fileKey, nodes, localPath)`.
|
|
24
62
|
- **Figma API token verification using wrong auth header** — `verifyFigma()` in `scripts/init.js` was sending `Authorization: Bearer <token>`, which is only valid for OAuth tokens. Figma Personal Access Tokens (`figd_...`) require `X-Figma-Token: <token>`. This caused every PAT to be rejected as invalid during `ak init -a figma` even when the token was correct.
|
|
63
|
+
- **Critical: `currentGate` not advancing after gate transitions** — `task-state.json` was not updating `currentGate` when the AI called `ak gate N start`, so resuming a task always restarted from the wrong gate. Added dedicated `updateTaskGateState()` and fixed `createOrActivateTaskState()` to use `Math.max()`.
|
|
64
|
+
- **Duplicate `session.start` telemetry event** — `session-start.js` was calling `record()` before reading stdin, causing the event to fire twice in some hook configurations. Fixed by moving `record()` inside the `stdin.on('end')` handler.
|
|
65
|
+
- **Short command aliases not resolving for telemetry** — `task` and `memory` subcommand short aliases (`t st`, `t ls`, `mem s`, etc.) were not being resolved before telemetry pre-processing, causing `unknown` in the command column. Fixed alias resolution in the pre-hook telemetry mapping.
|
|
66
|
+
- **`ak telemetry log` silent on failure** — `ak telemetry log --event X` previously swallowed all errors silently (no output). Now shows ✓ on success and ⚠ with reason (`disabled`, `opted-out`, `no-url`) on skip/failure.
|
|
67
|
+
- **Gate telemetry blocked by bash redirect error** — AI was appending `2>$null` (PowerShell syntax) to `ak gate` commands when following "run silently" instructions, causing bash to fail with `/usr/bin/bash: $null: ambiguous redirect`. Added explicit "do NOT append shell redirects" instruction to `gate-workflow.md` for all gate telemetry commands.
|
|
25
68
|
|
|
26
69
|
---
|
|
27
70
|
|
|
@@ -76,6 +76,10 @@ aiflow use https://mycompany.backlog.com/view/PROJ-33
|
|
|
76
76
|
# Load newest 5 comments
|
|
77
77
|
aiflow use PROJ-33 --clast 5
|
|
78
78
|
|
|
79
|
+
# Multi-target — primary ticket + supplementary sources (v0.1.0+)
|
|
80
|
+
aiflow use PROJ-33 PROJ-10 docs/arch.md
|
|
81
|
+
# PROJ-33 drives Gate 1; PROJ-10 + docs/arch.md become supplementary context
|
|
82
|
+
|
|
79
83
|
# Manual input (no Backlog/Jira)
|
|
80
84
|
aiflow use --manual
|
|
81
85
|
|
|
@@ -83,6 +87,8 @@ aiflow use --manual
|
|
|
83
87
|
aiflow use --file task-description.txt
|
|
84
88
|
```
|
|
85
89
|
|
|
90
|
+
> **Auto Link Resolution (v0.1.0+):** Backlog/Jira URLs in the primary ticket's description are auto-fetched and added to `supplementaryContext[]`. Comment links (`#comment-456`, `?focusedCommentId=456`) fetch **only that comment**. AI integrates these supplementary sources in Gate 1 analysis automatically.
|
|
91
|
+
|
|
86
92
|
Output:
|
|
87
93
|
```
|
|
88
94
|
✓ Context loaded
|
|
@@ -352,6 +358,45 @@ aiflow use PROJ-88
|
|
|
352
358
|
claude # AI auto-starts: map dependencies → assess risk → output report
|
|
353
359
|
```
|
|
354
360
|
|
|
361
|
+
### Figma Design → Code
|
|
362
|
+
|
|
363
|
+
Turn a Figma design into a React / Next.js / Vue / Angular component automatically.
|
|
364
|
+
|
|
365
|
+
**Step 1: Set up Figma MCP adapter (one-time)**
|
|
366
|
+
|
|
367
|
+
Choose one option:
|
|
368
|
+
|
|
369
|
+
| Option | Command | Requirement |
|
|
370
|
+
|--------|---------|-------------|
|
|
371
|
+
| Figma Desktop (recommended) | `ak init -a figma-desktop` | Figma Desktop app installed and open |
|
|
372
|
+
| Figma REST API | `ak init -a figma` | Figma Personal Access Token (`figd_...`) |
|
|
373
|
+
|
|
374
|
+
```bash
|
|
375
|
+
# Option A: Figma Desktop — no API token needed, uses Desktop session
|
|
376
|
+
ak init -a figma-desktop
|
|
377
|
+
|
|
378
|
+
# Option B: Figma REST API — requires Personal Access Token
|
|
379
|
+
ak init -a figma
|
|
380
|
+
# Enter your token when prompted (Settings → Security → Personal access tokens)
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
**Step 2: Get the Figma node URL**
|
|
384
|
+
|
|
385
|
+
In Figma Desktop or web, right-click the frame/component → **Copy link to selection**.
|
|
386
|
+
|
|
387
|
+
URL format: `https://www.figma.com/design/<fileKey>/...?node-id=<nodeId>`
|
|
388
|
+
|
|
389
|
+
**Step 3: Trigger the skill in Claude**
|
|
390
|
+
|
|
391
|
+
```
|
|
392
|
+
Generate component from this Figma frame:
|
|
393
|
+
https://www.figma.com/design/abc123/MyDesign?node-id=12:34
|
|
394
|
+
```
|
|
395
|
+
|
|
396
|
+
Claude uses the `figma-to-component` skill and auto-detects your framework (Next.js App Router, React, Vue, Angular).
|
|
397
|
+
|
|
398
|
+
> Full guide: [docs/common/workflows/figma.md](./workflows/figma.md)
|
|
399
|
+
|
|
355
400
|
---
|
|
356
401
|
|
|
357
402
|
## All Commands
|
|
@@ -371,12 +416,14 @@ ak sync # sync aiflow instruction files
|
|
|
371
416
|
|
|
372
417
|
# Per task
|
|
373
418
|
ak use PROJ-33 # load context (Fast Mode, default) — alias: ak u PROJ-33
|
|
419
|
+
ak use PROJ-33 PROJ-10 docs/arch.md # multi-target: primary + supplementary (v0.1.0+)
|
|
374
420
|
ak use PROJ-33 -F # Fast Mode explicit (--fast)
|
|
375
421
|
ak use PROJ-33 -U # Full Mode (--full)
|
|
376
422
|
ak use -f task.md # load from local file (--file)
|
|
377
423
|
ak use PROJ-33 -c # load with all comments (--coms)
|
|
378
424
|
ak use PROJ-33 --clast 5 # newest 5 comments
|
|
379
425
|
ak use -m # manual input (--manual)
|
|
426
|
+
ak fetch-links "<backlog-or-jira-url>" # fetch single link → JSON (used by AI runtime, v0.1.0+)
|
|
380
427
|
ak p bug-fix # generate prompt (ak prompt)
|
|
381
428
|
ak p feature -o p.md # save prompt to file (--output)
|
|
382
429
|
ak p -L vietnamese # Vietnamese prompt (--lang)
|
|
@@ -81,11 +81,12 @@ Initializing ai-flow-kit (v1.0.0)...
|
|
|
81
81
|
|
|
82
82
|
## use
|
|
83
83
|
|
|
84
|
-
Load context from
|
|
84
|
+
Load context from one or more tickets, files, or manual entry. **Accepts variadic targets** (v0.1.0+) — the first target is the primary context (drives Gate 1); any additional targets are appended as `supplementaryContext[]`.
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
|
-
ak use JIRA-123 # load from Jira
|
|
88
|
-
ak use BACKLOG-456 # load from Backlog
|
|
87
|
+
ak use JIRA-123 # single target — load from Jira
|
|
88
|
+
ak use BACKLOG-456 # single target — load from Backlog
|
|
89
|
+
ak use PROJ-33 PROJ-10 docs/arch.md # multi-target — primary + supplementary (v0.1.0+)
|
|
89
90
|
ak use BACKLOG-456 -F # fast mode (--fast)
|
|
90
91
|
ak use BACKLOG-456 -U # full mode (--full)
|
|
91
92
|
ak use -m # manual entry (--manual)
|
|
@@ -96,8 +97,10 @@ ak use BACKLOG-456 --cid 42 # specific comment
|
|
|
96
97
|
ak use 1.0.0 # switch between versions
|
|
97
98
|
```
|
|
98
99
|
|
|
100
|
+
**Arguments:**
|
|
101
|
+
- `[targets...]` — One or more targets. Each target can be a ticket ID (`PROJ-33`), a Backlog/Jira URL, or a local file path. First target = primary; rest = supplementary.
|
|
102
|
+
|
|
99
103
|
**Options:**
|
|
100
|
-
- `<id>` — Ticket ID or version number
|
|
101
104
|
- `-m, --manual` — Manual context entry
|
|
102
105
|
- `-f, --file <path>` — Load from file (JSON or plain text)
|
|
103
106
|
- `-s, --save <name>` — Save as named context
|
|
@@ -110,11 +113,31 @@ ak use 1.0.0 # switch between versions
|
|
|
110
113
|
- `-F, --fast` — Fast mode: AI skips Q&A, lite 3-section requirement doc (< 5 min Gate 1)
|
|
111
114
|
- `-U, --full` — Full mode: force complete Gate 1 analysis with Q&A
|
|
112
115
|
|
|
116
|
+
**Auto link resolution (v0.1.0+):** When the primary ticket description contains Backlog/Jira URLs, `ak use` auto-fetches them and appends to `supplementaryContext[]`. Comment URLs (`#comment-456` or `?focusedCommentId=456`) resolve to **that single comment only**. Capped at 5 auto-resolved links per `use`; per-link errors are logged without aborting the command.
|
|
117
|
+
|
|
118
|
+
**`supplementaryContext[]` schema** (persisted in `.aiflow/context/current.json`):
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
{
|
|
122
|
+
"sourceType": "ticket | comment | file | text",
|
|
123
|
+
"sourceUrl": "https://...",
|
|
124
|
+
"sourcePath": "docs/arch.md",
|
|
125
|
+
"ticketId": "PROJ-10",
|
|
126
|
+
"commentId": "456",
|
|
127
|
+
"title": "...",
|
|
128
|
+
"description": "...",
|
|
129
|
+
"content": "...",
|
|
130
|
+
"author": "...",
|
|
131
|
+
"date": "..."
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
113
135
|
**What it does:**
|
|
114
|
-
1.
|
|
115
|
-
2.
|
|
116
|
-
3.
|
|
117
|
-
4.
|
|
136
|
+
1. Loads the first target as primary context (fetches from MCP adapter / file / manual entry)
|
|
137
|
+
2. Loads each remaining target as a supplementary item
|
|
138
|
+
3. Scans the primary description for Backlog/Jira URLs and auto-resolves them
|
|
139
|
+
4. Saves the merged context (including `mode` and `supplementaryContext[]`) to `.aiflow/context/current.json`
|
|
140
|
+
5. Updates state tracking
|
|
118
141
|
|
|
119
142
|
**Example:**
|
|
120
143
|
```bash
|
|
@@ -126,8 +149,37 @@ Fetching context from Jira...
|
|
|
126
149
|
✓ Saved to .aiflow/context/current.json
|
|
127
150
|
|
|
128
151
|
Ready to prompt! Run: aiflow prompt bug-fix
|
|
152
|
+
|
|
153
|
+
$ aiflow use PROJ-33 PROJ-10 docs/arch.md
|
|
154
|
+
✓ Loaded primary: PROJ-33
|
|
155
|
+
✓ Supplementary: PROJ-10 (ticket), docs/arch.md (file)
|
|
156
|
+
✓ Auto-resolved 2 link(s) from description
|
|
129
157
|
```
|
|
130
158
|
|
|
159
|
+
## fetch-links
|
|
160
|
+
|
|
161
|
+
Fetch a single Backlog/Jira URL and print a `SupplementaryContext` JSON object to stdout. Intended for AI runtime use inside the `read-study-requirement` skill — when AI encounters a link in the ticket description that wasn't already resolved by `ak use`, it can call this command and integrate the JSON output.
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
ak fetch-links "https://company.backlog.com/view/PROJ-10" # full ticket
|
|
165
|
+
ak fetch-links "https://company.backlog.com/view/PROJ-10#comment-456" # single comment
|
|
166
|
+
ak fetch-links "https://company.atlassian.net/browse/PROJ-10" # Jira ticket
|
|
167
|
+
ak fetch-links "https://company.atlassian.net/browse/PROJ-10?focusedCommentId=789" # Jira comment
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
**Arguments:**
|
|
171
|
+
- `<url>` — Backlog or Jira URL (ticket or comment)
|
|
172
|
+
|
|
173
|
+
**What it does:**
|
|
174
|
+
1. Loads stored credentials from `.aiflow/credentials.json`
|
|
175
|
+
2. Classifies the URL (Backlog vs Jira, ticket vs comment)
|
|
176
|
+
3. Fetches via the appropriate adapter API
|
|
177
|
+
4. Prints the resulting `SupplementaryContext` JSON to stdout
|
|
178
|
+
|
|
179
|
+
**Exit codes:**
|
|
180
|
+
- `0` — Success, JSON written to stdout
|
|
181
|
+
- `1` — URL not recognised as Backlog/Jira, or fetch failed (error message on stderr)
|
|
182
|
+
|
|
131
183
|
## task (alias: `t`)
|
|
132
184
|
|
|
133
185
|
Manage multiple tasks — pause, switch, and resume while preserving gate progress.
|