Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Merge session worktree branch back to main
.claude/skills/catlog22-maestro-merge/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 1219% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-11 | ✗→✓ | ▲ Improved | 26% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 52% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 44% | 0% |
<required_reading> @~/.maestro/workflows/run-mode.md @~/.maestro/workflows/codex-run-mode.md </required_reading>
<purpose> Merge a session worktree branch back into main, sync Run artifacts, and reconcile the artifact registry. Two-step: git merge first, artifact sync second (only after git succeeds). </purpose>
<context> $ARGUMENTS -- session ID (or slug) and optional flags.
Terminology: this command uses 'session' throughout. The underlying workflow file (merge.md) may use 'milestone' as a legacy alias for 'session'. Treat them as equivalent: --session maps to workflow's -m, state.json.sessions[] maps to state.json.milestones[].
Flags (--session, --force, --dry-run, --no-cleanup, --continue), merge sequence, artifact sync detail, and conflict handling are defined in workflow merge.md. </context>
<execution> Follow '~/.maestro/workflows/merge.md' completely.
--dry-run short-circuit: execute GATE 1 health check only, display merge preview (files that would change, artifact sync plan), then EXIT before rebase/merge. GATE 2 and GATE 3 are not reached.
GATE 1: Pre-merge → Git Merge
Note on --force: skips user confirmation for incomplete phase artifacts (W002). Does NOT skip conflict resolution or rebase. Specifically: GATE 1 and GATE 2 are unaffected by --force; GATE 3's artifact completeness check uses --force to bypass the W002 confirmation.
GATE 2: Git Merge → Artifact Sync
GATE 3: Artifact Sync → Completion
sessions/{session_id}/runs/.--no-cleanup flag present.</execution>
<completion>
After successful merge, use request_user_input to confirm knowledge persistence:
question: "Merge 完成。是否记录本次工作经验教训?"
options:
- label: "记录经验"
description: "通过 maestro-spec add 持久化此次工作的关键洞察"
- label: "跳过"
description: "不记录,直接完成"User selects "记录经验" → prompt for title/insight, then recommend /maestro-spec add learning "<title>" "<insight>" --keywords <kw1>,<kw2> --description "<summary>". User selects "跳过" → proceed to next-step routing.
| Condition | Suggestion | |-----------|-----------| | Next dep-ready session | step analyze for session — open a v3 Session (maestro session open "<goal>" --id YYYYMMDD-analyze-{next-dep-ready-slug} --chain analyze --participant {p} --actor {a} --request-id {r} --reason "<reason>" --json → fenced maestro run next --session {session_id} ... --json), or route via /maestro-next | </completion>
<error_codes> | Code | Severity | Condition | Recovery | |------|----------|-----------|----------| | E001 | error | Running inside a worktree | Run from main worktree | | E002 | error | No worktree registry found | Nothing to merge | | E003 | error | --continue but no merge state | Start fresh merge | | E004 | error | No session ID provided | Provide --session <session_id> | | W001 | warning | Stale registry entries found | Auto-cleaned | | W002 | warning | Incomplete artifacts (without --force) | Confirm or use --force | | W003 | warning | Conflict pulling main into worktree | Resolve in worktree first | | W004 | warning | Schema version mismatch between worktree and main | Run maestro-update in worktree before merge | </error_codes>
<success_criteria>
sessions/{session_id}/runs/worktrees.json registry updated (entry removed)worktree-scope.json removed from worktree (even with --no-cleanup, to prevent stale scope detection)</success_criteria>
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 10,019 | 5,189 | -48% | 1 | 1 | 0% | 1,575 | 1,540 | -2% | 0 | 0 | — |
case-02 | fail→fail | 3,434 | 5,333 | +55% | 1 | 1 | 0% | 389 | 1,510 | +288% | 0 | 0 | — |
case-03 | fail→fail | 3,960 | 5,243 | +32% | 1 | 1 | 0% | 426 | 1,475 | +246% | 0 | 0 | — |
case-04 | fail→pass | 6,089 | 17,825 | +193% | 1 | 1 | 0% | 306 | 4,037 | +1219% | 0 | 0 | — |
case-05 | fail→fail | 6,132 | 6,417 | +5% | 1 | 1 | 0% | 849 | 1,637 | +93% | 0 | 0 | — |
case-06 | fail→fail | 7,042 | 5,331 | -24% | 1 | 1 | 0% | 1,096 | 1,495 | +36% | 0 | 0 | — |
case-07 | fail→pass | 10,703 | 4,550 | -57% | 1 | 1 | 0% | 1,645 | 2,056 | +25% | 0 | 0 | — |
case-08 | pass→pass | 8,334 | 3,997 | -52% | 1 | 1 | 0% | 1,140 | 1,934 | +70% | 0 | 0 | — |
case-09 | pass→pass | 6,335 | 5,427 | -14% | 1 | 1 | 0% | 890 | 2,101 | +136% | 0 | 0 | — |
case-10 | pass→pass | 4,955 | 13,129 | +165% | 1 | 1 | 0% | 735 | 2,899 | +294% | 0 | 0 | — |
case-11 | fail→pass | 10,645 | 5,218 | -51% | 1 | 1 | 0% | 1,623 | 2,046 | +26% | 0 | 0 | — |
case-12 | fail→pass | 8,384 | 3,894 | -54% | 1 | 1 | 0% | 1,209 | 1,835 | +52% | 0 | 0 | — |
case-13 | fail→fail | 2,551 | 5,618 | +120% | 1 | 1 | 0% | 299 | 1,561 | +422% | 0 | 0 | — |
case-14 | fail→pass | 8,473 | 3,849 | -55% | 1 | 1 | 0% | 1,284 | 1,846 | +44% | 0 | 0 | — |
case-15 | fail→pass | 9,093 | 2,247 | -75% | 1 | 1 | 0% | 1,377 | 1,629 | +18% | 0 | 0 | — |
case-16 | fail→pass | 11,900 | 3,359 | -72% | 1 | 1 | 0% | 1,839 | 1,792 | -3% | 0 | 0 | — |
case-17 | fail→pass | 12,627 | 3,995 | -68% | 1 | 1 | 0% | 1,847 | 1,842 | -0% | 0 | 0 | — |
case-18 | fail→fail | 11,062 | 7,518 | -32% | 1 | 1 | 0% | 1,696 | 1,862 | +10% | 0 | 0 | — |
case-19 | fail→pass | 10,811 | 3,374 | -69% | 1 | 1 | 0% | 1,603 | 1,777 | +11% | 0 | 0 | — |
case-20 | pass→pass | 13,420 | 3,875 | -71% | 1 | 1 | 0% | 2,074 | 1,829 | -12% | 0 | 0 | — |
case-21 | pass→pass | 14,635 | 4,950 | -66% | 1 | 1 | 0% | 2,201 | 2,072 | -6% | 0 | 0 | — |
case-22 | fail→pass | 8,919 | 6,822 | -24% | 1 | 1 | 0% | 1,386 | 1,808 | +30% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 15 counted toward the lift figure. The other 7 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +45 percentage points is the difference between those two pass rates over the 15 comparable cases. 2 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.