@relipa/ai-flow-kit 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/AIFLOW.md +432 -0
  2. package/CHANGELOG.md +78 -0
  3. package/CONTRIBUTING.md +351 -0
  4. package/IMPLEMENTATION_SUMMARY.md +348 -0
  5. package/QUICK_START.md +392 -0
  6. package/README.md +323 -0
  7. package/bin/aiflow.js +178 -0
  8. package/custom/mcp-presets/README.md +138 -0
  9. package/custom/mcp-presets/backlog.json +15 -0
  10. package/custom/mcp-presets/figma.json +15 -0
  11. package/custom/mcp-presets/google-sheets.json +14 -0
  12. package/custom/mcp-presets/jira.json +16 -0
  13. package/custom/prompts/bug-fix.md +149 -0
  14. package/custom/prompts/feature.md +190 -0
  15. package/custom/prompts/investigation.md +164 -0
  16. package/custom/rules/code-style.md +7 -0
  17. package/custom/rules/java/code-style.md +11 -0
  18. package/custom/rules/java/naming.md +17 -0
  19. package/custom/rules/java/review-checklist.md +36 -0
  20. package/custom/rules/javascript/code-style.md +12 -0
  21. package/custom/rules/javascript/naming.md +14 -0
  22. package/custom/rules/naming.md +9 -0
  23. package/custom/rules/php/code-style.md +10 -0
  24. package/custom/rules/php/naming.md +15 -0
  25. package/custom/rules/review-checklist.md +9 -0
  26. package/custom/skills/figma-to-component/SKILL.md +207 -0
  27. package/custom/skills/generate-spec/SKILL.md +97 -0
  28. package/custom/skills/impact-analysis/SKILL.md +94 -0
  29. package/custom/skills/investigate-bug/SKILL.md +93 -0
  30. package/custom/skills/report-customer/SKILL.md +95 -0
  31. package/custom/skills/review-plan/SKILL.md +158 -0
  32. package/custom/skills/validate-ticket/SKILL.md +240 -0
  33. package/custom/templates/laravel.md +90 -0
  34. package/custom/templates/nextjs.md +89 -0
  35. package/custom/templates/reactjs.md +567 -0
  36. package/custom/templates/spring-boot.md +598 -0
  37. package/custom/templates/vue-nuxt.md +89 -0
  38. package/docs/architecture.md +395 -0
  39. package/docs/cli-reference.md +438 -0
  40. package/docs/configuration.md +412 -0
  41. package/docs/getting-started.md +248 -0
  42. package/docs/troubleshooting.md +587 -0
  43. package/docs/workflows/bug-fix.md +126 -0
  44. package/docs/workflows/feature.md +123 -0
  45. package/docs/workflows/impact-analysis.md +13 -0
  46. package/docs/workflows/investigation.md +13 -0
  47. package/docs/workflows/refactor.md +13 -0
  48. package/index.js +27 -0
  49. package/package.json +70 -0
  50. package/scripts/config.js +317 -0
  51. package/scripts/context.js +117 -0
  52. package/scripts/detect.js +239 -0
  53. package/scripts/doctor.js +48 -0
  54. package/scripts/guide.js +282 -0
  55. package/scripts/hooks/session-start.js +140 -0
  56. package/scripts/init.js +453 -0
  57. package/scripts/memory.js +247 -0
  58. package/scripts/prompt.js +392 -0
  59. package/scripts/remove.js +170 -0
  60. package/scripts/update.js +111 -0
  61. package/scripts/use.js +570 -0
  62. package/scripts/validate.js +303 -0
  63. package/upstream/.claude-plugin/marketplace.json +20 -0
  64. package/upstream/.claude-plugin/plugin.json +20 -0
  65. package/upstream/.codex/INSTALL.md +67 -0
  66. package/upstream/.cursor-plugin/plugin.json +25 -0
  67. package/upstream/.gitattributes +18 -0
  68. package/upstream/.github/FUNDING.yml +3 -0
  69. package/upstream/.github/ISSUE_TEMPLATE/bug_report.md +52 -0
  70. package/upstream/.github/ISSUE_TEMPLATE/config.yml +5 -0
  71. package/upstream/.github/ISSUE_TEMPLATE/feature_request.md +34 -0
  72. package/upstream/.github/ISSUE_TEMPLATE/platform_support.md +23 -0
  73. package/upstream/.github/PULL_REQUEST_TEMPLATE.md +87 -0
  74. package/upstream/.opencode/INSTALL.md +83 -0
  75. package/upstream/.opencode/plugins/superpowers.js +112 -0
  76. package/upstream/.version-bump.json +19 -0
  77. package/upstream/AGENTS.md +1 -0
  78. package/upstream/CHANGELOG.md +13 -0
  79. package/upstream/CLAUDE.md +85 -0
  80. package/upstream/CODE_OF_CONDUCT.md +128 -0
  81. package/upstream/GEMINI.md +2 -0
  82. package/upstream/LICENSE +21 -0
  83. package/upstream/README.md +190 -0
  84. package/upstream/RELEASE-NOTES.md +1096 -0
  85. package/upstream/agents/code-reviewer.md +48 -0
  86. package/upstream/commands/brainstorm.md +5 -0
  87. package/upstream/commands/execute-plan.md +5 -0
  88. package/upstream/commands/write-plan.md +5 -0
  89. package/upstream/docs/README.codex.md +126 -0
  90. package/upstream/docs/README.opencode.md +130 -0
  91. package/upstream/docs/plans/2025-11-22-opencode-support-design.md +294 -0
  92. package/upstream/docs/plans/2025-11-22-opencode-support-implementation.md +1095 -0
  93. package/upstream/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +711 -0
  94. package/upstream/docs/plans/2026-01-17-visual-brainstorming.md +571 -0
  95. package/upstream/docs/superpowers/plans/2026-01-22-document-review-system.md +301 -0
  96. package/upstream/docs/superpowers/plans/2026-02-19-visual-brainstorming-refactor.md +523 -0
  97. package/upstream/docs/superpowers/plans/2026-03-11-zero-dep-brainstorm-server.md +479 -0
  98. package/upstream/docs/superpowers/plans/2026-03-23-codex-app-compatibility.md +564 -0
  99. package/upstream/docs/superpowers/specs/2026-01-22-document-review-system-design.md +136 -0
  100. package/upstream/docs/superpowers/specs/2026-02-19-visual-brainstorming-refactor-design.md +162 -0
  101. package/upstream/docs/superpowers/specs/2026-03-11-zero-dep-brainstorm-server-design.md +118 -0
  102. package/upstream/docs/superpowers/specs/2026-03-23-codex-app-compatibility-design.md +244 -0
  103. package/upstream/docs/testing.md +303 -0
  104. package/upstream/docs/windows/polyglot-hooks.md +212 -0
  105. package/upstream/gemini-extension.json +6 -0
  106. package/upstream/hooks/hooks-cursor.json +10 -0
  107. package/upstream/hooks/hooks.json +16 -0
  108. package/upstream/hooks/run-hook.cmd +46 -0
  109. package/upstream/hooks/session-start +57 -0
  110. package/upstream/package.json +6 -0
  111. package/upstream/scripts/bump-version.sh +220 -0
  112. package/upstream/skills/brainstorming/SKILL.md +164 -0
  113. package/upstream/skills/brainstorming/scripts/frame-template.html +214 -0
  114. package/upstream/skills/brainstorming/scripts/helper.js +88 -0
  115. package/upstream/skills/brainstorming/scripts/server.cjs +354 -0
  116. package/upstream/skills/brainstorming/scripts/start-server.sh +148 -0
  117. package/upstream/skills/brainstorming/scripts/stop-server.sh +56 -0
  118. package/upstream/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  119. package/upstream/skills/brainstorming/visual-companion.md +287 -0
  120. package/upstream/skills/dispatching-parallel-agents/SKILL.md +182 -0
  121. package/upstream/skills/executing-plans/SKILL.md +70 -0
  122. package/upstream/skills/finishing-a-development-branch/SKILL.md +200 -0
  123. package/upstream/skills/receiving-code-review/SKILL.md +213 -0
  124. package/upstream/skills/requesting-code-review/SKILL.md +105 -0
  125. package/upstream/skills/requesting-code-review/code-reviewer.md +146 -0
  126. package/upstream/skills/subagent-driven-development/SKILL.md +277 -0
  127. package/upstream/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
  128. package/upstream/skills/subagent-driven-development/implementer-prompt.md +113 -0
  129. package/upstream/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
  130. package/upstream/skills/systematic-debugging/CREATION-LOG.md +119 -0
  131. package/upstream/skills/systematic-debugging/SKILL.md +296 -0
  132. package/upstream/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
  133. package/upstream/skills/systematic-debugging/condition-based-waiting.md +115 -0
  134. package/upstream/skills/systematic-debugging/defense-in-depth.md +122 -0
  135. package/upstream/skills/systematic-debugging/find-polluter.sh +63 -0
  136. package/upstream/skills/systematic-debugging/root-cause-tracing.md +169 -0
  137. package/upstream/skills/systematic-debugging/test-academic.md +14 -0
  138. package/upstream/skills/systematic-debugging/test-pressure-1.md +58 -0
  139. package/upstream/skills/systematic-debugging/test-pressure-2.md +68 -0
  140. package/upstream/skills/systematic-debugging/test-pressure-3.md +69 -0
  141. package/upstream/skills/test-driven-development/SKILL.md +371 -0
  142. package/upstream/skills/test-driven-development/testing-anti-patterns.md +299 -0
  143. package/upstream/skills/using-git-worktrees/SKILL.md +218 -0
  144. package/upstream/skills/using-superpowers/SKILL.md +117 -0
  145. package/upstream/skills/using-superpowers/references/codex-tools.md +100 -0
  146. package/upstream/skills/using-superpowers/references/copilot-tools.md +52 -0
  147. package/upstream/skills/using-superpowers/references/gemini-tools.md +33 -0
  148. package/upstream/skills/verification-before-completion/SKILL.md +139 -0
  149. package/upstream/skills/writing-plans/SKILL.md +152 -0
  150. package/upstream/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
  151. package/upstream/skills/writing-skills/SKILL.md +655 -0
  152. package/upstream/skills/writing-skills/anthropic-best-practices.md +1150 -0
  153. package/upstream/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
  154. package/upstream/skills/writing-skills/graphviz-conventions.dot +172 -0
  155. package/upstream/skills/writing-skills/persuasion-principles.md +187 -0
  156. package/upstream/skills/writing-skills/render-graphs.js +168 -0
  157. package/upstream/skills/writing-skills/testing-skills-with-subagents.md +384 -0
  158. package/upstream/tests/brainstorm-server/package-lock.json +36 -0
  159. package/upstream/tests/brainstorm-server/package.json +10 -0
  160. package/upstream/tests/brainstorm-server/server.test.js +427 -0
  161. package/upstream/tests/brainstorm-server/windows-lifecycle.test.sh +351 -0
  162. package/upstream/tests/brainstorm-server/ws-protocol.test.js +392 -0
  163. package/upstream/tests/claude-code/README.md +158 -0
  164. package/upstream/tests/claude-code/analyze-token-usage.py +168 -0
  165. package/upstream/tests/claude-code/run-skill-tests.sh +187 -0
  166. package/upstream/tests/claude-code/test-document-review-system.sh +177 -0
  167. package/upstream/tests/claude-code/test-helpers.sh +202 -0
  168. package/upstream/tests/claude-code/test-subagent-driven-development-integration.sh +314 -0
  169. package/upstream/tests/claude-code/test-subagent-driven-development.sh +165 -0
  170. package/upstream/tests/explicit-skill-requests/prompts/action-oriented.txt +3 -0
  171. package/upstream/tests/explicit-skill-requests/prompts/after-planning-flow.txt +17 -0
  172. package/upstream/tests/explicit-skill-requests/prompts/claude-suggested-it.txt +11 -0
  173. package/upstream/tests/explicit-skill-requests/prompts/i-know-what-sdd-means.txt +8 -0
  174. package/upstream/tests/explicit-skill-requests/prompts/mid-conversation-execute-plan.txt +3 -0
  175. package/upstream/tests/explicit-skill-requests/prompts/please-use-brainstorming.txt +1 -0
  176. package/upstream/tests/explicit-skill-requests/prompts/skip-formalities.txt +3 -0
  177. package/upstream/tests/explicit-skill-requests/prompts/subagent-driven-development-please.txt +1 -0
  178. package/upstream/tests/explicit-skill-requests/prompts/use-systematic-debugging.txt +1 -0
  179. package/upstream/tests/explicit-skill-requests/run-all.sh +70 -0
  180. package/upstream/tests/explicit-skill-requests/run-claude-describes-sdd.sh +100 -0
  181. package/upstream/tests/explicit-skill-requests/run-extended-multiturn-test.sh +113 -0
  182. package/upstream/tests/explicit-skill-requests/run-haiku-test.sh +144 -0
  183. package/upstream/tests/explicit-skill-requests/run-multiturn-test.sh +143 -0
  184. package/upstream/tests/explicit-skill-requests/run-test.sh +136 -0
  185. package/upstream/tests/opencode/run-tests.sh +163 -0
  186. package/upstream/tests/opencode/setup.sh +88 -0
  187. package/upstream/tests/opencode/test-plugin-loading.sh +82 -0
  188. package/upstream/tests/opencode/test-priority.sh +198 -0
  189. package/upstream/tests/opencode/test-tools.sh +104 -0
  190. package/upstream/tests/skill-triggering/prompts/dispatching-parallel-agents.txt +8 -0
  191. package/upstream/tests/skill-triggering/prompts/executing-plans.txt +1 -0
  192. package/upstream/tests/skill-triggering/prompts/requesting-code-review.txt +3 -0
  193. package/upstream/tests/skill-triggering/prompts/systematic-debugging.txt +11 -0
  194. package/upstream/tests/skill-triggering/prompts/test-driven-development.txt +7 -0
  195. package/upstream/tests/skill-triggering/prompts/writing-plans.txt +10 -0
  196. package/upstream/tests/skill-triggering/run-all.sh +60 -0
  197. package/upstream/tests/skill-triggering/run-test.sh +88 -0
  198. package/upstream/tests/subagent-driven-dev/go-fractals/design.md +81 -0
  199. package/upstream/tests/subagent-driven-dev/go-fractals/plan.md +172 -0
  200. package/upstream/tests/subagent-driven-dev/go-fractals/scaffold.sh +45 -0
  201. package/upstream/tests/subagent-driven-dev/run-test.sh +106 -0
  202. package/upstream/tests/subagent-driven-dev/svelte-todo/design.md +70 -0
  203. package/upstream/tests/subagent-driven-dev/svelte-todo/plan.md +222 -0
  204. package/upstream/tests/subagent-driven-dev/svelte-todo/scaffold.sh +46 -0
@@ -0,0 +1,158 @@
1
+ ---
2
+ name: review-plan
3
+ description: Gate 4 — After AI generates code, the developer reviews source code + summary. Developer must provide APPROVED or report a bug before closing the task.
4
+ keywords: review, code review, approve, summary, checklist
5
+ ---
6
+
7
+ # Review Plan — Gate 4
8
+
9
+ > **GATE 4: Runs after AI has completed code generation.**
10
+ >
11
+ > Principle: AI self-reviews first (verification + impact-analysis), then presents a summary to the developer. The developer decides: APPROVED or report a bug.
12
+
13
+ ---
14
+
15
+ ## Conditions to enter Gate 4
16
+
17
+ - ✅ Gate 1 (requirement doc) has been APPROVED
18
+ - ✅ Gate 2 (implementation plan) has been APPROVED
19
+ - ✅ AI has completed code generation (Gate 3)
20
+ - ✅ `superpowers:verification-before-completion` has run — tests pass
21
+ - ✅ `impact-analysis` skill has run
22
+
23
+ ---
24
+
25
+ ## Process
26
+
27
+ ### Step 1: AI self-review (before showing the developer)
28
+
29
+ Run in the following mandatory order:
30
+
31
+ ```
32
+ 1. superpowers:verification-before-completion
33
+ → All tests must PASS. If any fail → fix immediately, do not show the developer.
34
+
35
+ 2. impact-analysis skill
36
+ → Check for breaking changes and side effects.
37
+
38
+ 3. review-checklist (.rules/review-checklist.md)
39
+ → Tick each item in the checklist.
40
+ ```
41
+
42
+ **If any step fails → fix first, do not proceed to Step 2.**
43
+
44
+ ### Step 2: Create Summary Report
45
+
46
+ Create file `plan/[ticket-id]/summary.md`:
47
+
48
+ ```markdown
49
+ # Summary: [Ticket ID] — [Title]
50
+
51
+ **Date:** [YYYY-MM-DD]
52
+ **Status:** Waiting for DEV review
53
+
54
+ ---
55
+
56
+ ## Implementation Details
57
+
58
+ | File | Change | Reason |
59
+ |------|----------|-------|
60
+ | [path/to/file] | Created / Modified | [reason] |
61
+
62
+ ---
63
+
64
+ ## Acceptance Criteria — results
65
+
66
+ | Criteria | Status | Notes |
67
+ |---------|--------|---------|
68
+ | [Criteria 1] | ✅ Done | [implementation details] |
69
+ | [Criteria 2] | ✅ Done | |
70
+
71
+ ---
72
+
73
+ ## Tests Written
74
+
75
+ | Test file | Test cases | Coverage |
76
+ |-----------|-----------|---------|
77
+ | [file] | [N] cases | [X%] |
78
+
79
+ **Test output:**
80
+ ```
81
+ [Paste test results here]
82
+ ```
83
+
84
+ ---
85
+
86
+ ## Impact Analysis results
87
+
88
+ **Level:** 🟢 Low / 🟡 Medium / 🔴 High
89
+
90
+ **Impact Scope:**
91
+ - [File/Service A] — [reason for impact / lack of impact]
92
+
93
+ **Breaking changes:** None / [description if any]
94
+
95
+ ---
96
+
97
+ ## Review Checklist
98
+
99
+ - [ ] Code compiles and all tests pass
100
+ - [ ] No hardcoded credentials / config
101
+ - [ ] Security: no SQL injection, no exposure of sensitive data
102
+ - [ ] Impact Analysis has been run
103
+ - [ ] Naming and Code Style follow conventions
104
+ - [ ] Sufficient tests (unit + integration)
105
+ - [ ] No dead code / leftover console.logs
106
+ ```
107
+
108
+ ### Step 3: GATE 4 — Present to Developer
109
+
110
+ ```markdown
111
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
112
+ ⏸️ GATE 4: WAITING FOR DEV REVIEW
113
+
114
+ I have completed implementation and self-review.
115
+ Summary: plan/[ticket-id]/summary.md
116
+
117
+ **Self-review results:**
118
+ - Tests: ✅ [N] passed / ❌ [N] failed
119
+ - Impact: [Low/Medium/High]
120
+ - Checklist: [N/N] items ✅
121
+
122
+ **You need to:**
123
+ 1. Review the summary above
124
+ 2. Check the source code if necessary
125
+ 3. Run manual tests if desired
126
+
127
+ **After review, reply with one of the following:**
128
+
129
+ ✅ If OK: type **"APPROVED"**
130
+ 🐛 If there are bugs: type **"BUG: [description]"**
131
+ → If a requirement bug: I will return to Gate 2
132
+ → If a coding bug: I will fix and repeat Gate 4
133
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
134
+ ```
135
+
136
+ ### Step 4: Handle feedback
137
+
138
+ **If the developer types "APPROVED":**
139
+ → Invoke `superpowers:requesting-code-review` to send for peer review
140
+ → Guide on creating a Pull Request
141
+
142
+ **If the developer types "BUG: [description]" — coding bug:**
143
+ → Analyze bug, fix, rerun verification
144
+ → Repeat from Step 1 of Gate 4
145
+
146
+ **If the developer types "BUG: [description]" — requirement bug:**
147
+ → Notify: "This is a requirement bug, requirement document needs update"
148
+ → Return to Gate 1, update requirement.md, wait for APPROVED again
149
+
150
+ ---
151
+
152
+ ## Mandatory Rules
153
+
154
+ - ❌ **DO NOT** invoke `requesting-code-review` before the developer provides APPROVED
155
+ - ❌ **DO NOT** decide "task is done" on your own — must be confirmed by the developer
156
+ - ✅ **MUST** run verification + impact-analysis before showing the developer
157
+ - ✅ **MUST** clearly classify: requirement bug vs coding bug
158
+ - ✅ **MUST** update summary.md each time changes are made
@@ -0,0 +1,240 @@
1
+ ---
2
+ name: validate-ticket
3
+ description: Gate 1 — AI reads ticket from Backlog/Jira + reads source code, then uses superpowers:brainstorming for collaborative Q&A and solution proposal. Adds impact analysis and effort estimate. Outputs requirement.md for DEV to approve.
4
+ keywords: ticket, validate, context, requirement, backlog, jira, analyze, understand, solution, estimate
5
+ ---
6
+
7
+ # Analyze Requirement — Gate 1
8
+
9
+ > **GATE 1: Must run before any other gate. Auto-starts when ticket context exists.**
10
+ >
11
+ > Principle: AI actively participates in understanding requirements — reading ticket + source code, clarifying via collaborative dialogue, proposing solutions, analyzing impact, and estimating effort.
12
+
13
+ ---
14
+
15
+ ## Steps
16
+
17
+ ### Step 1: Load Ticket & Read Source Code
18
+
19
+ 1. Read `.claude/context/current.json` — ticket info from Backlog/Jira
20
+ 2. Read `CLAUDE.md` — understand project architecture, tech stack, conventions
21
+ 3. Read related source files — trace data flow, identify patterns, dependencies
22
+ 4. Read ticket comments — additional context from PM/team
23
+
24
+ Do this investigation **before** asking any questions. Come prepared.
25
+
26
+ ---
27
+
28
+ ### Step 2: Clarify Requirements via Brainstorming
29
+
30
+ **INVOKE: `superpowers:brainstorming`**
31
+
32
+ Use brainstorming's collaborative Q&A process to:
33
+ - Ask clarifying questions **one at a time** — never batch multiple questions
34
+ - Understand purpose, constraints, and success criteria from the developer
35
+ - Propose **2–3 solution approaches** with trade-offs and a recommendation
36
+ - Present the proposed design and get developer confirmation
37
+
38
+ Brainstorming handles the full Q&A loop automatically. Let it run until the developer has confirmed the design direction.
39
+
40
+ **Do NOT proceed to Step 3 until brainstorming confirms the design is approved.**
41
+
42
+ ---
43
+
44
+ ### Step 3: Extend with Impact Analysis & Effort Estimate
45
+
46
+ After brainstorming completes, add what brainstorming does not cover:
47
+
48
+ **Impact Analysis:**
49
+ - Which services, modules, and jobs are affected?
50
+ - Any breaking changes to APIs, DB schema, or shared components?
51
+ - Risk level: 🟢 Low / 🟡 Medium / 🔴 High
52
+ - Mitigation for each risk
53
+
54
+ **Effort Estimate:**
55
+ - Break down into tasks: tests, implementation, migration
56
+ - Size each task: S (< 1h) / M (1–4h) / L (4–8h) / XL (8h+, consider splitting)
57
+ - If XL → suggest sub-task breakdown
58
+
59
+ ---
60
+
61
+ ### Step 4: Write Requirement Document
62
+
63
+ Save to `plan/[ticket-id]/requirement.md`:
64
+
65
+ ```markdown
66
+ # Requirement: [Ticket ID] — [Title]
67
+
68
+ **Date:** [YYYY-MM-DD]
69
+ **Type:** [feature | bug-fix | refactor | investigation]
70
+ **Status:** ⏸️ Waiting for DEV Approval
71
+
72
+ ---
73
+
74
+ ## 1. Requirements Summary
75
+
76
+ ### Description
77
+ [Clear technical restatement of the requirement, incorporating all clarifications from Q&A]
78
+
79
+ ### Current Behavior / Business Goal
80
+ [What exists now vs what is needed]
81
+
82
+ ### Acceptance Criteria
83
+ - [ ] [Criteria 1 — specific, measurable]
84
+ - [ ] [Criteria 2]
85
+
86
+ ### Context & Constraints
87
+ [Environment, business rules, dependencies, deadlines]
88
+
89
+ ---
90
+
91
+ ## 2. Source Code Analysis
92
+
93
+ ### Related Files
94
+ | File | Role | Current State |
95
+ |------|------|---------------|
96
+ | [path] | [Controller/Service/...] | [what it does now] |
97
+
98
+ ### Data Flow
99
+ ```
100
+ [Entry point] → [Service] → [Repository] → [DB/External]
101
+ ```
102
+
103
+ ### Existing Patterns to Follow
104
+ [Patterns in the codebase this change must follow]
105
+
106
+ ### Current Test Coverage
107
+ | Area | Test File | Status |
108
+ |------|-----------|--------|
109
+ | [area] | [file] | [exists / missing] |
110
+
111
+ ---
112
+
113
+ ## 3. Proposed Solution
114
+
115
+ ### Chosen Approach: [Name]
116
+ [From brainstorming session — the approach the developer confirmed]
117
+
118
+ ### Alternatives Considered
119
+ | Option | Pros | Cons | Why Not Chosen |
120
+ |--------|------|------|----------------|
121
+ | [Option B] | ... | ... | ... |
122
+
123
+ ### Files to Create / Modify
124
+ | Action | File | Change |
125
+ |--------|------|--------|
126
+ | Create | [path] | [purpose] |
127
+ | Modify | [path] | [what changes] |
128
+
129
+ ### Database Changes
130
+ | Table | Change | Details |
131
+ |-------|--------|---------|
132
+ | [table] | [migration type] | [description] |
133
+
134
+ ---
135
+
136
+ ## 4. Impact Analysis
137
+
138
+ **Impact Level:** 🟢 Low / 🟡 Medium / 🔴 High
139
+
140
+ | Area | Impact | Reason |
141
+ |------|--------|--------|
142
+ | [Module] | 🟢 None / 🟡 Minor / 🔴 Major | [why] |
143
+
144
+ **Breaking Changes:**
145
+ - [ ] None expected
146
+ - [ ] [Breaking change if any]
147
+
148
+ **Risks:**
149
+ | Risk | Severity | Mitigation |
150
+ |------|----------|------------|
151
+ | [description] | Low / Medium / High | [mitigation] |
152
+
153
+ ---
154
+
155
+ ## 5. Effort Estimate
156
+
157
+ | Task | Size | Notes |
158
+ |------|------|-------|
159
+ | Tests (TDD) | S/M/L | [N scenarios] |
160
+ | Implementation | S/M/L | [complexity] |
161
+ | Migration / Integration | S/M/L | [if applicable] |
162
+ | **Total** | **S/M/L/XL** | |
163
+
164
+ > S = <1h · M = 1–4h · L = 4–8h · XL = 8h+ (split recommended)
165
+
166
+ **Sub-tasks (if XL):**
167
+ - [ ] [Sub-task 1]
168
+ - [ ] [Sub-task 2]
169
+
170
+ ---
171
+
172
+ ## 6. Testing Plan
173
+
174
+ ### Unit Tests
175
+ - [ ] [Scenario to test]
176
+
177
+ ### Integration Tests
178
+ - [ ] [API/service flow to test]
179
+
180
+ ### Manual Test Cases
181
+ - [ ] [Step-by-step]
182
+ ```
183
+
184
+ ---
185
+
186
+ ### Step 5: Present to Developer
187
+
188
+ ```
189
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
190
+ ⏸️ GATE 1: REQUIREMENT DOCUMENT READY
191
+
192
+ Ticket: [ticket-id] — [title]
193
+ File: plan/[ticket-id]/requirement.md
194
+
195
+ Summary:
196
+ Type: [feature / bug-fix / refactor]
197
+ Impact: [Low / Medium / High]
198
+ Estimate: [S / M / L / XL]
199
+ Approach: [one-line description]
200
+
201
+ Please review the requirement document.
202
+ → Type APPROVED to proceed to implementation plan
203
+ → Or provide feedback to update the document
204
+
205
+ ⚠️ I will NOT generate code until I receive "APPROVED".
206
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
207
+ ```
208
+
209
+ ---
210
+
211
+ ### Step 6: Handle Feedback
212
+
213
+ - DEV provides feedback → update `requirement.md` → re-show Gate 1 prompt
214
+ - DEV types `APPROVED` → proceed to Gate 2 (Implementation Plan)
215
+
216
+ ---
217
+
218
+ ## What This Skill Delegates vs Owns
219
+
220
+ | Concern | Handled by |
221
+ |---------|-----------|
222
+ | Q&A loop (one question at a time) | `superpowers:brainstorming` |
223
+ | Propose 2–3 solution approaches | `superpowers:brainstorming` |
224
+ | Root cause tracing (bug tasks) | `superpowers:systematic-debugging` |
225
+ | Impact analysis | This skill |
226
+ | Effort estimate | This skill |
227
+ | requirement.md template & output | This skill |
228
+ | Gate 1 APPROVED gate | This skill |
229
+
230
+ ---
231
+
232
+ ## Mandatory Rules
233
+
234
+ - ❌ **DO NOT** skip invoking `superpowers:brainstorming` — it owns the Q&A loop
235
+ - ❌ **DO NOT** proceed past Step 2 if design is not confirmed by developer
236
+ - ❌ **DO NOT** write code at any point in this skill
237
+ - ❌ **DO NOT** skip impact analysis and effort estimate
238
+ - ✅ **MUST** read source code before brainstorming begins
239
+ - ✅ **MUST** save `plan/[ticket-id]/requirement.md`
240
+ - ✅ **MUST** display Gate 1 prompt and wait for `APPROVED`
@@ -0,0 +1,90 @@
1
+ # Laravel AI System Prompt
2
+
3
+ You are an expert Laravel developer. Follow these specific rules when generating or modifying code in this project.
4
+
5
+ ---
6
+
7
+ ## MANDATORY: Strict Gate Workflow
8
+
9
+ > **Absolute Rule: Complete Gate N before entering Gate N+1.**
10
+ > **Do not skip, shorten, or merge Gates.**
11
+
12
+ You have superpowers. When a ticket context exists in `.claude/context/current.json`:
13
+ - **AUTO-START Gate 1 immediately** — do NOT wait for the developer to ask.
14
+ - Read `CLAUDE.md` (this file) and follow the gate sequence below — NO EXCEPTIONS.
15
+
16
+ ---
17
+
18
+ ### GATE 1 — AI Analyze Requirement (auto-start)
19
+
20
+ **INVOKE:** `validate-ticket` skill
21
+
22
+ AI actively reads ticket + source code to understand the requirement:
23
+ 1. Read `.claude/context/current.json` — ticket info
24
+ 2. Read source code — architecture, related files, data flow
25
+ 3. If anything is unclear — ask ONE question at a time, wait for reply
26
+ 4. Output `plan/[ticket-id]/requirement.md` with:
27
+ - Requirements summary, source code analysis
28
+ - Proposed solution and approach
29
+ - Impact analysis, effort estimate, testing plan
30
+ 5. Display "GATE 1: Requirement doc ready" → wait for **APPROVED**
31
+
32
+ DO NOT just check format — **understand the content and propose solutions**.
33
+
34
+ ---
35
+
36
+ ### GATE 2 — Implementation Plan (wait for APPROVED)
37
+
38
+ **INVOKE:** `generate-spec` skill, then `superpowers:writing-plans`
39
+
40
+ - Create a detailed TDD implementation plan based on the approved requirement.
41
+ - Display: "GATE 2 PAUSED: type APPROVED to start coding".
42
+ - CODE WILL NOT BE GENERATED until "APPROVED" is received.
43
+
44
+ ---
45
+
46
+ ### GATE 3 — Code Generation (TDD only)
47
+
48
+ Only runs after Gate 2 has been APPROVED.
49
+
50
+ **INVOKE:** `superpowers:test-driven-development`
51
+ - Complex feature (3+ files): `superpowers:subagent-driven-development`
52
+ - Write tests FIRST — run to confirm FAIL -> implement -> PASS.
53
+ - Bug fix EXTRA: `superpowers:systematic-debugging` + `investigate-bug` skill first.
54
+
55
+ ---
56
+
57
+ ### GATE 4 — AI Self-Review (wait for APPROVED)
58
+
59
+ **INVOKE:** `review-plan` skill
60
+
61
+ Mandatory order:
62
+ 1. `superpowers:verification-before-completion` — all tests must PASS
63
+ 2. `impact-analysis` skill — check for breaking changes
64
+ 3. `custom/rules/review-checklist.md` — tick each item
65
+ 4. Create `plan/[ticket-id]/summary.md`
66
+
67
+ Then: "GATE 4 PAUSED: type APPROVED or BUG: [description]"
68
+ - Coding bug -> fix -> repeat Gate 4.
69
+ - Requirement bug -> return to Gate 1.
70
+
71
+ ---
72
+
73
+ ### GATE 5 — Peer Review and Done
74
+
75
+ Only runs after Gate 4 has been APPROVED.
76
+
77
+ **INVOKE:** `superpowers:requesting-code-review`
78
+ Guide on creating a Pull Request with the ticket link.
79
+
80
+ ---
81
+
82
+ - Use Laravel's built-in tools over custom solutions (e.g., Collections, Eloquent features, built-in validation rules).
83
+ - Keep Controllers thin. Move business logic to Services or Action classes (`app/Services` or `app/Actions`).
84
+ - Use FormRequests for validation, never validate inside the controller logic.
85
+ - Avoid N+1 queries. Always use `with()` when eager loading relationships.
86
+ - Return typed Responses or API Resources, never arbitrary arrays.
87
+ - Use strict typing natively in PHP 8+.
88
+ - Adhere to PSR-12 styling.
89
+
90
+ When explaining changes, refer to Laravel's official documentation conventions.
@@ -0,0 +1,89 @@
1
+ # Next.js AI System Prompt
2
+
3
+ You are an expert React & Next.js developer. Follow these specific rules.
4
+
5
+ ---
6
+
7
+ ## MANDATORY: Strict Gate Workflow
8
+
9
+ > **Absolute Rule: Complete Gate N before entering Gate N+1.**
10
+ > **Do not skip, shorten, or merge Gates.**
11
+
12
+ You have superpowers. When a ticket context exists in `.claude/context/current.json`:
13
+ - **AUTO-START Gate 1 immediately** — do NOT wait for the developer to ask.
14
+ - Read `CLAUDE.md` (this file) and follow the gate sequence below — NO EXCEPTIONS.
15
+
16
+ ---
17
+
18
+ ### GATE 1 — AI Analyze Requirement (auto-start)
19
+
20
+ **INVOKE:** `validate-ticket` skill
21
+
22
+ AI actively reads ticket + source code to understand the requirement:
23
+ 1. Read `.claude/context/current.json` — ticket info
24
+ 2. Read source code — architecture, related files, data flow
25
+ 3. If anything is unclear — ask ONE question at a time, wait for reply
26
+ 4. Output `plan/[ticket-id]/requirement.md` with:
27
+ - Requirements summary, source code analysis
28
+ - Proposed solution and approach
29
+ - Impact analysis, effort estimate, testing plan
30
+ 5. Display "GATE 1: Requirement doc ready" → wait for **APPROVED**
31
+
32
+ DO NOT just check format — **understand the content and propose solutions**.
33
+
34
+ ---
35
+
36
+ ### GATE 2 — Implementation Plan (wait for APPROVED)
37
+
38
+ **INVOKE:** `generate-spec` skill, then `superpowers:writing-plans`
39
+
40
+ - Create a detailed TDD implementation plan based on the approved requirement.
41
+ - Display: "GATE 2 PAUSED: type APPROVED to start coding".
42
+ - CODE WILL NOT BE GENERATED until "APPROVED" is received.
43
+
44
+ ---
45
+
46
+ ### GATE 3 — Code Generation (TDD only)
47
+
48
+ Only runs after Gate 2 has been APPROVED.
49
+
50
+ **INVOKE:** `superpowers:test-driven-development`
51
+ - Complex feature (3+ files): `superpowers:subagent-driven-development`
52
+ - Write tests FIRST — run to confirm FAIL -> implement -> PASS.
53
+ - Bug fix EXTRA: `superpowers:systematic-debugging` + `investigate-bug` skill first.
54
+
55
+ ---
56
+
57
+ ### GATE 4 — AI Self-Review (wait for APPROVED)
58
+
59
+ **INVOKE:** `review-plan` skill
60
+
61
+ Mandatory order:
62
+ 1. `superpowers:verification-before-completion` — all tests must PASS
63
+ 2. `impact-analysis` skill — check for breaking changes
64
+ 3. `custom/rules/review-checklist.md` — tick each item
65
+ 4. Create `plan/[ticket-id]/summary.md`
66
+
67
+ Then: "GATE 4 PAUSED: type APPROVED or BUG: [description]"
68
+ - Coding bug -> fix -> repeat Gate 4.
69
+ - Requirement bug -> return to Gate 1.
70
+
71
+ ---
72
+
73
+ ### GATE 5 — Peer Review and Done
74
+
75
+ Only runs after Gate 4 has been APPROVED.
76
+
77
+ **INVOKE:** `superpowers:requesting-code-review`
78
+ Guide on creating a Pull Request with the ticket link.
79
+
80
+ ---
81
+
82
+ - Use the Next.js App Router (`app/` directory).
83
+ - Default to Server Components. Only use Client Components (`"use client"`) when you need hooks (`useState`, `useEffect`) or browser APIs.
84
+ - For data fetching, prefer native `fetch` with caching logic in Server Components. If doing client-side mutation, use Server Actions or `SWR`/`React Query` if configured.
85
+ - Style with CSS Modules or TailwindCSS (check project configuration).
86
+ - Ensure strict TypeScript typing. Avoid `any` at all costs.
87
+ - Place reusable isolated UI components in `components/ui/` and complex view logic in `components/`.
88
+
89
+ When explaining concepts, focus on SSR, CSR, and hydration best practices.