@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.
- package/AIFLOW.md +432 -0
- package/CHANGELOG.md +78 -0
- package/CONTRIBUTING.md +351 -0
- package/IMPLEMENTATION_SUMMARY.md +348 -0
- package/QUICK_START.md +392 -0
- package/README.md +323 -0
- package/bin/aiflow.js +178 -0
- package/custom/mcp-presets/README.md +138 -0
- package/custom/mcp-presets/backlog.json +15 -0
- package/custom/mcp-presets/figma.json +15 -0
- package/custom/mcp-presets/google-sheets.json +14 -0
- package/custom/mcp-presets/jira.json +16 -0
- package/custom/prompts/bug-fix.md +149 -0
- package/custom/prompts/feature.md +190 -0
- package/custom/prompts/investigation.md +164 -0
- package/custom/rules/code-style.md +7 -0
- package/custom/rules/java/code-style.md +11 -0
- package/custom/rules/java/naming.md +17 -0
- package/custom/rules/java/review-checklist.md +36 -0
- package/custom/rules/javascript/code-style.md +12 -0
- package/custom/rules/javascript/naming.md +14 -0
- package/custom/rules/naming.md +9 -0
- package/custom/rules/php/code-style.md +10 -0
- package/custom/rules/php/naming.md +15 -0
- package/custom/rules/review-checklist.md +9 -0
- package/custom/skills/figma-to-component/SKILL.md +207 -0
- package/custom/skills/generate-spec/SKILL.md +97 -0
- package/custom/skills/impact-analysis/SKILL.md +94 -0
- package/custom/skills/investigate-bug/SKILL.md +93 -0
- package/custom/skills/report-customer/SKILL.md +95 -0
- package/custom/skills/review-plan/SKILL.md +158 -0
- package/custom/skills/validate-ticket/SKILL.md +240 -0
- package/custom/templates/laravel.md +90 -0
- package/custom/templates/nextjs.md +89 -0
- package/custom/templates/reactjs.md +567 -0
- package/custom/templates/spring-boot.md +598 -0
- package/custom/templates/vue-nuxt.md +89 -0
- package/docs/architecture.md +395 -0
- package/docs/cli-reference.md +438 -0
- package/docs/configuration.md +412 -0
- package/docs/getting-started.md +248 -0
- package/docs/troubleshooting.md +587 -0
- package/docs/workflows/bug-fix.md +126 -0
- package/docs/workflows/feature.md +123 -0
- package/docs/workflows/impact-analysis.md +13 -0
- package/docs/workflows/investigation.md +13 -0
- package/docs/workflows/refactor.md +13 -0
- package/index.js +27 -0
- package/package.json +70 -0
- package/scripts/config.js +317 -0
- package/scripts/context.js +117 -0
- package/scripts/detect.js +239 -0
- package/scripts/doctor.js +48 -0
- package/scripts/guide.js +282 -0
- package/scripts/hooks/session-start.js +140 -0
- package/scripts/init.js +453 -0
- package/scripts/memory.js +247 -0
- package/scripts/prompt.js +392 -0
- package/scripts/remove.js +170 -0
- package/scripts/update.js +111 -0
- package/scripts/use.js +570 -0
- package/scripts/validate.js +303 -0
- package/upstream/.claude-plugin/marketplace.json +20 -0
- package/upstream/.claude-plugin/plugin.json +20 -0
- package/upstream/.codex/INSTALL.md +67 -0
- package/upstream/.cursor-plugin/plugin.json +25 -0
- package/upstream/.gitattributes +18 -0
- package/upstream/.github/FUNDING.yml +3 -0
- package/upstream/.github/ISSUE_TEMPLATE/bug_report.md +52 -0
- package/upstream/.github/ISSUE_TEMPLATE/config.yml +5 -0
- package/upstream/.github/ISSUE_TEMPLATE/feature_request.md +34 -0
- package/upstream/.github/ISSUE_TEMPLATE/platform_support.md +23 -0
- package/upstream/.github/PULL_REQUEST_TEMPLATE.md +87 -0
- package/upstream/.opencode/INSTALL.md +83 -0
- package/upstream/.opencode/plugins/superpowers.js +112 -0
- package/upstream/.version-bump.json +19 -0
- package/upstream/AGENTS.md +1 -0
- package/upstream/CHANGELOG.md +13 -0
- package/upstream/CLAUDE.md +85 -0
- package/upstream/CODE_OF_CONDUCT.md +128 -0
- package/upstream/GEMINI.md +2 -0
- package/upstream/LICENSE +21 -0
- package/upstream/README.md +190 -0
- package/upstream/RELEASE-NOTES.md +1096 -0
- package/upstream/agents/code-reviewer.md +48 -0
- package/upstream/commands/brainstorm.md +5 -0
- package/upstream/commands/execute-plan.md +5 -0
- package/upstream/commands/write-plan.md +5 -0
- package/upstream/docs/README.codex.md +126 -0
- package/upstream/docs/README.opencode.md +130 -0
- package/upstream/docs/plans/2025-11-22-opencode-support-design.md +294 -0
- package/upstream/docs/plans/2025-11-22-opencode-support-implementation.md +1095 -0
- package/upstream/docs/plans/2025-11-28-skills-improvements-from-user-feedback.md +711 -0
- package/upstream/docs/plans/2026-01-17-visual-brainstorming.md +571 -0
- package/upstream/docs/superpowers/plans/2026-01-22-document-review-system.md +301 -0
- package/upstream/docs/superpowers/plans/2026-02-19-visual-brainstorming-refactor.md +523 -0
- package/upstream/docs/superpowers/plans/2026-03-11-zero-dep-brainstorm-server.md +479 -0
- package/upstream/docs/superpowers/plans/2026-03-23-codex-app-compatibility.md +564 -0
- package/upstream/docs/superpowers/specs/2026-01-22-document-review-system-design.md +136 -0
- package/upstream/docs/superpowers/specs/2026-02-19-visual-brainstorming-refactor-design.md +162 -0
- package/upstream/docs/superpowers/specs/2026-03-11-zero-dep-brainstorm-server-design.md +118 -0
- package/upstream/docs/superpowers/specs/2026-03-23-codex-app-compatibility-design.md +244 -0
- package/upstream/docs/testing.md +303 -0
- package/upstream/docs/windows/polyglot-hooks.md +212 -0
- package/upstream/gemini-extension.json +6 -0
- package/upstream/hooks/hooks-cursor.json +10 -0
- package/upstream/hooks/hooks.json +16 -0
- package/upstream/hooks/run-hook.cmd +46 -0
- package/upstream/hooks/session-start +57 -0
- package/upstream/package.json +6 -0
- package/upstream/scripts/bump-version.sh +220 -0
- package/upstream/skills/brainstorming/SKILL.md +164 -0
- package/upstream/skills/brainstorming/scripts/frame-template.html +214 -0
- package/upstream/skills/brainstorming/scripts/helper.js +88 -0
- package/upstream/skills/brainstorming/scripts/server.cjs +354 -0
- package/upstream/skills/brainstorming/scripts/start-server.sh +148 -0
- package/upstream/skills/brainstorming/scripts/stop-server.sh +56 -0
- package/upstream/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
- package/upstream/skills/brainstorming/visual-companion.md +287 -0
- package/upstream/skills/dispatching-parallel-agents/SKILL.md +182 -0
- package/upstream/skills/executing-plans/SKILL.md +70 -0
- package/upstream/skills/finishing-a-development-branch/SKILL.md +200 -0
- package/upstream/skills/receiving-code-review/SKILL.md +213 -0
- package/upstream/skills/requesting-code-review/SKILL.md +105 -0
- package/upstream/skills/requesting-code-review/code-reviewer.md +146 -0
- package/upstream/skills/subagent-driven-development/SKILL.md +277 -0
- package/upstream/skills/subagent-driven-development/code-quality-reviewer-prompt.md +26 -0
- package/upstream/skills/subagent-driven-development/implementer-prompt.md +113 -0
- package/upstream/skills/subagent-driven-development/spec-reviewer-prompt.md +61 -0
- package/upstream/skills/systematic-debugging/CREATION-LOG.md +119 -0
- package/upstream/skills/systematic-debugging/SKILL.md +296 -0
- package/upstream/skills/systematic-debugging/condition-based-waiting-example.ts +158 -0
- package/upstream/skills/systematic-debugging/condition-based-waiting.md +115 -0
- package/upstream/skills/systematic-debugging/defense-in-depth.md +122 -0
- package/upstream/skills/systematic-debugging/find-polluter.sh +63 -0
- package/upstream/skills/systematic-debugging/root-cause-tracing.md +169 -0
- package/upstream/skills/systematic-debugging/test-academic.md +14 -0
- package/upstream/skills/systematic-debugging/test-pressure-1.md +58 -0
- package/upstream/skills/systematic-debugging/test-pressure-2.md +68 -0
- package/upstream/skills/systematic-debugging/test-pressure-3.md +69 -0
- package/upstream/skills/test-driven-development/SKILL.md +371 -0
- package/upstream/skills/test-driven-development/testing-anti-patterns.md +299 -0
- package/upstream/skills/using-git-worktrees/SKILL.md +218 -0
- package/upstream/skills/using-superpowers/SKILL.md +117 -0
- package/upstream/skills/using-superpowers/references/codex-tools.md +100 -0
- package/upstream/skills/using-superpowers/references/copilot-tools.md +52 -0
- package/upstream/skills/using-superpowers/references/gemini-tools.md +33 -0
- package/upstream/skills/verification-before-completion/SKILL.md +139 -0
- package/upstream/skills/writing-plans/SKILL.md +152 -0
- package/upstream/skills/writing-plans/plan-document-reviewer-prompt.md +49 -0
- package/upstream/skills/writing-skills/SKILL.md +655 -0
- package/upstream/skills/writing-skills/anthropic-best-practices.md +1150 -0
- package/upstream/skills/writing-skills/examples/CLAUDE_MD_TESTING.md +189 -0
- package/upstream/skills/writing-skills/graphviz-conventions.dot +172 -0
- package/upstream/skills/writing-skills/persuasion-principles.md +187 -0
- package/upstream/skills/writing-skills/render-graphs.js +168 -0
- package/upstream/skills/writing-skills/testing-skills-with-subagents.md +384 -0
- package/upstream/tests/brainstorm-server/package-lock.json +36 -0
- package/upstream/tests/brainstorm-server/package.json +10 -0
- package/upstream/tests/brainstorm-server/server.test.js +427 -0
- package/upstream/tests/brainstorm-server/windows-lifecycle.test.sh +351 -0
- package/upstream/tests/brainstorm-server/ws-protocol.test.js +392 -0
- package/upstream/tests/claude-code/README.md +158 -0
- package/upstream/tests/claude-code/analyze-token-usage.py +168 -0
- package/upstream/tests/claude-code/run-skill-tests.sh +187 -0
- package/upstream/tests/claude-code/test-document-review-system.sh +177 -0
- package/upstream/tests/claude-code/test-helpers.sh +202 -0
- package/upstream/tests/claude-code/test-subagent-driven-development-integration.sh +314 -0
- package/upstream/tests/claude-code/test-subagent-driven-development.sh +165 -0
- package/upstream/tests/explicit-skill-requests/prompts/action-oriented.txt +3 -0
- package/upstream/tests/explicit-skill-requests/prompts/after-planning-flow.txt +17 -0
- package/upstream/tests/explicit-skill-requests/prompts/claude-suggested-it.txt +11 -0
- package/upstream/tests/explicit-skill-requests/prompts/i-know-what-sdd-means.txt +8 -0
- package/upstream/tests/explicit-skill-requests/prompts/mid-conversation-execute-plan.txt +3 -0
- package/upstream/tests/explicit-skill-requests/prompts/please-use-brainstorming.txt +1 -0
- package/upstream/tests/explicit-skill-requests/prompts/skip-formalities.txt +3 -0
- package/upstream/tests/explicit-skill-requests/prompts/subagent-driven-development-please.txt +1 -0
- package/upstream/tests/explicit-skill-requests/prompts/use-systematic-debugging.txt +1 -0
- package/upstream/tests/explicit-skill-requests/run-all.sh +70 -0
- package/upstream/tests/explicit-skill-requests/run-claude-describes-sdd.sh +100 -0
- package/upstream/tests/explicit-skill-requests/run-extended-multiturn-test.sh +113 -0
- package/upstream/tests/explicit-skill-requests/run-haiku-test.sh +144 -0
- package/upstream/tests/explicit-skill-requests/run-multiturn-test.sh +143 -0
- package/upstream/tests/explicit-skill-requests/run-test.sh +136 -0
- package/upstream/tests/opencode/run-tests.sh +163 -0
- package/upstream/tests/opencode/setup.sh +88 -0
- package/upstream/tests/opencode/test-plugin-loading.sh +82 -0
- package/upstream/tests/opencode/test-priority.sh +198 -0
- package/upstream/tests/opencode/test-tools.sh +104 -0
- package/upstream/tests/skill-triggering/prompts/dispatching-parallel-agents.txt +8 -0
- package/upstream/tests/skill-triggering/prompts/executing-plans.txt +1 -0
- package/upstream/tests/skill-triggering/prompts/requesting-code-review.txt +3 -0
- package/upstream/tests/skill-triggering/prompts/systematic-debugging.txt +11 -0
- package/upstream/tests/skill-triggering/prompts/test-driven-development.txt +7 -0
- package/upstream/tests/skill-triggering/prompts/writing-plans.txt +10 -0
- package/upstream/tests/skill-triggering/run-all.sh +60 -0
- package/upstream/tests/skill-triggering/run-test.sh +88 -0
- package/upstream/tests/subagent-driven-dev/go-fractals/design.md +81 -0
- package/upstream/tests/subagent-driven-dev/go-fractals/plan.md +172 -0
- package/upstream/tests/subagent-driven-dev/go-fractals/scaffold.sh +45 -0
- package/upstream/tests/subagent-driven-dev/run-test.sh +106 -0
- package/upstream/tests/subagent-driven-dev/svelte-todo/design.md +70 -0
- package/upstream/tests/subagent-driven-dev/svelte-todo/plan.md +222 -0
- 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.
|