planflow-ai 1.0.4 → 1.0.6
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/package.json +1 -1
- package/rules/core/autopilot-mode.mdc +106 -95
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ alwaysApply: true
|
|
|
7
7
|
|
|
8
8
|
## Purpose
|
|
9
9
|
|
|
10
|
-
When `flow/.autopilot` exists, this rule is active. It automatically orchestrates the full plan-flow workflow for feature requests
|
|
10
|
+
When `flow/.autopilot` exists, this rule is active. It automatically orchestrates the full plan-flow workflow for feature requests. **You MUST follow every step below in order. Do NOT skip steps. Do NOT jump to implementation without discovery and planning first.**
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
@@ -23,137 +23,150 @@ When `flow/.autopilot` exists, this rule is active. It automatically orchestrate
|
|
|
23
23
|
|
|
24
24
|
When autopilot is ON, classify every new user input before acting:
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
| Category | Signals | Action |
|
|
27
|
+
|----------|---------|--------|
|
|
28
|
+
| Slash Command | Input starts with `/` | Run that command normally. Do NOT trigger the flow. |
|
|
29
|
+
| Question/Exploration | Asking about code, explanations, help | Answer normally. Do NOT trigger the flow. |
|
|
30
|
+
| Trivial Task | Single-file change, obvious fix, complexity 0-2 | Execute directly. Do NOT trigger the flow. |
|
|
31
|
+
| **Feature Request** | New functionality, behavior changes, multi-file scope, complexity 3+ | **TRIGGER THE FULL FLOW BELOW. You MUST complete ALL 6 steps in order.** |
|
|
29
32
|
|
|
30
|
-
###
|
|
31
|
-
**Signals**: User is asking about code, requesting explanations, exploring the codebase, or asking for help.
|
|
32
|
-
**Examples**: "What does this function do?", "How does auth work here?", "Show me the API routes"
|
|
33
|
-
**Action**: Answer normally. Do NOT trigger the flow.
|
|
33
|
+
### When Uncertain
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
**Signals**: Single-file change, obvious fix, user specifies exact change, no architectural decisions needed. Estimated complexity 0-2.
|
|
37
|
-
**Examples**: "Fix the typo in README", "Rename this variable to camelCase", "Add a missing import"
|
|
38
|
-
**Action**: Execute directly. Do NOT trigger the flow.
|
|
35
|
+
Ask the user directly: "I'm in autopilot mode. Should I run the full flow (discovery → plan → execute → review) for this, or just handle it directly?"
|
|
39
36
|
|
|
40
|
-
|
|
41
|
-
**Signals**: Adding new functionality, behavior changes, multi-file scope, mentions creating/building/implementing, references APIs/integrations/components. Estimated complexity 3+.
|
|
42
|
-
**Examples**: "Add dark mode support", "Implement user authentication", "Create a new API endpoint for payments"
|
|
43
|
-
**Action**: **Trigger the full flow** (see below).
|
|
37
|
+
---
|
|
44
38
|
|
|
45
|
-
|
|
46
|
-
If the input doesn't clearly fit a category, use the `AskUserQuestion` tool:
|
|
47
|
-
|
|
48
|
-
```typescript
|
|
49
|
-
AskUserQuestion({
|
|
50
|
-
questions: [{
|
|
51
|
-
question: "I'm in autopilot mode. How should I handle this request?",
|
|
52
|
-
header: "Flow mode",
|
|
53
|
-
options: [
|
|
54
|
-
{ label: "Run full flow", description: "Run the full workflow: discovery → plan → execute → review" },
|
|
55
|
-
{ label: "Handle directly", description: "Just handle this task directly without the full flow" }
|
|
56
|
-
],
|
|
57
|
-
multiSelect: false
|
|
58
|
-
}]
|
|
59
|
-
})
|
|
60
|
-
```
|
|
39
|
+
## FULL FLOW — 6 MANDATORY STEPS
|
|
61
40
|
|
|
62
|
-
|
|
41
|
+
**CRITICAL**: When a feature request is detected, you MUST execute ALL 6 steps below in order. **Do NOT skip discovery. Do NOT skip planning. Do NOT jump to writing code.**
|
|
63
42
|
|
|
64
|
-
|
|
43
|
+
The flow is: **Contracts → Discovery → Plan → Execute → Review → Archive**
|
|
65
44
|
|
|
66
|
-
|
|
45
|
+
---
|
|
67
46
|
|
|
68
47
|
### Step 1: Check Contracts
|
|
69
48
|
|
|
70
|
-
Check `flow/contracts/` for any relevant integration contracts. If found, note them for
|
|
49
|
+
Check `flow/contracts/` for any relevant integration contracts. If found, note them for Step 2.
|
|
50
|
+
|
|
51
|
+
---
|
|
71
52
|
|
|
72
|
-
### Step 2: Discovery
|
|
53
|
+
### Step 2: Discovery (MANDATORY — Do NOT skip)
|
|
73
54
|
|
|
74
|
-
|
|
75
|
-
2. Execute the discovery skill following that command's instructions
|
|
76
|
-
3. **PAUSE**: Ask user discovery questions as needed (mandatory checkpoint)
|
|
77
|
-
4. Produce the discovery document in `flow/discovery/`
|
|
78
|
-
5. Write transition summary (see format below)
|
|
79
|
-
6. **Auto-proceed** to Step 3 (override the "ask before proceeding" rule)
|
|
55
|
+
**PURPOSE**: Gather requirements, search the codebase for context, ask clarifying questions. **NO CODE is written in this step.**
|
|
80
56
|
|
|
81
|
-
|
|
57
|
+
**What to do**:
|
|
82
58
|
|
|
83
|
-
|
|
59
|
+
1. Read the file `.cursor/commands/discovery-plan.md` for detailed instructions
|
|
60
|
+
2. Search the codebase to find all files related to the feature (components, types, API routes, stores, tests)
|
|
61
|
+
3. Read referenced documents or contracts if any
|
|
62
|
+
4. **PAUSE and ask the user clarifying questions** about requirements — this is a mandatory checkpoint
|
|
63
|
+
5. Document requirements as: Functional (FR-), Non-Functional (NFR-), Constraints (C-)
|
|
64
|
+
6. Identify technical considerations, risks, and proposed approach (high-level, NO code)
|
|
65
|
+
7. **Save the discovery document** to `flow/discovery/discovery_<feature>_v1.md`
|
|
84
66
|
|
|
85
|
-
|
|
86
|
-
2. **Read** the create-plan command to load planning context
|
|
87
|
-
3. Execute the create-plan skill with the discovery document as input
|
|
88
|
-
4. **PAUSE**: Present the plan for user approval (mandatory checkpoint)
|
|
89
|
-
5. Wait for user to approve the plan before proceeding
|
|
90
|
-
6. Produce the plan document in `flow/plans/`
|
|
91
|
-
7. Write transition summary
|
|
92
|
-
8. **Auto-proceed** to Step 4 (override the "no auto-chaining" rule)
|
|
67
|
+
**Output**: A discovery markdown file in `flow/discovery/`
|
|
93
68
|
|
|
94
|
-
|
|
69
|
+
**FORBIDDEN during discovery**: Writing code, editing source files, creating plans, running build/test commands
|
|
95
70
|
|
|
96
|
-
|
|
97
|
-
2. Execute the plan following complexity-based grouping strategy
|
|
98
|
-
3. Update the plan file with progress
|
|
99
|
-
4. Run build + test verification at the end
|
|
100
|
-
5. Write transition summary
|
|
101
|
-
6. **Auto-proceed** to Step 5
|
|
71
|
+
**After completing discovery**: Auto-proceed to Step 3. Do NOT ask "Would you like to proceed?" — just continue.
|
|
102
72
|
|
|
103
|
-
|
|
73
|
+
---
|
|
104
74
|
|
|
105
|
-
|
|
106
|
-
2. Review all uncommitted changes
|
|
107
|
-
3. Present the review summary
|
|
75
|
+
### Step 3: Create Plan (MANDATORY — Do NOT skip)
|
|
108
76
|
|
|
109
|
-
|
|
77
|
+
**GATE CHECK**: Before this step, verify that Step 2 produced a discovery document in `flow/discovery/`. **If no discovery document exists, go back to Step 2. A plan CANNOT be created without discovery. No exceptions.**
|
|
110
78
|
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
79
|
+
**What to do**:
|
|
80
|
+
|
|
81
|
+
1. Read the file `.cursor/commands/create-plan.md` for detailed instructions
|
|
82
|
+
2. Read the discovery document created in Step 2
|
|
83
|
+
3. Extract requirements (FR, NFR, Constraints) from discovery
|
|
84
|
+
4. Create phases with complexity scores (0-10) for each phase
|
|
85
|
+
5. Tests MUST be the last phase
|
|
86
|
+
6. Include a Key Changes section
|
|
87
|
+
7. **Save the plan** to `flow/plans/plan_<feature>_v1.md`
|
|
88
|
+
8. **PAUSE and present the plan for user approval** — this is a mandatory checkpoint
|
|
89
|
+
9. Wait for user to approve before proceeding
|
|
90
|
+
|
|
91
|
+
**Output**: A plan markdown file in `flow/plans/`
|
|
92
|
+
|
|
93
|
+
**FORBIDDEN during planning**: Writing code, editing source files, running build/test commands
|
|
94
|
+
|
|
95
|
+
**After user approves**: Auto-proceed to Step 4.
|
|
115
96
|
|
|
116
97
|
---
|
|
117
98
|
|
|
118
|
-
|
|
99
|
+
### Step 4: Execute Plan
|
|
119
100
|
|
|
120
|
-
|
|
101
|
+
**What to do**:
|
|
121
102
|
|
|
122
|
-
|
|
123
|
-
|
|
103
|
+
1. Read the file `.cursor/commands/execute-plan.md` for detailed instructions
|
|
104
|
+
2. Read the plan file created in Step 3
|
|
105
|
+
3. Execute phases following complexity-based grouping:
|
|
106
|
+
- Combined score ≤ 6: Aggregate phases together
|
|
107
|
+
- Combined score 7-10: Execute 1-2 phases at a time
|
|
108
|
+
- Combined score > 10: Execute one phase at a time
|
|
109
|
+
- Tests phase: Always execute separately
|
|
110
|
+
4. For each phase: implement the code, then mark tasks complete in the plan file
|
|
111
|
+
5. **Run build + test verification ONLY at the very end** (not between phases)
|
|
112
|
+
6. Update the plan file with progress after each phase
|
|
124
113
|
|
|
125
|
-
**
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
**
|
|
132
|
-
|
|
133
|
-
|
|
114
|
+
**After execution completes**: Auto-proceed to Step 5.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
### Step 5: Review Code
|
|
119
|
+
|
|
120
|
+
**What to do**:
|
|
121
|
+
|
|
122
|
+
1. Read the file `.cursor/commands/review-code.md` for detailed instructions
|
|
123
|
+
2. Review all uncommitted changes (git diff)
|
|
124
|
+
3. Check for pattern consistency, security issues, and code quality
|
|
125
|
+
4. Present a review summary
|
|
126
|
+
|
|
127
|
+
**After review**: Auto-proceed to Step 6.
|
|
134
128
|
|
|
135
129
|
---
|
|
136
130
|
|
|
137
|
-
|
|
131
|
+
### Step 6: Archive and Complete
|
|
138
132
|
|
|
139
|
-
|
|
133
|
+
1. Move the discovery document to `flow/archive/`
|
|
134
|
+
2. Move the plan document to `flow/archive/`
|
|
135
|
+
3. Present completion summary:
|
|
140
136
|
|
|
141
137
|
```
|
|
142
138
|
Flow complete! All artifacts archived.
|
|
143
139
|
|
|
144
|
-
|
|
140
|
+
Summary:
|
|
145
141
|
- Discovery: archived
|
|
146
142
|
- Plan: archived
|
|
147
143
|
- Code: reviewed
|
|
148
144
|
- Build: passing
|
|
149
145
|
- Tests: passing
|
|
150
146
|
|
|
151
|
-
For best results on your next feature, consider starting a fresh context with `/clear`.
|
|
152
147
|
Ready for the next task?
|
|
153
148
|
```
|
|
154
149
|
|
|
155
150
|
---
|
|
156
151
|
|
|
152
|
+
## Transition Summary Format
|
|
153
|
+
|
|
154
|
+
At each step boundary, write this brief summary:
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
## Flow Progress
|
|
158
|
+
|
|
159
|
+
**Feature**: [feature name]
|
|
160
|
+
**Current Step**: [N] of 6
|
|
161
|
+
**Completed**:
|
|
162
|
+
- Step 1: Contracts check → [found/none]
|
|
163
|
+
- Step 2: Discovery → `flow/discovery/discovery_<feature>_v1.md`
|
|
164
|
+
- Step 3: Plan → `flow/plans/plan_<feature>_v1.md`
|
|
165
|
+
**Next**: [description of next step]
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
157
170
|
## Mandatory Checkpoints
|
|
158
171
|
|
|
159
172
|
Even in autopilot, these checkpoints **always** pause for user input:
|
|
@@ -161,12 +174,10 @@ Even in autopilot, these checkpoints **always** pause for user input:
|
|
|
161
174
|
| Checkpoint | When | Why |
|
|
162
175
|
| --- | --- | --- |
|
|
163
176
|
| Discovery Q&A | Step 2 | User must answer requirements questions |
|
|
164
|
-
| Discovery Gate | Step 2→3 | Discovery document
|
|
165
|
-
| Plan Approval | Step 3 | User must
|
|
166
|
-
|
|
167
|
-
All other transitions happen automatically.
|
|
177
|
+
| Discovery Gate | Step 2→3 | Discovery document MUST exist before plan. No exceptions. |
|
|
178
|
+
| Plan Approval | Step 3 | User must approve plan before execution begins |
|
|
168
179
|
|
|
169
|
-
|
|
180
|
+
All other transitions happen automatically without asking.
|
|
170
181
|
|
|
171
182
|
---
|
|
172
183
|
|
|
@@ -174,10 +185,10 @@ All other transitions happen automatically.
|
|
|
174
185
|
|
|
175
186
|
When autopilot is ON, the following rules in individual commands are **suspended**:
|
|
176
187
|
|
|
177
|
-
-
|
|
178
|
-
-
|
|
179
|
-
-
|
|
180
|
-
-
|
|
188
|
+
- `.cursor/commands/discovery-plan.md`: "Ask Before Proceeding" and "No Auto-Execution" rules
|
|
189
|
+
- `.cursor/commands/create-plan.md`: "No Auto-Chaining" and "Complete and Stop" rules
|
|
190
|
+
- `.cursor/commands/execute-plan.md`: "Complete and Stop" rule
|
|
191
|
+
- `.cursor/commands/review-code.md`: completion stop behavior
|
|
181
192
|
|
|
182
193
|
These rules remain fully active when autopilot is OFF.
|
|
183
194
|
|