opencode-mad 0.3.7 → 0.3.8
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/package.json +1 -1
- 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/package.json
CHANGED
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
|
|