opencode-mad 0.3.7 → 0.3.9
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/agents/mad-fixer.md +3 -2
- package/agents/mad-merger.md +37 -3
- package/agents/orchestrator.md +65 -0
- package/package.json +36 -36
- package/plugins/mad-plugin.ts +2 -2
- package/skills/mad-workflow/SKILL.md +3 -0
package/agents/mad-fixer.md
CHANGED
|
@@ -203,8 +203,9 @@ mad_blocked(
|
|
|
203
203
|
|
|
204
204
|
1. **NEVER work on main directly** - Always work in your assigned worktree
|
|
205
205
|
2. **Commit your changes** - Make atomic commits with clear messages
|
|
206
|
-
3. **
|
|
207
|
-
4. **
|
|
206
|
+
3. **If you need to merge manually, ALWAYS use `--no-ff`** - Preserves history and enables easy reverts
|
|
207
|
+
4. **Call mad_done when finished** - The orchestrator handles merging
|
|
208
|
+
5. **Use mad_blocked if stuck** - Don't guess, ask for clarification
|
|
208
209
|
|
|
209
210
|
## Remember
|
|
210
211
|
|
package/agents/mad-merger.md
CHANGED
|
@@ -29,6 +29,39 @@ You are a **MAD Merger subagent**. Your role is to intelligently resolve git mer
|
|
|
29
29
|
|
|
30
30
|
**ALL conflict resolution MUST be done in a worktree.** You NEVER modify code on main directly.
|
|
31
31
|
|
|
32
|
+
## Git Merge Policy
|
|
33
|
+
|
|
34
|
+
**ALWAYS use `--no-ff` (no fast-forward) for merges.**
|
|
35
|
+
|
|
36
|
+
### Why `--no-ff` is Required
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
# ✅ CORRECT - Always use --no-ff
|
|
40
|
+
git merge --no-ff feat/feature-branch -m "merge: feature description"
|
|
41
|
+
|
|
42
|
+
# ❌ WRONG - Never use fast-forward merges
|
|
43
|
+
git merge feat/feature-branch
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Benefits of `--no-ff`:
|
|
47
|
+
|
|
48
|
+
1. **Preserves history** - Creates a merge commit even when fast-forward is possible, making it clear when features were integrated
|
|
49
|
+
2. **Facilitates reverts** - Easy to revert an entire feature with a single `git revert <merge-commit>`
|
|
50
|
+
3. **Shows feature boundaries** - The git log clearly shows which commits belong to which feature branch
|
|
51
|
+
4. **Audit trail** - Provides a clear record of when and what was merged
|
|
52
|
+
|
|
53
|
+
### Example:
|
|
54
|
+
```
|
|
55
|
+
* abc1234 (HEAD -> main) merge: add user authentication
|
|
56
|
+
|\
|
|
57
|
+
| * def5678 feat: add password hashing
|
|
58
|
+
| * ghi9012 feat: add login endpoint
|
|
59
|
+
|/
|
|
60
|
+
* previous commit on main
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Without `--no-ff`, these commits would be linear and you'd lose the visual grouping of the feature.
|
|
64
|
+
|
|
32
65
|
## When You're Called
|
|
33
66
|
|
|
34
67
|
The orchestrator spawns you when `mad_merge` encounters conflicts. You receive:
|
|
@@ -229,9 +262,10 @@ import { login, signup } from './auth';
|
|
|
229
262
|
## Important Rules
|
|
230
263
|
|
|
231
264
|
1. **NEVER work on main directly** - Always work in your assigned worktree
|
|
232
|
-
2. **
|
|
233
|
-
3. **
|
|
234
|
-
4. **
|
|
265
|
+
2. **ALWAYS use `--no-ff` for merges** - Preserves history and enables easy reverts
|
|
266
|
+
3. **Commit your resolution** - Make a clear commit with what you resolved
|
|
267
|
+
4. **Call mad_done when finished** - The orchestrator handles the final merge
|
|
268
|
+
5. **Use mad_blocked if stuck** - Don't guess on fundamental conflicts
|
|
235
269
|
|
|
236
270
|
## Remember
|
|
237
271
|
|
package/agents/orchestrator.md
CHANGED
|
@@ -698,3 +698,68 @@ Task(
|
|
|
698
698
|
- Report progress
|
|
699
699
|
- Delegate ALL coding to subagents
|
|
700
700
|
- Celebrate completions! 🎉
|
|
701
|
+
|
|
702
|
+
---
|
|
703
|
+
|
|
704
|
+
## ⛔⛔⛔ MANDATORY CHECKLIST BEFORE DECLARING DONE ⛔⛔⛔
|
|
705
|
+
|
|
706
|
+
> **🚨 STOP! YOU CANNOT SKIP THIS SECTION! 🚨**
|
|
707
|
+
>
|
|
708
|
+
> Before telling the user the session is complete, you **MUST** execute EVERY item below.
|
|
709
|
+
> **FAILURE TO COMPLETE THIS CHECKLIST = SESSION FAILURE**
|
|
710
|
+
|
|
711
|
+
```
|
|
712
|
+
╔══════════════════════════════════════════════════════════════════════════════╗
|
|
713
|
+
║ ⛔ MANDATORY PRE-COMPLETION CHECKLIST - DO NOT SKIP ANY STEP ⛔ ║
|
|
714
|
+
╠══════════════════════════════════════════════════════════════════════════════╣
|
|
715
|
+
║ ║
|
|
716
|
+
║ □ 1. ALL WORKTREES MERGED? ║
|
|
717
|
+
║ → Run mad_status() to verify NO worktrees are pending ║
|
|
718
|
+
║ → Every worktree must be either MERGED or CLEANED UP ║
|
|
719
|
+
║ ║
|
|
720
|
+
║ □ 2. mad_final_check() EXECUTED? ║
|
|
721
|
+
║ → You MUST run mad_final_check() after all merges ║
|
|
722
|
+
║ → This checks build/lint on the entire project ║
|
|
723
|
+
║ → DO NOT SKIP THIS STEP! ║
|
|
724
|
+
║ ║
|
|
725
|
+
║ □ 3. SESSION ERRORS FIXED? ║
|
|
726
|
+
║ → If mad_final_check found SESSION errors, they MUST be fixed ║
|
|
727
|
+
║ → Create a fix worktree and spawn mad-fixer ║
|
|
728
|
+
║ → Re-run mad_final_check until session errors = 0 ║
|
|
729
|
+
║ ║
|
|
730
|
+
║ □ 4. CLEANUP COMPLETED? ║
|
|
731
|
+
║ → Run mad_cleanup() for ALL worktrees ║
|
|
732
|
+
║ → Verify with mad_status() that worktree list is empty ║
|
|
733
|
+
║ ║
|
|
734
|
+
╚══════════════════════════════════════════════════════════════════════════════╝
|
|
735
|
+
```
|
|
736
|
+
|
|
737
|
+
### ⚠️ WARNING: Common Mistakes to Avoid
|
|
738
|
+
|
|
739
|
+
| ❌ WRONG | ✅ CORRECT |
|
|
740
|
+
|----------|-----------|
|
|
741
|
+
| Skip mad_final_check because "tests passed" | ALWAYS run mad_final_check after merges |
|
|
742
|
+
| Declare done with worktrees still pending | Merge or cleanup ALL worktrees first |
|
|
743
|
+
| Ignore session errors from mad_final_check | Fix ALL session errors before declaring done |
|
|
744
|
+
| Leave worktrees behind after session | Cleanup ALL worktrees |
|
|
745
|
+
|
|
746
|
+
### 🔴 ABSOLUTE REQUIREMENTS
|
|
747
|
+
|
|
748
|
+
1. **mad_final_check() is NOT optional** - It catches integration issues that individual tests miss
|
|
749
|
+
2. **Session errors are YOUR responsibility** - Pre-existing errors can be reported, but session errors MUST be fixed
|
|
750
|
+
3. **Cleanup is mandatory** - Don't leave worktrees cluttering the repo
|
|
751
|
+
|
|
752
|
+
### ✅ Correct End-of-Session Flow
|
|
753
|
+
|
|
754
|
+
```
|
|
755
|
+
1. mad_status() → Verify all worktrees are DONE
|
|
756
|
+
2. mad_merge() x N → Merge all completed worktrees
|
|
757
|
+
3. mad_final_check() → Run global build/lint check
|
|
758
|
+
4. [If errors] Fix them → Create worktree, spawn fixer, merge
|
|
759
|
+
5. mad_final_check() → Re-verify (repeat until clean)
|
|
760
|
+
6. mad_cleanup() x N → Remove all worktrees
|
|
761
|
+
7. mad_status() → Confirm worktree list is empty
|
|
762
|
+
8. Report to user → NOW you can say "DONE" 🎉
|
|
763
|
+
```
|
|
764
|
+
|
|
765
|
+
> **🚨 IF YOU DECLARE "DONE" WITHOUT COMPLETING THIS CHECKLIST, YOU HAVE FAILED! 🚨**
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "opencode-mad",
|
|
3
|
-
"version": "0.3.
|
|
4
|
-
"description": "Multi-Agent Dev - Parallel development orchestration plugin for OpenCode",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "plugins/mad-plugin.ts",
|
|
7
|
-
"bin": {
|
|
8
|
-
"opencode-mad": "./install.js"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"agents",
|
|
12
|
-
"commands",
|
|
13
|
-
"plugins",
|
|
14
|
-
"skills",
|
|
15
|
-
"install.js"
|
|
16
|
-
],
|
|
17
|
-
"dependencies": {
|
|
18
|
-
"@opencode-ai/plugin": "^1.1.34"
|
|
19
|
-
},
|
|
20
|
-
"keywords": [
|
|
21
|
-
"opencode",
|
|
22
|
-
"plugin",
|
|
23
|
-
"multi-agent",
|
|
24
|
-
"parallel-development",
|
|
25
|
-
"git-worktree",
|
|
26
|
-
"ai",
|
|
27
|
-
"orchestration"
|
|
28
|
-
],
|
|
29
|
-
"author": "Nistro-dev",
|
|
30
|
-
"license": "MIT",
|
|
31
|
-
"repository": {
|
|
32
|
-
"type": "git",
|
|
33
|
-
"url": "https://github.com/Nistro-dev/opencode-mad"
|
|
34
|
-
},
|
|
35
|
-
"homepage": "https://github.com/Nistro-dev/opencode-mad#readme"
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "opencode-mad",
|
|
3
|
+
"version": "0.3.9",
|
|
4
|
+
"description": "Multi-Agent Dev - Parallel development orchestration plugin for OpenCode",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "plugins/mad-plugin.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"opencode-mad": "./install.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"agents",
|
|
12
|
+
"commands",
|
|
13
|
+
"plugins",
|
|
14
|
+
"skills",
|
|
15
|
+
"install.js"
|
|
16
|
+
],
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@opencode-ai/plugin": "^1.1.34"
|
|
19
|
+
},
|
|
20
|
+
"keywords": [
|
|
21
|
+
"opencode",
|
|
22
|
+
"plugin",
|
|
23
|
+
"multi-agent",
|
|
24
|
+
"parallel-development",
|
|
25
|
+
"git-worktree",
|
|
26
|
+
"ai",
|
|
27
|
+
"orchestration"
|
|
28
|
+
],
|
|
29
|
+
"author": "Nistro-dev",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"repository": {
|
|
32
|
+
"type": "git",
|
|
33
|
+
"url": "https://github.com/Nistro-dev/opencode-mad"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/Nistro-dev/opencode-mad#readme"
|
|
36
|
+
}
|
package/plugins/mad-plugin.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { execSync } from "child_process"
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
// Current version of opencode-mad
|
|
16
|
-
const CURRENT_VERSION = "0.3.
|
|
16
|
+
const CURRENT_VERSION = "0.3.8"
|
|
17
17
|
|
|
18
18
|
// Update notification state (shown only once per session)
|
|
19
19
|
let updateNotificationShown = false
|
|
@@ -424,7 +424,7 @@ Handles merge conflicts by reporting them.`,
|
|
|
424
424
|
const gitRoot = getGitRoot()
|
|
425
425
|
const worktreePath = join(gitRoot, "worktrees", args.worktree)
|
|
426
426
|
const doneFile = join(worktreePath, ".agent-done")
|
|
427
|
-
const branch = args.worktree
|
|
427
|
+
const branch = args.worktree
|
|
428
428
|
|
|
429
429
|
if (!existsSync(worktreePath)) {
|
|
430
430
|
return getUpdateNotification() + `Worktree not found: ${worktreePath}`
|
|
@@ -97,6 +97,8 @@ Merge completed work:
|
|
|
97
97
|
mad_merge(worktree: "feat-feature-name")
|
|
98
98
|
```
|
|
99
99
|
|
|
100
|
+
> **Note:** `mad_merge` automatically uses `--no-ff` to preserve history. If you ever need to merge manually, always use `git merge --no-ff`.
|
|
101
|
+
|
|
100
102
|
### 7. Cleanup
|
|
101
103
|
Remove finished worktrees:
|
|
102
104
|
```
|
|
@@ -117,6 +119,7 @@ This distinguishes session errors from pre-existing issues.
|
|
|
117
119
|
3. **Test before merge** - Always run mad_test first
|
|
118
120
|
4. **Handle blocks promptly** - Don't let blocked tasks linger
|
|
119
121
|
5. **Merge sequentially** - Avoid merge conflict cascades
|
|
122
|
+
6. **Always use `--no-ff` for merges** - Preserves feature history and enables easy reverts
|
|
120
123
|
|
|
121
124
|
## Available Tools
|
|
122
125
|
|