opencode-plan-manager 0.1.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/LICENSE +21 -0
- package/README.md +149 -0
- package/dist/index.js +1025 -0
- package/package.json +41 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Yuri Maciel
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# OpenCode Plan Manager
|
|
2
|
+
|
|
3
|
+
[](https://opencode.ai)
|
|
4
|
+
[](https://www.typescriptlang.org/)
|
|
5
|
+
[](https://bun.sh)
|
|
6
|
+
|
|
7
|
+
**AI-Native Implementation Planning for Modern Agentic Workflows.**
|
|
8
|
+
|
|
9
|
+
OpenCode Plan Manager is a high-performance, minimalist plugin designed to bridge the gap between complex implementation strategies and autonomous execution. By utilizing a **folder-per-plan** architecture and **token-efficient views**, it empowers AI agents to manage large-scale features without context overload.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## π§ Why Plan Manager?
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
|
|
17
|
+
Plan Manager solves this by enforcing **Plan-to-Code Determinism**:
|
|
18
|
+
|
|
19
|
+
- **Selective Context Loading:** Don't load the whole project. Agents can read just the `summary` (stats), `spec` (requirements), or `plan` (tasks) as needed.
|
|
20
|
+
- **Zero-Hallucination Schemas:** Built with strict Zod validation. Agents _cannot_ create malformed plans or invalid state transitions.
|
|
21
|
+
- **Visible Filesystem Kanban:** Unlike hidden databases, your state is the filesystem. `pending/`, `in_progress/`, and `done/` folders provide an atomic, human-readable Kanban board.
|
|
22
|
+
- **Multi-Agent Native:** Designed for the **Planner-Builder** pattern. Standardized outputs allow a specialized **Plan Agent** to hand off a deterministic spec to a **Build Agent** with zero ambiguity.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## π€ The Agentic Workflow
|
|
27
|
+
|
|
28
|
+
This plugin is optimized for a dual-agent hierarchy, utilizing specialized prompts found in `src/prompts/`:
|
|
29
|
+
|
|
30
|
+
1. **Plan Agent (`plan.txt`):** A high-reasoning architect that transforms vague requirements into structured, phased implementation plans.
|
|
31
|
+
- **System Reminder:** Uses a custom `src/system/plan.txt` to inject planning rigor into the agent's core reasoning loop.
|
|
32
|
+
- **Workflow:** Follows a 4-step process: Context Discovery β Strategy Mapping β Phase Definition β Task Breakdown.
|
|
33
|
+
2. **Build Agent (`build.txt`):** An implementation specialist that executes plans with high precision.
|
|
34
|
+
- **Logic:** If a plan exists, it _must_ follow it. If a task is too complex, it will suggest calling the Plan Agent first.
|
|
35
|
+
- **Task Management:** Automatically handles task state transitions from `pending` to `in_progress` to `done`.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## β¨ Features
|
|
40
|
+
|
|
41
|
+
- π οΈ **Folder-Per-Plan Architecture:** Isolation of concerns. Each feature has its own metadata, spec, and task list.
|
|
42
|
+
- π **Token Optimization:** Native support for `summary` and `selective` views to keep agent context windows clean and focused.
|
|
43
|
+
- π **Atomic State Transitions:** Safe folder movements (`rename()`) ensure that plan status is always in sync with the filesystem.
|
|
44
|
+
- β
**Deterministic Task Management:** Support for three task states (`[ ]`, `[~]`, `[x]`) with batch update capabilities.
|
|
45
|
+
- π **High Performance:** Metadata-only listing for fast scanning of 100+ plans in milliseconds.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## π Architecture: The Filesystem Kanban
|
|
50
|
+
|
|
51
|
+
Plan Manager organizes work into a structured directory tree that both humans and AI can navigate intuitively:
|
|
52
|
+
|
|
53
|
+
```text
|
|
54
|
+
.opencode/plans/
|
|
55
|
+
βββ pending/ # New ideas and upcoming features
|
|
56
|
+
β βββ feature_auth/ # Each plan is a dedicated folder
|
|
57
|
+
β βββ metadata.json
|
|
58
|
+
β βββ spec.md
|
|
59
|
+
β βββ plan.md
|
|
60
|
+
βββ in_progress/ # Currently active development
|
|
61
|
+
βββ done/ # Immutable history of completed work
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## π Usage
|
|
67
|
+
|
|
68
|
+
### 1. Creating a Deterministic Plan (`plan_create`)
|
|
69
|
+
|
|
70
|
+
Instead of loose markdown, agents use structured objects to ensure every plan has clear requirements and phases.
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
plan_create({
|
|
74
|
+
title: "JWT Authentication",
|
|
75
|
+
type: "feature",
|
|
76
|
+
description: "Secure auth flow with refresh tokens",
|
|
77
|
+
spec: {
|
|
78
|
+
overview: "Implement secure JWT-based authentication",
|
|
79
|
+
functionals: ["User login", "Token refresh"],
|
|
80
|
+
nonFunctionals: ["Passwords hashed with bcrypt"],
|
|
81
|
+
acceptanceCriterias: ["Successful login returns valid JWT"],
|
|
82
|
+
outOfScope: ["Social OAuth"],
|
|
83
|
+
},
|
|
84
|
+
implementation: {
|
|
85
|
+
description: "Phased rollout",
|
|
86
|
+
phases: [
|
|
87
|
+
{
|
|
88
|
+
phase: "Phase 1: Database",
|
|
89
|
+
tasks: ["Create users table", "Create sessions table"],
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### 2. Context-Efficient Reading (`plan_read`)
|
|
97
|
+
|
|
98
|
+
Agents can request only the information they need, significantly reducing token costs.
|
|
99
|
+
|
|
100
|
+
```typescript
|
|
101
|
+
// Summary View: Just the metadata and progress stats
|
|
102
|
+
plan_read({ plan_id: "feature_auth", view: "summary" });
|
|
103
|
+
|
|
104
|
+
// Spec View: Just the requirements (useful for the Planner)
|
|
105
|
+
plan_read({ plan_id: "feature_auth", view: "spec" });
|
|
106
|
+
|
|
107
|
+
// Plan View: Just the task list (useful for the Builder)
|
|
108
|
+
plan_read({ plan_id: "feature_auth", view: "plan" });
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### 3. Batch Task Updates (`plan_update`)
|
|
112
|
+
|
|
113
|
+
Update multiple tasks or move a plan through the lifecycle with validation.
|
|
114
|
+
|
|
115
|
+
```typescript
|
|
116
|
+
plan_update({
|
|
117
|
+
plan_id: "feature_auth",
|
|
118
|
+
status: "in_progress",
|
|
119
|
+
taskUpdates: [
|
|
120
|
+
{ content: "Create users table", status: "done" },
|
|
121
|
+
{ content: "Create sessions table", status: "in_progress" },
|
|
122
|
+
],
|
|
123
|
+
});
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## π οΈ API Reference
|
|
129
|
+
|
|
130
|
+
| Tool | Purpose | Key Optimization |
|
|
131
|
+
| :------------ | :--------------------- | :---------------------------------------- |
|
|
132
|
+
| `plan_create` | Initializes a new plan | Validates structure via Zod |
|
|
133
|
+
| `plan_list` | Scans available plans | Reads only 200B metadata files |
|
|
134
|
+
| `plan_read` | Loads plan content | Supports selective views for token saving |
|
|
135
|
+
| `plan_update` | Updates state/tasks | Atomic folder moves + batch updates |
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## π§ͺ Development
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
bun install # Install dependencies
|
|
143
|
+
bun test # Run test suite (188 tests)
|
|
144
|
+
bun build # Build for production
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
## π License
|
|
148
|
+
|
|
149
|
+
MIT Β© 2026 OpenCode Ecosystem.
|