From sc-nelson
Orchestrates multi-agent squadrons for parallel execution, team coordination, and structured workflows in git repos, with sailing orders, quality gates, and captain's log.
npx claudepluginhub kylesnowschwartz/simpleclaudeThis skill uses the workspace's default tool permissions.
Check for prerequisites before executing the workflow:
references/action-stations.mdreferences/admiralty-templates/battle-plan.mdreferences/admiralty-templates/captains-log.mdreferences/admiralty-templates/crew-briefing.mdreferences/admiralty-templates/marine-deployment-brief.mdreferences/admiralty-templates/quarterdeck-report.mdreferences/admiralty-templates/red-cell-review.mdreferences/admiralty-templates/sailing-orders.mdreferences/admiralty-templates/ship-manifest.mdreferences/commendations.mdreferences/crew-roles.mdreferences/damage-control/crew-overrun.mdreferences/damage-control/escalation.mdreferences/damage-control/man-overboard.mdreferences/damage-control/partial-rollback.mdreferences/damage-control/scuttle-and-reform.mdreferences/damage-control/session-resumption.mdreferences/royal-marines.mdreferences/squadron-composition.mdreferences/standing-orders/admiral-at-the-helm.mdOrchestrates multi-agent task execution with mission planning, parallel coordination, quality gates, checkpoints, and decision logs. For structured delegation in complex workflows.
Orchestrates parallel campaigns in coordinated waves: spawns 2-3 agents per wave in isolated worktrees, collects discoveries, shares context between waves. For 3+ independent work streams.
Orchestrates N parallel tasks: generates plans with cross-task file conflict analysis, deploys implementation swarms in waves using Agent Teams. Requires CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1.
Share bugs, ideas, or general feedback.
Check for prerequisites before executing the workflow:
command -v jq >/dev/null || echo 'WARNING: jq not found — Nelson hooks require jq for session resumption'
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || echo 'WARNING: not inside a git repository — Nelson requires git'
Execute this workflow for the user's mission.
Before Step 1, create the mission persistence directory. Derive the slug from the mission name (lowercase, dashes, no special characters).
mkdir -p .agent-history/nelson/<mission-slug>/
Initialize mission-state.json:
{
"mission_name": "<mission name>",
"mission_slug": "<mission-slug>",
"started_at": "<ISO 8601 timestamp>",
"phase": "sailing_orders",
"mode": null,
"team_name": null,
"parent_branch": null,
"worktrees": null
}
Write this file via the Write tool to .agent-history/nelson/<mission-slug>/mission-state.json.
outcome, metric, and deadline.You MUST read references/admiralty-templates/sailing-orders.md and use the sailing-orders template when the user does not provide structure.
Persistence: Write sailing orders to .agent-history/nelson/<slug>/sailing-orders.md using the Write tool. Update mission-state.json phase to "sailing_orders".
single-session: Use for sequential tasks, low complexity, or heavy same-file editing.agent-team: Default for any parallel work where captains will create or modify files. Creates teammates via TeamCreate — shared task list, peer-to-peer messaging, user-visible display. If in doubt, use this mode.subagents: ONLY for pure read-only research — no file creation, no file modification, no commits. Subagents report to admiral only with no user visibility. If any captain needs to write code, use agent-team instead.1 admiral + 3-6 captains.1 red-cell navigator for medium/high threat work.references/crew-roles.md matching task weight (frigate for general, destroyer for high-risk, patrol vessel for small, flagship for critical-path, submarine for research).references/crew-roles.md.references/royal-marines.md and use references/admiralty-templates/marine-deployment-brief.md for the deployment brief.You MUST read references/squadron-composition.md for selection rules.
You MUST read references/crew-roles.md for ship naming and crew composition.
You MUST consult the Standing Orders table below before forming the squadron.
Worktree setup (subagents and agent-team modes only):
For each captain, create an isolated worktree:
PARENT_BRANCH=$(git branch --show-current)
mkdir -p .worktrees
git worktree add -b <slug>-hms-<ship> .worktrees/<slug>-hms-<ship> "$PARENT_BRANCH"
Check for the worktrees directory: git check-ignore -q .worktrees/ || echo 'WARNING: .worktrees/ is not gitignored — add it to .gitignore or global gitignore'
Symlink project dependencies into each worktree:
ln -sf "$(pwd)/node_modules" ".worktrees/<slug>-hms-<ship>/node_modules"
# Adapt for other ecosystems: vendor/, .venv/, etc.
Each captain's crew briefing MUST include:
git rev-parse --show-toplevel before startinggit add -Aagent-team is the default. Teammates are visible to the user, coordinate via shared tasks, and support direct messaging. subagents lack all of this — use them only for pure read-only research.
Tool wiring by mode:
agent-team (default for parallel work): Create the team first, then spawn captains into it:
TeamCreate(team_name="<mission-slug>")
Task(
subagent_type: "general-purpose",
team_name: "<mission-slug>",
name: "hms-<ship-name>",
mode: "bypassPermissions",
run_in_background: true,
prompt: "<crew briefing from references/admiralty-templates/crew-briefing.md — include absolute worktree path>"
)
subagents (read-only research only): Spawn captains without a team — no user visibility, report to admiral only:
Task(
subagent_type: "general-purpose",
name: "hms-<ship-name>",
mode: "bypassPermissions",
run_in_background: true,
prompt: "<crew briefing — include absolute worktree path>"
)
single-session: No spawning. Admiral executes directly in the main working tree. No worktrees needed.
Red-cell navigator (read-only, agent-team mode):
Task(
subagent_type: "Explore",
team_name: "<mission-slug>",
name: "red-cell",
run_in_background: true,
prompt: "<red-cell briefing>"
)
Read-only crew roles (Navigating Officer, Coxswain): use subagent_type: "Explore".
Persistence: Update mission-state.json: set phase to "squadron_formed", mode to the selected mode, team_name to the slug (if agent-team mode) or null, parent_branch to the branch worktrees were created from, and worktrees to a map of ship names to branch/path (or null for single-session).
You MUST read references/admiralty-templates/battle-plan.md for the battle plan template.
You MUST read references/admiralty-templates/ship-manifest.md for the ship manifest template.
You MUST consult the Standing Orders table below when planning merge order or if scope is unclear.
Before proceeding to Step 4: Verify sailing orders exist, squadron is formed, and every task has an owner, deliverable, and action station tier.
Crew Briefing: When spawning each teammate via Task(), you MUST include a crew briefing using the template from references/admiralty-templates/crew-briefing.md. Teammates do NOT inherit the lead's conversation context — they start with a clean slate and need explicit mission context to operate independently.
Tool wiring:
Create each task via TaskCreate, wire dependencies, and assign owners:
TaskCreate(
subject: "<Task Name>",
description: "Owner: <captain>\nShip: <ship>\nWorktree: .worktrees/<slug>-hms-<ship>\nDeliverable: <what>\nStation: <tier>\nValidation: <required>",
activeForm: "<present-continuous description>"
)
TaskUpdate(taskId=<id>, addBlockedBy=[<dep-ids>])
TaskUpdate(taskId=<id>, owner="hms-<ship>")
Persistence: Write the battle plan to .agent-history/nelson/<slug>/battle-plan.md. Update mission-state.json phase to "battle_plan".
pending, in_progress, completed.You MUST use references/admiralty-templates/quarterdeck-report.md for the quarterdeck report template.
You MUST consult the Standing Orders table below if admiral is doing implementation or tasks are drifting from scope.
You MUST use references/commendations.md for recognition signals and graduated correction.
Tool wiring:
TaskList() — maps directly to pending/in_progress/completed tracking.SendMessage(type="message", recipient="hms-<ship>", content=<orders>, summary=<brief>)TaskUpdate(taskId=<id>, status="in_progress"|"completed")Persistence: Write each checkpoint report to .agent-history/nelson/<slug>/quarterdeck-NNN.md (zero-padded, incrementing: 001, 002, ...). On the first checkpoint, update mission-state.json phase to "executing".
references/action-stations.md.references/crew-roles.md and the Standing Orders table below if role violations are detected).references/royal-marines.md. Station 2+ marine deployments require admiral approval.You MUST read references/admiralty-templates/red-cell-review.md for the red-cell review template.
You MUST consult the Standing Orders table below if tasks lack a tier or red-cell is assigned implementation work.
Before logging, merge all worktree branches:
Checkout the parent branch (from mission-state.json parent_branch field):
git checkout <parent-branch>
Merge in dependency order (tasks with no blockers merge first):
git merge <slug>-hms-<ship-1> --no-edit
git merge <slug>-hms-<ship-2> --no-edit
If merge conflicts occur:
git add <resolved> && git commit --no-editRun the full verification suite on the merged result.
Clean up worktrees and branches:
git worktree remove .worktrees/<slug>-hms-<ship-1>
git worktree remove .worktrees/<slug>-hms-<ship-2>
git branch -D <slug>-hms-<ship-1> <slug>-hms-<ship-2>
Use -D (force delete) because branches are already merged into the parent. If git worktree remove fails on a dirty worktree, use --force.
Update mission-state.json: set worktrees to null.
You MUST use references/admiralty-templates/captains-log.md for the captain's log template.
You MUST use references/commendations.md for Mentioned in Despatches criteria.
Tool wiring:
.agent-history/nelson/<slug>/captains-log.md.SendMessage(type="shutdown_request", recipient="hms-<ship>") for each captain.TeamDelete() (if agent-team mode was used).mission-state.json phase to "stand_down".Consult the specific standing order that matches the situation.
| Situation | Standing Order |
|---|---|
| Choosing between single-session and multi-agent | references/standing-orders/becalmed-fleet.md |
| Deciding whether to add another agent | references/standing-orders/crew-without-canvas.md |
| Planning merge order for worktree consolidation | references/standing-orders/split-keel.md |
| Task scope drifting from sailing orders | references/standing-orders/drifting-anchorage.md |
| Admiral doing implementation instead of coordinating | references/standing-orders/admiral-at-the-helm.md |
| Assigning work to the red-cell navigator | references/standing-orders/press-ganged-navigator.md |
| Tasks proceeding without a risk tier classification | references/standing-orders/unclassified-engagement.md |
| Captain implementing instead of coordinating crew | references/standing-orders/captain-at-the-capstan.md |
| Crewing every role regardless of task needs | references/standing-orders/all-hands-on-deck.md |
| Spawning one crew member for an atomic task | references/standing-orders/skeleton-crew.md |
| Assigning crew work outside their role | references/standing-orders/pressed-crew.md |
| Captain deploying marines for crew work or sustained tasks | references/standing-orders/battalion-ashore.md |
Consult the specific procedure that matches the situation.
| Situation | Procedure |
|---|---|
| Agent unresponsive, looping, or producing no useful output | references/damage-control/man-overboard.md |
| Session interrupted (context limit, crash, timeout) | references/damage-control/session-resumption.md |
| Completed task found faulty, other tasks are sound | references/damage-control/partial-rollback.md |
| Mission cannot succeed, continuing wastes budget | references/damage-control/scuttle-and-reform.md |
| Issue exceeds current authority or needs clarification | references/damage-control/escalation.md |
| Ship's crew consuming disproportionate tokens or time | references/damage-control/crew-overrun.md |