plugins/specweave/skills/team-merge/SKILL.md
--- description: Merge completed parallel agent work and trigger GitHub sync per increment. Activates for: team merge, merge agents, combine work, team finish. --- # Team Merge **Verify all teammates completed, run quality gates, close increments, and trigger sync.** ## Usage ```bash sw:team-merge sw:team-merge --dry-run # Preview merge plan sw:team-merge --skip-sync # Merge without GitHub/JIRA sync ``` ## What This Skill Does 1. **Verify all teammates completed** -- bl
npx skillsauth add anton-abyzov/specweave plugins/specweave/skills/team-mergeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Verify all teammates completed, run quality gates, close increments, and trigger sync.
sw:team-merge
sw:team-merge --dry-run # Preview merge plan
sw:team-merge --skip-sync # Merge without GitHub/JIRA sync
sw:grill for each incrementsw:done per incrementsw-github:sync) or JIRA (sw-jira:push)Native Agent Teams share the filesystem, so verification is straightforward:
For each teammate's increment:
- Check tasks.md is 100% complete
- Verify sw:grill quality gate passed
- If any teammate still running -> report and ask user to wait
For multi-repo team sessions, verify all agent work follows the repository directory convention:
# Check for repos created outside repositories/ directory
if [ -d "repositories" ]; then
for git_dir in ./*/.git; do
repo_name=$(dirname "$git_dir")
if [[ "$repo_name" != ./repositories/* && "$repo_name" != "./.git" ]]; then
echo "WARNING: Repository $repo_name found outside repositories/ directory"
echo "Expected: repositories/{org}/$(basename $repo_name)/"
fi
done
fi
If repos are found outside repositories/, report as a warning with remediation instructions. The merge proceeds but the report flags the issue for cleanup.
Dependencies flow: shared -> backend -> frontend (or as defined by team topology)
Closure order respects contract chain:
1. shared/types (no dependencies)
2. database (depends on shared types)
3. backend (depends on database + shared)
4. frontend (depends on backend API + shared types)
5. devops/qa/security (independent, close last)
For each teammate's increment, in dependency order:
PRE-CLOSURE: Ensure increment is in "active" or "ready_for_review" status:
STATUS=$(jq -r '.status' .specweave/increments/<id>/metadata.json)
if [ "$STATUS" = "planned" ] || [ "$STATUS" = "backlog" ]; then
# Edit metadata.json to set "status": "active"
fi
Spawn an sw-closer subagent per increment for a fresh context:
Agent({
subagent_type: "sw:sw-closer",
prompt: "Close increment <ID>. Increment path: .specweave/increments/<ID>/",
description: "Close increment <ID>"
})
Wait for each sw-closer to complete before spawning the next (dependency order). If a closer fails, log the failure and continue to the next increment.
If the Agent tool is NOT available, invoke closure directly:
sw:done <increment-id> --auto
If sw:done fails, fix root cause and retry (max 2 retries). Common fixes: sync ACs, update task counts, write missing reports.
This ensures:
sw:grill runs for each incrementtasks.md and spec.md ACs are validatedmetadata.json is updated to completedFor each closed increment, trigger external sync:
# GitHub Issues sync
sw-github:sync <increment-id>
# JIRA sync (if configured)
sw-jira:push <increment-id>
The team's durable artifacts are already in .specweave/increments/ (spec.md, tasks.md, grill-report.json, metadata.json). No additional archival of ephemeral Claude Code state is needed.
Print a structured execution summary as the final output:
Team Execution Summary
═══════════════════════
Team: {team_name}
Agents:
{agent-1}: COMPLETED (T-8/8, tests passing)
{agent-2}: COMPLETED (T-12/12, tests passing)
Increments closed: {list}
Sync: {GitHub/JIRA status}
7a. Send shutdown_request to all agents you know from the team session:
SendMessage({ type: "shutdown_request", recipient: "<agent-1>", content: "Merge complete" });
SendMessage({ type: "shutdown_request", recipient: "<agent-2>", content: "Merge complete" });
// ... for every agent in this team
Harmless if agents already exited. NOTE: shutdown_request via SendMessage does NOT close the tmux pane — Phase 7c below is the ONLY mechanism that kills orphaned panes. NEVER skip 7c.
7b. Destroy team:
TeamDelete()
If TeamDelete fails (agents still shutting down), wait 3 seconds, retry once.
7c. Kill orphaned panes (MANDATORY — this is the ONLY thing that closes tmux panes):
SendMessage shutdown does NOT close tmux panes. ALWAYS run this script.
if command -v tmux >/dev/null 2>&1; then
CURRENT_PANE=$(tmux display-message -p '#{pane_id}' 2>/dev/null || echo "")
for pane_id in $(tmux list-panes -a -F '#{pane_id}' 2>/dev/null); do
[ -n "$CURRENT_PANE" ] && [ "$pane_id" = "$CURRENT_PANE" ] && continue
if tmux capture-pane -t "$pane_id" -p -S -50 2>/dev/null | grep -q "Resume this session"; then
tmux kill-pane -t "$pane_id" 2>/dev/null
fi
done
fi
| Option | Description |
|--------|-------------|
| --dry-run | Show merge plan without executing |
| --skip-sync | Merge without triggering GitHub/JIRA sync |
| --skip-done | Skip running sw:done (increments stay active) |
User: sw:team-merge
Checking teammates...
backend (0301-api-endpoints) -- done, grill passed
frontend (0302-ui-components) -- done, grill passed
shared (0300-shared-types) -- done, grill passed
Closure order: 0300 -> 0301 -> 0302
Running sw:done 0300-shared-types... done
Running sw:done 0301-api-endpoints... done
Running sw:done 0302-ui-components... done
Syncing to GitHub...
0300 -> issue #45 closed
0301 -> issue #46 closed
0302 -> issue #47 closed
Team Execution Summary
═══════════════════════
Team: feature-checkout
Agents:
shared-agent: COMPLETED (T-4/4, tests passing)
backend-agent: COMPLETED (T-8/8, tests passing)
frontend-agent: COMPLETED (T-6/6, tests passing)
Increments closed: 0300, 0301, 0302
Sync: GitHub issues #45, #46, #47 closed
Shutting down agents... done
TeamDelete: team cleaned up.
All increments merged and synced.
tools
Generate AI videos from text prompts or images. Supports Google Veo 3.1 and Pollinations.ai (free). Use when generating video, creating animations, text-to-video, AI video, video generation, make clip, animate.
tools
Validate increment with rule-based checks and AI quality assessment. Use when saying "validate", "check quality", or "verify increment".
tools
Create and manage umbrella workspaces for multi-repo projects. Activate when the user wants to: create umbrella, umbrella init, wrap in umbrella, create workspace, setup multi-repo, migrate repos to umbrella, umbrella create, new workspace, restructure into umbrella, "wrap this repo", "create umbrella for these repos", "setup workspace with repos", "move repos into umbrella". Do NOT activate for: add a repo to existing umbrella (use sw:get), add a feature, add an increment, clone a repo (use sw:get).
tools
Phase-agnostic orchestrator for parallel multi-agent work — brainstorm, plan, implement, review, research, or test. Auto-detects mode from intent. Use for implementation (3+ domains or 15+ tasks), brainstorming (multiple perspectives), parallel planning (PM + Architect), code review (delegates to sw:code-reviewer), research (multiple topics), or testing (parallel test layers). Also use when user says "team setup", "parallel agents", "team lead", "agent teams", "brainstorm with agents", "plan in parallel", "review code", "research this".