opencode-plan-manager 0.2.1 → 0.4.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/README.md +127 -33
- package/dist/index.js +107 -105
- package/package.json +58 -39
package/README.md
CHANGED
|
@@ -11,6 +11,44 @@ OpenCode Plan Manager is a high-performance, minimalist plugin designed to bridg
|
|
|
11
11
|
|
|
12
12
|
---
|
|
13
13
|
|
|
14
|
+
<details>
|
|
15
|
+
<summary><strong>⚠️ v0.3.0 Breaking Changes – Read Before Upgrading!</strong></summary>
|
|
16
|
+
|
|
17
|
+
#### **This release introduces breaking changes that affect file structure, field names, and plan format.**
|
|
18
|
+
|
|
19
|
+
If you are upgrading from v0.2.x, you MUST migrate all existing plans and metadata for compatibility.
|
|
20
|
+
|
|
21
|
+
> Tip: AI Agents can still access old plans by reading their files directly (using Bash/list/read tools), then recreate plans in the new format using the latest plugin's API.
|
|
22
|
+
|
|
23
|
+
**What Changed?**
|
|
24
|
+
|
|
25
|
+
- **File naming:**
|
|
26
|
+
- `spec.md` → `specifications.md`
|
|
27
|
+
- `plan.md` → `implementation.md`
|
|
28
|
+
- **Metadata key:**
|
|
29
|
+
- `"plan_id"` → `"id"` in `metadata.json`
|
|
30
|
+
- **Markdown structure:**
|
|
31
|
+
- All `.md` files now require H1 headers:
|
|
32
|
+
- `# Specifications` at the top of `specifications.md`
|
|
33
|
+
- `# Implementation Plan` at the top of `implementation.md`
|
|
34
|
+
- Phases are now indicated using H2 (`##`) headers, not H3.
|
|
35
|
+
- No more `## Overview/Description` headers—put the summary right after the H1.
|
|
36
|
+
- **Tool arguments:**
|
|
37
|
+
- All APIs expect updated argument keys (e.g., `id` instead of `plan_id`)
|
|
38
|
+
|
|
39
|
+
**How to Migrate?**
|
|
40
|
+
|
|
41
|
+
1. Rename all `spec.md` to `specifications.md` & `plan.md` to `implementation.md` in each plan folder.
|
|
42
|
+
2. Open each `metadata.json` file and rename `plan_id` → `id`.
|
|
43
|
+
3. Update the content of each markdown file to add the correct H1 headers and phase header levels as described above.
|
|
44
|
+
4. Validate your plans by running `plan_list` and `plan_read`.
|
|
45
|
+
|
|
46
|
+
**Older plans will not load or load with errors until they are migrated to the new format.**
|
|
47
|
+
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
14
52
|
## 🧠 Why Plan Manager?
|
|
15
53
|
|
|
16
54
|
In agentic workflows, **Implementation Plans** are the source of truth. However, most implementations suffer from "Token Soup"—where agents are forced to parse massive, unstructured files, leading to hallucinations and lost context.
|
|
@@ -28,10 +66,10 @@ Plan Manager solves this by enforcing **Plan-to-Code Determinism**:
|
|
|
28
66
|
|
|
29
67
|
Add the plugin to your OpenCode configuration file (~/.config/opencode/opencode.json or similar):
|
|
30
68
|
|
|
31
|
-
```
|
|
69
|
+
```jsonc
|
|
32
70
|
{
|
|
33
|
-
|
|
34
|
-
|
|
71
|
+
"$schema": "https://opencode.ai/config.json",
|
|
72
|
+
"plugin": ["opencode-plan-manager@0.2.0"],
|
|
35
73
|
}
|
|
36
74
|
```
|
|
37
75
|
|
|
@@ -39,6 +77,62 @@ Add the plugin to your OpenCode configuration file (~/.config/opencode/opencode.
|
|
|
39
77
|
|
|
40
78
|
---
|
|
41
79
|
|
|
80
|
+
## ⚙️ Configuration
|
|
81
|
+
|
|
82
|
+
Configuration files are loaded with the following precedence (highest to lowest):
|
|
83
|
+
|
|
84
|
+
1. **Local Config:** `<project-root>/.opencode/plan-manager.json` (project-specific settings)
|
|
85
|
+
2. **User Config:** `~/.config/opencode/plan-manager.json` (global user settings)
|
|
86
|
+
3. **Default Config:** Built-in defaults (used when no config files exist)
|
|
87
|
+
|
|
88
|
+
```jsonc
|
|
89
|
+
{
|
|
90
|
+
"outputFormat": "markdown", // "markdown" (default), "json" or "toon" (see https://github.com/toon-format/toon)
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
<details>
|
|
95
|
+
<summary>⚠️ Permission Requirement</summary>
|
|
96
|
+
|
|
97
|
+
> Important:
|
|
98
|
+
> If you deny edit permission in your OpenCode configuration (opencode.json) for the .opencode/plans/\* file pattern, the Plan Manager plugin cannot create or update plans.
|
|
99
|
+
> This is because the plugin uses OpenCode’s built-in ask permission method when modifying plan files. This mechanism shows users a summary of the changes and asks for review (accept/reject) before files are edited, increasing transparency and control.
|
|
100
|
+
|
|
101
|
+
What does this mean?
|
|
102
|
+
|
|
103
|
+
- The plan_create and plan_update actions require that AI agents (Plan and Build) have ask or allow permissions for edit on the .opencode/plans/\* pattern.
|
|
104
|
+
- If permission is set to deny, plan creation and modification will fail, and the workflow will not proceed.
|
|
105
|
+
How to ensure compatibility:
|
|
106
|
+
|
|
107
|
+
1. Open your opencode.json config file (usually at ~/.config/opencode/opencode.json).
|
|
108
|
+
2. Check the permissions for .opencode/plans/\*.
|
|
109
|
+
3. Make sure edit edit permission is set to "ask" or "allow" for both the Plan Agent and Build Agent.
|
|
110
|
+
|
|
111
|
+
Here is an example similar to how I configure permissions for the Plan agent:
|
|
112
|
+
|
|
113
|
+
```jsonc
|
|
114
|
+
{
|
|
115
|
+
"agent": {
|
|
116
|
+
"plan": {
|
|
117
|
+
"permission": {
|
|
118
|
+
"edit": {
|
|
119
|
+
"*": "deny", // Deny edits on everything
|
|
120
|
+
".opencode/plans/*": "ask", // Except for plan files, ask for permission
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
}
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
References:
|
|
129
|
+
|
|
130
|
+
- https://opencode.ai/docs/permissions
|
|
131
|
+
|
|
132
|
+
</details>
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
42
136
|
## 🤖 The Agentic Workflow
|
|
43
137
|
|
|
44
138
|
This plugin is optimized for a dual-agent hierarchy, utilizing specialized prompts found in `src/prompts/`:
|
|
@@ -76,8 +170,8 @@ Plan Manager organizes work into a structured directory tree that both humans an
|
|
|
76
170
|
├── pending/ # New ideas and upcoming features
|
|
77
171
|
│ └── feature_auth/ # Each plan is a dedicated folder
|
|
78
172
|
│ ├── metadata.json
|
|
79
|
-
│ ├──
|
|
80
|
-
│ └──
|
|
173
|
+
│ ├── specifications.md
|
|
174
|
+
│ └── implementation.md
|
|
81
175
|
├── in_progress/ # Currently active development
|
|
82
176
|
└── done/ # Immutable history of completed work
|
|
83
177
|
```
|
|
@@ -92,25 +186,25 @@ Instead of loose markdown, agents use structured objects to ensure every plan ha
|
|
|
92
186
|
|
|
93
187
|
```typescript
|
|
94
188
|
plan_create({
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
189
|
+
title: "JWT Authentication",
|
|
190
|
+
type: "feature",
|
|
191
|
+
description: "Secure auth flow with refresh tokens",
|
|
192
|
+
spec: {
|
|
193
|
+
description: "Implement secure JWT-based authentication",
|
|
194
|
+
functionals: ["User login", "Token refresh"],
|
|
195
|
+
nonFunctionals: ["Passwords hashed with bcrypt"],
|
|
196
|
+
acceptanceCriterias: ["Successful login returns valid JWT"],
|
|
197
|
+
outOfScope: ["Social OAuth"],
|
|
198
|
+
},
|
|
199
|
+
implementation: {
|
|
200
|
+
description: "Phased rollout",
|
|
201
|
+
phases: [
|
|
202
|
+
{
|
|
203
|
+
phase: "Phase 1: Database",
|
|
204
|
+
tasks: ["Create users table", "Create sessions table"],
|
|
205
|
+
},
|
|
206
|
+
],
|
|
207
|
+
},
|
|
114
208
|
});
|
|
115
209
|
```
|
|
116
210
|
|
|
@@ -120,13 +214,13 @@ Agents can request only the information they need, significantly reducing token
|
|
|
120
214
|
|
|
121
215
|
```typescript
|
|
122
216
|
// Summary View: Just the metadata and progress stats
|
|
123
|
-
plan_read({
|
|
217
|
+
plan_read({ id: "feature_auth", view: "summary" });
|
|
124
218
|
|
|
125
219
|
// Spec View: Just the requirements (useful for the Planner)
|
|
126
|
-
plan_read({
|
|
220
|
+
plan_read({ id: "feature_auth", view: "spec" });
|
|
127
221
|
|
|
128
222
|
// Plan View: Just the task list (useful for the Builder)
|
|
129
|
-
plan_read({
|
|
223
|
+
plan_read({ id: "feature_auth", view: "plan" });
|
|
130
224
|
```
|
|
131
225
|
|
|
132
226
|
### 3. Batch Task Updates (`plan_update`)
|
|
@@ -135,12 +229,12 @@ Update multiple tasks or move a plan through the lifecycle with validation.
|
|
|
135
229
|
|
|
136
230
|
```typescript
|
|
137
231
|
plan_update({
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
232
|
+
id: "feature_auth",
|
|
233
|
+
status: "in_progress",
|
|
234
|
+
taskUpdates: [
|
|
235
|
+
{ content: "Create users table", status: "done" },
|
|
236
|
+
{ content: "Create sessions table", status: "in_progress" },
|
|
237
|
+
],
|
|
144
238
|
});
|
|
145
239
|
```
|
|
146
240
|
|