@dreki-gg/pi-plan-mode 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +44 -70
- package/extensions/plan-mode/index.ts +463 -548
- package/extensions/plan-mode/utils.ts +26 -11
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @dreki-gg/pi-plan-mode
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`5c9d134`](https://github.com/dreki-gg/pi-extensions/commit/5c9d134131599cd102f77d3849660e3e6f885f70) Thanks [@jalbarrang](https://github.com/jalbarrang)! - Redesign plan mode as a two-phase workflow with file-based handoff
|
|
8
|
+
|
|
9
|
+
- Plan phase uses `claude-opus-4-6:medium` with read-only tools + strict bash allowlist
|
|
10
|
+
- Plans are written to `.plans/<kebab-name>/PLAN.md` with a `START-PROMPT.md` for clean context handoff
|
|
11
|
+
- Execute phase uses `gpt-5.5:low` with full tool access, starting from START-PROMPT.md in a clean context
|
|
12
|
+
- Todo extraction is deferred to execution time (extracted from PLAN.md on "Execute Plan")
|
|
13
|
+
- New menu: Execute Plan, Refine Plan (adversarial self-review), Follow up, Exit plan mode
|
|
14
|
+
- Model and thinking level are saved/restored across phase transitions
|
|
15
|
+
- Removed domain-model, plan-files, and autocomplete sub-workflows
|
|
16
|
+
|
|
3
17
|
## 0.2.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
# @dreki-gg/pi-plan-mode
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Two-phase planning workflow for [pi](https://github.com/badlogic/pi-mono).
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
- locks the agent into a read-only planning pass
|
|
7
|
-
- nudges it to use `questionnaire` before planning when scope is unclear
|
|
8
|
-
- hands off to `/skill:domain-model` when you want terminology/design pressure-testing
|
|
9
|
-
- hands off to `/skill:create-implementation-plans` when you want self-contained `*.plan.md` files
|
|
10
|
-
- restores full tool access for execution once the plan is approved
|
|
5
|
+
Plan with `claude-opus-4-6:medium`, execute with `gpt-5.5:low`. Plans are persisted as files in `.plans/` for clean context handoff between models.
|
|
11
6
|
|
|
12
7
|
## Install
|
|
13
8
|
|
|
@@ -21,89 +16,68 @@ Recommended companions:
|
|
|
21
16
|
pi install npm:@dreki-gg/pi-questionnaire
|
|
22
17
|
```
|
|
23
18
|
|
|
24
|
-
And make sure these skills are available globally or project-locally if you want the full workflow:
|
|
25
|
-
- `domain-model`
|
|
26
|
-
- `create-implementation-plans`
|
|
27
|
-
|
|
28
|
-
If those skills are missing, the extension falls back to plain prompts that emulate the same workflow.
|
|
29
|
-
|
|
30
19
|
## What it provides
|
|
31
20
|
|
|
32
|
-
| Feature
|
|
33
|
-
|
|
34
|
-
| Flag
|
|
35
|
-
| Command
|
|
36
|
-
| Command
|
|
37
|
-
|
|
|
38
|
-
| Command | `/plan-plans [prompt]` | Generate self-contained implementation plan files |
|
|
39
|
-
| Command | `/plan-execute [prompt]` | Restore full tool access and execute the approved plan |
|
|
40
|
-
| Shortcut | `Ctrl+Alt+P` | Toggle plan mode |
|
|
21
|
+
| Feature | Name | Notes |
|
|
22
|
+
| -------- | -------------- | ---------------------------------------------- |
|
|
23
|
+
| Flag | `--plan` | Start pi in plan mode |
|
|
24
|
+
| Command | `/plan [prompt]` | Enter plan mode, optionally with a starting prompt |
|
|
25
|
+
| Command | `/todos` | Show current plan progress |
|
|
26
|
+
| Shortcut | `Ctrl+Alt+P` | Toggle plan mode |
|
|
41
27
|
|
|
42
28
|
## Workflow
|
|
43
29
|
|
|
44
|
-
### 1.
|
|
30
|
+
### 1. Plan (`claude-opus-4-6:medium`)
|
|
45
31
|
|
|
46
32
|
```text
|
|
47
|
-
/plan add
|
|
33
|
+
/plan add authentication middleware with JWT support
|
|
48
34
|
```
|
|
49
35
|
|
|
50
|
-
|
|
51
|
-
- `read`
|
|
52
|
-
- `bash` (allowlisted read-only commands only)
|
|
53
|
-
- `grep`
|
|
54
|
-
- `find`
|
|
55
|
-
- `ls`
|
|
56
|
-
- `questionnaire` (if installed)
|
|
57
|
-
- `lsp` / `context7_*` (if installed)
|
|
36
|
+
The planner has access to read-only tools plus `edit`/`write` restricted to `.plans/` files. Bash is locked to a strict allowlist of safe commands.
|
|
58
37
|
|
|
59
|
-
The
|
|
60
|
-
-
|
|
61
|
-
-
|
|
62
|
-
-
|
|
63
|
-
-
|
|
38
|
+
The planner:
|
|
39
|
+
- Inspects the codebase using read-only tools
|
|
40
|
+
- Uses `questionnaire` when requirements are underspecified
|
|
41
|
+
- Creates `.plans/<kebab-name>/PLAN.md` with the full numbered plan
|
|
42
|
+
- Creates `.plans/<kebab-name>/START-PROMPT.md` — a self-contained handoff prompt with all context needed to execute without the planning conversation
|
|
43
|
+
- Can add supporting files in the same directory for extra context
|
|
64
44
|
|
|
65
|
-
### 2.
|
|
45
|
+
### 2. Choose next step
|
|
66
46
|
|
|
67
|
-
|
|
68
|
-
/plan-domain
|
|
69
|
-
```
|
|
47
|
+
When the planner finishes, a menu appears:
|
|
70
48
|
|
|
71
|
-
|
|
49
|
+
| Option | Description |
|
|
50
|
+
| ---------------- | ---------------------------------------------------------------------- |
|
|
51
|
+
| **Execute Plan** | Extract todos from PLAN.md, switch to gpt-5.5:low, start with START-PROMPT.md |
|
|
52
|
+
| **Refine Plan** | Adversarial review — planner critiques its own plan and updates files |
|
|
53
|
+
| **Follow up** | Open an editor for additional instructions to the planner |
|
|
54
|
+
| **Exit plan mode** | Disable plan mode and restore original model |
|
|
72
55
|
|
|
73
|
-
|
|
74
|
-
/skill:domain-model
|
|
75
|
-
```
|
|
56
|
+
### 3. Execute (`gpt-5.5:low`)
|
|
76
57
|
|
|
77
|
-
|
|
58
|
+
When **Execute Plan** is selected:
|
|
59
|
+
1. Todos are extracted from `PLAN.md`
|
|
60
|
+
2. Model switches to `gpt-5.5:low` with full tool access
|
|
61
|
+
3. The executor starts with a **clean context window** using `START-PROMPT.md`
|
|
62
|
+
4. Each step must be marked with `[DONE:n]` before moving to the next
|
|
63
|
+
5. Progress is tracked in a widget in the status bar
|
|
64
|
+
6. When all steps complete, the original model and thinking level are restored
|
|
78
65
|
|
|
79
|
-
|
|
66
|
+
## Plan directory structure
|
|
80
67
|
|
|
81
|
-
```text
|
|
82
|
-
/plan-plans
|
|
83
68
|
```
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
```text
|
|
90
|
-
/skill:create-implementation-plans
|
|
69
|
+
.plans/
|
|
70
|
+
└── add-auth-middleware/
|
|
71
|
+
├── PLAN.md # Numbered plan with context
|
|
72
|
+
├── START-PROMPT.md # Self-contained executor handoff prompt
|
|
73
|
+
└── ... # Optional supporting files
|
|
91
74
|
```
|
|
92
75
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
### 4. Execute
|
|
96
|
-
|
|
97
|
-
```text
|
|
98
|
-
/plan-execute
|
|
99
|
-
```
|
|
76
|
+
## Footer indicators
|
|
100
77
|
|
|
101
|
-
|
|
78
|
+
- `📝 plan` — plan mode active (opus-4-6:medium, strict bash)
|
|
79
|
+
- `📋 exec 2/5` — executing plan with gpt-5.5:low, 2 of 5 steps done
|
|
102
80
|
|
|
103
|
-
##
|
|
81
|
+
## Bash safety
|
|
104
82
|
|
|
105
|
-
|
|
106
|
-
- `bash` is restricted to read-only commands while planning.
|
|
107
|
-
- Plan steps are extracted from `Plan:` sections and shown in a widget/status area.
|
|
108
|
-
- State is persisted across session resume and tree navigation.
|
|
109
|
-
- The implementation-plan phase is a **controlled write phase** intended for planning docs, not code changes.
|
|
83
|
+
In plan mode, bash is restricted to read-only commands (ls, grep, git status, cat, rg, etc.). Destructive commands (rm, mv, git commit, etc.) are blocked.
|