opencode-dashboard 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 +329 -0
- package/agents/orchestrator.md +99 -0
- package/agents/pipeline-builder.md +53 -0
- package/agents/pipeline-committer.md +78 -0
- package/agents/pipeline-refactor.md +58 -0
- package/agents/pipeline-reviewer.md +68 -0
- package/bin/cli.ts +332 -0
- package/commands/dashboard-start.md +5 -0
- package/commands/dashboard-status.md +5 -0
- package/commands/dashboard-stop.md +5 -0
- package/dist/assets/index-W-qyIr7d.js +134 -0
- package/dist/assets/index-mMdK5PVd.css +1 -0
- package/dist/index.html +13 -0
- package/package.json +82 -0
- package/plugin/index.ts +1441 -0
- package/server/PLUGIN_EVENTS.md +410 -0
- package/server/index.ts +55 -0
- package/server/pid.ts +140 -0
- package/server/routes.ts +520 -0
- package/server/sse.ts +196 -0
- package/server/state.ts +936 -0
- package/shared/types.ts +402 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Gabor Zakhar
|
|
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,329 @@
|
|
|
1
|
+
# OpenCode Dashboard
|
|
2
|
+
|
|
3
|
+
A real-time browser-based Kanban board that visualizes agent activity in [OpenCode](https://opencode.ai). Watch beads (tasks) move through agent stages -- from ready to done -- as AI agents work on them. Columns are generated dynamically based on your configured agents.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
1. Add the plugin to your OpenCode config:
|
|
8
|
+
|
|
9
|
+
```json
|
|
10
|
+
// opencode.json
|
|
11
|
+
{
|
|
12
|
+
"plugin": ["opencode-dashboard"]
|
|
13
|
+
}
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
OpenCode will install the plugin automatically on next launch.
|
|
17
|
+
|
|
18
|
+
2. Run the setup command to install slash commands and (optionally) agent definitions:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npx opencode-dashboard setup
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
This will prompt you to choose between global (`~/.config/opencode/`) or per-project (`.opencode/`) installation. It copies the `/dashboard-start`, `/dashboard-stop`, and `/dashboard-status` commands, plus the shipped agent definitions. Existing files are never overwritten.
|
|
25
|
+
|
|
26
|
+
## Usage
|
|
27
|
+
|
|
28
|
+
### Start the Dashboard
|
|
29
|
+
|
|
30
|
+
Use the slash command in OpenCode:
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
/dashboard-start
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Or use the CLI directly:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
npx opencode-dashboard start
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
The dashboard will be available at `http://localhost:3333`.
|
|
43
|
+
|
|
44
|
+
### Check Status
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
/dashboard-status
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Or via CLI:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npx opencode-dashboard status
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Stop the Dashboard
|
|
57
|
+
|
|
58
|
+
```
|
|
59
|
+
/dashboard-stop
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Or via CLI:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
npx opencode-dashboard stop
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Custom Port
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
npx opencode-dashboard start --port 4000
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Or set the `DASHBOARD_PORT` environment variable.
|
|
75
|
+
|
|
76
|
+
## How It Works
|
|
77
|
+
|
|
78
|
+
The dashboard has three components:
|
|
79
|
+
|
|
80
|
+
```
|
|
81
|
+
OpenCode Plugin (plugin/index.ts)
|
|
82
|
+
|
|
|
83
|
+
| POST /api/plugin/event
|
|
84
|
+
v
|
|
85
|
+
Bun Server (server/index.ts)
|
|
86
|
+
|
|
|
87
|
+
| SSE /api/events
|
|
88
|
+
v
|
|
89
|
+
React Dashboard (dist/)
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
1. **Plugin** -- An OpenCode plugin that hooks into agent lifecycle events, discovers configured agents, tracks bead state via `bd list --json`, and pushes structured events to the server. Registers custom tools (`dashboard_start`, `dashboard_stop`, `dashboard_status`, `dashboard_open`) for controlling the dashboard from within OpenCode.
|
|
93
|
+
2. **Server** -- A Bun HTTP server that aggregates state from connected plugins, persists it to disk, serves the dashboard frontend, and broadcasts updates to browser clients via Server-Sent Events (SSE).
|
|
94
|
+
3. **Dashboard** -- A React SPA that renders a dynamic Kanban board with real-time updates, animated card transitions, and connection resilience.
|
|
95
|
+
|
|
96
|
+
### Kanban Columns
|
|
97
|
+
|
|
98
|
+
Columns are generated dynamically based on your configured agents. Three fixed columns are always present:
|
|
99
|
+
|
|
100
|
+
| Column | Description |
|
|
101
|
+
|--------|-------------|
|
|
102
|
+
| Ready | Open beads not yet claimed by an agent |
|
|
103
|
+
| Done | Bead closed successfully |
|
|
104
|
+
| Error | Bead blocked, failed, or abandoned |
|
|
105
|
+
|
|
106
|
+
Agent columns appear between Ready and Done, one per discovered agent. For example, if you have `orchestrator`, `pipeline-builder`, `pipeline-reviewer`, and `pipeline-committer` agents configured, the board will show columns for each of them. Column colors are pulled from the agent's frontmatter `color` field when available.
|
|
107
|
+
|
|
108
|
+
## Development
|
|
109
|
+
|
|
110
|
+
### Prerequisites
|
|
111
|
+
|
|
112
|
+
- [Bun](https://bun.sh) >= 1.0
|
|
113
|
+
- [OpenCode](https://opencode.ai) with plugin support
|
|
114
|
+
- A project using [bd (beads)](https://github.com/anomalyco/beads) for issue tracking
|
|
115
|
+
|
|
116
|
+
### Clone and Install
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
git clone https://github.com/GZakhar88/opencode-agents-dashboard.git
|
|
120
|
+
cd opencode-agents-dashboard
|
|
121
|
+
bun install
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Running Locally (Frontend + Server only)
|
|
125
|
+
|
|
126
|
+
This starts the dashboard UI and server **without** the OpenCode plugin. Useful for working on the frontend or server code. No OpenCode or bd needed.
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
# Terminal 1: Start the Bun API server (port 3333)
|
|
130
|
+
bun run server
|
|
131
|
+
|
|
132
|
+
# Terminal 2: Start the Vite dev server with HMR (port 5173)
|
|
133
|
+
bun run dev
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Open `http://localhost:5173`. The Vite dev server proxies `/api/*` requests to the Bun server at `localhost:3333`. The board will show "No projects connected" until a plugin registers — you can test by sending events directly:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
# Register a fake plugin
|
|
140
|
+
curl -X POST http://localhost:3333/api/plugin/register \
|
|
141
|
+
-H 'Content-Type: application/json' \
|
|
142
|
+
-d '{"projectPath": "/tmp/test", "projectName": "test-project"}'
|
|
143
|
+
# Returns: {"pluginId": "some-uuid"}
|
|
144
|
+
|
|
145
|
+
# Push an event (use the pluginId from above)
|
|
146
|
+
curl -X POST http://localhost:3333/api/plugin/event \
|
|
147
|
+
-H 'Content-Type: application/json' \
|
|
148
|
+
-d '{"pluginId": "PASTE_ID_HERE", "event": "bead:discovered", "data": {"bead": {"id": "test-1", "title": "Test bead", "status": "open", "priority": "medium"}}}'
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Running Locally (Full end-to-end with OpenCode)
|
|
152
|
+
|
|
153
|
+
This connects the plugin to a live OpenCode session so you can test the full pipeline: plugin hooks -> server -> dashboard.
|
|
154
|
+
|
|
155
|
+
**Step 1: Symlink the plugin into your project**
|
|
156
|
+
|
|
157
|
+
From the project directory where you run OpenCode (not this repo):
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
# Create the plugins directory if it doesn't exist
|
|
161
|
+
mkdir -p /path/to/your/project/.opencode/plugins
|
|
162
|
+
|
|
163
|
+
# Symlink the plugin entry point
|
|
164
|
+
ln -sf /path/to/opencode-agents-dashboard/plugin/index.ts \
|
|
165
|
+
/path/to/your/project/.opencode/plugins/dashboard.ts
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
OpenCode auto-loads all `.ts` files from `.opencode/plugins/` on startup. The symlink's relative imports resolve from the real file's location, so `../shared/types`, `../server/pid`, etc. all work.
|
|
169
|
+
|
|
170
|
+
**Step 2: Install commands and agents**
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
# From this repo's directory
|
|
174
|
+
bun run bin/cli.ts setup
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
Choose "project" to install into `/path/to/your/project/.opencode/`, or "global" for `~/.config/opencode/`. This copies the `/dashboard-start`, `/dashboard-stop`, `/dashboard-status` commands and agent definitions.
|
|
178
|
+
|
|
179
|
+
**Step 3: Launch OpenCode and start the dashboard**
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# In your project directory
|
|
183
|
+
DASHBOARD_DEBUG=1 opencode
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Then in the OpenCode TUI, type `/dashboard-start`. The plugin will spawn the Bun server and open the dashboard at `http://localhost:3333`.
|
|
187
|
+
|
|
188
|
+
`DASHBOARD_DEBUG=1` enables verbose plugin logging to stderr — useful for seeing what the plugin is doing.
|
|
189
|
+
|
|
190
|
+
**Step 4: (Optional) Run Vite dev server for frontend HMR**
|
|
191
|
+
|
|
192
|
+
If you're working on the frontend and want hot-reload instead of the pre-built `dist/`:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
# In this repo's directory
|
|
196
|
+
bun run dev
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Open `http://localhost:5173` instead of `:3333`. Vite proxies API calls to the running Bun server.
|
|
200
|
+
|
|
201
|
+
**Cleanup**
|
|
202
|
+
|
|
203
|
+
To disconnect the plugin from your project:
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
rm /path/to/your/project/.opencode/plugins/dashboard.ts
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
### Testing
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
bun test
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
| File | What it tests |
|
|
216
|
+
|------|---------------|
|
|
217
|
+
| `src/hooks/useBoardState.test.ts` | Board state reducer -- all 13 SSE event handlers |
|
|
218
|
+
| `src/hooks/useEventSource.test.ts` | SSE connection, backoff, retry logic |
|
|
219
|
+
| `src/lib/format.test.ts` | Formatting utilities (elapsed time, priority labels) |
|
|
220
|
+
| `server/state.test.ts` | Server state manager (event processing, persistence) |
|
|
221
|
+
| `server/routes.test.ts` | HTTP route handlers (register, event, heartbeat) |
|
|
222
|
+
| `server/sse.test.ts` | SSE client management and broadcasting |
|
|
223
|
+
| `server/diffBeadState.test.ts` | Bead snapshot diffing algorithm |
|
|
224
|
+
|
|
225
|
+
### Building
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
bun run build # Build the frontend (outputs to dist/)
|
|
229
|
+
bun run build:check # Run TypeScript type checking
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
## Environment Variables
|
|
233
|
+
|
|
234
|
+
| Variable | Default | Description |
|
|
235
|
+
|----------|---------|-------------|
|
|
236
|
+
| `DASHBOARD_PORT` | `3333` | Port for the dashboard server |
|
|
237
|
+
| `DASHBOARD_DEBUG` | (unset) | Set to `1` to enable verbose plugin logging to stderr |
|
|
238
|
+
|
|
239
|
+
## Project Structure
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
opencode-dashboard/
|
|
243
|
+
├── agents/ # Shipped agent definitions (optional install)
|
|
244
|
+
│ ├── orchestrator.md
|
|
245
|
+
│ ├── pipeline-builder.md
|
|
246
|
+
│ ├── pipeline-refactor.md
|
|
247
|
+
│ ├── pipeline-reviewer.md
|
|
248
|
+
│ └── pipeline-committer.md
|
|
249
|
+
├── commands/ # Slash commands (installed via setup)
|
|
250
|
+
│ ├── dashboard-start.md
|
|
251
|
+
│ ├── dashboard-stop.md
|
|
252
|
+
│ └── dashboard-status.md
|
|
253
|
+
├── plugin/
|
|
254
|
+
│ └── index.ts # Main plugin entry (npm distribution)
|
|
255
|
+
├── server/
|
|
256
|
+
│ ├── index.ts # Server entry point (Bun.serve)
|
|
257
|
+
│ ├── routes.ts # HTTP route handlers (7 endpoints)
|
|
258
|
+
│ ├── sse.ts # SSE client management & broadcasting
|
|
259
|
+
│ ├── state.ts # State manager (events -> state, persistence)
|
|
260
|
+
│ ├── pid.ts # PID file management
|
|
261
|
+
│ └── PLUGIN_EVENTS.md # Event reference documentation
|
|
262
|
+
├── shared/
|
|
263
|
+
│ └── types.ts # Shared TypeScript types
|
|
264
|
+
├── bin/
|
|
265
|
+
│ └── cli.ts # CLI entry (npx opencode-dashboard)
|
|
266
|
+
├── src/ # React frontend source
|
|
267
|
+
│ ├── main.tsx
|
|
268
|
+
│ ├── App.tsx
|
|
269
|
+
│ ├── hooks/ # SSE connection, board state reducer
|
|
270
|
+
│ ├── components/ # Kanban board, cards, columns
|
|
271
|
+
│ └── lib/ # Utilities, constants, API client
|
|
272
|
+
├── plugins/
|
|
273
|
+
│ └── dashboard-bridge.ts # Local dev plugin (not published)
|
|
274
|
+
└── dist/ # Built frontend (generated by vite build)
|
|
275
|
+
```
|
|
276
|
+
|
|
277
|
+
## API Reference
|
|
278
|
+
|
|
279
|
+
### Plugin API (used by the OpenCode plugin)
|
|
280
|
+
|
|
281
|
+
| Method | Endpoint | Description |
|
|
282
|
+
|--------|----------|-------------|
|
|
283
|
+
| `POST` | `/api/plugin/register` | Register a plugin instance |
|
|
284
|
+
| `POST` | `/api/plugin/event` | Push an event |
|
|
285
|
+
| `POST` | `/api/plugin/heartbeat` | Send heartbeat |
|
|
286
|
+
| `DELETE` | `/api/plugin/:id` | Deregister a plugin |
|
|
287
|
+
|
|
288
|
+
### Dashboard API (used by the frontend)
|
|
289
|
+
|
|
290
|
+
| Method | Endpoint | Description |
|
|
291
|
+
|--------|----------|-------------|
|
|
292
|
+
| `GET` | `/api/state` | Full board state as JSON |
|
|
293
|
+
| `GET` | `/api/events` | SSE stream for real-time updates |
|
|
294
|
+
| `GET` | `/api/health` | Server health check |
|
|
295
|
+
|
|
296
|
+
## Tech Stack
|
|
297
|
+
|
|
298
|
+
- **Runtime:** [Bun](https://bun.sh)
|
|
299
|
+
- **Frontend:** [React 19](https://react.dev), [TypeScript](https://www.typescriptlang.org) 5.7
|
|
300
|
+
- **Build:** [Vite](https://vite.dev) 6
|
|
301
|
+
- **Styling:** [Tailwind CSS](https://tailwindcss.com) 3.4, [shadcn/ui](https://ui.shadcn.com)
|
|
302
|
+
- **Animation:** [Framer Motion](https://www.framer.com/motion/) 11.15
|
|
303
|
+
- **State:** React `useReducer` with SSE-driven updates
|
|
304
|
+
- **Transport:** Server-Sent Events (SSE) with exponential backoff
|
|
305
|
+
|
|
306
|
+
## Troubleshooting
|
|
307
|
+
|
|
308
|
+
### Dashboard shows "No projects connected"
|
|
309
|
+
|
|
310
|
+
- Verify OpenCode is running with the plugin installed.
|
|
311
|
+
- Check that agents are configured (in `opencode.json`, `.opencode/agents/`, or `~/.config/opencode/agents/`). Enable debug logging: `DASHBOARD_DEBUG=1 opencode`.
|
|
312
|
+
- Confirm the server is reachable: `curl http://localhost:3333/api/health`.
|
|
313
|
+
|
|
314
|
+
### Beads not showing on the board
|
|
315
|
+
|
|
316
|
+
- Ensure the project uses `bd` for issue tracking (`bd list` should return issues).
|
|
317
|
+
- The plugin runs `bd list --json` to discover beads. If `bd` is not installed or not initialized in the project, no beads will appear.
|
|
318
|
+
|
|
319
|
+
### Server state persists across restarts
|
|
320
|
+
|
|
321
|
+
The server saves state to `server/.dashboard-state.json`. Delete this file to start fresh:
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
rm server/.dashboard-state.json
|
|
325
|
+
```
|
|
326
|
+
|
|
327
|
+
## License
|
|
328
|
+
|
|
329
|
+
[MIT](LICENSE)
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Orchestrates multi-agent implementation pipeline
|
|
3
|
+
mode: all
|
|
4
|
+
color: "#f7d778"
|
|
5
|
+
temperature: 0.1
|
|
6
|
+
tools:
|
|
7
|
+
read: true
|
|
8
|
+
glob: true
|
|
9
|
+
task: true
|
|
10
|
+
permission:
|
|
11
|
+
bash:
|
|
12
|
+
"*": deny
|
|
13
|
+
"git diff*": allow
|
|
14
|
+
"git status*": allow
|
|
15
|
+
"bd *": allow
|
|
16
|
+
task:
|
|
17
|
+
"*": allow
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
You are the Pipeline Orchestrator. You coordinate a multi-agent implementation pipeline.
|
|
21
|
+
|
|
22
|
+
## Your Role
|
|
23
|
+
|
|
24
|
+
When given a task file, you will:
|
|
25
|
+
|
|
26
|
+
1. **Read and analyze** the task markdown file
|
|
27
|
+
2. **Determine which stages** to run based on the task type
|
|
28
|
+
3. **Invoke each agent in sequence** using the Task tool
|
|
29
|
+
4. **Pass context between agents** (original task + git changes)
|
|
30
|
+
5. **Report completion** when all stages are done
|
|
31
|
+
|
|
32
|
+
## Working with beads
|
|
33
|
+
|
|
34
|
+
- You can use the bd * commands to work with beads
|
|
35
|
+
- You always need to work sequentually, one-by-one with beads
|
|
36
|
+
- You need to pass the current bead down to the pipeline for the first sub-agent all the time
|
|
37
|
+
- You cannot implement code or do changes for a bead. That is the work for the sub-agents
|
|
38
|
+
- If the last sub-agent finished the work, then update the current bead
|
|
39
|
+
- When the previous bead is finished, pick up the next one and start working on that
|
|
40
|
+
- YOU AS THE ORCEHSTRATOR AGENT IS THE ONLY ONE WHO CAN PICK UP THE NEXT BEAD
|
|
41
|
+
|
|
42
|
+
## Pipeline Stages
|
|
43
|
+
|
|
44
|
+
Run these agents in order using the Task tool:
|
|
45
|
+
|
|
46
|
+
1. **pipeline-builder** - Implement the feature (REQUIRED)
|
|
47
|
+
2. **pipeline-refactor** - Improve code quality (OPTIONAL - skip for simple tasks)
|
|
48
|
+
3. **pipeline-reviewer** - Review and fix issues (REQUIRED)
|
|
49
|
+
4. **pipeline-committer** - Create final git commit (REQUIRED)
|
|
50
|
+
|
|
51
|
+
## How to Invoke Subagents
|
|
52
|
+
|
|
53
|
+
Use the Task tool for each stage. Example:
|
|
54
|
+
|
|
55
|
+
For builder stage:
|
|
56
|
+
- subagent_type: "pipeline-builder"
|
|
57
|
+
- description: "Build: [brief task summary]"
|
|
58
|
+
- prompt: Include the full task description and any context
|
|
59
|
+
|
|
60
|
+
## Execution Flow
|
|
61
|
+
|
|
62
|
+
1. First, READ the task file to get its content
|
|
63
|
+
2. Analyze the task and decide which optional stages to include
|
|
64
|
+
3. For each stage in sequence:
|
|
65
|
+
- Run `git status` to see current state
|
|
66
|
+
- Invoke the agent using Task tool with full context
|
|
67
|
+
- The agent will do its work
|
|
68
|
+
- Continue to next stage
|
|
69
|
+
4. After pipeline-committer completes, summarize the pipeline results
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
## Context Template for Each Agent
|
|
74
|
+
|
|
75
|
+
When invoking each agent, include:
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
## Original Task
|
|
79
|
+
[paste task file content here]
|
|
80
|
+
|
|
81
|
+
## Previous Stage Results
|
|
82
|
+
[output from previous agent, or "First stage" if this is builder]
|
|
83
|
+
|
|
84
|
+
## Current Git Status
|
|
85
|
+
[paste git status output]
|
|
86
|
+
|
|
87
|
+
## Instructions
|
|
88
|
+
Execute your stage of the pipeline. You are stage X of Y.
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
## Important Rules
|
|
92
|
+
|
|
93
|
+
- Always read the task file FIRST before doing anything else (If task file was given)
|
|
94
|
+
- Run stages SEQUENTIALLY, not in parallel
|
|
95
|
+
- Pass the original task description to EVERY stage
|
|
96
|
+
- The committer should be the LAST stage always
|
|
97
|
+
- Report a final summary when complete
|
|
98
|
+
|
|
99
|
+
Begin by reading the task file path provided to you.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Implements features based on task specifications in the pipeline
|
|
3
|
+
mode: subagent
|
|
4
|
+
hidden: true
|
|
5
|
+
temperature: 0.2
|
|
6
|
+
permission:
|
|
7
|
+
edit: allow
|
|
8
|
+
bash:
|
|
9
|
+
"*": allow
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
You are the Builder agent in an automated multi-agent pipeline.
|
|
13
|
+
|
|
14
|
+
## Your Responsibilities
|
|
15
|
+
|
|
16
|
+
1. **Implement the task** as described in your input
|
|
17
|
+
2. **Write clean, functional code** that meets the requirements
|
|
18
|
+
3. **Create or modify files** as needed
|
|
19
|
+
4. **Run basic validation** (syntax checks, simple tests if applicable)
|
|
20
|
+
|
|
21
|
+
## Important Rules
|
|
22
|
+
|
|
23
|
+
- Do NOT commit changes - the Committer agent handles that
|
|
24
|
+
- Do NOT refactor existing code beyond what's needed - the Refactor agent handles that
|
|
25
|
+
- Focus on **correctness and functionality first**
|
|
26
|
+
- If you encounter blockers, document them clearly
|
|
27
|
+
- If you have questions ask them
|
|
28
|
+
|
|
29
|
+
## Input Format
|
|
30
|
+
|
|
31
|
+
You will receive:
|
|
32
|
+
- Task summary from the Orchestrator
|
|
33
|
+
- Original task description
|
|
34
|
+
- Current state of the codebase (if relevant)
|
|
35
|
+
|
|
36
|
+
## Output Format
|
|
37
|
+
|
|
38
|
+
When done, provide:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
## Implementation Summary
|
|
42
|
+
[What you built/modified]
|
|
43
|
+
|
|
44
|
+
## Files Changed
|
|
45
|
+
- [path/to/file1.ts] - [what changed]
|
|
46
|
+
- [path/to/file2.ts] - [what changed]
|
|
47
|
+
|
|
48
|
+
## Validation
|
|
49
|
+
- [Any tests run or checks performed]
|
|
50
|
+
|
|
51
|
+
## Notes for Next Stage
|
|
52
|
+
[Anything the Refactor/Review agent should know]
|
|
53
|
+
```
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Creates the final git commit for pipeline changes
|
|
3
|
+
mode: subagent
|
|
4
|
+
hidden: true
|
|
5
|
+
temperature: 0.1
|
|
6
|
+
tools:
|
|
7
|
+
write: false
|
|
8
|
+
edit: false
|
|
9
|
+
read: true
|
|
10
|
+
glob: false
|
|
11
|
+
permission:
|
|
12
|
+
bash:
|
|
13
|
+
"*": deny
|
|
14
|
+
"git add*": allow
|
|
15
|
+
"git commit*": allow
|
|
16
|
+
"git status*": allow
|
|
17
|
+
"git diff*": allow
|
|
18
|
+
"git log*": allow
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
You are the Committer agent in an automated multi-agent pipeline.
|
|
22
|
+
|
|
23
|
+
## Your Responsibilities
|
|
24
|
+
|
|
25
|
+
1. **Review all changes** made during the pipeline
|
|
26
|
+
2. **Stage all modified files** with `git add`
|
|
27
|
+
3. **Create a well-formatted commit message**
|
|
28
|
+
4. **Commit the changes**
|
|
29
|
+
5. **Report success** back to the pipeline
|
|
30
|
+
|
|
31
|
+
## Commit Message Format
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
<type>: <short description>
|
|
35
|
+
|
|
36
|
+
<body - what was implemented>
|
|
37
|
+
|
|
38
|
+
Pipeline stages: orchestrator -> [stages run] -> committer
|
|
39
|
+
Task: <original task title or first line>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Types:
|
|
43
|
+
- `feat` - New feature
|
|
44
|
+
- `fix` - Bug fix
|
|
45
|
+
- `refactor` - Code refactoring
|
|
46
|
+
- `docs` - Documentation
|
|
47
|
+
- `style` - Formatting/style changes
|
|
48
|
+
- `test` - Adding tests
|
|
49
|
+
|
|
50
|
+
## Important Rules
|
|
51
|
+
|
|
52
|
+
- Do NOT push to remote - only commit locally
|
|
53
|
+
- Do NOT use --amend or any destructive git operations
|
|
54
|
+
- Create a single commit with all pipeline changes
|
|
55
|
+
- If there are no changes to commit, report that clearly
|
|
56
|
+
|
|
57
|
+
## Input Format
|
|
58
|
+
|
|
59
|
+
You will receive:
|
|
60
|
+
- Original task summary
|
|
61
|
+
- List of stages that ran
|
|
62
|
+
- Summary from the Reviewer
|
|
63
|
+
|
|
64
|
+
## Output Format
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
## Commit Created
|
|
68
|
+
|
|
69
|
+
Commit hash: [hash]
|
|
70
|
+
Message: [commit message]
|
|
71
|
+
|
|
72
|
+
Files committed:
|
|
73
|
+
- [file1]
|
|
74
|
+
- [file2]
|
|
75
|
+
|
|
76
|
+
## Pipeline Complete
|
|
77
|
+
The task has been implemented and committed successfully.
|
|
78
|
+
```
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Improves code quality for files changed in the pipeline
|
|
3
|
+
mode: subagent
|
|
4
|
+
hidden: true
|
|
5
|
+
temperature: 0.2
|
|
6
|
+
permission:
|
|
7
|
+
edit: allow
|
|
8
|
+
bash:
|
|
9
|
+
"*": deny
|
|
10
|
+
"git diff*": allow
|
|
11
|
+
"git status*": allow
|
|
12
|
+
"npm run lint*": allow
|
|
13
|
+
"npx prettier*": allow
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
You are the Refactoring agent in an automated multi-agent pipeline.
|
|
17
|
+
|
|
18
|
+
## Your Responsibilities
|
|
19
|
+
|
|
20
|
+
1. **Review ONLY the files that were just modified** (listed in your input)
|
|
21
|
+
2. **Improve code quality** without changing functionality:
|
|
22
|
+
- Better naming conventions
|
|
23
|
+
- Cleaner structure and organization
|
|
24
|
+
- Remove code duplication
|
|
25
|
+
- Improve readability
|
|
26
|
+
- Apply consistent patterns
|
|
27
|
+
3. **Run linting/formatting** if available
|
|
28
|
+
|
|
29
|
+
## Important Rules
|
|
30
|
+
|
|
31
|
+
- Do NOT change functionality or add features
|
|
32
|
+
- Do NOT modify files that weren't changed by the Builder
|
|
33
|
+
- Do NOT commit changes
|
|
34
|
+
- Keep refactoring focused and minimal
|
|
35
|
+
|
|
36
|
+
## Input Format
|
|
37
|
+
|
|
38
|
+
You will receive:
|
|
39
|
+
- List of changed files
|
|
40
|
+
- Git diff of changes
|
|
41
|
+
- Original task description (for context)
|
|
42
|
+
|
|
43
|
+
## Output Format
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
## Refactoring Summary
|
|
47
|
+
[What improvements were made]
|
|
48
|
+
|
|
49
|
+
## Files Refactored
|
|
50
|
+
- [path/to/file1.ts] - [improvements made]
|
|
51
|
+
|
|
52
|
+
## Code Quality Checks
|
|
53
|
+
- Linting: [pass/fail/not available]
|
|
54
|
+
- Formatting: [applied/skipped]
|
|
55
|
+
|
|
56
|
+
## Notes
|
|
57
|
+
[Any remaining code smells or suggestions for future]
|
|
58
|
+
```
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Reviews implementation and fixes any issues found
|
|
3
|
+
mode: subagent
|
|
4
|
+
hidden: true
|
|
5
|
+
color: "#e2dc21"
|
|
6
|
+
temperature: 0.2
|
|
7
|
+
permission:
|
|
8
|
+
edit: allow
|
|
9
|
+
bash:
|
|
10
|
+
"*": deny
|
|
11
|
+
"git diff*": allow
|
|
12
|
+
"git status*": allow
|
|
13
|
+
"npm test*": allow
|
|
14
|
+
"npm run test*": allow
|
|
15
|
+
"npm run lint*": allow
|
|
16
|
+
"npx tsc*": allow
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
You are the Reviewer agent in an automated multi-agent pipeline.
|
|
20
|
+
|
|
21
|
+
## Your Responsibilities
|
|
22
|
+
|
|
23
|
+
1. **Review the implementation** against the original requirements
|
|
24
|
+
2. **Check for issues**:
|
|
25
|
+
- Bugs and edge cases
|
|
26
|
+
- Security vulnerabilities
|
|
27
|
+
- Performance problems
|
|
28
|
+
- Missing error handling
|
|
29
|
+
- Type errors (if TypeScript)
|
|
30
|
+
3. **FIX any issues you find** - don't just report them
|
|
31
|
+
4. **Write tests against acceptance criterias (if missing)** if the code changes can be tested by automated tests
|
|
32
|
+
5. **Run tests** if available
|
|
33
|
+
|
|
34
|
+
## Important Rules
|
|
35
|
+
|
|
36
|
+
- You have permission to make fixes - use it
|
|
37
|
+
- Do NOT commit changes
|
|
38
|
+
- Focus on correctness and robustness
|
|
39
|
+
- If you can't fix something, document it clearly
|
|
40
|
+
|
|
41
|
+
## Input Format
|
|
42
|
+
|
|
43
|
+
You will receive:
|
|
44
|
+
- Original task description
|
|
45
|
+
- List of all changed files
|
|
46
|
+
- Git diff of all changes
|
|
47
|
+
- Output from previous stages
|
|
48
|
+
|
|
49
|
+
## Output Format
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
## Review Summary
|
|
53
|
+
[Overall assessment: Ready to commit / Needs attention]
|
|
54
|
+
|
|
55
|
+
## Issues Found and Fixed
|
|
56
|
+
- [Issue 1] - [How it was fixed]
|
|
57
|
+
- [Issue 2] - [How it was fixed]
|
|
58
|
+
|
|
59
|
+
## Tests
|
|
60
|
+
- Test suite: [passed/failed/not available]
|
|
61
|
+
- Manual verification: [what was checked]
|
|
62
|
+
|
|
63
|
+
## Remaining Concerns
|
|
64
|
+
[Any issues that couldn't be fixed, or suggestions]
|
|
65
|
+
|
|
66
|
+
## Final Verdict
|
|
67
|
+
[APPROVED / APPROVED WITH NOTES / BLOCKED]
|
|
68
|
+
```
|