@relipa/ai-flow-kit 0.0.3 → 0.0.4-beta.2
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 +27 -1
- package/QUICK_START.md +20 -6
- package/README.md +27 -0
- package/bin/aiflow.js +5 -0
- package/custom/templates/laravel.md +15 -90
- package/custom/templates/nestjs.md +72 -0
- package/custom/templates/nextjs.md +14 -89
- package/custom/templates/nodejs-express.md +73 -0
- package/custom/templates/python-django.md +71 -0
- package/custom/templates/python-fastapi.md +54 -0
- package/custom/templates/reactjs.md +492 -567
- package/custom/templates/shared/gate-workflow.md +75 -0
- package/custom/templates/spring-boot.md +523 -598
- package/custom/templates/tools/copilot.md +8 -0
- package/custom/templates/tools/cursor.md +8 -0
- package/custom/templates/tools/gemini.md +8 -0
- package/custom/templates/tools/generic.md +12 -0
- package/custom/templates/vue-nuxt.md +14 -89
- package/docs/ai-integration.md +53 -0
- package/docs/developer-overview.md +126 -0
- package/package.json +1 -1
- package/scripts/hooks/session-start.js +2 -1
- package/scripts/init.js +460 -453
- package/scripts/prompt.js +12 -2
- package/scripts/use.js +594 -570
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# GitHub Copilot Custom Instructions
|
|
2
|
+
|
|
3
|
+
You are an expert AI assistant specialized in this project's stack. Follow the Gate Workflow and Team Rules strictly.
|
|
4
|
+
|
|
5
|
+
> [!IMPORTANT]
|
|
6
|
+
> Always check for context in `.claude/context/current.json` and progress in the `plan/` folder before suggesting changes.
|
|
7
|
+
|
|
8
|
+
If the Gate Workflow hasn't started, wait for the developer to type **"start"** or **"Gate 1"**.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Cursor AI Project Rules
|
|
2
|
+
|
|
3
|
+
You are an expert AI assistant specialized in this project's stack. Follow the Gate Workflow and Team Rules strictly.
|
|
4
|
+
|
|
5
|
+
> [!IMPORTANT]
|
|
6
|
+
> Always check `.claude/context/current.json` and the `plan/` directory before starting any task to understand current context and progress.
|
|
7
|
+
|
|
8
|
+
If Gate 1 doesn't auto-start, wait for the developer to type **"start"**, **"Gate 1"** or **"Analyze ticket"**.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Gemini AI System Instructions
|
|
2
|
+
|
|
3
|
+
You are an expert AI assistant specialized in this project's stack. Follow the Gate Workflow and Team Rules strictly.
|
|
4
|
+
|
|
5
|
+
> [!IMPORTANT]
|
|
6
|
+
> When starting a session, always read `.claude/context/current.json` to load ticket context and check the `plan/` directory for existing progress.
|
|
7
|
+
|
|
8
|
+
If no instructions are automatically followed, wait for the developer to type **"start"** or **"Gate 1"** to start the analysis.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# AI System Instructions
|
|
2
|
+
|
|
3
|
+
You are an expert AI assistant. Follow the project's Gate Workflow and Team Rules strictly.
|
|
4
|
+
|
|
5
|
+
## Context Awareness
|
|
6
|
+
- **Ticket context**: `.claude/context/current.json`
|
|
7
|
+
- **Task progress**: `plan/[ticket-id]/`
|
|
8
|
+
- **Rules**: `.rules/`
|
|
9
|
+
|
|
10
|
+
Follow the gated workflow and rules defined below.
|
|
11
|
+
|
|
12
|
+
If Gate 1 does not start automatically, please start it when the developer types **"Gate 1"**.
|
|
@@ -1,89 +1,14 @@
|
|
|
1
|
-
# Vue/Nuxt.js AI System Prompt
|
|
2
|
-
|
|
3
|
-
You are an expert Vue.js & Nuxt 3 developer. Follow these rules.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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 `<script setup lang="ts">` with Composition API exclusively. Do not use the Options API.
|
|
83
|
-
- Use explicit Nuxt auto-imports where appropriate, but maintain clarity on complex utilities.
|
|
84
|
-
- For state management, prefer Pinia or native `useState` bindings in Nuxt.
|
|
85
|
-
- Use `useFetch` or `useAsyncData` for server-side data fetching. Use `$fetch` for client-side API requests outside component initialization.
|
|
86
|
-
- Keep components small and specialized.
|
|
87
|
-
- Adhere to the official Vue Style Guide (Priority A and B).
|
|
88
|
-
|
|
89
|
-
Ensure code is strictly typed with TypeScript.
|
|
1
|
+
# Vue/Nuxt.js AI System Prompt
|
|
2
|
+
|
|
3
|
+
You are an expert Vue.js & Nuxt 3 developer. Follow these rules.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
- Use `<script setup lang="ts">` with Composition API exclusively. Do not use the Options API.
|
|
8
|
+
- Use explicit Nuxt auto-imports where appropriate, but maintain clarity on complex utilities.
|
|
9
|
+
- For state management, prefer Pinia or native `useState` bindings in Nuxt.
|
|
10
|
+
- Use `useFetch` or `useAsyncData` for server-side data fetching. Use `$fetch` for client-side API requests outside component initialization.
|
|
11
|
+
- Keep components small and specialized.
|
|
12
|
+
- Adhere to the official Vue Style Guide (Priority A and B).
|
|
13
|
+
|
|
14
|
+
Ensure code is strictly typed with TypeScript.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Multi-AI Environment Integration
|
|
2
|
+
|
|
3
|
+
`ai-flow-kit` is designed to be tool-agnostic. While it works best with Claude Code CLI due to deep MCP integration, you can use it with any AI tool.
|
|
4
|
+
|
|
5
|
+
## Supported Environments
|
|
6
|
+
|
|
7
|
+
| Tool | Instruction File | Support Level | Key Features |
|
|
8
|
+
|------|------------------|---------------|--------------|
|
|
9
|
+
| **Claude Code** | `CLAUDE.md` | Native (Best) | Auto-triggers, full MCP access, session hooks. |
|
|
10
|
+
| **Cursor** | `.cursorrules` | High | Project-wide rules, `@Codebase` context. |
|
|
11
|
+
| **Gemini CLI** | `GEMINI.md` | Medium | System instructions support. |
|
|
12
|
+
| **GitHub Copilot** | `.github/copilot-instructions.md` | Medium | Inline suggestions, custom instructions. |
|
|
13
|
+
| **OpenCode / Generic** | `AI_INSTRUCTIONS.md` | General | Manual context loading. |
|
|
14
|
+
|
|
15
|
+
---
|
|
16
|
+
|
|
17
|
+
## Tool-Specific Setup
|
|
18
|
+
|
|
19
|
+
### 1. Cursor AI
|
|
20
|
+
When you run `aiflow init`, it generates a `.cursorrules` file.
|
|
21
|
+
- Cursor will automatically read this file to understand the **Gate Workflow**.
|
|
22
|
+
- Use `@Codebase` when you need the AI to search across your whole project.
|
|
23
|
+
- **Resumption**: If you start a task in Claude Code and switch to Cursor, Cursor will see the generated `plan/` files and resume from where you left off.
|
|
24
|
+
|
|
25
|
+
### 2. Gemini CLI
|
|
26
|
+
Pass `GEMINI.md` as system instructions to your Gemini session.
|
|
27
|
+
- **Tip**: Always ensure the AI reads `.claude/context/current.json` first to load the ticket context.
|
|
28
|
+
- Gemini is excellent for large context analysis during Gate 1.
|
|
29
|
+
|
|
30
|
+
### 3. GitHub Copilot / Codex
|
|
31
|
+
Copilot uses `.github/copilot-instructions.md` to guide its suggestions.
|
|
32
|
+
- This ensures that Copilot's inline completions follow your project's architecture and team rules.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Cross-Tool State Resumption
|
|
37
|
+
The "Secret Sauce" of `ai-flow-kit` is its file-based state management:
|
|
38
|
+
|
|
39
|
+
1. **Context**: Saved in `.claude/context/current.json`.
|
|
40
|
+
2. **Progress**: Saved as Markdown docs in `plan/[ticket-id]/`.
|
|
41
|
+
3. **Rules**: Saved in `.rules/`.
|
|
42
|
+
|
|
43
|
+
Because these are standard files, any AI tool can read them. You can:
|
|
44
|
+
1. Start **Gate 1** (Analysis) in Claude Code.
|
|
45
|
+
2. Review and **Approve** the requirement doc.
|
|
46
|
+
3. Switch to **Cursor** for **Gate 3** (Coding) because you prefer the IDE integrations.
|
|
47
|
+
4. Switch back to **Claude Code** for **Gate 4** (Self-Review) to use its automated testing power.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Best Practices
|
|
52
|
+
- **Always Approve Docs**: Ensure `requirement.md` and `plan.md` are approved (you can just type "APPROVED" in the chat or edit the file to say so).
|
|
53
|
+
- **Update Status**: If you make progress in a tool that doesn't have hooks, manually update the `summary.md` or the ticket status.
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# AI Flow Kit — Developer Rollout Guide
|
|
2
|
+
|
|
3
|
+
Welcome to the **AI Flow Kit**! This guide is designed to get you up and running with our standardized AI development workflow.
|
|
4
|
+
|
|
5
|
+
## 1. What is AI Flow Kit?
|
|
6
|
+
|
|
7
|
+
It's a "Zero-Config" framework for AI-assisted development. It automatically:
|
|
8
|
+
- Pulls ticket context (requirements, comments) from Backlog/Jira.
|
|
9
|
+
- Orchestrates a **5-Gate Workflow** (Analyze → Plan → Code → Review → PR).
|
|
10
|
+
- Enforces team coding standards and architecture rules.
|
|
11
|
+
- Synchronizes state across different AI tools (Claude, Cursor, Gemini).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 2. Prerequisites
|
|
16
|
+
|
|
17
|
+
Before starting, ensure you have:
|
|
18
|
+
1. **Node.js** (v18 or higher).
|
|
19
|
+
2. **AI Tool(s)**:
|
|
20
|
+
- **Claude Code CLI** (Recommended for analysis and heavy tasks).
|
|
21
|
+
- **Cursor AI** (Recommended for coding and UI work).
|
|
22
|
+
- **Gemini CLI** or **GitHub Copilot** (Alternative options).
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 3. Installation
|
|
27
|
+
|
|
28
|
+
Run this command to install the CLI tool globally:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Stable version
|
|
32
|
+
npm install -g @relipa/ai-flow-kit
|
|
33
|
+
|
|
34
|
+
# Beta version (recommend for newest features)
|
|
35
|
+
npm install -g @relipa/ai-flow-kit@beta
|
|
36
|
+
|
|
37
|
+
# Verification
|
|
38
|
+
aiflow --version
|
|
39
|
+
|
|
40
|
+
# Uninstall
|
|
41
|
+
npm uninstall -g @relipa/ai-flow-kit
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 4. First-time Setup
|
|
46
|
+
|
|
47
|
+
In your project root, run:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
aiflow init --framework [your-framework] --adapter [backlog/jira]
|
|
51
|
+
```
|
|
52
|
+
*Example: `aiflow init --framework nestjs --adapter backlog`*
|
|
53
|
+
|
|
54
|
+
**What this does:**
|
|
55
|
+
1. Verifies your API keys.
|
|
56
|
+
2. Creates instruction files: `CLAUDE.md`, `.cursorrules`, `GEMINI.md`.
|
|
57
|
+
3. Installs "Superpowers" skills.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 5. Daily Task Workflow (The 5 Gates)
|
|
62
|
+
|
|
63
|
+
### Step 1: Start a Task
|
|
64
|
+
Load the ticket context from your issue tracker:
|
|
65
|
+
```bash
|
|
66
|
+
aiflow use PROJ-33
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Step 2: Open your AI Tool
|
|
70
|
+
- **Claude Code**: Type `claude`. The AI will automatically start **Gate 1**.
|
|
71
|
+
- **Cursor**: Just start chatting with Cursor. It will detect the active ticket and start analyzing.
|
|
72
|
+
|
|
73
|
+
### Step 3: Follow the Gates
|
|
74
|
+
The AI *must* pass each gate in order. You act as the **Reviewer**.
|
|
75
|
+
|
|
76
|
+
1. **⛩️ Gate 1: Requirement Analysis**
|
|
77
|
+
- AI reads code + ticket.
|
|
78
|
+
- AI outputs `plan/PROJ-33/requirement.md`.
|
|
79
|
+
- **Your Action**: Read the doc. If OK, type `APPROVED`.
|
|
80
|
+
|
|
81
|
+
2. **⛩️ Gate 2: Implementation Plan**
|
|
82
|
+
- AI creates a step-by-step TDD plan.
|
|
83
|
+
- **Your Action**: Type `APPROVED` to start coding.
|
|
84
|
+
|
|
85
|
+
3. **⛩️ Gate 3: Coding (TDD)**
|
|
86
|
+
- AI writes tests first, then code.
|
|
87
|
+
- **Your Action**: Monitor.
|
|
88
|
+
|
|
89
|
+
4. **⛩️ Gate 4: Self-Review**
|
|
90
|
+
- AI verifies tests and checks a review-checklist.
|
|
91
|
+
- **Your Action**: Review the final diff. If OK, type `APPROVED`.
|
|
92
|
+
|
|
93
|
+
5. **⛩️ Gate 5: Pull Request**
|
|
94
|
+
- AI helps you write a detailed PR description.
|
|
95
|
+
- **Your Action**: Create the PR and ask for a peer review.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 6. Switching AI Tools Mid-Task
|
|
100
|
+
|
|
101
|
+
You can switch tools at any time because the "brain" (the State) is stored in your project files.
|
|
102
|
+
|
|
103
|
+
**Example Scenario:**
|
|
104
|
+
1. Use **Claude Code CLI** for **Gate 1** (Analysis) because it's great at exploring many files.
|
|
105
|
+
2. Once you type `APPROVED`, close Claude.
|
|
106
|
+
3. Open **Cursor** for **Gate 3** (Coding) to take advantage of its excellent editor integration. Cursor will see you've already finished the analysis and will continue from the plan.
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 7. Best Practices
|
|
111
|
+
|
|
112
|
+
- **One question at a time**: If the AI asks 5 questions, answer them one by one or ignore the irrelevant ones.
|
|
113
|
+
- **Small commits**: Let the AI commit frequently (default behavior).
|
|
114
|
+
- **Be the Pilot**: The AI is your co-pilot. If its solution looks over-engineered, tell it: *"Simplify this by using [X] pattern"*.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## 8. Troubleshooting
|
|
119
|
+
|
|
120
|
+
- **AI is stuck**: Type `reset context` or use `aiflow doctor` to check setup.
|
|
121
|
+
- **Credentials fail**: Re-run `aiflow init --adapter backlog` to update keys.
|
|
122
|
+
- **Rules not followed**: Remind the AI: *"Follow the rules in CLAUDE.md"*.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
**Happy Coding!** สำหรับรายละเอียดเชิงลึก โปรดดู [AIFLOW.md](../AIFLOW.md).
|
package/package.json
CHANGED
|
@@ -134,7 +134,8 @@ function buildContextPrompt(ctx) {
|
|
|
134
134
|
lines.push('6. Display GATE 1 prompt and wait for APPROVED');
|
|
135
135
|
lines.push('');
|
|
136
136
|
lines.push('DO NOT wait for the developer to ask. START NOW.');
|
|
137
|
+
lines.push('If you have not started automatically, begin as soon as the developer types **"start"**.');
|
|
137
138
|
lines.push('</ACTIVE_TASK>');
|
|
138
139
|
|
|
139
140
|
return lines.join('\n');
|
|
140
|
-
}
|
|
141
|
+
}
|