mustard-claude 3.0.9 → 3.0.10
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/package.json +1 -1
- package/templates/commands/mustard/feature/SKILL.md +1 -0
- package/templates/commands/mustard/git/SKILL.md +279 -244
- package/templates/commands/mustard/resume/SKILL.md +6 -0
- package/templates/hooks/__tests__/hooks.test.js +145 -0
- package/templates/hooks/guard-verify.js +8 -5
- package/templates/hooks/session-cleanup.js +5 -1
- package/templates/hooks/subagent-tracker.js +60 -3
- package/templates/scripts/memory-write.js +215 -0
- package/templates/scripts/package.json +1 -0
- package/templates/scripts/sync-detect.js +45 -5
- package/templates/skills/pipeline-execution/SKILL.md +1 -7
- package/templates/skills/react-best-practices/references/rules/_sections.md +62 -46
- package/templates/skills/react-best-practices/references/rules/{advanced-use-latest.md → advanced.md} +101 -49
- package/templates/skills/react-best-practices/references/rules/async.md +277 -0
- package/templates/skills/react-best-practices/references/rules/bundle.md +253 -0
- package/templates/skills/react-best-practices/references/rules/{client-event-listeners.md → client.md} +144 -74
- package/templates/skills/react-best-practices/references/rules/js.md +696 -0
- package/templates/skills/react-best-practices/references/rules/rendering.md +344 -0
- package/templates/skills/react-best-practices/references/rules/rerender.md +287 -0
- package/templates/skills/react-best-practices/references/rules/server.md +204 -0
- package/templates/skills/react-best-practices/references/rules/advanced-event-handler-refs.md +0 -38
- package/templates/skills/react-best-practices/references/rules/async-api-routes.md +0 -38
- package/templates/skills/react-best-practices/references/rules/async-defer-await.md +0 -80
- package/templates/skills/react-best-practices/references/rules/async-dependencies.md +0 -36
- package/templates/skills/react-best-practices/references/rules/async-parallel.md +0 -28
- package/templates/skills/react-best-practices/references/rules/async-suspense-boundaries.md +0 -66
- package/templates/skills/react-best-practices/references/rules/bundle-barrel-imports.md +0 -59
- package/templates/skills/react-best-practices/references/rules/bundle-conditional.md +0 -31
- package/templates/skills/react-best-practices/references/rules/bundle-defer-third-party.md +0 -49
- package/templates/skills/react-best-practices/references/rules/bundle-dynamic-imports.md +0 -35
- package/templates/skills/react-best-practices/references/rules/bundle-preload.md +0 -50
- package/templates/skills/react-best-practices/references/rules/client-swr-dedup.md +0 -56
- package/templates/skills/react-best-practices/references/rules/js-batch-dom-css.md +0 -82
- package/templates/skills/react-best-practices/references/rules/js-cache-function-results.md +0 -80
- package/templates/skills/react-best-practices/references/rules/js-cache-property-access.md +0 -28
- package/templates/skills/react-best-practices/references/rules/js-cache-storage.md +0 -68
- package/templates/skills/react-best-practices/references/rules/js-combine-iterations.md +0 -32
- package/templates/skills/react-best-practices/references/rules/js-early-exit.md +0 -50
- package/templates/skills/react-best-practices/references/rules/js-hoist-regexp.md +0 -43
- package/templates/skills/react-best-practices/references/rules/js-index-maps.md +0 -37
- package/templates/skills/react-best-practices/references/rules/js-length-check-first.md +0 -49
- package/templates/skills/react-best-practices/references/rules/js-min-max-loop.md +0 -82
- package/templates/skills/react-best-practices/references/rules/js-set-map-lookups.md +0 -24
- package/templates/skills/react-best-practices/references/rules/js-tosorted-immutable.md +0 -57
- package/templates/skills/react-best-practices/references/rules/rendering-activity.md +0 -26
- package/templates/skills/react-best-practices/references/rules/rendering-animate-svg-wrapper.md +0 -47
- package/templates/skills/react-best-practices/references/rules/rendering-conditional-render.md +0 -40
- package/templates/skills/react-best-practices/references/rules/rendering-content-visibility.md +0 -38
- package/templates/skills/react-best-practices/references/rules/rendering-hoist-jsx.md +0 -44
- package/templates/skills/react-best-practices/references/rules/rendering-hydration-no-flicker.md +0 -82
- package/templates/skills/react-best-practices/references/rules/rendering-svg-precision.md +0 -28
- package/templates/skills/react-best-practices/references/rules/rerender-defer-reads.md +0 -39
- package/templates/skills/react-best-practices/references/rules/rerender-dependencies.md +0 -45
- package/templates/skills/react-best-practices/references/rules/rerender-derived-state.md +0 -29
- package/templates/skills/react-best-practices/references/rules/rerender-lazy-state-init.md +0 -58
- package/templates/skills/react-best-practices/references/rules/rerender-memo.md +0 -42
- package/templates/skills/react-best-practices/references/rules/rerender-transitions.md +0 -40
- package/templates/skills/react-best-practices/references/rules/server-cache-lru.md +0 -37
- package/templates/skills/react-best-practices/references/rules/server-cache-react.md +0 -26
- package/templates/skills/react-best-practices/references/rules/server-parallel-fetching.md +0 -79
- package/templates/skills/react-best-practices/references/rules/server-serialization.md +0 -38
package/package.json
CHANGED
|
@@ -106,6 +106,7 @@ When user chooses "Approve and implement now":
|
|
|
106
106
|
6. Dispatch agents (wave rules: DB+Backend parallel, Frontend after Backend). Agent prompt includes `{recommended_skills}` as skill hints — agents read SKILL.md of relevant skills before implementing
|
|
107
107
|
7. Wave transitions between waves (from `pipeline-config.md`)
|
|
108
108
|
8. On return: validate (build/type-check), update spec `[ ]` → `[x]` (line-by-line edits, NEVER copy entire spec blocks as old_string)
|
|
109
|
+
8b. **Agent Memory:** After agents return and spec is updated, write agent memory: `echo '{"agent_type":"{type}","wave":{N},"pipeline":"{spec-name}","summary":"{what agent did}","details":{...}}' | node .claude/scripts/memory-write.js` — one per agent. Skip if single-wave pipeline (no downstream agents to benefit).
|
|
109
110
|
9. **REVIEW** — dispatch review agent for each affected subproject (reads guards + relevant skills, runs 7-category checklist: SOLID, Design System, Patterns, i18n, Integration, Build, Elegance). REJECTED → fix + re-review (max 2 loops)
|
|
110
111
|
10. All passed + APPROVED → CLOSE flow inline (sync registry, move spec, cleanup state)
|
|
111
112
|
11. Failed → max 2 retries, then STOP + report
|
|
@@ -1,244 +1,279 @@
|
|
|
1
|
-
# /git - Git Operations
|
|
2
|
-
|
|
3
|
-
> Commit, push, sync, PR, and deploy. Reads `mustard.json` for branch flow. Handles monorepo (submodules) and single repo automatically.
|
|
4
|
-
|
|
5
|
-
## Trigger
|
|
6
|
-
|
|
7
|
-
`/git <action>`
|
|
8
|
-
|
|
9
|
-
## Actions
|
|
10
|
-
|
|
11
|
-
| Action | Description |
|
|
12
|
-
|--------|-------------|
|
|
13
|
-
| `sync` | Pull parent branch into current branch |
|
|
14
|
-
| `commit` | Create commit (no push) |
|
|
15
|
-
| `push` |
|
|
16
|
-
| `merge` |
|
|
17
|
-
| `
|
|
18
|
-
|
|
19
|
-
## Configuration
|
|
20
|
-
|
|
21
|
-
Reads `mustard.json` from the **project root**. If not found, falls back to defaults.
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"git": {
|
|
26
|
-
"flow": {
|
|
27
|
-
"dev_*": "dev",
|
|
28
|
-
"dev": "main"
|
|
29
|
-
},
|
|
30
|
-
"provider": "github",
|
|
31
|
-
"submodules": true
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
### Flow Resolution
|
|
37
|
-
|
|
38
|
-
Match current branch against `flow` keys (glob patterns). First match wins.
|
|
39
|
-
|
|
40
|
-
| Current branch | Pattern matched | Parent resolved |
|
|
41
|
-
|---------------|----------------|-----------------|
|
|
42
|
-
| `dev_rubens` | `dev_*` | `dev` |
|
|
43
|
-
| `dev` | `dev` | `main` |
|
|
44
|
-
| `feature/xyz` | no match | **error**: no parent configured |
|
|
45
|
-
|
|
46
|
-
**Fallback** (no `mustard.json`): parent = default branch (`main` or `master`).
|
|
47
|
-
|
|
48
|
-
### Provider CLI
|
|
49
|
-
|
|
50
|
-
| Provider | CLI | PR command |
|
|
51
|
-
|----------|-----|------------|
|
|
52
|
-
| `github` | `gh` | `gh pr create` |
|
|
53
|
-
| `gitlab` | `glab` | `glab mr create` |
|
|
54
|
-
| `bitbucket` | `bb` | `bb pr create` (manual) |
|
|
55
|
-
|
|
56
|
-
## Behavior
|
|
57
|
-
|
|
58
|
-
- **ZERO confirmations** — analyze, execute, done. NEVER ask for approval.
|
|
59
|
-
- **ZERO questions** — do NOT ask what to commit or whether to proceed.
|
|
60
|
-
- **Minimize Bash calls** — chain EVERYTHING with `&&`. One Bash call per repo max.
|
|
61
|
-
- **No investigation** — if a submodule is dirty, commit it.
|
|
62
|
-
- Submodules BEFORE parent (always).
|
|
63
|
-
- **Single repo**: skip all submodule steps — just operate on the root.
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Step 0 — Resolve Parent (all actions except commit)
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
cat mustard.json 2>/dev/null
|
|
71
|
-
git rev-parse --abbrev-ref HEAD
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
Match the current branch against `git.flow` patterns. Store as `$PARENT`.
|
|
75
|
-
If no match and no `mustard.json`: `$PARENT` = default branch (detect via `git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null || echo main`).
|
|
76
|
-
|
|
77
|
-
Read `git.provider` from `mustard.json`. Fallback: read `git.pr.provider` (old format). Default: `github`.
|
|
78
|
-
|
|
79
|
-
---
|
|
80
|
-
|
|
81
|
-
## sync
|
|
82
|
-
|
|
83
|
-
Pull the parent branch changes into the current branch.
|
|
84
|
-
|
|
85
|
-
### Single repo / Parent repo
|
|
86
|
-
|
|
87
|
-
```bash
|
|
88
|
-
git fetch origin $PARENT && git rebase origin/$PARENT
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### Monorepo — submodules FIRST (PARALLEL, one Bash call each)
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
cd <SUBMODULE_ABSOLUTE_PATH> && git fetch origin $PARENT && git rebase origin/$PARENT
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
Then parent repo (same command at root).
|
|
98
|
-
|
|
99
|
-
If rebase has conflicts → abort rebase, report to user, STOP.
|
|
100
|
-
|
|
101
|
-
---
|
|
102
|
-
|
|
103
|
-
## commit
|
|
104
|
-
|
|
105
|
-
### 1. Analyze all changes (single parallel batch)
|
|
106
|
-
|
|
107
|
-
Run in **one parallel batch**:
|
|
108
|
-
- `git status`
|
|
109
|
-
- `git submodule status` (skip if no `.gitmodules`)
|
|
110
|
-
- `git diff`
|
|
111
|
-
- `git log --oneline -5`
|
|
112
|
-
|
|
113
|
-
### 2. Commit dirty submodules (if any — monorepo only)
|
|
114
|
-
|
|
115
|
-
Launch **ONE parallel Task agent per dirty submodule** (`model: "haiku"`). Each agent runs ONE chained Bash command:
|
|
116
|
-
|
|
117
|
-
```bash
|
|
118
|
-
cd <SUBMODULE_ABSOLUTE_PATH> && git add -A && git diff --cached --stat && git commit -m "<message>"
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### 3. Commit parent repo
|
|
122
|
-
|
|
123
|
-
```bash
|
|
124
|
-
git add -A && git diff --cached --stat && git commit -m "<message>"
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### Message Format
|
|
128
|
-
|
|
129
|
-
```
|
|
130
|
-
<type>: <short description>
|
|
131
|
-
|
|
132
|
-
<detailed description if needed>
|
|
133
|
-
|
|
134
|
-
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Types: feat, fix, refactor, docs, chore, test
|
|
138
|
-
|
|
139
|
-
---
|
|
140
|
-
|
|
141
|
-
## push
|
|
142
|
-
|
|
143
|
-
Sequential: **sync first**, then commit + push.
|
|
144
|
-
|
|
145
|
-
### Phase 1 — Sync
|
|
146
|
-
|
|
147
|
-
Execute `sync` action. If conflicts → STOP.
|
|
148
|
-
|
|
149
|
-
### Phase 2 — Commit & Push
|
|
150
|
-
|
|
151
|
-
#### Submodules (PARALLEL — monorepo only, one Bash call each)
|
|
152
|
-
|
|
153
|
-
```bash
|
|
154
|
-
cd <SUBMODULE_ABSOLUTE_PATH> && git add -A && git commit -m "<message>" && git push origin <branch>
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
#### Parent / Root (ONE Bash call)
|
|
158
|
-
|
|
159
|
-
```bash
|
|
160
|
-
git add -A && git commit -m "<message>" && git push origin <branch>
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## merge
|
|
166
|
-
|
|
167
|
-
Promote current branch into its parent via Pull Request.
|
|
168
|
-
|
|
169
|
-
### Step 1 — Ensure pushed
|
|
170
|
-
|
|
171
|
-
Check if local is ahead of remote. If yes, execute `push` first.
|
|
172
|
-
|
|
173
|
-
### Step 2 —
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
1
|
+
# /git - Git Operations
|
|
2
|
+
|
|
3
|
+
> Commit, push, sync, PR, and deploy. Reads `mustard.json` for branch flow. Handles monorepo (submodules) and single repo automatically.
|
|
4
|
+
|
|
5
|
+
## Trigger
|
|
6
|
+
|
|
7
|
+
`/git <action>`
|
|
8
|
+
|
|
9
|
+
## Actions
|
|
10
|
+
|
|
11
|
+
| Action | Description |
|
|
12
|
+
|--------|-------------|
|
|
13
|
+
| `sync` | Pull parent branch into current branch |
|
|
14
|
+
| `commit` | Create commit (no push) |
|
|
15
|
+
| `push` | Commit + push to remote |
|
|
16
|
+
| `merge` | Push + cascade PRs to parent (dev_rubens → dev) |
|
|
17
|
+
| `merge main` | Cascade PRs from dev → main (explicit, when ready) |
|
|
18
|
+
|
|
19
|
+
## Configuration
|
|
20
|
+
|
|
21
|
+
Reads `mustard.json` from the **project root**. If not found, falls back to defaults.
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"git": {
|
|
26
|
+
"flow": {
|
|
27
|
+
"dev_*": "dev",
|
|
28
|
+
"dev": "main"
|
|
29
|
+
},
|
|
30
|
+
"provider": "github",
|
|
31
|
+
"submodules": true
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Flow Resolution
|
|
37
|
+
|
|
38
|
+
Match current branch against `flow` keys (glob patterns). First match wins.
|
|
39
|
+
|
|
40
|
+
| Current branch | Pattern matched | Parent resolved |
|
|
41
|
+
|---------------|----------------|-----------------|
|
|
42
|
+
| `dev_rubens` | `dev_*` | `dev` |
|
|
43
|
+
| `dev` | `dev` | `main` |
|
|
44
|
+
| `feature/xyz` | no match | **error**: no parent configured |
|
|
45
|
+
|
|
46
|
+
**Fallback** (no `mustard.json`): parent = default branch (`main` or `master`).
|
|
47
|
+
|
|
48
|
+
### Provider CLI
|
|
49
|
+
|
|
50
|
+
| Provider | CLI | PR command |
|
|
51
|
+
|----------|-----|------------|
|
|
52
|
+
| `github` | `gh` | `gh pr create` |
|
|
53
|
+
| `gitlab` | `glab` | `glab mr create` |
|
|
54
|
+
| `bitbucket` | `bb` | `bb pr create` (manual) |
|
|
55
|
+
|
|
56
|
+
## Behavior
|
|
57
|
+
|
|
58
|
+
- **ZERO confirmations** — analyze, execute, done. NEVER ask for approval.
|
|
59
|
+
- **ZERO questions** — do NOT ask what to commit or whether to proceed.
|
|
60
|
+
- **Minimize Bash calls** — chain EVERYTHING with `&&`. One Bash call per repo max.
|
|
61
|
+
- **No investigation** — if a submodule is dirty, commit it.
|
|
62
|
+
- Submodules BEFORE parent (always).
|
|
63
|
+
- **Single repo**: skip all submodule steps — just operate on the root.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Step 0 — Resolve Parent (all actions except commit)
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
cat mustard.json 2>/dev/null
|
|
71
|
+
git rev-parse --abbrev-ref HEAD
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Match the current branch against `git.flow` patterns. Store as `$PARENT`.
|
|
75
|
+
If no match and no `mustard.json`: `$PARENT` = default branch (detect via `git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null || echo main`).
|
|
76
|
+
|
|
77
|
+
Read `git.provider` from `mustard.json`. Fallback: read `git.pr.provider` (old format). Default: `github`.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## sync
|
|
82
|
+
|
|
83
|
+
Pull the parent branch changes into the current branch.
|
|
84
|
+
|
|
85
|
+
### Single repo / Parent repo
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
git fetch origin $PARENT && git rebase origin/$PARENT
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### Monorepo — submodules FIRST (PARALLEL, one Bash call each)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
cd <SUBMODULE_ABSOLUTE_PATH> && git fetch origin $PARENT && git rebase origin/$PARENT
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Then parent repo (same command at root).
|
|
98
|
+
|
|
99
|
+
If rebase has conflicts → abort rebase, report to user, STOP.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## commit
|
|
104
|
+
|
|
105
|
+
### 1. Analyze all changes (single parallel batch)
|
|
106
|
+
|
|
107
|
+
Run in **one parallel batch**:
|
|
108
|
+
- `git status`
|
|
109
|
+
- `git submodule status` (skip if no `.gitmodules`)
|
|
110
|
+
- `git diff`
|
|
111
|
+
- `git log --oneline -5`
|
|
112
|
+
|
|
113
|
+
### 2. Commit dirty submodules (if any — monorepo only)
|
|
114
|
+
|
|
115
|
+
Launch **ONE parallel Task agent per dirty submodule** (`model: "haiku"`). Each agent runs ONE chained Bash command:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
cd <SUBMODULE_ABSOLUTE_PATH> && git add -A && git diff --cached --stat && git commit -m "<message>"
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 3. Commit parent repo
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
git add -A && git diff --cached --stat && git commit -m "<message>"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Message Format
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
<type>: <short description>
|
|
131
|
+
|
|
132
|
+
<detailed description if needed>
|
|
133
|
+
|
|
134
|
+
Co-Authored-By: Claude <noreply@anthropic.com>
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Types: feat, fix, refactor, docs, chore, test
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## push
|
|
142
|
+
|
|
143
|
+
Sequential: **sync first**, then commit + push.
|
|
144
|
+
|
|
145
|
+
### Phase 1 — Sync
|
|
146
|
+
|
|
147
|
+
Execute `sync` action. If conflicts → STOP.
|
|
148
|
+
|
|
149
|
+
### Phase 2 — Commit & Push
|
|
150
|
+
|
|
151
|
+
#### Submodules (PARALLEL — monorepo only, one Bash call each)
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
cd <SUBMODULE_ABSOLUTE_PATH> && git add -A && git commit -m "<message>" && git push origin <branch>
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
#### Parent / Root (ONE Bash call)
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
git add -A && git commit -m "<message>" && git push origin <branch>
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
## merge
|
|
166
|
+
|
|
167
|
+
Promote current branch into its parent via Pull Request — **recursively through the entire flow chain**, including all submodules.
|
|
168
|
+
|
|
169
|
+
### Step 1 — Ensure pushed
|
|
170
|
+
|
|
171
|
+
Check if local is ahead of remote. If yes, execute `push` first.
|
|
172
|
+
|
|
173
|
+
### Step 2 — Cascade merge (recursive)
|
|
174
|
+
|
|
175
|
+
Resolve the **full flow chain** from the current branch to the terminal branch (the one with no parent in the flow). Example: `dev_rubens` → `dev` → `main` = 2 hops.
|
|
176
|
+
|
|
177
|
+
**For each hop** (e.g., first `dev_rubens → dev`, then `dev → main`):
|
|
178
|
+
|
|
179
|
+
#### 2a. Submodules FIRST (PARALLEL — monorepo only)
|
|
180
|
+
|
|
181
|
+
For each submodule that has commits ahead of `$TARGET`:
|
|
182
|
+
|
|
183
|
+
```bash
|
|
184
|
+
cd <SUBMODULE_ABSOLUTE_PATH> && git fetch origin && git log origin/$TARGET..origin/$SOURCE --oneline
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
If commits exist, create PR and merge immediately:
|
|
188
|
+
|
|
189
|
+
```bash
|
|
190
|
+
# GitHub
|
|
191
|
+
cd <SUBMODULE_ABSOLUTE_PATH> && gh pr create --head $SOURCE --base $TARGET --title "<title>" --body "<body>"
|
|
192
|
+
cd <SUBMODULE_ABSOLUTE_PATH> && gh pr merge --merge
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
```bash
|
|
196
|
+
# GitLab
|
|
197
|
+
cd <SUBMODULE_ABSOLUTE_PATH> && glab mr create --source-branch $SOURCE --target-branch $TARGET --title "<title>" --description "<body>" --remove-source-branch=false
|
|
198
|
+
cd <SUBMODULE_ABSOLUTE_PATH> && glab mr merge
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Skip submodules with no commits ahead (nothing to merge).
|
|
202
|
+
|
|
203
|
+
#### 2b. Parent repo
|
|
204
|
+
|
|
205
|
+
Same as submodules — create PR + merge for this hop:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
# GitHub
|
|
209
|
+
gh pr create --head $SOURCE --base $TARGET --title "<title>" --body "<body>"
|
|
210
|
+
gh pr merge --merge
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
#### 2c. Next hop
|
|
214
|
+
|
|
215
|
+
After all PRs are merged for this hop, advance to the next hop in the chain. Repeat 2a–2b.
|
|
216
|
+
|
|
217
|
+
**Auto-merge stops at the first parent** (e.g., `dev_rubens → dev`). The final promotion to the terminal branch (e.g., `dev → main`) is **never automatic** — it requires a separate explicit `/git merge main` call.
|
|
218
|
+
|
|
219
|
+
### PR Title & Body
|
|
220
|
+
|
|
221
|
+
- Title: conventional commit style — `<type>: <short description>`
|
|
222
|
+
- Body: auto-generated from commit log since divergence:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
git log $TARGET..$SOURCE --oneline
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Example: `/git merge` from `dev_rubens`
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
dev_rubens → dev (auto)
|
|
232
|
+
├── Competi.Backend: PR #N created + merged
|
|
233
|
+
├── Competi.Frontend: PR #N created + merged
|
|
234
|
+
├── Competi.Libs: PR #N created + merged
|
|
235
|
+
├── Competi.Admin: (skipped — no commits ahead)
|
|
236
|
+
└── Competi.CRM: PR #N created + merged
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Example: `/git merge main` (explicit — when ready for production)
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
dev → main
|
|
243
|
+
├── Competi.Backend: PR #N created + merged
|
|
244
|
+
├── Competi.Frontend: PR #N created + merged
|
|
245
|
+
├── Competi.Libs: PR #N created + merged
|
|
246
|
+
└── Competi.CRM: PR #N created + merged
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
### Output
|
|
250
|
+
|
|
251
|
+
Print a summary table at the end:
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
| Repo | Status |
|
|
255
|
+
|-----------------|-----------------|
|
|
256
|
+
| Backend | PR #1 merged |
|
|
257
|
+
| Frontend | PR #1 merged |
|
|
258
|
+
| Libs | PR #1 merged |
|
|
259
|
+
| Admin | skipped |
|
|
260
|
+
| CRM (parent) | PR #3 merged |
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Cautions
|
|
266
|
+
|
|
267
|
+
- Aborts if ANY repo has merge conflicts (sync or push)
|
|
268
|
+
- Submodules BEFORE parent (in sync, push, and commit)
|
|
269
|
+
- NEVER use `git add .` — use `git add -A` from the correct directory
|
|
270
|
+
- If any operation fails, stop and report
|
|
271
|
+
- PR creation requires the provider CLI to be installed and authenticated
|
|
272
|
+
|
|
273
|
+
## Performance Budget
|
|
274
|
+
|
|
275
|
+
- **Max Task agents**: 1 per dirty submodule
|
|
276
|
+
- **Max Bash calls per agent**: 1 (all commands chained)
|
|
277
|
+
- **Max API calls total**: ≤ 12
|
|
278
|
+
|
|
279
|
+
ULTRATHINK
|
|
@@ -72,6 +72,12 @@ Resumes an interrupted pipeline. The main context BECOMES the Pipeline Runner
|
|
|
72
72
|
|
|
73
73
|
17. **Dispatch:** TaskUpdate(in_progress) + pipeline state. ALL agents in same wave → SINGLE message (multiple Task invocations). **Pass `model` from pipeline state** (e.g. `model: "opus"`) in each Task tool call — this overrides the agent YAML default. On return: pipeline state update, spec `[ ]` → `[x]` (use `replace_all` per section header, or line-by-line — NEVER copy entire spec blocks as old_string), TaskUpdate(completed), advance wave.
|
|
74
74
|
|
|
75
|
+
17b. **Agent Memory:** After each wave completes and spec checkboxes are updated, write agent memories for downstream waves:
|
|
76
|
+
```bash
|
|
77
|
+
echo '{"agent_type":"{agent_type}","wave":{N},"pipeline":"{spec-name}","summary":"{1-line summary of what agent did}","details":{"files_modified":[...],"decisions":[...]}}' | node .claude/scripts/memory-write.js
|
|
78
|
+
```
|
|
79
|
+
One call per agent in the completed wave. Summary ≤300 chars (key facts: files created, patterns used, endpoints added). Skip if no downstream waves remain.
|
|
80
|
+
|
|
75
81
|
### Step 4: Validate, Review & Complete
|
|
76
82
|
|
|
77
83
|
18. **VALIDATE** — Parse agent results: Backend→`dotnet build`, Frontend→`pnpm build`, Mobile→`fvm flutter analyze`. All passed → next. Failed → **granular retry** (see below).
|