@relipa/ai-flow-kit 0.1.0-beta.0 → 0.1.1-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.
Files changed (236) hide show
  1. package/README.md +497 -497
  2. package/bin/aiflow.js +525 -525
  3. package/bin/ak.js +0 -0
  4. package/custom/mcp-presets/README.md +0 -0
  5. package/custom/mcp-presets/backlog.json +0 -0
  6. package/custom/mcp-presets/figma-desktop.json +0 -0
  7. package/custom/mcp-presets/figma.json +0 -0
  8. package/custom/mcp-presets/gitnexus.json +0 -0
  9. package/custom/mcp-presets/google-sheets.json +0 -0
  10. package/custom/mcp-presets/jira.json +0 -0
  11. package/custom/prompts/bug-fix.md +0 -0
  12. package/custom/prompts/feature.md +0 -0
  13. package/custom/prompts/investigation.md +0 -0
  14. package/custom/rules/code-style.md +0 -0
  15. package/custom/rules/java/code-style.md +0 -0
  16. package/custom/rules/java/naming.md +0 -0
  17. package/custom/rules/java/review-checklist.md +0 -0
  18. package/custom/rules/java/spring-boot-examples.md +0 -0
  19. package/custom/rules/javascript/code-style.md +0 -0
  20. package/custom/rules/javascript/naming.md +0 -0
  21. package/custom/rules/naming.md +0 -0
  22. package/custom/rules/php/code-style.md +0 -0
  23. package/custom/rules/php/naming.md +0 -0
  24. package/custom/rules/project-conventions.md +0 -0
  25. package/custom/rules/review-checklist.md +0 -0
  26. package/custom/skills/figma-to-component/SKILL.md +294 -207
  27. package/custom/skills/generate-spec/SKILL.md +0 -0
  28. package/custom/skills/impact-analysis/SKILL.md +0 -0
  29. package/custom/skills/investigate-bug/SKILL.md +0 -0
  30. package/custom/skills/read-study-requirement/SKILL.md +334 -334
  31. package/custom/skills/report-customer/SKILL.md +0 -0
  32. package/custom/skills/review-plan/SKILL.md +0 -0
  33. package/custom/templates/laravel.md +0 -0
  34. package/custom/templates/nestjs.md +0 -0
  35. package/custom/templates/nextjs.md +0 -0
  36. package/custom/templates/nodejs-express.md +0 -0
  37. package/custom/templates/php-plain.md +0 -0
  38. package/custom/templates/php.md +0 -0
  39. package/custom/templates/python-django.md +0 -0
  40. package/custom/templates/python-fastapi.md +0 -0
  41. package/custom/templates/python.md +0 -0
  42. package/custom/templates/reactjs.md +0 -0
  43. package/custom/templates/shared/gate-workflow.md +91 -91
  44. package/custom/templates/spring-boot.md +0 -0
  45. package/custom/templates/tools/claude.md +0 -0
  46. package/custom/templates/tools/copilot.md +0 -0
  47. package/custom/templates/tools/cursor.md +0 -0
  48. package/custom/templates/tools/gemini.md +0 -0
  49. package/custom/templates/tools/generic.md +0 -0
  50. package/custom/templates/vue-nuxt.md +0 -0
  51. package/docs/common/AIFLOW.md +0 -0
  52. package/docs/common/CHANGELOG.md +334 -334
  53. package/docs/common/QUICK_START.md +537 -537
  54. package/docs/common/ai-integration.md +0 -0
  55. package/docs/common/cli-reference.md +657 -657
  56. package/docs/common/configuration.md +0 -0
  57. package/docs/common/getting-started.md +0 -0
  58. package/docs/common/troubleshooting.md +0 -0
  59. package/docs/common/workflows/bug-fix.md +0 -0
  60. package/docs/common/workflows/feature.md +0 -0
  61. package/docs/common/workflows/figma.md +0 -0
  62. package/docs/common/workflows/impact-analysis.md +0 -0
  63. package/docs/common/workflows/investigation.md +0 -0
  64. package/docs/common/workflows/refactor.md +0 -0
  65. package/docs/project/ARCHITECTURE.md +0 -0
  66. package/index.js +0 -0
  67. package/package.json +68 -67
  68. package/scripts/checkpoint.js +0 -0
  69. package/scripts/config.js +0 -0
  70. package/scripts/context.js +0 -0
  71. package/scripts/create-score-excel.js +0 -0
  72. package/scripts/detect.js +0 -0
  73. package/scripts/doctor.js +26 -0
  74. package/scripts/gitnexus-worker.js +0 -0
  75. package/scripts/guide.js +314 -314
  76. package/scripts/hooks/block-git-write.js +0 -0
  77. package/scripts/hooks/session-start.js +315 -315
  78. package/scripts/hooks/session-stop.js +0 -0
  79. package/scripts/init.js +0 -0
  80. package/scripts/link-resolver.js +0 -0
  81. package/scripts/memory.js +0 -0
  82. package/scripts/prompt.js +95 -9
  83. package/scripts/remove.js +0 -0
  84. package/scripts/score_members.js +320 -0
  85. package/scripts/task.js +0 -0
  86. package/scripts/telemetry/cli.js +0 -0
  87. package/scripts/telemetry/config.js +0 -0
  88. package/scripts/telemetry/crypto.js +0 -0
  89. package/scripts/telemetry/flush.js +0 -0
  90. package/scripts/telemetry/record.js +0 -0
  91. package/scripts/update.js +0 -0
  92. package/scripts/use.js +1162 -1162
  93. package/scripts/validate.js +0 -0
  94. package/upstream/.claude-plugin/marketplace.json +0 -0
  95. package/upstream/.claude-plugin/plugin.json +0 -0
  96. package/upstream/.codex/INSTALL.md +0 -0
  97. package/upstream/.cursor-plugin/plugin.json +0 -0
  98. package/upstream/.gitattributes +0 -0
  99. package/upstream/.github/FUNDING.yml +0 -0
  100. package/upstream/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  101. package/upstream/.github/ISSUE_TEMPLATE/config.yml +0 -0
  102. package/upstream/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  103. package/upstream/.github/ISSUE_TEMPLATE/platform_support.md +0 -0
  104. package/upstream/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  105. package/upstream/.opencode/INSTALL.md +0 -0
  106. package/upstream/.opencode/plugins/superpowers.js +0 -0
  107. package/upstream/.version-bump.json +0 -0
  108. package/upstream/AGENTS.md +0 -0
  109. package/upstream/CHANGELOG.md +0 -0
  110. package/upstream/CLAUDE.md +0 -0
  111. package/upstream/CODE_OF_CONDUCT.md +0 -0
  112. package/upstream/GEMINI.md +0 -0
  113. package/upstream/LICENSE +0 -0
  114. package/upstream/README.md +0 -0
  115. package/upstream/RELEASE-NOTES.md +0 -0
  116. package/upstream/agents/code-reviewer.md +0 -0
  117. package/upstream/commands/brainstorm.md +0 -0
  118. package/upstream/commands/execute-plan.md +0 -0
  119. package/upstream/commands/write-plan.md +0 -0
  120. package/upstream/docs/README.codex.md +0 -0
  121. package/upstream/docs/README.opencode.md +0 -0
  122. package/upstream/docs/plans/2025-11-22-opencode-support-design.md +0 -0
  123. package/upstream/docs/plans/2025-11-22-opencode-support-implementation.md +0 -0
  124. package/upstream/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +0 -0
  125. package/upstream/docs/plans/2026-01-17-visual-brainstorming.md +0 -0
  126. package/upstream/docs/superpowers/plans/2026-01-22-document-review-system.md +0 -0
  127. package/upstream/docs/superpowers/plans/2026-02-19-visual-brainstorming-refactor.md +0 -0
  128. package/upstream/docs/superpowers/plans/2026-03-11-zero-dep-brainstorm-server.md +0 -0
  129. package/upstream/docs/superpowers/plans/2026-03-23-codex-app-compatibility.md +0 -0
  130. package/upstream/docs/superpowers/specs/2026-01-22-document-review-system-design.md +0 -0
  131. package/upstream/docs/superpowers/specs/2026-02-19-visual-brainstorming-refactor-design.md +0 -0
  132. package/upstream/docs/superpowers/specs/2026-03-11-zero-dep-brainstorm-server-design.md +0 -0
  133. package/upstream/docs/superpowers/specs/2026-03-23-codex-app-compatibility-design.md +0 -0
  134. package/upstream/docs/testing.md +0 -0
  135. package/upstream/docs/windows/polyglot-hooks.md +0 -0
  136. package/upstream/gemini-extension.json +0 -0
  137. package/upstream/hooks/hooks-cursor.json +0 -0
  138. package/upstream/hooks/hooks.json +0 -0
  139. package/upstream/hooks/run-hook.cmd +0 -0
  140. package/upstream/hooks/session-start +0 -0
  141. package/upstream/package.json +0 -0
  142. package/upstream/scripts/bump-version.sh +0 -0
  143. package/upstream/skills/brainstorming/SKILL.md +0 -0
  144. package/upstream/skills/brainstorming/scripts/frame-template.html +0 -0
  145. package/upstream/skills/brainstorming/scripts/helper.js +0 -0
  146. package/upstream/skills/brainstorming/scripts/server.cjs +0 -0
  147. package/upstream/skills/brainstorming/scripts/start-server.sh +0 -0
  148. package/upstream/skills/brainstorming/scripts/stop-server.sh +0 -0
  149. package/upstream/skills/brainstorming/spec-document-reviewer-prompt.md +0 -0
  150. package/upstream/skills/brainstorming/visual-companion.md +0 -0
  151. package/upstream/skills/dispatching-parallel-agents/SKILL.md +0 -0
  152. package/upstream/skills/executing-plans/SKILL.md +0 -0
  153. package/upstream/skills/finishing-a-development-branch/SKILL.md +0 -0
  154. package/upstream/skills/receiving-code-review/SKILL.md +0 -0
  155. package/upstream/skills/requesting-code-review/SKILL.md +0 -0
  156. package/upstream/skills/requesting-code-review/code-reviewer.md +0 -0
  157. package/upstream/skills/subagent-driven-development/SKILL.md +0 -0
  158. package/upstream/skills/subagent-driven-development/code-quality-reviewer-prompt.md +0 -0
  159. package/upstream/skills/subagent-driven-development/implementer-prompt.md +0 -0
  160. package/upstream/skills/subagent-driven-development/spec-reviewer-prompt.md +0 -0
  161. package/upstream/skills/systematic-debugging/CREATION-LOG.md +0 -0
  162. package/upstream/skills/systematic-debugging/SKILL.md +0 -0
  163. package/upstream/skills/systematic-debugging/condition-based-waiting-example.ts +0 -0
  164. package/upstream/skills/systematic-debugging/condition-based-waiting.md +0 -0
  165. package/upstream/skills/systematic-debugging/defense-in-depth.md +0 -0
  166. package/upstream/skills/systematic-debugging/find-polluter.sh +0 -0
  167. package/upstream/skills/systematic-debugging/root-cause-tracing.md +0 -0
  168. package/upstream/skills/systematic-debugging/test-academic.md +0 -0
  169. package/upstream/skills/systematic-debugging/test-pressure-1.md +0 -0
  170. package/upstream/skills/systematic-debugging/test-pressure-2.md +0 -0
  171. package/upstream/skills/systematic-debugging/test-pressure-3.md +0 -0
  172. package/upstream/skills/tdd-lean/SKILL.md +0 -0
  173. package/upstream/skills/test-driven-development/SKILL.md +0 -0
  174. package/upstream/skills/test-driven-development/testing-anti-patterns.md +0 -0
  175. package/upstream/skills/using-git-worktrees/SKILL.md +0 -0
  176. package/upstream/skills/using-superpowers/SKILL.md +0 -0
  177. package/upstream/skills/using-superpowers/references/codex-tools.md +0 -0
  178. package/upstream/skills/using-superpowers/references/copilot-tools.md +0 -0
  179. package/upstream/skills/using-superpowers/references/gemini-tools.md +0 -0
  180. package/upstream/skills/verification-before-completion/SKILL.md +0 -0
  181. package/upstream/skills/writing-plans/SKILL.md +0 -0
  182. package/upstream/skills/writing-plans/plan-document-reviewer-prompt.md +0 -0
  183. package/upstream/skills/writing-skills/SKILL.md +0 -0
  184. package/upstream/skills/writing-skills/anthropic-best-practices.md +0 -0
  185. package/upstream/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -0
  186. package/upstream/skills/writing-skills/graphviz-conventions.dot +0 -0
  187. package/upstream/skills/writing-skills/persuasion-principles.md +0 -0
  188. package/upstream/skills/writing-skills/render-graphs.js +0 -0
  189. package/upstream/skills/writing-skills/testing-skills-with-subagents.md +0 -0
  190. package/upstream/tests/brainstorm-server/package-lock.json +0 -0
  191. package/upstream/tests/brainstorm-server/package.json +0 -0
  192. package/upstream/tests/brainstorm-server/server.test.js +0 -0
  193. package/upstream/tests/brainstorm-server/windows-lifecycle.test.sh +0 -0
  194. package/upstream/tests/brainstorm-server/ws-protocol.test.js +0 -0
  195. package/upstream/tests/claude-code/README.md +0 -0
  196. package/upstream/tests/claude-code/analyze-token-usage.py +0 -0
  197. package/upstream/tests/claude-code/run-skill-tests.sh +0 -0
  198. package/upstream/tests/claude-code/test-document-review-system.sh +0 -0
  199. package/upstream/tests/claude-code/test-helpers.sh +0 -0
  200. package/upstream/tests/claude-code/test-subagent-driven-development-integration.sh +0 -0
  201. package/upstream/tests/claude-code/test-subagent-driven-development.sh +0 -0
  202. package/upstream/tests/explicit-skill-requests/prompts/action-oriented.txt +0 -0
  203. package/upstream/tests/explicit-skill-requests/prompts/after-planning-flow.txt +0 -0
  204. package/upstream/tests/explicit-skill-requests/prompts/claude-suggested-it.txt +0 -0
  205. package/upstream/tests/explicit-skill-requests/prompts/i-know-what-sdd-means.txt +0 -0
  206. package/upstream/tests/explicit-skill-requests/prompts/mid-conversation-execute-plan.txt +0 -0
  207. package/upstream/tests/explicit-skill-requests/prompts/please-use-brainstorming.txt +0 -0
  208. package/upstream/tests/explicit-skill-requests/prompts/skip-formalities.txt +0 -0
  209. package/upstream/tests/explicit-skill-requests/prompts/subagent-driven-development-please.txt +0 -0
  210. package/upstream/tests/explicit-skill-requests/prompts/use-systematic-debugging.txt +0 -0
  211. package/upstream/tests/explicit-skill-requests/run-all.sh +0 -0
  212. package/upstream/tests/explicit-skill-requests/run-claude-describes-sdd.sh +0 -0
  213. package/upstream/tests/explicit-skill-requests/run-extended-multiturn-test.sh +0 -0
  214. package/upstream/tests/explicit-skill-requests/run-haiku-test.sh +0 -0
  215. package/upstream/tests/explicit-skill-requests/run-multiturn-test.sh +0 -0
  216. package/upstream/tests/explicit-skill-requests/run-test.sh +0 -0
  217. package/upstream/tests/opencode/run-tests.sh +0 -0
  218. package/upstream/tests/opencode/setup.sh +0 -0
  219. package/upstream/tests/opencode/test-plugin-loading.sh +0 -0
  220. package/upstream/tests/opencode/test-priority.sh +0 -0
  221. package/upstream/tests/opencode/test-tools.sh +0 -0
  222. package/upstream/tests/skill-triggering/prompts/dispatching-parallel-agents.txt +0 -0
  223. package/upstream/tests/skill-triggering/prompts/executing-plans.txt +0 -0
  224. package/upstream/tests/skill-triggering/prompts/requesting-code-review.txt +0 -0
  225. package/upstream/tests/skill-triggering/prompts/systematic-debugging.txt +0 -0
  226. package/upstream/tests/skill-triggering/prompts/test-driven-development.txt +0 -0
  227. package/upstream/tests/skill-triggering/prompts/writing-plans.txt +0 -0
  228. package/upstream/tests/skill-triggering/run-all.sh +0 -0
  229. package/upstream/tests/skill-triggering/run-test.sh +0 -0
  230. package/upstream/tests/subagent-driven-dev/go-fractals/design.md +0 -0
  231. package/upstream/tests/subagent-driven-dev/go-fractals/plan.md +0 -0
  232. package/upstream/tests/subagent-driven-dev/go-fractals/scaffold.sh +0 -0
  233. package/upstream/tests/subagent-driven-dev/run-test.sh +0 -0
  234. package/upstream/tests/subagent-driven-dev/svelte-todo/design.md +0 -0
  235. package/upstream/tests/subagent-driven-dev/svelte-todo/plan.md +0 -0
  236. package/upstream/tests/subagent-driven-dev/svelte-todo/scaffold.sh +0 -0
package/README.md CHANGED
@@ -1,497 +1,497 @@
1
- # AI Flow Kit
2
-
3
- **All-in-one package for software development teams using Claude AI.**
4
-
5
- Developers only need a single command to load ticket context → AI automatically understands the requirements, chooses the workflow, and follows team rules — no long prompts needed, no need to know the templates.
6
-
7
- ---
8
-
9
- ## Problems Solved
10
-
11
- | Problem | Solution |
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 |
15
- | Too many templates, not sure which to use | AI auto-detects task type and selects the appropriate skill |
16
- | New plugins (superpowers, MCP...) require manual setup | Package auto-sets up hooks, skills, and MCP on init |
17
- | Missing investigation / bug reproduction flow | Skill `investigate-bug` (inherits systematic-debugging) |
18
- | Missing impact analysis flow | Skill `impact-analysis` |
19
- | Hard to resume tasks | **State Resumption**: Unified `plan/` docs, `task-summary.md` progress tracking, and intelligent session continuity (automatic Gate 3 resumption). |
20
-
21
- ## Documentation & Guides
22
-
23
- > [!TIP]
24
- > After running `aiflow init`, documentation files are automatically copied to `.aiflow/docs/` in your project for easy access.
25
-
26
- - **[Quick Start Guide](https://github.com/example/ai-flow-kit/blob/main/docs/common/QUICK_START.md)** — Step-by-step instructions for developers.
27
- - **[Full Workflow (5 Gates)](https://github.com/example/ai-flow-kit/blob/main/docs/common/AIFLOW.md)** — In-depth look at the Gate process.
28
- - **[Troubleshooting](https://github.com/example/ai-flow-kit/blob/main/docs/common/troubleshooting.md)** — Common issues and fixes.
29
- - **[Integration Guide](https://github.com/example/ai-flow-kit/blob/main/docs/common/ai-integration.md)** — Advanced tool setup (Claude, Cursor, Gemini).
30
- - **[Changelog](https://github.com/example/ai-flow-kit/blob/main/docs/common/CHANGELOG.md)** — Version history and release notes.
31
-
32
- ---
33
-
34
- ## Overview Flow
35
-
36
- ```
37
- PM writes ticket on Backlog/Jira
38
-
39
-
40
- ⛩️ GATE 1 — AI Analyze Requirement [AI + DEV]
41
- aiflow use PROJ-33 → claude
42
- AI loads ticket + reads source code
43
- AI asks clarifying questions (max 1 in Fast mode)
44
- AI outputs: plan/PROJ-33/requirement.md (Lite in Fast mode)
45
- DEV reviews → "APPROVED"
46
- │ APPROVED
47
-
48
- ⛩️ GATE 2 — Implementation Plan [AI + DEV]
49
- AI creates detailed coding plan (TDD steps)
50
- DEV reviews → "APPROVED"
51
- │ APPROVED
52
-
53
- ⛩️ GATE 3 — Code Generation (TDD) [AI]
54
- AI writes tests first → implement → tests pass
55
- Verify implementation works
56
- │ Code done
57
-
58
- ⛩️ GATE 4 — AI Self-Review [AI + DEV]
59
- AI runs: verification + impact-analysis + checklist
60
- AI generates: plan/PROJ-33/task-summary.md
61
- DEV reviews → "APPROVED" or "BUG: [description]"
62
- │ APPROVED
63
-
64
- ⛩️ GATE 5 — Peer Review & PR [DEV + Peer]
65
- Create Pull Request → peer review → merge
66
-
67
-
68
- DONE
69
- ```
70
-
71
- ---
72
-
73
- ## Installation
74
-
75
- ```bash
76
- # Stable version
77
- npm install -g @relipa/ai-flow-kit
78
-
79
- # Beta version (recommend for newest features)
80
- npm install -g @relipa/ai-flow-kit@beta
81
-
82
- # Uninstall
83
- npm uninstall -g @relipa/ai-flow-kit
84
- ```
85
-
86
- ---
87
-
88
- ## Commands
89
-
90
- | Command | Description |
91
- |---------|-------------|
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 fetch-links <url>` | Fetch a Backlog/Jira link and print SupplementaryContext JSON (used by AI at runtime). |
95
- | `aiflow task` | Manage multiple tasks — pause, switch, resume. |
96
- | `aiflow task next` | Finalize gate approval and prepare for fresh session. |
97
- | `aiflow prompt` | Generate tool-optimized prompts (`--env cursor`). |
98
- | `aiflow sync-skills` | Manually synchronize AI Instruction files with local custom skills. |
99
- | `aiflow telemetry` | Manage telemetry tracking (enable/disable/status). |
100
- | `aiflow guide` | View integrated multi-AI integration guide. |
101
-
102
- ### `aiflow init`
103
-
104
- Initial setup for the project. Run once per project.
105
-
106
- ```bash
107
- # Single framework + adapter
108
- aiflow init --framework spring-boot --adapter backlog
109
-
110
- # Enable token savings tools
111
- aiflow init --with-rtk # RTK: compress bash outputs (60–90% reduction)
112
- # aiflow init --with-gitnexus # GitNexus: code intelligence (waits for index)
113
- # aiflow init --with-gitnexus --no-wait # GitNexus: index in background
114
-
115
- # Multiple frameworks and adapters
116
- aiflow init --framework spring-boot,reactjs --adapter backlog,jira
117
- ```
118
-
119
- **What gets automatically set up:**
120
- - `.claude/skills/` — superpowers skills + team custom skills
121
- - `.claude/hooks/session-start.js` — SessionStart hook
122
- - `.claude/settings.json` — hook configuration
123
- - `.rules/` — team coding rules (based on framework language)
124
- - `CLAUDE.md` — framework-specific AI prompt
125
- - `.mcp.json` + Claude Desktop config — MCP adapter
126
- - `.aiflow/credentials.json` — save API credentials
127
-
128
- **Supported Frameworks:** `spring-boot`, `laravel`, `php`, `nestjs`, `reactjs`, `nextjs`, `vue-nuxt`, `nodejs-express`, `python`, `python-django`, `python-fastapi`
129
-
130
- **Supported Adapters:** `backlog`, `jira`, `google-sheets`, `figma`, `figma-desktop`
131
-
132
- **Figma adapters:**
133
-
134
- | Adapter | Command | Auth | Requirement |
135
- |---------|---------|------|-------------|
136
- | `figma` | `ak init -a figma` | Personal Access Token (`figd_...`) | None — REST API |
137
- | `figma-desktop` | `ak init -a figma-desktop` | Desktop session (no token needed) | Figma Desktop app installed & open |
138
-
139
- > The `figma-desktop` adapter uses the official `@figma/mcp-server` package from Figma Inc. and is the recommended option if you already use Figma Desktop.
140
- > See [Figma workflow guide](docs/common/workflows/figma.md) for usage with the `figma-to-component` skill.
141
-
142
- ---
143
-
144
- ### `aiflow sync-skills`
145
-
146
- Synchronize AI instruction files (`CLAUDE.md`, `GEMINI.md`, etc.) and Skills without upgrading the package version.
147
-
148
- ```bash
149
- aiflow sync-skills
150
- ```
151
-
152
- **Features:**
153
- - Intelligent marker-based updates (`<!-- aiflow-kit-start -->`)
154
- - Confirmation prompts before overwriting custom rules
155
- - English notifications and status reports
156
-
157
- ---
158
-
159
- ### `aiflow use <ticket...>`
160
-
161
- 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.
162
-
163
- ```bash
164
- # Single target (backward compatible)
165
- aiflow use PROJ-33
166
- aiflow use https://mycompany.backlog.com/view/PROJ-33
167
-
168
- # Multiple targets — primary + supplementary
169
- aiflow use PROJ-33 PROJ-10 docs/arch.md
170
- # PROJ-33 drives Gate 1; PROJ-10 + docs/arch.md become supplementary context
171
-
172
- # Backlog / Jira ticket
173
- aiflow use PROJ-123
174
-
175
- # Comments
176
- aiflow use PROJ-33 --with-comments
177
- aiflow use PROJ-33 --comments-last 5
178
- aiflow use PROJ-33 --comments-from 3
179
-
180
- # Manual input
181
- aiflow use --manual
182
-
183
- # Load from local file (JSON or plain text)
184
- aiflow use --file task.md # Auto-generates taskId from filename & prompts for taskType
185
-
186
- # Modes (Fast is default)
187
- aiflow use PROJ-33 # Fast Mode: skip Q&A, target < 5 min
188
- aiflow use PROJ-33 --full # Full Mode: deep analysis with Q&A
189
-
190
- # Save with custom name
191
- aiflow use PROJ-33 --save sprint-42-bug
192
- ```
193
-
194
- > **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.
195
-
196
- ---
197
-
198
- ### `aiflow fetch-links <url>`
199
-
200
- 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.
201
-
202
- ```bash
203
- # Backlog ticket → full ticket JSON
204
- aiflow fetch-links "https://company.backlog.com/view/PROJ-10"
205
-
206
- # Backlog comment → that single comment only
207
- aiflow fetch-links "https://company.backlog.com/view/PROJ-10#comment-456"
208
-
209
- # Jira ticket / comment
210
- aiflow fetch-links "https://company.atlassian.net/browse/PROJ-10"
211
- aiflow fetch-links "https://company.atlassian.net/browse/PROJ-10?focusedCommentId=789"
212
- ```
213
-
214
- Output schema:
215
-
216
- ```json
217
- {
218
- "sourceType": "ticket | comment",
219
- "sourceUrl": "...",
220
- "ticketId": "PROJ-10",
221
- "commentId": "456",
222
- "title": "...",
223
- "description": "...",
224
- "content": "...",
225
- "author": "...",
226
- "date": "..."
227
- }
228
- ```
229
-
230
- Exits non-zero with a stderr message if the URL is not a recognised Backlog/Jira pattern or fetching fails.
231
-
232
- ---
233
-
234
- ### `aiflow task`
235
-
236
- Manage multiple tasks — pause a task, switch to another, and resume later while keeping full progress.
237
-
238
- ```bash
239
- aiflow task status # show active task and pending tasks
240
- aiflow task list # list all saved tasks
241
- aiflow task pause # pause current task (saves context + gate progress)
242
- aiflow task pause --note "waiting for API spec" # pause with a note
243
- aiflow task switch PROJ-99 # pause current + switch to another task
244
- aiflow task resume PROJ-33 # resume a paused task (restores context + gate state)
245
- aiflow task reset PROJ-33 # reset to Gate 1 (keeps ticket context, clears progress)
246
- aiflow task remove PROJ-33 # permanently delete all saved data for the task
247
- aiflow task next # approve current gate + prepare for fresh session
248
- aiflow task next --ticket PROJ-33 # same, but specify ticket explicitly
249
- ```
250
-
251
- **Use case — switching tasks mid-flow:**
252
-
253
- ```bash
254
- # Working on PROJ-33 at Gate 2...
255
- aiflow task pause # pauses and saves PROJ-33 progress
256
-
257
- aiflow use PROJ-99 # loads urgent task (auto-pauses current)
258
- claude # AI starts Gate 1 for PROJ-99
259
-
260
- # Done with PROJ-99, resuming PROJ-33
261
- aiflow task resume PROJ-33 # restores context
262
- claude # AI resumes from Gate 2 automatically
263
- ```
264
-
265
- Task state (context + gate progress) is saved in `.aiflow/tasks/<taskId>/`.
266
-
267
- ---
268
-
269
- ### `aiflow doctor`
270
-
271
- Check if the setup is complete.
272
-
273
- ```bash
274
- aiflow doctor
275
- ```
276
-
277
- ```
278
- ✓ .claude/skills exists (42 skills)
279
- ✓ .rules exists
280
- ✓ CLAUDE.md exists
281
- ✓ SessionStart hook configured
282
- ✓ Version tracking active (v1.0.0)
283
- ✨ Everything looks healthy!
284
- ```
285
-
286
- ---
287
-
288
- ### `aiflow update`
289
-
290
- Update skills, rules, and templates to the latest version.
291
-
292
- ```bash
293
- aiflow update
294
- ```
295
-
296
- ---
297
-
298
- ### `aiflow validate <file>`
299
-
300
- Validate code output against team rules.
301
-
302
- ```bash
303
- aiflow validate src/Payment.java --ruleset strict
304
- ```
305
-
306
- ---
307
-
308
- ### `aiflow memory`
309
-
310
- Save/search team knowledge.
311
-
312
- ```bash
313
- aiflow memory save "payment-flow" "Payment flow description..."
314
- aiflow memory search "payment"
315
- aiflow memory list
316
- ```
317
-
318
- ---
319
-
320
- ## Available Skills
321
-
322
- ### Custom skills (team-specific)
323
-
324
- | Skill | Trigger | Description |
325
- |-------|---------|-------|
326
- | `investigate-bug` | "fix bug", "error", "crash" | Investigate bugs via data flow, inherits `systematic-debugging` |
327
- | `impact-analysis` | "impact scope", "breaking change" | Analyze the impact when changing code |
328
- | `generate-spec` | "new feature", "spec", "design" | Write technical specs, integrates `brainstorming` |
329
- | `report-customer` | "customer report", "incident" | Write incident reports for Customer Service |
330
- | `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) |
331
-
332
- ### Superpowers skills (upstream, inherited from obra/superpowers)
333
-
334
- | Skill | Description |
335
- |-------|-------|
336
- | `systematic-debugging` | Core debugging methodology — NO FIX WITHOUT ROOT CAUSE |
337
- | `brainstorming` | Explore requirements before coding |
338
- | `writing-plans` | Create bite-sized implementation plans |
339
- | `executing-plans` | Execute plans with review checkpoints |
340
- | `test-driven-development` | RED→GREEN→REFACTOR |
341
- | `subagent-driven-development` | Dispatch subagents for independent tasks |
342
- | `requesting-code-review` | Review code before merging |
343
- | `verification-before-completion` | Verify before claiming done |
344
- | `using-git-worktrees` | Isolated workspace for feature work |
345
- | `finishing-a-development-branch` | Complete branch and merge options |
346
-
347
- ---
348
-
349
- ## Framework Templates
350
-
351
- | Framework | Language | Rules applied |
352
- |-----------|---------|--------------|
353
- | `spring-boot` | Java 17+ | `rules/java/` |
354
- | `laravel` | PHP 8.1+ | `rules/php/` |
355
- | `php` | PHP 8.1+ (no framework) | `rules/php/` |
356
- | `nestjs` | TypeScript | `rules/javascript/` |
357
- | `reactjs` | TypeScript | `rules/javascript/` |
358
- | `nextjs` | TypeScript | `rules/javascript/` |
359
- | `vue-nuxt` | TypeScript | `rules/javascript/` |
360
- | `nodejs-express` | JavaScript/TypeScript | `rules/javascript/` |
361
- | `python` | Python (no framework) | — |
362
- | `python-django` | Python | — |
363
- | `python-fastapi` | Python | — |
364
-
365
- ---
366
-
367
- ## Project Structure
368
-
369
- ```
370
- ai-flow-kit/
371
- ├── README.md # Main documentation
372
- ├── bin/aiflow.js # CLI entry
373
- ├── docs/
374
- │ ├── common/ # Published with package
375
- │ │ ├── QUICK_START.md # Quick start guide
376
- │ │ ├── AIFLOW.md # Workflow (5 Gates) detail
377
- │ │ ├── CHANGELOG.md # Version history
378
- │ │ ├── cli-reference.md # Full CLI reference
379
- │ │ └── workflows/ # Per-task workflow guides
380
- │ └── project/ # Project template files
381
- │ └── ARCHITECTURE.md # Architecture doc template
382
- ├── scripts/
383
- │ ├── init.js # Project initialization
384
- │ ├── update.js # Version management
385
- │ ├── doctor.js # Health check
386
- │ ├── use.js # Context loading (Backlog/Jira)
387
- │ ├── config.js # Config system
388
- │ ├── detect.js # Task type detection
389
- │ ├── validate.js # Code validation
390
- │ ├── memory.js # Knowledge management
391
- │ └── hooks/session-start.js # SessionStart hook (Node.js)
392
- ├── custom/
393
- │ ├── skills/ # Team-specific AI skills
394
- │ ├── rules/java/ # Java/Spring Boot rules
395
- │ ├── rules/php/ # PHP/Laravel rules
396
- │ ├── rules/javascript/ # JS/TS rules
397
- │ ├── templates/ # Framework tool templates
398
- │ ├── prompts/ # Task prompt templates
399
- │ └── mcp-presets/ # Backlog/Jira/Sheets config
400
- └── upstream/ # obra/superpowers (inherited)
401
- ```
402
-
403
- ---
404
-
405
- ## Adding new frameworks / adapters
406
-
407
- **New Framework:** create `custom/templates/<name>.md` + `custom/rules/<lang>/`
408
-
409
- **New Adapter:** create `custom/mcp-presets/<name>.json`
410
-
411
- **Custom skill:** create `custom/skills/<name>/SKILL.md`
412
-
413
- Then run `aiflow update` or `aiflow sync-skills` to apply.
414
-
415
- ---
416
-
417
- ## Usage Environments
418
-
419
- | Environment | Experience | Notes |
420
- |-----------|------------|---------|
421
- | Claude Code CLI (`claude`) | ⭐⭐⭐⭐⭐ | Full auto — skills, hook, automatically loaded context |
422
- | Claude Extension (VS Code) | ⭐⭐⭐ | `aiflow prompt <type>` → copy paste |
423
- | Antigravity / Cursor | ⭐⭐⭐ | `aiflow prompt <type>` → copy paste |
424
-
425
- ---
426
-
427
- ## Release Notes
428
-
429
- > Summary of major changes per version. See full details in [CHANGELOG.md](docs/common/CHANGELOG.md).
430
-
431
- ### v0.1.0 — 2026-05-28
432
- - Multi-target `ak use` — load multiple tickets/files in a single call (primary + supplementary).
433
- - Auto link resolution — auto-fetch Backlog/Jira URLs found in the ticket description (capped at 5 links).
434
- - Comment-aware resolution — `#comment-456` links fetch only that specific comment.
435
- - New `ak fetch-links <url>` command for AI runtime use.
436
- - SessionStart hook renders the `supplementaryContext[]` block into the prompt.
437
- - Added Jest test suite (20+ unit tests for `link-resolver`).
438
-
439
- ### v0.0.9 — 2026-05-25
440
- - New `figma-desktop` adapter (uses `@figma/mcp-server`, no token required).
441
- - `figma-to-component` skill supports Next.js App Router and Angular.
442
- - `ak gate N start|approved` auto-syncs `task-state.json`.
443
- - New `project-conventions.md` — enforces Gate 2 plan output at `plan/[ticket-id]/plan.md`.
444
- - WSL clipboard support in `ak prompt`.
445
- - Fixes: wrong Figma tool names, PAT verify using wrong auth header, `currentGate` not advancing.
446
-
447
- ### v0.0.8 — 2026-05-14
448
- - New CLI alias `ak` (short for `aiflow`) + aliases for every sub-command.
449
- - Flexible comment loading options: `--coms`, `--cid`, `--clast`, `--cfrom`, `--cto`.
450
- - Fixed Backlog comment pagination (switched to `minId`-based).
451
- - v0.0.8-beta.1: Actually removed auto-commit + added PreToolUse hook blocking `git commit/add/push`.
452
-
453
- ### v0.0.7 — 2026-05-08
454
- - `aiflow use --file` auto-generates `taskId` from filename + interactive `taskType` prompt.
455
- - Auto-generates `task-summary.md` at each gate transition.
456
- - Added NestJS and PHP Plain framework support.
457
- - New `aiflow sync-skills` command.
458
- - Marker-based update for `CLAUDE.md`, `GEMINI.md`, `.cursorrules`.
459
- - Auto-manages `.gitignore` for generated files.
460
-
461
- ### v0.0.6 — 2026-04-29
462
- - **Fast Mode** enabled by default (reduced Q&A, single-session implementation).
463
- - New `aiflow task` command group (status/list/pause/switch/resume).
464
- - Integrated RTK token compression (60–90% savings).
465
- - `--file` loader supports plain-text input.
466
-
467
- ### v0.0.5 — 2026-04-23
468
- - Telemetry MVP — opt-in tracking, HMAC-SHA256 signed payload, no prompt content logged.
469
- - New `aiflow gate <n> <action>` command for AI to call automatically on gate transitions.
470
- - Safe overwrite flow in `aiflow init` (backs up existing files before overwrite).
471
-
472
- ### v0.0.1 — 2026-04-13
473
- - Initial release: `aiflow` CLI, 5-Gate workflow, 7 custom skills, support for Claude Code / Gemini / Copilot.
474
-
475
- ---
476
-
477
- ## Troubleshooting
478
-
479
- **`aiflow` not found:**
480
- ```bash
481
- npm install -g @relipa/ai-flow-kit
482
- ```
483
-
484
- **Backlog load fails:**
485
- ```bash
486
- aiflow doctor
487
- # Re-setup credentials
488
- aiflow init --adapter backlog
489
- ```
490
-
491
- **Skills not loading in Claude:**
492
- ```bash
493
- # Ensure init was run outside Claude terminal (session-start hook needs restart)
494
- aiflow doctor
495
- ```
496
-
497
- See more: [docs/common/troubleshooting.md](./docs/common/troubleshooting.md)
1
+ # AI Flow Kit
2
+
3
+ **All-in-one package for software development teams using Claude AI.**
4
+
5
+ Developers only need a single command to load ticket context → AI automatically understands the requirements, chooses the workflow, and follows team rules — no long prompts needed, no need to know the templates.
6
+
7
+ ---
8
+
9
+ ## Problems Solved
10
+
11
+ | Problem | Solution |
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 |
15
+ | Too many templates, not sure which to use | AI auto-detects task type and selects the appropriate skill |
16
+ | New plugins (superpowers, MCP...) require manual setup | Package auto-sets up hooks, skills, and MCP on init |
17
+ | Missing investigation / bug reproduction flow | Skill `investigate-bug` (inherits systematic-debugging) |
18
+ | Missing impact analysis flow | Skill `impact-analysis` |
19
+ | Hard to resume tasks | **State Resumption**: Unified `plan/` docs, `task-summary.md` progress tracking, and intelligent session continuity (automatic Gate 3 resumption). |
20
+
21
+ ## Documentation & Guides
22
+
23
+ > [!TIP]
24
+ > After running `aiflow init`, documentation files are automatically copied to `.aiflow/docs/` in your project for easy access.
25
+
26
+ - **[Quick Start Guide](https://github.com/example/ai-flow-kit/blob/main/docs/common/QUICK_START.md)** — Step-by-step instructions for developers.
27
+ - **[Full Workflow (5 Gates)](https://github.com/example/ai-flow-kit/blob/main/docs/common/AIFLOW.md)** — In-depth look at the Gate process.
28
+ - **[Troubleshooting](https://github.com/example/ai-flow-kit/blob/main/docs/common/troubleshooting.md)** — Common issues and fixes.
29
+ - **[Integration Guide](https://github.com/example/ai-flow-kit/blob/main/docs/common/ai-integration.md)** — Advanced tool setup (Claude, Cursor, Gemini).
30
+ - **[Changelog](https://github.com/example/ai-flow-kit/blob/main/docs/common/CHANGELOG.md)** — Version history and release notes.
31
+
32
+ ---
33
+
34
+ ## Overview Flow
35
+
36
+ ```
37
+ PM writes ticket on Backlog/Jira
38
+
39
+
40
+ ⛩️ GATE 1 — AI Analyze Requirement [AI + DEV]
41
+ aiflow use PROJ-33 → claude
42
+ AI loads ticket + reads source code
43
+ AI asks clarifying questions (max 1 in Fast mode)
44
+ AI outputs: plan/PROJ-33/requirement.md (Lite in Fast mode)
45
+ DEV reviews → "APPROVED"
46
+ │ APPROVED
47
+
48
+ ⛩️ GATE 2 — Implementation Plan [AI + DEV]
49
+ AI creates detailed coding plan (TDD steps)
50
+ DEV reviews → "APPROVED"
51
+ │ APPROVED
52
+
53
+ ⛩️ GATE 3 — Code Generation (TDD) [AI]
54
+ AI writes tests first → implement → tests pass
55
+ Verify implementation works
56
+ │ Code done
57
+
58
+ ⛩️ GATE 4 — AI Self-Review [AI + DEV]
59
+ AI runs: verification + impact-analysis + checklist
60
+ AI generates: plan/PROJ-33/task-summary.md
61
+ DEV reviews → "APPROVED" or "BUG: [description]"
62
+ │ APPROVED
63
+
64
+ ⛩️ GATE 5 — Peer Review & PR [DEV + Peer]
65
+ Create Pull Request → peer review → merge
66
+
67
+
68
+ DONE
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Installation
74
+
75
+ ```bash
76
+ # Stable version
77
+ npm install -g @relipa/ai-flow-kit
78
+
79
+ # Beta version (recommend for newest features)
80
+ npm install -g @relipa/ai-flow-kit@beta
81
+
82
+ # Uninstall
83
+ npm uninstall -g @relipa/ai-flow-kit
84
+ ```
85
+
86
+ ---
87
+
88
+ ## Commands
89
+
90
+ | Command | Description |
91
+ |---------|-------------|
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 fetch-links <url>` | Fetch a Backlog/Jira link and print SupplementaryContext JSON (used by AI at runtime). |
95
+ | `aiflow task` | Manage multiple tasks — pause, switch, resume. |
96
+ | `aiflow task next` | Finalize gate approval and prepare for fresh session. |
97
+ | `aiflow prompt` | Generate tool-optimized prompts (`--env cursor`). |
98
+ | `aiflow sync-skills` | Manually synchronize AI Instruction files with local custom skills. |
99
+ | `aiflow telemetry` | Manage telemetry tracking (enable/disable/status). |
100
+ | `aiflow guide` | View integrated multi-AI integration guide. |
101
+
102
+ ### `aiflow init`
103
+
104
+ Initial setup for the project. Run once per project.
105
+
106
+ ```bash
107
+ # Single framework + adapter
108
+ aiflow init --framework spring-boot --adapter backlog
109
+
110
+ # Enable token savings tools
111
+ aiflow init --with-rtk # RTK: compress bash outputs (60–90% reduction)
112
+ # aiflow init --with-gitnexus # GitNexus: code intelligence (waits for index)
113
+ # aiflow init --with-gitnexus --no-wait # GitNexus: index in background
114
+
115
+ # Multiple frameworks and adapters
116
+ aiflow init --framework spring-boot,reactjs --adapter backlog,jira
117
+ ```
118
+
119
+ **What gets automatically set up:**
120
+ - `.claude/skills/` — superpowers skills + team custom skills
121
+ - `.claude/hooks/session-start.js` — SessionStart hook
122
+ - `.claude/settings.json` — hook configuration
123
+ - `.rules/` — team coding rules (based on framework language)
124
+ - `CLAUDE.md` — framework-specific AI prompt
125
+ - `.mcp.json` + Claude Desktop config — MCP adapter
126
+ - `.aiflow/credentials.json` — save API credentials
127
+
128
+ **Supported Frameworks:** `spring-boot`, `laravel`, `php`, `nestjs`, `reactjs`, `nextjs`, `vue-nuxt`, `nodejs-express`, `python`, `python-django`, `python-fastapi`
129
+
130
+ **Supported Adapters:** `backlog`, `jira`, `google-sheets`, `figma`, `figma-desktop`
131
+
132
+ **Figma adapters:**
133
+
134
+ | Adapter | Command | Auth | Requirement |
135
+ |---------|---------|------|-------------|
136
+ | `figma` | `ak init -a figma` | Personal Access Token (`figd_...`) | None — REST API |
137
+ | `figma-desktop` | `ak init -a figma-desktop` | Desktop session (no token needed) | Figma Desktop app installed & open |
138
+
139
+ > The `figma-desktop` adapter uses the official `@figma/mcp-server` package from Figma Inc. and is the recommended option if you already use Figma Desktop.
140
+ > See [Figma workflow guide](docs/common/workflows/figma.md) for usage with the `figma-to-component` skill.
141
+
142
+ ---
143
+
144
+ ### `aiflow sync-skills`
145
+
146
+ Synchronize AI instruction files (`CLAUDE.md`, `GEMINI.md`, etc.) and Skills without upgrading the package version.
147
+
148
+ ```bash
149
+ aiflow sync-skills
150
+ ```
151
+
152
+ **Features:**
153
+ - Intelligent marker-based updates (`<!-- aiflow-kit-start -->`)
154
+ - Confirmation prompts before overwriting custom rules
155
+ - English notifications and status reports
156
+
157
+ ---
158
+
159
+ ### `aiflow use <ticket...>`
160
+
161
+ 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.
162
+
163
+ ```bash
164
+ # Single target (backward compatible)
165
+ aiflow use PROJ-33
166
+ aiflow use https://mycompany.backlog.com/view/PROJ-33
167
+
168
+ # Multiple targets — primary + supplementary
169
+ aiflow use PROJ-33 PROJ-10 docs/arch.md
170
+ # PROJ-33 drives Gate 1; PROJ-10 + docs/arch.md become supplementary context
171
+
172
+ # Backlog / Jira ticket
173
+ aiflow use PROJ-123
174
+
175
+ # Comments
176
+ aiflow use PROJ-33 --with-comments
177
+ aiflow use PROJ-33 --comments-last 5
178
+ aiflow use PROJ-33 --comments-from 3
179
+
180
+ # Manual input
181
+ aiflow use --manual
182
+
183
+ # Load from local file (JSON or plain text)
184
+ aiflow use --file task.md # Auto-generates taskId from filename & prompts for taskType
185
+
186
+ # Modes (Fast is default)
187
+ aiflow use PROJ-33 # Fast Mode: skip Q&A, target < 5 min
188
+ aiflow use PROJ-33 --full # Full Mode: deep analysis with Q&A
189
+
190
+ # Save with custom name
191
+ aiflow use PROJ-33 --save sprint-42-bug
192
+ ```
193
+
194
+ > **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.
195
+
196
+ ---
197
+
198
+ ### `aiflow fetch-links <url>`
199
+
200
+ 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.
201
+
202
+ ```bash
203
+ # Backlog ticket → full ticket JSON
204
+ aiflow fetch-links "https://company.backlog.com/view/PROJ-10"
205
+
206
+ # Backlog comment → that single comment only
207
+ aiflow fetch-links "https://company.backlog.com/view/PROJ-10#comment-456"
208
+
209
+ # Jira ticket / comment
210
+ aiflow fetch-links "https://company.atlassian.net/browse/PROJ-10"
211
+ aiflow fetch-links "https://company.atlassian.net/browse/PROJ-10?focusedCommentId=789"
212
+ ```
213
+
214
+ Output schema:
215
+
216
+ ```json
217
+ {
218
+ "sourceType": "ticket | comment",
219
+ "sourceUrl": "...",
220
+ "ticketId": "PROJ-10",
221
+ "commentId": "456",
222
+ "title": "...",
223
+ "description": "...",
224
+ "content": "...",
225
+ "author": "...",
226
+ "date": "..."
227
+ }
228
+ ```
229
+
230
+ Exits non-zero with a stderr message if the URL is not a recognised Backlog/Jira pattern or fetching fails.
231
+
232
+ ---
233
+
234
+ ### `aiflow task`
235
+
236
+ Manage multiple tasks — pause a task, switch to another, and resume later while keeping full progress.
237
+
238
+ ```bash
239
+ aiflow task status # show active task and pending tasks
240
+ aiflow task list # list all saved tasks
241
+ aiflow task pause # pause current task (saves context + gate progress)
242
+ aiflow task pause --note "waiting for API spec" # pause with a note
243
+ aiflow task switch PROJ-99 # pause current + switch to another task
244
+ aiflow task resume PROJ-33 # resume a paused task (restores context + gate state)
245
+ aiflow task reset PROJ-33 # reset to Gate 1 (keeps ticket context, clears progress)
246
+ aiflow task remove PROJ-33 # permanently delete all saved data for the task
247
+ aiflow task next # approve current gate + prepare for fresh session
248
+ aiflow task next --ticket PROJ-33 # same, but specify ticket explicitly
249
+ ```
250
+
251
+ **Use case — switching tasks mid-flow:**
252
+
253
+ ```bash
254
+ # Working on PROJ-33 at Gate 2...
255
+ aiflow task pause # pauses and saves PROJ-33 progress
256
+
257
+ aiflow use PROJ-99 # loads urgent task (auto-pauses current)
258
+ claude # AI starts Gate 1 for PROJ-99
259
+
260
+ # Done with PROJ-99, resuming PROJ-33
261
+ aiflow task resume PROJ-33 # restores context
262
+ claude # AI resumes from Gate 2 automatically
263
+ ```
264
+
265
+ Task state (context + gate progress) is saved in `.aiflow/tasks/<taskId>/`.
266
+
267
+ ---
268
+
269
+ ### `aiflow doctor`
270
+
271
+ Check if the setup is complete.
272
+
273
+ ```bash
274
+ aiflow doctor
275
+ ```
276
+
277
+ ```
278
+ ✓ .claude/skills exists (42 skills)
279
+ ✓ .rules exists
280
+ ✓ CLAUDE.md exists
281
+ ✓ SessionStart hook configured
282
+ ✓ Version tracking active (v1.0.0)
283
+ ✨ Everything looks healthy!
284
+ ```
285
+
286
+ ---
287
+
288
+ ### `aiflow update`
289
+
290
+ Update skills, rules, and templates to the latest version.
291
+
292
+ ```bash
293
+ aiflow update
294
+ ```
295
+
296
+ ---
297
+
298
+ ### `aiflow validate <file>`
299
+
300
+ Validate code output against team rules.
301
+
302
+ ```bash
303
+ aiflow validate src/Payment.java --ruleset strict
304
+ ```
305
+
306
+ ---
307
+
308
+ ### `aiflow memory`
309
+
310
+ Save/search team knowledge.
311
+
312
+ ```bash
313
+ aiflow memory save "payment-flow" "Payment flow description..."
314
+ aiflow memory search "payment"
315
+ aiflow memory list
316
+ ```
317
+
318
+ ---
319
+
320
+ ## Available Skills
321
+
322
+ ### Custom skills (team-specific)
323
+
324
+ | Skill | Trigger | Description |
325
+ |-------|---------|-------|
326
+ | `investigate-bug` | "fix bug", "error", "crash" | Investigate bugs via data flow, inherits `systematic-debugging` |
327
+ | `impact-analysis` | "impact scope", "breaking change" | Analyze the impact when changing code |
328
+ | `generate-spec` | "new feature", "spec", "design" | Write technical specs, integrates `brainstorming` |
329
+ | `report-customer` | "customer report", "incident" | Write incident reports for Customer Service |
330
+ | `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) |
331
+
332
+ ### Superpowers skills (upstream, inherited from obra/superpowers)
333
+
334
+ | Skill | Description |
335
+ |-------|-------|
336
+ | `systematic-debugging` | Core debugging methodology — NO FIX WITHOUT ROOT CAUSE |
337
+ | `brainstorming` | Explore requirements before coding |
338
+ | `writing-plans` | Create bite-sized implementation plans |
339
+ | `executing-plans` | Execute plans with review checkpoints |
340
+ | `test-driven-development` | RED→GREEN→REFACTOR |
341
+ | `subagent-driven-development` | Dispatch subagents for independent tasks |
342
+ | `requesting-code-review` | Review code before merging |
343
+ | `verification-before-completion` | Verify before claiming done |
344
+ | `using-git-worktrees` | Isolated workspace for feature work |
345
+ | `finishing-a-development-branch` | Complete branch and merge options |
346
+
347
+ ---
348
+
349
+ ## Framework Templates
350
+
351
+ | Framework | Language | Rules applied |
352
+ |-----------|---------|--------------|
353
+ | `spring-boot` | Java 17+ | `rules/java/` |
354
+ | `laravel` | PHP 8.1+ | `rules/php/` |
355
+ | `php` | PHP 8.1+ (no framework) | `rules/php/` |
356
+ | `nestjs` | TypeScript | `rules/javascript/` |
357
+ | `reactjs` | TypeScript | `rules/javascript/` |
358
+ | `nextjs` | TypeScript | `rules/javascript/` |
359
+ | `vue-nuxt` | TypeScript | `rules/javascript/` |
360
+ | `nodejs-express` | JavaScript/TypeScript | `rules/javascript/` |
361
+ | `python` | Python (no framework) | — |
362
+ | `python-django` | Python | — |
363
+ | `python-fastapi` | Python | — |
364
+
365
+ ---
366
+
367
+ ## Project Structure
368
+
369
+ ```
370
+ ai-flow-kit/
371
+ ├── README.md # Main documentation
372
+ ├── bin/aiflow.js # CLI entry
373
+ ├── docs/
374
+ │ ├── common/ # Published with package
375
+ │ │ ├── QUICK_START.md # Quick start guide
376
+ │ │ ├── AIFLOW.md # Workflow (5 Gates) detail
377
+ │ │ ├── CHANGELOG.md # Version history
378
+ │ │ ├── cli-reference.md # Full CLI reference
379
+ │ │ └── workflows/ # Per-task workflow guides
380
+ │ └── project/ # Project template files
381
+ │ └── ARCHITECTURE.md # Architecture doc template
382
+ ├── scripts/
383
+ │ ├── init.js # Project initialization
384
+ │ ├── update.js # Version management
385
+ │ ├── doctor.js # Health check
386
+ │ ├── use.js # Context loading (Backlog/Jira)
387
+ │ ├── config.js # Config system
388
+ │ ├── detect.js # Task type detection
389
+ │ ├── validate.js # Code validation
390
+ │ ├── memory.js # Knowledge management
391
+ │ └── hooks/session-start.js # SessionStart hook (Node.js)
392
+ ├── custom/
393
+ │ ├── skills/ # Team-specific AI skills
394
+ │ ├── rules/java/ # Java/Spring Boot rules
395
+ │ ├── rules/php/ # PHP/Laravel rules
396
+ │ ├── rules/javascript/ # JS/TS rules
397
+ │ ├── templates/ # Framework tool templates
398
+ │ ├── prompts/ # Task prompt templates
399
+ │ └── mcp-presets/ # Backlog/Jira/Sheets config
400
+ └── upstream/ # obra/superpowers (inherited)
401
+ ```
402
+
403
+ ---
404
+
405
+ ## Adding new frameworks / adapters
406
+
407
+ **New Framework:** create `custom/templates/<name>.md` + `custom/rules/<lang>/`
408
+
409
+ **New Adapter:** create `custom/mcp-presets/<name>.json`
410
+
411
+ **Custom skill:** create `custom/skills/<name>/SKILL.md`
412
+
413
+ Then run `aiflow update` or `aiflow sync-skills` to apply.
414
+
415
+ ---
416
+
417
+ ## Usage Environments
418
+
419
+ | Environment | Experience | Notes |
420
+ |-----------|------------|---------|
421
+ | Claude Code CLI (`claude`) | ⭐⭐⭐⭐⭐ | Full auto — skills, hook, automatically loaded context |
422
+ | Claude Extension (VS Code) | ⭐⭐⭐ | `aiflow prompt <type>` → copy paste |
423
+ | Antigravity / Cursor | ⭐⭐⭐ | `aiflow prompt <type>` → copy paste |
424
+
425
+ ---
426
+
427
+ ## Release Notes
428
+
429
+ > Summary of major changes per version. See full details in [CHANGELOG.md](docs/common/CHANGELOG.md).
430
+
431
+ ### v0.1.0 — 2026-05-28
432
+ - Multi-target `ak use` — load multiple tickets/files in a single call (primary + supplementary).
433
+ - Auto link resolution — auto-fetch Backlog/Jira URLs found in the ticket description (capped at 5 links).
434
+ - Comment-aware resolution — `#comment-456` links fetch only that specific comment.
435
+ - New `ak fetch-links <url>` command for AI runtime use.
436
+ - SessionStart hook renders the `supplementaryContext[]` block into the prompt.
437
+ - Added Jest test suite (20+ unit tests for `link-resolver`).
438
+
439
+ ### v0.0.9 — 2026-05-25
440
+ - New `figma-desktop` adapter (uses `@figma/mcp-server`, no token required).
441
+ - `figma-to-component` skill supports Next.js App Router and Angular.
442
+ - `ak gate N start|approved` auto-syncs `task-state.json`.
443
+ - New `project-conventions.md` — enforces Gate 2 plan output at `plan/[ticket-id]/plan.md`.
444
+ - WSL clipboard support in `ak prompt`.
445
+ - Fixes: wrong Figma tool names, PAT verify using wrong auth header, `currentGate` not advancing.
446
+
447
+ ### v0.0.8 — 2026-05-14
448
+ - New CLI alias `ak` (short for `aiflow`) + aliases for every sub-command.
449
+ - Flexible comment loading options: `--coms`, `--cid`, `--clast`, `--cfrom`, `--cto`.
450
+ - Fixed Backlog comment pagination (switched to `minId`-based).
451
+ - v0.0.8-beta.1: Actually removed auto-commit + added PreToolUse hook blocking `git commit/add/push`.
452
+
453
+ ### v0.0.7 — 2026-05-08
454
+ - `aiflow use --file` auto-generates `taskId` from filename + interactive `taskType` prompt.
455
+ - Auto-generates `task-summary.md` at each gate transition.
456
+ - Added NestJS and PHP Plain framework support.
457
+ - New `aiflow sync-skills` command.
458
+ - Marker-based update for `CLAUDE.md`, `GEMINI.md`, `.cursorrules`.
459
+ - Auto-manages `.gitignore` for generated files.
460
+
461
+ ### v0.0.6 — 2026-04-29
462
+ - **Fast Mode** enabled by default (reduced Q&A, single-session implementation).
463
+ - New `aiflow task` command group (status/list/pause/switch/resume).
464
+ - Integrated RTK token compression (60–90% savings).
465
+ - `--file` loader supports plain-text input.
466
+
467
+ ### v0.0.5 — 2026-04-23
468
+ - Telemetry MVP — opt-in tracking, HMAC-SHA256 signed payload, no prompt content logged.
469
+ - New `aiflow gate <n> <action>` command for AI to call automatically on gate transitions.
470
+ - Safe overwrite flow in `aiflow init` (backs up existing files before overwrite).
471
+
472
+ ### v0.0.1 — 2026-04-13
473
+ - Initial release: `aiflow` CLI, 5-Gate workflow, 7 custom skills, support for Claude Code / Gemini / Copilot.
474
+
475
+ ---
476
+
477
+ ## Troubleshooting
478
+
479
+ **`aiflow` not found:**
480
+ ```bash
481
+ npm install -g @relipa/ai-flow-kit
482
+ ```
483
+
484
+ **Backlog load fails:**
485
+ ```bash
486
+ aiflow doctor
487
+ # Re-setup credentials
488
+ aiflow init --adapter backlog
489
+ ```
490
+
491
+ **Skills not loading in Claude:**
492
+ ```bash
493
+ # Ensure init was run outside Claude terminal (session-start hook needs restart)
494
+ aiflow doctor
495
+ ```
496
+
497
+ See more: [docs/common/troubleshooting.md](./docs/common/troubleshooting.md)