opencode-mad 0.4.1 → 1.0.1
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 +155 -32
- package/agents/mad-analyste.md +252 -0
- package/agents/mad-architecte.md +271 -0
- package/agents/mad-developer.md +13 -39
- package/agents/mad-fixer.md +7 -18
- package/agents/mad-merger.md +7 -18
- package/agents/mad-planner.md +76 -90
- package/agents/mad-reviewer.md +256 -0
- package/agents/mad-security.md +102 -0
- package/agents/mad-tester.md +11 -57
- package/agents/orchestrator.md +362 -634
- package/package.json +3 -3
- package/plugins/mad-plugin.ts +436 -525
- package/skills/mad-workflow/SKILL.md +81 -114
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: mad-workflow
|
|
3
|
-
description: Multi-Agent Dev workflow for parallel development with git worktrees and
|
|
3
|
+
description: Multi-Agent Dev workflow for parallel development with git worktrees and specialized agents
|
|
4
4
|
license: MIT
|
|
5
5
|
compatibility: opencode
|
|
6
6
|
metadata:
|
|
@@ -10,129 +10,96 @@ metadata:
|
|
|
10
10
|
|
|
11
11
|
# MAD Workflow
|
|
12
12
|
|
|
13
|
-
MAD (Multi-Agent Dev) enables parallel software development by decomposing tasks into independent subtasks, each running in isolated git worktrees with dedicated
|
|
13
|
+
MAD (Multi-Agent Dev) enables parallel software development by decomposing tasks into independent subtasks, each running in isolated git worktrees with dedicated specialized agents.
|
|
14
14
|
|
|
15
|
-
##
|
|
15
|
+
## Architecture
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
```
|
|
18
|
+
USER REQUEST → ORCHESTRATOR → ANALYSTE → ARCHITECTE → Plan
|
|
19
|
+
↓
|
|
20
|
+
┌───────────────┼───────────────┐
|
|
21
|
+
↓ ↓ ↓
|
|
22
|
+
DEVELOPER 1 DEVELOPER 2 DEVELOPER 3
|
|
23
|
+
(worktree) (worktree) (worktree)
|
|
24
|
+
↓ ↓ ↓
|
|
25
|
+
└───────────────┼───────────────┘
|
|
26
|
+
↓
|
|
27
|
+
TESTER / REVIEWER / SECURITY
|
|
28
|
+
↓
|
|
29
|
+
MERGER / FIXER (if needed)
|
|
30
|
+
↓
|
|
31
|
+
FINAL CHECK → PUSH
|
|
32
|
+
```
|
|
31
33
|
|
|
32
|
-
##
|
|
34
|
+
## Specialized Agents
|
|
33
35
|
|
|
34
|
-
|
|
36
|
+
| Agent | Role |
|
|
37
|
+
|-------|------|
|
|
38
|
+
| **mad-analyste** | Understands codebase, finds patterns |
|
|
39
|
+
| **mad-architecte** | Creates task breakdown, file ownership |
|
|
40
|
+
| **mad-developer** | Writes code in isolated worktrees |
|
|
41
|
+
| **mad-tester** | Runs tests, verifies functionality |
|
|
42
|
+
| **mad-reviewer** | Checks quality, best practices |
|
|
43
|
+
| **mad-security** | Audits for vulnerabilities |
|
|
44
|
+
| **mad-fixer** | Fixes errors, test failures |
|
|
45
|
+
| **mad-merger** | Resolves git merge conflicts |
|
|
35
46
|
|
|
36
|
-
|
|
37
|
-
```
|
|
38
|
-
Message 1: mad_worktree_create(branch: "feat-a", ...)
|
|
39
|
-
Message 2: mad_worktree_create(branch: "feat-b", ...)
|
|
40
|
-
Message 3: Task(subagent_type: "mad-developer", ...) for feat-a
|
|
41
|
-
Message 4: Task(subagent_type: "mad-developer", ...) for feat-b
|
|
42
|
-
```
|
|
47
|
+
## Signal Files
|
|
43
48
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
mad_worktree_create(branch: "feat-b", ...)
|
|
49
|
-
mad_worktree_create(branch: "feat-c", ...)
|
|
50
|
-
|
|
51
|
-
Single Message containing:
|
|
52
|
-
Task(subagent_type: "mad-developer", ...) for feat-a
|
|
53
|
-
Task(subagent_type: "mad-developer", ...) for feat-b
|
|
54
|
-
Task(subagent_type: "mad-developer", ...) for feat-c
|
|
55
|
-
```
|
|
49
|
+
- `.agent-task`: Task description
|
|
50
|
+
- `.agent-done`: Completion marker
|
|
51
|
+
- `.agent-blocked`: Block marker
|
|
52
|
+
- `.agent-error`: Error details
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
## Workflow Phases
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
56
|
+
1. **Analysis**: Analyste understands codebase
|
|
57
|
+
2. **Planning**: Architecte creates plan with file ownership
|
|
58
|
+
3. **Approval**: User validates plan ("GO")
|
|
59
|
+
4. **Development**: Parallel developer spawning
|
|
60
|
+
5. **QA**: Testers, Reviewers, Security in parallel
|
|
61
|
+
6. **Resolution**: Fixer/Merger if issues
|
|
62
|
+
7. **Finalization**: Merge, final check, push, cleanup
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
For each subtask:
|
|
67
|
-
```
|
|
68
|
-
mad_worktree_create(
|
|
69
|
-
branch: "feat/feature-name",
|
|
70
|
-
task: "Detailed task description"
|
|
71
|
-
)
|
|
72
|
-
```
|
|
64
|
+
## CRITICAL: Parallel Execution
|
|
73
65
|
|
|
74
|
-
|
|
75
|
-
Spawn subagents simultaneously:
|
|
76
|
-
```
|
|
77
|
-
Task(subagent_type: "mad-developer", ...)
|
|
78
|
-
Task(subagent_type: "mad-developer", ...)
|
|
79
|
-
Task(subagent_type: "mad-developer", ...)
|
|
80
|
-
```
|
|
66
|
+
**The entire purpose of MAD is to run tasks IN PARALLEL.**
|
|
81
67
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```
|
|
68
|
+
All independent operations MUST be in a single message:
|
|
69
|
+
- Create all worktrees together
|
|
70
|
+
- Spawn all developers together
|
|
71
|
+
- Run all QA agents together
|
|
87
72
|
|
|
88
|
-
|
|
89
|
-
Verify each worktree:
|
|
90
|
-
```
|
|
91
|
-
mad_test(worktree: "feat-feature-name")
|
|
92
|
-
```
|
|
73
|
+
If you're not parallelizing, you're not using MAD correctly!
|
|
93
74
|
|
|
94
|
-
|
|
95
|
-
Merge completed work:
|
|
96
|
-
```
|
|
97
|
-
mad_merge(worktree: "feat-feature-name")
|
|
98
|
-
```
|
|
75
|
+
## File Ownership Rules
|
|
99
76
|
|
|
100
|
-
|
|
77
|
+
Each task MUST have exclusive ownership. Two agents must NEVER modify the same file.
|
|
101
78
|
|
|
102
|
-
### 7. Cleanup
|
|
103
|
-
Remove finished worktrees:
|
|
104
79
|
```
|
|
105
|
-
|
|
80
|
+
Task 1: OWNS /backend/**
|
|
81
|
+
Task 2: OWNS /frontend/**
|
|
82
|
+
Task 3: OWNS /package.json, /README.md
|
|
106
83
|
```
|
|
107
84
|
|
|
108
|
-
|
|
109
|
-
Verify global project health:
|
|
110
|
-
```
|
|
111
|
-
mad_final_check()
|
|
112
|
-
```
|
|
113
|
-
This distinguishes session errors from pre-existing issues.
|
|
85
|
+
## Silence Protocol
|
|
114
86
|
|
|
115
|
-
|
|
116
|
-
Push to remote and monitor CI:
|
|
117
|
-
```
|
|
118
|
-
mad_push_and_watch()
|
|
119
|
-
```
|
|
120
|
-
This will:
|
|
121
|
-
- Push changes to the remote
|
|
122
|
-
- Detect if GitHub Actions CI exists
|
|
123
|
-
- Watch CI progress in real-time with `gh run watch`
|
|
124
|
-
- Report success or failure with logs
|
|
87
|
+
**CRITICAL: Subagents MUST NOT output verbose commentary.**
|
|
125
88
|
|
|
126
|
-
|
|
89
|
+
### Rules for Subagents:
|
|
90
|
+
1. **No status updates** - Don't say "I'm now going to..."
|
|
91
|
+
2. **No explanations** - Don't explain what you're doing
|
|
92
|
+
3. **No summaries** - Don't summarize at the end
|
|
93
|
+
4. **Actions only** - Just execute tools and complete the task
|
|
94
|
+
5. **Signal via tools** - Use `mad_done` or `mad_blocked` to communicate
|
|
127
95
|
|
|
128
|
-
|
|
96
|
+
### Why?
|
|
97
|
+
- Reduces token usage dramatically
|
|
98
|
+
- Speeds up execution
|
|
99
|
+
- Orchestrator monitors via `mad_status`, not agent output
|
|
129
100
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
3. **Test before merge** - Always run mad_test first
|
|
133
|
-
4. **Handle blocks promptly** - Don't let blocked tasks linger
|
|
134
|
-
5. **Merge sequentially** - Avoid merge conflict cascades
|
|
135
|
-
6. **Always use `--no-ff` for merges** - Preserves feature history and enables easy reverts
|
|
101
|
+
### Orchestrator Exception:
|
|
102
|
+
The orchestrator MAY output status to keep the user informed, but should remain concise.
|
|
136
103
|
|
|
137
104
|
## Available Tools
|
|
138
105
|
|
|
@@ -140,22 +107,22 @@ If CI fails, create a `fix-ci` worktree to fix the errors.
|
|
|
140
107
|
|------|---------|
|
|
141
108
|
| `mad_worktree_create` | Create isolated branch |
|
|
142
109
|
| `mad_status` | Dashboard of all worktrees |
|
|
110
|
+
| `mad_visualize` | ASCII art visualization |
|
|
143
111
|
| `mad_test` | Run tests on worktree |
|
|
144
|
-
| `mad_merge` | Merge completed branch |
|
|
112
|
+
| `mad_merge` | Merge completed branch (uses --no-ff) |
|
|
145
113
|
| `mad_cleanup` | Remove worktree |
|
|
146
114
|
| `mad_done` | Mark task complete |
|
|
147
115
|
| `mad_blocked` | Mark task blocked |
|
|
148
116
|
| `mad_read_task` | Read task description |
|
|
149
|
-
| `
|
|
150
|
-
| `
|
|
151
|
-
|
|
152
|
-
## Example
|
|
117
|
+
| `mad_register_agent` | Register agent permissions |
|
|
118
|
+
| `mad_final_check` | Run global build/lint |
|
|
119
|
+
| `mad_push_and_watch` | Push and watch CI |
|
|
153
120
|
|
|
154
|
-
|
|
121
|
+
## Best Practices
|
|
155
122
|
|
|
156
|
-
1.
|
|
157
|
-
2.
|
|
158
|
-
3.
|
|
159
|
-
4. Test
|
|
160
|
-
5.
|
|
161
|
-
6.
|
|
123
|
+
1. **Delegate everything** - Orchestrator never codes
|
|
124
|
+
2. **Keep subtasks focused** - Completable in one session
|
|
125
|
+
3. **Name branches clearly** - `feat/`, `fix/`, `refactor/`
|
|
126
|
+
4. **Test before merge** - Always run QA first
|
|
127
|
+
5. **Merge sequentially** - Avoid conflict cascades
|
|
128
|
+
6. **Register permissions** - Before spawning developers
|