@relipa/ai-flow-kit 0.1.1 → 0.1.2-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 (253) hide show
  1. package/README.md +0 -0
  2. package/bin/aiflow.js +55 -2
  3. package/bin/ak.js +0 -0
  4. package/custom/mcp-presets/README.md +204 -237
  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/ml-conventions.md +88 -0
  22. package/custom/rules/ml-review-checklist.md +14 -0
  23. package/custom/rules/naming.md +0 -0
  24. package/custom/rules/php/code-style.md +0 -0
  25. package/custom/rules/php/naming.md +0 -0
  26. package/custom/rules/project-conventions.md +0 -0
  27. package/custom/rules/review-checklist.md +0 -0
  28. package/custom/skills/deploy-model/SKILL.md +90 -0
  29. package/custom/skills/design-experiment/SKILL.md +88 -0
  30. package/custom/skills/evaluate-model/SKILL.md +93 -0
  31. package/custom/skills/explore-data/SKILL.md +87 -0
  32. package/custom/skills/figma-to-component/SKILL.md +0 -0
  33. package/custom/skills/frame-ml-problem/SKILL.md +88 -0
  34. package/custom/skills/generate-spec/SKILL.md +0 -0
  35. package/custom/skills/impact-analysis/SKILL.md +0 -0
  36. package/custom/skills/improve-algorithm/SKILL.md +74 -0
  37. package/custom/skills/investigate-bug/SKILL.md +0 -0
  38. package/custom/skills/read-study-requirement/SKILL.md +0 -0
  39. package/custom/skills/report-customer/SKILL.md +0 -0
  40. package/custom/skills/review-plan/SKILL.md +0 -0
  41. package/custom/skills/train-model/SKILL.md +78 -0
  42. package/custom/templates/laravel.md +0 -0
  43. package/custom/templates/nestjs.md +0 -0
  44. package/custom/templates/nextjs.md +0 -0
  45. package/custom/templates/nodejs-express.md +0 -0
  46. package/custom/templates/php-plain.md +0 -0
  47. package/custom/templates/php.md +0 -0
  48. package/custom/templates/python-django.md +0 -0
  49. package/custom/templates/python-fastapi.md +0 -0
  50. package/custom/templates/python-ml.md +273 -0
  51. package/custom/templates/python.md +0 -0
  52. package/custom/templates/reactjs.md +0 -0
  53. package/custom/templates/shared/gate-workflow.md +0 -0
  54. package/custom/templates/shared/ml-gate-workflow.md +103 -0
  55. package/custom/templates/spring-boot.md +0 -0
  56. package/custom/templates/tools/claude.md +0 -0
  57. package/custom/templates/tools/copilot.md +0 -0
  58. package/custom/templates/tools/cursor.md +0 -0
  59. package/custom/templates/tools/gemini.md +0 -0
  60. package/custom/templates/tools/generic.md +0 -0
  61. package/custom/templates/vue-nuxt.md +0 -0
  62. package/docs/common/AIFLOW.md +512 -512
  63. package/docs/common/CHANGELOG.md +0 -0
  64. package/docs/common/QUICK_START.md +0 -0
  65. package/docs/common/ai-integration.md +0 -0
  66. package/docs/common/cli-reference.md +0 -0
  67. package/docs/common/configuration.md +0 -0
  68. package/docs/common/getting-started.md +0 -0
  69. package/docs/common/troubleshooting.md +0 -0
  70. package/docs/common/workflows/bug-fix.md +0 -0
  71. package/docs/common/workflows/feature.md +0 -0
  72. package/docs/common/workflows/figma.md +0 -0
  73. package/docs/common/workflows/impact-analysis.md +0 -0
  74. package/docs/common/workflows/investigation.md +0 -0
  75. package/docs/common/workflows/refactor.md +0 -0
  76. package/docs/project/ARCHITECTURE.md +0 -0
  77. package/index.js +0 -0
  78. package/package.json +1 -1
  79. package/scripts/checkpoint.js +0 -0
  80. package/scripts/config.js +0 -0
  81. package/scripts/context.js +0 -0
  82. package/scripts/create-score-excel.js +0 -0
  83. package/scripts/detect.js +239 -239
  84. package/scripts/doctor.js +192 -218
  85. package/scripts/gitnexus-worker.js +0 -0
  86. package/scripts/guide.js +0 -0
  87. package/scripts/hooks/block-git-write.js +0 -0
  88. package/scripts/hooks/session-start.js +0 -0
  89. package/scripts/hooks/session-stop.js +0 -0
  90. package/scripts/init.js +1112 -1009
  91. package/scripts/link-resolver.js +0 -0
  92. package/scripts/memory.js +0 -0
  93. package/scripts/prompt.js +538 -538
  94. package/scripts/remove.js +0 -0
  95. package/scripts/task.js +546 -546
  96. package/scripts/telemetry/cli.js +0 -0
  97. package/scripts/telemetry/config.js +0 -0
  98. package/scripts/telemetry/crypto.js +0 -0
  99. package/scripts/telemetry/flush.js +0 -0
  100. package/scripts/telemetry/record.js +0 -0
  101. package/scripts/update.js +10 -7
  102. package/scripts/use.js +33 -12
  103. package/scripts/validate.js +0 -0
  104. package/upstream/.claude-plugin/marketplace.json +0 -0
  105. package/upstream/.claude-plugin/plugin.json +0 -0
  106. package/upstream/.codex/INSTALL.md +0 -0
  107. package/upstream/.cursor-plugin/plugin.json +0 -0
  108. package/upstream/.gitattributes +0 -0
  109. package/upstream/.github/FUNDING.yml +0 -0
  110. package/upstream/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  111. package/upstream/.github/ISSUE_TEMPLATE/config.yml +0 -0
  112. package/upstream/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  113. package/upstream/.github/ISSUE_TEMPLATE/platform_support.md +0 -0
  114. package/upstream/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  115. package/upstream/.opencode/INSTALL.md +0 -0
  116. package/upstream/.opencode/plugins/superpowers.js +0 -0
  117. package/upstream/.version-bump.json +0 -0
  118. package/upstream/AGENTS.md +0 -0
  119. package/upstream/CHANGELOG.md +0 -0
  120. package/upstream/CLAUDE.md +0 -0
  121. package/upstream/CODE_OF_CONDUCT.md +0 -0
  122. package/upstream/GEMINI.md +0 -0
  123. package/upstream/LICENSE +0 -0
  124. package/upstream/README.md +0 -0
  125. package/upstream/RELEASE-NOTES.md +0 -0
  126. package/upstream/agents/code-reviewer.md +0 -0
  127. package/upstream/commands/brainstorm.md +0 -0
  128. package/upstream/commands/execute-plan.md +0 -0
  129. package/upstream/commands/write-plan.md +0 -0
  130. package/upstream/docs/README.codex.md +0 -0
  131. package/upstream/docs/README.opencode.md +0 -0
  132. package/upstream/docs/plans/2025-11-22-opencode-support-design.md +0 -0
  133. package/upstream/docs/plans/2025-11-22-opencode-support-implementation.md +0 -0
  134. package/upstream/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +0 -0
  135. package/upstream/docs/plans/2026-01-17-visual-brainstorming.md +0 -0
  136. package/upstream/docs/superpowers/plans/2026-01-22-document-review-system.md +0 -0
  137. package/upstream/docs/superpowers/plans/2026-02-19-visual-brainstorming-refactor.md +0 -0
  138. package/upstream/docs/superpowers/plans/2026-03-11-zero-dep-brainstorm-server.md +0 -0
  139. package/upstream/docs/superpowers/plans/2026-03-23-codex-app-compatibility.md +0 -0
  140. package/upstream/docs/superpowers/specs/2026-01-22-document-review-system-design.md +0 -0
  141. package/upstream/docs/superpowers/specs/2026-02-19-visual-brainstorming-refactor-design.md +0 -0
  142. package/upstream/docs/superpowers/specs/2026-03-11-zero-dep-brainstorm-server-design.md +0 -0
  143. package/upstream/docs/superpowers/specs/2026-03-23-codex-app-compatibility-design.md +0 -0
  144. package/upstream/docs/testing.md +0 -0
  145. package/upstream/docs/windows/polyglot-hooks.md +0 -0
  146. package/upstream/gemini-extension.json +0 -0
  147. package/upstream/hooks/hooks-cursor.json +0 -0
  148. package/upstream/hooks/hooks.json +0 -0
  149. package/upstream/hooks/run-hook.cmd +0 -0
  150. package/upstream/hooks/session-start +0 -0
  151. package/upstream/package.json +0 -0
  152. package/upstream/scripts/bump-version.sh +0 -0
  153. package/upstream/skills/brainstorming/SKILL.md +0 -0
  154. package/upstream/skills/brainstorming/scripts/frame-template.html +0 -0
  155. package/upstream/skills/brainstorming/scripts/helper.js +0 -0
  156. package/upstream/skills/brainstorming/scripts/server.cjs +0 -0
  157. package/upstream/skills/brainstorming/scripts/start-server.sh +0 -0
  158. package/upstream/skills/brainstorming/scripts/stop-server.sh +0 -0
  159. package/upstream/skills/brainstorming/spec-document-reviewer-prompt.md +0 -0
  160. package/upstream/skills/brainstorming/visual-companion.md +0 -0
  161. package/upstream/skills/dispatching-parallel-agents/SKILL.md +0 -0
  162. package/upstream/skills/executing-plans/SKILL.md +0 -0
  163. package/upstream/skills/finishing-a-development-branch/SKILL.md +0 -0
  164. package/upstream/skills/receiving-code-review/SKILL.md +0 -0
  165. package/upstream/skills/requesting-code-review/SKILL.md +0 -0
  166. package/upstream/skills/requesting-code-review/code-reviewer.md +0 -0
  167. package/upstream/skills/subagent-driven-development/SKILL.md +0 -0
  168. package/upstream/skills/subagent-driven-development/code-quality-reviewer-prompt.md +0 -0
  169. package/upstream/skills/subagent-driven-development/implementer-prompt.md +0 -0
  170. package/upstream/skills/subagent-driven-development/spec-reviewer-prompt.md +0 -0
  171. package/upstream/skills/systematic-debugging/CREATION-LOG.md +0 -0
  172. package/upstream/skills/systematic-debugging/SKILL.md +0 -0
  173. package/upstream/skills/systematic-debugging/condition-based-waiting-example.ts +0 -0
  174. package/upstream/skills/systematic-debugging/condition-based-waiting.md +0 -0
  175. package/upstream/skills/systematic-debugging/defense-in-depth.md +0 -0
  176. package/upstream/skills/systematic-debugging/find-polluter.sh +0 -0
  177. package/upstream/skills/systematic-debugging/root-cause-tracing.md +0 -0
  178. package/upstream/skills/systematic-debugging/test-academic.md +0 -0
  179. package/upstream/skills/systematic-debugging/test-pressure-1.md +0 -0
  180. package/upstream/skills/systematic-debugging/test-pressure-2.md +0 -0
  181. package/upstream/skills/systematic-debugging/test-pressure-3.md +0 -0
  182. package/upstream/skills/tdd-lean/SKILL.md +0 -0
  183. package/upstream/skills/test-driven-development/SKILL.md +0 -0
  184. package/upstream/skills/test-driven-development/testing-anti-patterns.md +0 -0
  185. package/upstream/skills/using-git-worktrees/SKILL.md +0 -0
  186. package/upstream/skills/using-superpowers/SKILL.md +0 -0
  187. package/upstream/skills/using-superpowers/references/codex-tools.md +0 -0
  188. package/upstream/skills/using-superpowers/references/copilot-tools.md +0 -0
  189. package/upstream/skills/using-superpowers/references/gemini-tools.md +0 -0
  190. package/upstream/skills/verification-before-completion/SKILL.md +0 -0
  191. package/upstream/skills/writing-plans/SKILL.md +0 -0
  192. package/upstream/skills/writing-plans/plan-document-reviewer-prompt.md +0 -0
  193. package/upstream/skills/writing-skills/SKILL.md +0 -0
  194. package/upstream/skills/writing-skills/anthropic-best-practices.md +0 -0
  195. package/upstream/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +0 -0
  196. package/upstream/skills/writing-skills/graphviz-conventions.dot +0 -0
  197. package/upstream/skills/writing-skills/persuasion-principles.md +0 -0
  198. package/upstream/skills/writing-skills/render-graphs.js +0 -0
  199. package/upstream/skills/writing-skills/testing-skills-with-subagents.md +0 -0
  200. package/upstream/tests/brainstorm-server/package-lock.json +0 -0
  201. package/upstream/tests/brainstorm-server/package.json +0 -0
  202. package/upstream/tests/brainstorm-server/server.test.js +0 -0
  203. package/upstream/tests/brainstorm-server/windows-lifecycle.test.sh +0 -0
  204. package/upstream/tests/brainstorm-server/ws-protocol.test.js +0 -0
  205. package/upstream/tests/claude-code/README.md +0 -0
  206. package/upstream/tests/claude-code/analyze-token-usage.py +0 -0
  207. package/upstream/tests/claude-code/run-skill-tests.sh +0 -0
  208. package/upstream/tests/claude-code/test-document-review-system.sh +0 -0
  209. package/upstream/tests/claude-code/test-helpers.sh +0 -0
  210. package/upstream/tests/claude-code/test-subagent-driven-development-integration.sh +0 -0
  211. package/upstream/tests/claude-code/test-subagent-driven-development.sh +0 -0
  212. package/upstream/tests/explicit-skill-requests/prompts/action-oriented.txt +0 -0
  213. package/upstream/tests/explicit-skill-requests/prompts/after-planning-flow.txt +0 -0
  214. package/upstream/tests/explicit-skill-requests/prompts/claude-suggested-it.txt +0 -0
  215. package/upstream/tests/explicit-skill-requests/prompts/i-know-what-sdd-means.txt +0 -0
  216. package/upstream/tests/explicit-skill-requests/prompts/mid-conversation-execute-plan.txt +0 -0
  217. package/upstream/tests/explicit-skill-requests/prompts/please-use-brainstorming.txt +0 -0
  218. package/upstream/tests/explicit-skill-requests/prompts/skip-formalities.txt +0 -0
  219. package/upstream/tests/explicit-skill-requests/prompts/subagent-driven-development-please.txt +0 -0
  220. package/upstream/tests/explicit-skill-requests/prompts/use-systematic-debugging.txt +0 -0
  221. package/upstream/tests/explicit-skill-requests/run-all.sh +0 -0
  222. package/upstream/tests/explicit-skill-requests/run-claude-describes-sdd.sh +0 -0
  223. package/upstream/tests/explicit-skill-requests/run-extended-multiturn-test.sh +0 -0
  224. package/upstream/tests/explicit-skill-requests/run-haiku-test.sh +0 -0
  225. package/upstream/tests/explicit-skill-requests/run-multiturn-test.sh +0 -0
  226. package/upstream/tests/explicit-skill-requests/run-test.sh +0 -0
  227. package/upstream/tests/opencode/run-tests.sh +0 -0
  228. package/upstream/tests/opencode/setup.sh +0 -0
  229. package/upstream/tests/opencode/test-plugin-loading.sh +0 -0
  230. package/upstream/tests/opencode/test-priority.sh +0 -0
  231. package/upstream/tests/opencode/test-tools.sh +0 -0
  232. package/upstream/tests/skill-triggering/prompts/dispatching-parallel-agents.txt +0 -0
  233. package/upstream/tests/skill-triggering/prompts/executing-plans.txt +0 -0
  234. package/upstream/tests/skill-triggering/prompts/requesting-code-review.txt +0 -0
  235. package/upstream/tests/skill-triggering/prompts/systematic-debugging.txt +0 -0
  236. package/upstream/tests/skill-triggering/prompts/test-driven-development.txt +0 -0
  237. package/upstream/tests/skill-triggering/prompts/writing-plans.txt +0 -0
  238. package/upstream/tests/skill-triggering/run-all.sh +0 -0
  239. package/upstream/tests/skill-triggering/run-test.sh +0 -0
  240. package/upstream/tests/subagent-driven-dev/go-fractals/design.md +0 -0
  241. package/upstream/tests/subagent-driven-dev/go-fractals/plan.md +0 -0
  242. package/upstream/tests/subagent-driven-dev/go-fractals/scaffold.sh +0 -0
  243. package/upstream/tests/subagent-driven-dev/run-test.sh +0 -0
  244. package/upstream/tests/subagent-driven-dev/svelte-todo/design.md +0 -0
  245. package/upstream/tests/subagent-driven-dev/svelte-todo/plan.md +0 -0
  246. package/upstream/tests/subagent-driven-dev/svelte-todo/scaffold.sh +0 -0
  247. package/custom/mcp-presets/playwright.json +0 -11
  248. package/custom/rules/test-patterns.md +0 -105
  249. package/custom/skills/automation-testing/SKILL.md +0 -168
  250. package/custom/skills/automation-testing/templates/BasePage.ts +0 -30
  251. package/custom/skills/automation-testing/templates/playwright.config.ts +0 -21
  252. package/custom/skills/automation-testing/templates/repos.json +0 -8
  253. package/scripts/score_members.js +0 -320
package/README.md CHANGED
File without changes
package/bin/aiflow.js CHANGED
@@ -19,6 +19,8 @@ const taskCommand = require('../scripts/task');
19
19
  const checkpointCommand = require('../scripts/checkpoint');
20
20
  const { record } = require('../scripts/telemetry/record');
21
21
  const { updateTaskGateState } = require('../scripts/task');
22
+ const semver = require('semver');
23
+ const { execSync: execSyncChild, spawnSync } = require('child_process');
22
24
 
23
25
  // ── DEPRECATION WARNING ───────────────────────────────────────
24
26
  if (!process.env.AIFLOW_IS_AK) {
@@ -415,6 +417,50 @@ function showTelResult(result, label) {
415
417
  } catch (e) { /* never block main flow */ }
416
418
  }
417
419
 
420
+ // ── Gate start helpers ────────────────────────────────────────
421
+
422
+ function checkNodeVersionForGate() {
423
+ try {
424
+ const minRaw = packageJson.engines && packageJson.engines.node
425
+ ? packageJson.engines.node
426
+ : '>=16.0.0';
427
+ const min = minRaw.replace('>=', '').trim();
428
+ const current = process.version.replace('v', '').trim();
429
+ if (semver.gte(current, min)) {
430
+ console.log(chalk.green(` ✓ Node ${process.version}`));
431
+ } else {
432
+ console.log(chalk.yellow(` ⚠ Node ${process.version} — minimum required: v${min}. Please upgrade Node.js.`));
433
+ }
434
+ } catch (_) {
435
+ console.log(chalk.gray(` Node ${process.version}`));
436
+ }
437
+ }
438
+
439
+ function checkAndInstallAiflowGlobal() {
440
+ try {
441
+ const out = execSyncChild('npm list -g --depth 0 @relipa/ai-flow-kit', {
442
+ encoding: 'utf-8',
443
+ stdio: ['pipe', 'pipe', 'pipe'],
444
+ });
445
+ if (!out.includes('@relipa/ai-flow-kit')) {
446
+ throw new Error('not found');
447
+ }
448
+ // Already installed — silent
449
+ } catch (_) {
450
+ console.log(chalk.yellow(' ⚠ @relipa/ai-flow-kit not found globally. Installing latest...'));
451
+ const result = spawnSync(
452
+ 'npm',
453
+ ['install', '-g', '@relipa/ai-flow-kit@latest'],
454
+ { stdio: 'inherit', shell: process.platform === 'win32' }
455
+ );
456
+ if (result.status !== 0) {
457
+ console.log(chalk.red(' ✗ Install failed. Please run manually: npm install -g @relipa/ai-flow-kit@latest'));
458
+ } else {
459
+ console.log(chalk.green(' ✓ @relipa/ai-flow-kit installed successfully.'));
460
+ }
461
+ }
462
+ }
463
+
418
464
  // ── gate (telemetry for gate workflow events) ─────────────────
419
465
  program
420
466
  .command('gate <number> <action>')
@@ -426,6 +472,12 @@ program
426
472
  if (isNaN(gateNum) || gateNum < 1 || gateNum > 5) return;
427
473
  if (!['start', 'approved'].includes(action)) return;
428
474
 
475
+ if (action === 'start') {
476
+ console.log(chalk.cyan(`\n [aiflow] Gate ${gateNum} environment check:`));
477
+ checkNodeVersionForGate();
478
+ checkAndInstallAiflowGlobal();
479
+ }
480
+
429
481
  const ticketId = options.ticket || '';
430
482
 
431
483
  const telResult = record(`gate.${action}`, {
@@ -489,12 +541,13 @@ program
489
541
  }
490
542
 
491
543
  const state = await fs.readJson(stateFile);
492
- const frameworks = state.frameworks || [];
544
+ // Support both old 'framework' (singular string) and new 'frameworks' (array)
545
+ const frameworks = state.frameworks || (state.framework ? [state.framework] : []);
493
546
  const selectedTools = state.aiTools || Object.keys(AI_TOOL_FILES);
494
547
 
495
548
  console.log(chalk.cyan('⟳ Syncing AI Instruction files...'));
496
549
  for (const fw of frameworks) {
497
- await setupFramework(projectDir, fw, frameworks.length > 1, selectedTools);
550
+ await setupFramework(projectDir, fw, frameworks.length > 1, selectedTools, { force: true });
498
551
  }
499
552
  await ensureAiflowGitignored(projectDir);
500
553
  console.log(chalk.green('✨ Sync completed!'));
package/bin/ak.js CHANGED
File without changes
@@ -1,237 +1,204 @@
1
- # MCP Presets
2
-
3
- Pre-configured MCP (Model Context Protocol) adapters for various project management and collaboration tools.
4
-
5
- ## Available Presets
6
-
7
- ### Jira (`jira.json`)
8
-
9
- Connect to Atlassian Jira for loading issues and context.
10
-
11
- **Setup:**
12
- ```bash
13
- aiflow init --adapter jira
14
- ```
15
-
16
- **Required Environment Variables:**
17
- - `JIRA_API_TOKEN` — Your Jira API token
18
- - `JIRA_EMAIL` — Your Jira account email
19
- - `JIRA_DOMAIN` — Your Jira domain (e.g., "company" in company.atlassian.net)
20
-
21
- **Get API Token:**
22
- 1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
23
- 2. Create new API token
24
- 3. Copy the token
25
-
26
- **Usage:**
27
- ```bash
28
- aiflow use JIRA-123
29
- # Loads issue JIRA-123 from your Jira instance
30
- ```
31
-
32
- ### Backlog (`backlog.json`)
33
-
34
- Connect to Nulab Backlog for loading tasks and context.
35
-
36
- **Setup:**
37
- ```bash
38
- aiflow init --adapter backlog
39
- ```
40
-
41
- **Required Environment Variables:**
42
- - `BACKLOG_API_KEY` — Your Backlog API key
43
- - `BACKLOG_SPACE_KEY` — Your Backlog space key
44
-
45
- **Get API Key:**
46
- 1. Log in to Backlog
47
- 2. Go to Personal Settings → API Settings
48
- 3. Generate new API token
49
-
50
- **Usage:**
51
- ```bash
52
- aiflow use BACKLOG-456
53
- # Loads task from your Backlog instance
54
- ```
55
-
56
- ### Figma (`figma.json`)
57
-
58
- Connect to Figma via REST API to read design files and generate components.
59
-
60
- **When to use:** Default choice. Works anywhere — no Desktop app required.
61
-
62
- **Setup:**
63
- ```bash
64
- aiflow init --adapter figma
65
- ```
66
-
67
- **Required Environment Variables:**
68
- - `FIGMA_API_TOKEN` — Your Figma Personal Access Token
69
-
70
- **Get API Token:**
71
- 1. Go to https://www.figma.com/settings → Security → Personal access tokens
72
- 2. Create a new token with File content (read) scope
73
- 3. Copy the token
74
-
75
- **Tools provided by `figma-developer-mcp`:**
76
- - `get_figma_data(fileKey, nodeId, depth)` — fetch node layout, styles, components
77
- - `download_figma_images(fileKey, nodes, localPath)` — export images
78
-
79
- **Usage:**
80
- ```
81
- Generate component from Figma:
82
- https://www.figma.com/design/XXXXX/App?node-id=123-456
83
- ```
84
-
85
- See: [Figma workflow guide](../../docs/common/workflows/figma.md)
86
-
87
- ---
88
-
89
- ### Figma Desktop (`figma-desktop.json`)
90
-
91
- Connect via the official Figma MCP server. Requires Figma Desktop app open.
92
-
93
- **When to use:** When your team prefers the official Figma tooling and has Desktop app licenses.
94
- **When NOT to use:** CI environments, headless servers, team members without Desktop licenses.
95
-
96
- **Setup:**
97
- ```bash
98
- aiflow init --adapter figma-desktop
99
- ```
100
-
101
- **Requirements:**
102
- - Figma Desktop app installed
103
- - A Figma file open in Desktop when invoking the skill
104
- - No API token needed — uses Desktop session
105
-
106
- **Tools provided by `@figma/mcp-server`:**
107
- - `get_figma_data(fileKey, nodeId)` — fetch design data for open file
108
- - `get_node_children(nodeId)` — traverse component tree
109
- - `get_local_components()` — list components in the open file
110
-
111
- | | `figma` (REST API) | `figma-desktop` (Official) |
112
- |---|---|---|
113
- | Needs Desktop app | No | Yes (must be open) |
114
- | Auth | API Token | Desktop session |
115
- | Works in CI | Yes | No |
116
- | Access scope | Full REST API | Currently open file |
117
-
118
- See: [Figma workflow guide](../../docs/common/workflows/figma.md)
119
-
120
- ---
121
-
122
- ### Playwright (`playwright.json`)
123
-
124
- Drive a real browser to explore selectors, verify flows, and capture evidence. Powers the `automation-testing` skill (Phase 3 — Explore).
125
-
126
- **When to use:** Generating E2E UI tests. The skill uses MCP to read the live DOM (real selectors, not guessed) and screenshot each step, then emits durable `.spec.ts` files for CI.
127
-
128
- **Setup:**
129
- ```bash
130
- aiflow init --adapter playwright
131
- ```
132
-
133
- **Requirements:**
134
- - The web app under test must be running and reachable at `baseUrl`
135
- - No API token needed
136
- - First run downloads browsers via `npx playwright install` (one-time)
137
-
138
- **Tools provided by `@playwright/mcp`:**
139
- - `browser_navigate(url)` open a page
140
- - `browser_snapshot()` — accessibility tree (source of real selectors)
141
- - `browser_click` / `browser_type` / `browser_fill` — interact with elements
142
- - `browser_take_screenshot(path)` — capture evidence
143
-
144
- **Usage:**
145
- ```
146
- /automation-testing baseUrl: http://localhost:3000 explore: true
147
- ```
148
-
149
- > **Hybrid principle:** MCP is for *exploration + evidence* only. It does not replace test files — the skill always emits committable `.spec.ts` so CI can re-run.
150
-
151
- See: [automation-testing design](../../requirements/autotest/AutomationTestWorkflow.md)
152
-
153
- ---
154
-
155
- ### Google Sheets (`google-sheets.json`)
156
-
157
- Connect to Google Sheets for loading task context.
158
-
159
- **Setup:**
160
- ```bash
161
- aiflow init --adapter google-sheets
162
- ```
163
-
164
- **Required Environment Variables:**
165
- - `GOOGLE_SHEETS_CREDS` — Path to service account JSON
166
-
167
- **Get Credentials:**
168
- 1. Create Google Cloud project
169
- 2. Enable Sheets API
170
- 3. Create service account
171
- 4. Download JSON credentials
172
- 5. Store securely and set path
173
-
174
- **Usage:**
175
- ```bash
176
- aiflow use SHEET-A1:D5
177
- # Loads data from Google Sheet
178
- ```
179
-
180
- ## Creating Custom Presets
181
-
182
- To add a new MCP adapter:
183
-
184
- 1. Create `<adapter-name>.json`:
185
-
186
- ```json
187
- {
188
- "mcpServers": {
189
- "<adapter-name>": {
190
- "command": "npx",
191
- "args": [
192
- "-y",
193
- "@modelcontextprotocol/server-<adapter-name>"
194
- ],
195
- "env": {
196
- "ENV_VAR_1": "{{PLACEHOLDER}}",
197
- "ENV_VAR_2": "{{PLACEHOLDER}}"
198
- }
199
- }
200
- }
201
- }
202
- ```
203
-
204
- 2. Document in this README
205
-
206
- 3. Users can install with:
207
- ```bash
208
- aiflow init --adapter <adapter-name>
209
- ```
210
-
211
- ## Validators
212
-
213
- Each preset should be validated during `aiflow init`:
214
-
215
- - ✓ Environment variables set
216
- - ✓ API connectivity working
217
- - ✓ Proper permissions configured
218
-
219
- ## Best Practices
220
-
221
- 1. **Use placeholders** — {{VAR_NAME}} for env variables
222
- 2. **Document setup** — Include step-by-step guide
223
- 3. **Provide examples** — Show usage patterns
224
- 4. **Handle errors** — Clear error messages if setup fails
225
- 5. **Support multiple instances** — Allow team variations
226
-
227
- ## Security
228
-
229
- - **Never commit credentials** — Use environment variables
230
- - **Use secure storage** — Store API tokens securely
231
- - **Rotate tokens** — Regularly update API tokens
232
- - **Restrict permissions** — Use minimal required permissions
233
- - **Audit access** — Monitor who accesses what
234
-
235
- ---
236
-
237
- For more info: See [Configuration Guide](../../docs/configuration.md)
1
+ # MCP Presets
2
+
3
+ Pre-configured MCP (Model Context Protocol) adapters for various project management and collaboration tools.
4
+
5
+ ## Available Presets
6
+
7
+ ### Jira (`jira.json`)
8
+
9
+ Connect to Atlassian Jira for loading issues and context.
10
+
11
+ **Setup:**
12
+ ```bash
13
+ aiflow init --adapter jira
14
+ ```
15
+
16
+ **Required Environment Variables:**
17
+ - `JIRA_API_TOKEN` — Your Jira API token
18
+ - `JIRA_EMAIL` — Your Jira account email
19
+ - `JIRA_DOMAIN` — Your Jira domain (e.g., "company" in company.atlassian.net)
20
+
21
+ **Get API Token:**
22
+ 1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
23
+ 2. Create new API token
24
+ 3. Copy the token
25
+
26
+ **Usage:**
27
+ ```bash
28
+ aiflow use JIRA-123
29
+ # Loads issue JIRA-123 from your Jira instance
30
+ ```
31
+
32
+ ### Backlog (`backlog.json`)
33
+
34
+ Connect to Nulab Backlog for loading tasks and context.
35
+
36
+ **Setup:**
37
+ ```bash
38
+ aiflow init --adapter backlog
39
+ ```
40
+
41
+ **Required Environment Variables:**
42
+ - `BACKLOG_API_KEY` — Your Backlog API key
43
+ - `BACKLOG_SPACE_KEY` — Your Backlog space key
44
+
45
+ **Get API Key:**
46
+ 1. Log in to Backlog
47
+ 2. Go to Personal Settings → API Settings
48
+ 3. Generate new API token
49
+
50
+ **Usage:**
51
+ ```bash
52
+ aiflow use BACKLOG-456
53
+ # Loads task from your Backlog instance
54
+ ```
55
+
56
+ ### Figma (`figma.json`)
57
+
58
+ Connect to Figma via REST API to read design files and generate components.
59
+
60
+ **When to use:** Default choice. Works anywhere — no Desktop app required.
61
+
62
+ **Setup:**
63
+ ```bash
64
+ aiflow init --adapter figma
65
+ ```
66
+
67
+ **Required Environment Variables:**
68
+ - `FIGMA_API_TOKEN` — Your Figma Personal Access Token
69
+
70
+ **Get API Token:**
71
+ 1. Go to https://www.figma.com/settings → Security → Personal access tokens
72
+ 2. Create a new token with File content (read) scope
73
+ 3. Copy the token
74
+
75
+ **Tools provided by `figma-developer-mcp`:**
76
+ - `get_figma_data(fileKey, nodeId, depth)` — fetch node layout, styles, components
77
+ - `download_figma_images(fileKey, nodes, localPath)` — export images
78
+
79
+ **Usage:**
80
+ ```
81
+ Generate component from Figma:
82
+ https://www.figma.com/design/XXXXX/App?node-id=123-456
83
+ ```
84
+
85
+ See: [Figma workflow guide](../../docs/common/workflows/figma.md)
86
+
87
+ ---
88
+
89
+ ### Figma Desktop (`figma-desktop.json`)
90
+
91
+ Connect via the official Figma MCP server. Requires Figma Desktop app open.
92
+
93
+ **When to use:** When your team prefers the official Figma tooling and has Desktop app licenses.
94
+ **When NOT to use:** CI environments, headless servers, team members without Desktop licenses.
95
+
96
+ **Setup:**
97
+ ```bash
98
+ aiflow init --adapter figma-desktop
99
+ ```
100
+
101
+ **Requirements:**
102
+ - Figma Desktop app installed
103
+ - A Figma file open in Desktop when invoking the skill
104
+ - No API token needed — uses Desktop session
105
+
106
+ **Tools provided by `@figma/mcp-server`:**
107
+ - `get_figma_data(fileKey, nodeId)` — fetch design data for open file
108
+ - `get_node_children(nodeId)` — traverse component tree
109
+ - `get_local_components()` — list components in the open file
110
+
111
+ | | `figma` (REST API) | `figma-desktop` (Official) |
112
+ |---|---|---|
113
+ | Needs Desktop app | No | Yes (must be open) |
114
+ | Auth | API Token | Desktop session |
115
+ | Works in CI | Yes | No |
116
+ | Access scope | Full REST API | Currently open file |
117
+
118
+ See: [Figma workflow guide](../../docs/common/workflows/figma.md)
119
+
120
+ ---
121
+
122
+ ### Google Sheets (`google-sheets.json`)
123
+
124
+ Connect to Google Sheets for loading task context.
125
+
126
+ **Setup:**
127
+ ```bash
128
+ aiflow init --adapter google-sheets
129
+ ```
130
+
131
+ **Required Environment Variables:**
132
+ - `GOOGLE_SHEETS_CREDS` — Path to service account JSON
133
+
134
+ **Get Credentials:**
135
+ 1. Create Google Cloud project
136
+ 2. Enable Sheets API
137
+ 3. Create service account
138
+ 4. Download JSON credentials
139
+ 5. Store securely and set path
140
+
141
+ **Usage:**
142
+ ```bash
143
+ aiflow use SHEET-A1:D5
144
+ # Loads data from Google Sheet
145
+ ```
146
+
147
+ ## Creating Custom Presets
148
+
149
+ To add a new MCP adapter:
150
+
151
+ 1. Create `<adapter-name>.json`:
152
+
153
+ ```json
154
+ {
155
+ "mcpServers": {
156
+ "<adapter-name>": {
157
+ "command": "npx",
158
+ "args": [
159
+ "-y",
160
+ "@modelcontextprotocol/server-<adapter-name>"
161
+ ],
162
+ "env": {
163
+ "ENV_VAR_1": "{{PLACEHOLDER}}",
164
+ "ENV_VAR_2": "{{PLACEHOLDER}}"
165
+ }
166
+ }
167
+ }
168
+ }
169
+ ```
170
+
171
+ 2. Document in this README
172
+
173
+ 3. Users can install with:
174
+ ```bash
175
+ aiflow init --adapter <adapter-name>
176
+ ```
177
+
178
+ ## Validators
179
+
180
+ Each preset should be validated during `aiflow init`:
181
+
182
+ - Environment variables set
183
+ - ✓ API connectivity working
184
+ - Proper permissions configured
185
+
186
+ ## Best Practices
187
+
188
+ 1. **Use placeholders** — {{VAR_NAME}} for env variables
189
+ 2. **Document setup** — Include step-by-step guide
190
+ 3. **Provide examples** — Show usage patterns
191
+ 4. **Handle errors** — Clear error messages if setup fails
192
+ 5. **Support multiple instances** — Allow team variations
193
+
194
+ ## Security
195
+
196
+ - **Never commit credentials** — Use environment variables
197
+ - **Use secure storage** — Store API tokens securely
198
+ - **Rotate tokens** — Regularly update API tokens
199
+ - **Restrict permissions** — Use minimal required permissions
200
+ - **Audit access** — Monitor who accesses what
201
+
202
+ ---
203
+
204
+ For more info: See [Configuration Guide](../../docs/configuration.md)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,88 @@
1
+ # ML Conventions (Override Skill Defaults)
2
+
3
+ > **MANDATORY:** These rules override ANY upstream skill default (including `writing-plans`, `generate-spec`, `train-model`, `evaluate-model`, and all superpowers skills).
4
+ > Read this file before writing any output file during the ML Gate Workflow.
5
+
6
+ ---
7
+
8
+ ## ML Plan Output Paths
9
+
10
+ | Output | Path | Note |
11
+ |--------|------|------|
12
+ | ML problem doc | `plan/[ticket-id]/ml-problem.md` | Gate 1 output |
13
+ | Experiment plan | `plan/[ticket-id]/experiment-plan.md` | Gate 2 output — **NOT** `docs/superpowers/plans/` |
14
+ | Evaluation report | `plan/[ticket-id]/eval-report.md` | Gate 4 output |
15
+
16
+ > The `[ticket-id]` comes from `.aiflow/context/current.json`.
17
+ > If no ticket context exists, use a descriptive slug: `plan/<feature-name>/ml-problem.md`.
18
+
19
+ ---
20
+
21
+ ## Reproducibility Rules
22
+
23
+ Every experiment must be fully reproducible from its logged artifacts alone:
24
+
25
+ - **Set all seeds** before any randomness: `random.seed(n)`, `numpy.random.seed(n)`, and the framework seed (`torch.manual_seed(n)`, `tf.random.set_seed(n)`).
26
+ - **Enable deterministic flags** where feasible (`torch.use_deterministic_algorithms(True)`; note and document any performance trade-off).
27
+ - **Pin the environment:** `requirements.txt` or a lockfile must be committed alongside every model artifact.
28
+ - **Log seed, config, and commit SHA** with every tracked run — a run is not reproducible unless these three are recorded.
29
+
30
+ ---
31
+
32
+ ## Experiment Naming Scheme
33
+
34
+ Pattern: `[ticket-id]_[approach]_[yyyymmdd-n]`
35
+
36
+ - `[ticket-id]` — Jira/linear ticket key (from `.aiflow/context/current.json`)
37
+ - `[approach]` — short slug describing the method (lowercase, hyphens, no spaces)
38
+ - `[yyyymmdd-n]` — date + 1-based daily sequence counter
39
+
40
+ **Concrete example:**
41
+
42
+ ```
43
+ ML-42_lgbm-tfidf_20241115-1
44
+ ML-42_lgbm-tfidf_20241115-2
45
+ ML-42_bert-finetune_20241116-1
46
+ ```
47
+
48
+ Use this name as the MLflow `run_name` / wandb `run` name and as the artifact folder name under `experiments/`.
49
+
50
+ ---
51
+
52
+ ## Data & Model Versioning
53
+
54
+ - **Datasets** must be versioned with DVC (or an equivalent registry). Never commit raw data or large processed files to git.
55
+ - **Model artifacts** must be registered in the artifact store (MLflow Model Registry, DVC, or equivalent). Record the data version used to produce each artifact.
56
+ - Each artifact's metadata must include: data version, code commit SHA, config file path, and eval metric.
57
+ - `models/` and `data/` directories are git-ignored; tracked via DVC or the registry instead.
58
+
59
+ ---
60
+
61
+ ## Anti-Leakage Rules (Hard Rules)
62
+
63
+ These rules are non-negotiable and override any convenience shortcut:
64
+
65
+ - **Split before fit** — perform the train/validation/test split BEFORE fitting any transformer, imputer, scaler, or encoder.
66
+ - **Fit transforms on train only** — all preprocessing must live inside a `Pipeline` that is fit exclusively on the training fold. Never fit on the full dataset and then split.
67
+ - **No target leakage** — features must not be derived from or computed after the prediction target. Explicitly check every feature's availability time relative to the target.
68
+ - **No temporal leakage** — for time-series data, use time-aware splits (no future data for past predictions). Validate that no feature uses information from future time steps.
69
+ - **Test set is held-out** — the test set is touched only at Gate 4 evaluation. No hyperparameter tuning, no feature selection, and no threshold selection on the test set.
70
+
71
+ ---
72
+
73
+ ## Checklist Before Writing Any Output File
74
+
75
+ Before saving any ML plan, experiment plan, or eval report, verify:
76
+
77
+ - [ ] Output path follows the table above — NOT the skill's default path
78
+ - [ ] `[ticket-id]` is read from `.aiflow/context/current.json`
79
+ - [ ] Directory `plan/[ticket-id]/` exists or will be created
80
+ - [ ] Announced path in the handoff message matches the actual saved path
81
+
82
+ ---
83
+
84
+ ## Other Conventions
85
+
86
+ - **ML review checklist:** `custom/rules/ml-review-checklist.md`
87
+ - **Code style:** `custom/rules/code-style.md`
88
+ - **Naming:** `custom/rules/naming.md`