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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: mad-workflow
3
- description: Multi-Agent Dev workflow for parallel development with git worktrees and subagents
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 subagents.
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
- ## Core Concepts
15
+ ## Architecture
16
16
 
17
- ### Worktrees
18
- Git worktrees provide isolated working directories, each on its own branch. This allows multiple tasks to be developed simultaneously without conflicts.
19
-
20
- ### Subagents
21
- - **mad-developer**: Implements a single focused task in a worktree
22
- - **mad-fixer**: Resolves build errors, test failures, and conflicts
23
-
24
- ### Signal Files
25
- - `.agent-task`: Task description (created by orchestrator)
26
- - `.agent-done`: Completion marker with summary
27
- - `.agent-blocked`: Block marker with reason
28
- - `.agent-error`: Error details from failed tests
29
-
30
- ## Workflow Steps
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
- ## CRITICAL: Parallel Execution is MANDATORY
34
+ ## Specialized Agents
33
35
 
34
- The entire purpose of MAD is to run tasks IN PARALLEL.
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
- ### WRONG - Sequential (defeats the purpose)
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
- ### ✅ CORRECT - Parallel (the whole point!)
45
- ```
46
- Single Message containing:
47
- mad_worktree_create(branch: "feat-a", ...)
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
- If you're not parallelizing, you're not using MAD correctly!
54
+ ## Workflow Phases
58
55
 
59
- ### 1. Decomposition
60
- Analyze the request and identify parallelizable components:
61
- - Different modules/features
62
- - Independent files
63
- - Separable concerns
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
- ### 2. Worktree Creation
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
- ### 3. Parallel Execution
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
- ### 4. Monitoring
83
- Check progress:
84
- ```
85
- mad_status()
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
- ### 5. Testing
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
- ### 6. Merging
95
- Merge completed work:
96
- ```
97
- mad_merge(worktree: "feat-feature-name")
98
- ```
75
+ ## File Ownership Rules
99
76
 
100
- > **Note:** `mad_merge` automatically uses `--no-ff` to preserve history. If you ever need to merge manually, always use `git merge --no-ff`.
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
- mad_cleanup(worktree: "feat-feature-name")
80
+ Task 1: OWNS /backend/**
81
+ Task 2: OWNS /frontend/**
82
+ Task 3: OWNS /package.json, /README.md
106
83
  ```
107
84
 
108
- ### 8. Final Check
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
- ### 9. Push & CI Watch
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
- If CI fails, create a `fix-ci` worktree to fix the errors.
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
- ## Best Practices
96
+ ### Why?
97
+ - Reduces token usage dramatically
98
+ - Speeds up execution
99
+ - Orchestrator monitors via `mad_status`, not agent output
129
100
 
130
- 1. **Keep subtasks focused** - Each should be completable in one session
131
- 2. **Name branches clearly** - `feat/`, `fix/`, `refactor/` prefixes
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
- | `mad_final_check` | Run global build/lint and categorize errors |
150
- | `mad_push_and_watch` | Push to remote and watch CI |
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
- Request: "Add user authentication with login, signup, and password reset"
121
+ ## Best Practices
155
122
 
156
- 1. Create 3 worktrees: `feat/auth-login`, `feat/auth-signup`, `feat/auth-reset`
157
- 2. Spawn 3 developer subagents in parallel
158
- 3. Monitor until all complete
159
- 4. Test each, merge sequentially
160
- 5. Cleanup worktrees
161
- 6. Final integration test
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