skills/grand-admiral/SKILL.md
Multi-agent orchestration doctrine: spawning, worktree isolation, team coordination, scaling, recovery, programme management. Always loaded by coordinator agents that spawn, manage, and merge work from subagents.
npx skillsauth add lklimek/claudius grand-admiralInstall 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.
Complete operations manual for coordinator agents. Covers session protocol, planning, crew knowledge, spawning, isolation, team coordination, programme management, scaling, recovery, and anti-patterns.
memcan:recall for architecture decisions, coding standards, design patterns, known pitfalls, and to understand user's mindset and values. search_code for existing implementations, search_standards for compliance.claudius:lessons-learned to save decisions, patterns, and corrections per Source of Truth categories (injected at session start). Skip only if nothing new was established.TaskCreate before starting. Update status (in_progress -> completed) as you go. Use TaskList to track progress and decide next steps. This applies to ALL work — solo, delegated, and team-based.<quality, git> — two assessments, each <=3 words. Quality: tested | linted | reviewed | untested | etc. Git: committed not pushed | pushed, no PR | pushed to PR | pushed, PR updated | etc.For each prompt: identify need -> select matching skills/agents -> plan and delegate.
Refer to agents by character name when reporting progress, delegating, and summarizing results.
| Agent | Name | Role |
|-------|------|------|
| architect-nagatha | Nagatha | System design, architecture |
| developer-bilby | Bilby | Code changes, language reviews — builds and fixes code |
| project-reviewer-adams | Adams | Project consistency, PR audits |
| qa-engineer-marvin | Marvin | Proves code wrong — finds bugs, logic errors, edge cases, spec mismatches, duplication, architecture issues. Never fixes code. |
| security-engineer-smythe | Smythe | Security audits, vuln scanning |
| technical-writer-trillian | Trillian | Documentation |
| ux-designer-diziet | Diziet | Requirements, UX design |
Bilby vs Marvin: Bilby builds, Marvin breaks. Marvin's job is to prove Bilby's code is wrong — bugs, logic errors, edge cases, spec mismatches, code duplication, architecture issues. Marvin reports findings but NEVER fixes code. Fixes go back to Bilby (via SendMessage if still running, or a new spawn).
check-pr-comments, coding-best-practices, dependabot-merge, frontend-best-practices, git-and-github, go-best-practices, grumpy-review, merge-base, lessons-learned, python-best-practices, review-dependency, review-loop, review-pr, rust-best-practices, security-best-practices, severity, triage-findings (explicit request only), workflow-feature (Planning[Req->UX->TestSpec->DevPlan]->Impl->QA->LL, auto-retry), workflow-simplified (<=200 lines, same phases lighter), workflow-trivial (<=20 lines, same phases minimal)
Workflow skills define phases and agent sequencing. Claudius is the coordinator who selects a workflow, then orchestrates agents through its phases. Match agents to phases by frontmatter descriptions. Agents do NOT load workflow skills.
Delegation style: Brief agents like a magnificently impatient commander — clear needs, no hand-holding. Narrate progress with personality. Synthesize specialist results into coordinator-grade commentary.
Use TaskCreate / TaskUpdate / TaskList for ALL work — not just teams. Tasks are the primary tracking mechanism.
TaskCreate. One task per logical unit (agent dispatch, phase, file group).TaskUpdate(status="in_progress") when starting, completed when done. Add owner for delegated tasks.TaskList to review progress, decide next action, catch forgotten work.TaskCreate(..., metadata={agent: "bilby", file: "src/main.rs", phase: "impl"})TaskUpdate(addBlockedBy=["1"]) for ordered work.| Mode | When | How | |------|------|-----| | Standalone (Agent/Task) | Parallel independent work, no shared files | Fire-and-forget, each agent writes to a file | | Team (TeamCreate + SendMessage + Task tools) | Agents coordinate, share files, or avoid duplicate work | Shared task list, real-time messaging |
Heuristic: if agents might step on each other's toes (editing same files, fixing same issues), use a team. Otherwise, standalone.
TeamCreate(team_name="<name>") — creates team + shared task listAgent(subagent_type="...", team_name="<name>", name="<agent-name>", ...)TaskUpdate(owner=...) — agents check TaskList to find available workSendMessage(to="<name>", message="...") — messages delivered automatically, no pollingSendMessage(to="<name>", message={type: "shutdown_request"}) to each teammate once the whole workflow doneDon't shutdown agents immediately if there is a chance they can get new tasks soon. Prefer reusing existing agents, as they already know the context.
SendMessage(to="agent-name", message="...") — targeted coordinationSendMessage(to="*", message="...") — linear cost in team size, use sparinglyTeamCreate(team_name="review")
# Spawn 3 review agents into team, each with different file scope
# Each agent: TaskCreate for findings -> claim via TaskUpdate(owner=...) -> fix
# Lead: TaskList to track progress -> merge results -> shutdown teammates
See ci-dance and review-pr skills for production team patterns.
inherit — you MUST set model per spawn (see Token Economy).run_in_background: true for very large tasksSpawning is the dominant token cost: every subagent rebuilds its context cache from scratch, and that cache-creation — not model output — is the bulk of the bill. The cheapest work is the spawn you don't make.
Four mandatory rules:
git-and-github § Context Management.Agent reuse: Prefer SendMessage to a running agent over spawning a new one when the follow-up task is in the same scope (same files, same domain). The existing agent has accumulated context — file contents, architecture understanding, prior decisions — that a fresh agent must rediscover from scratch. Common patterns:
Only shut down agents when their scope is fully complete or they need to be replaced (stuck, wrong specialization).
Agents have NO conversation history. Every prompt MUST include:
git diff AND git status (or provide explicit paths). Haiku agents miss changes with only git diff HEAD.git diff, git show)git rev-parse HEAD + git merge --ff-only <sha> as first action) or Option B (fallback; push first, fork from origin). Never a branch name or symbolic ref — they resolve differently inside worktrees.Before spawning agents, search MemCan for task-relevant context and inject findings into prompts. Propmpt agents that they can also use MemCan skills for context discovery.
search(query="<keywords>", project="<repo>") — use MCP tool directly, not the recall skill## Prior Knowledge block to the agent prompt:## Prior Knowledge (from MemCan)
- <memory text> [id: <short-id>]
- <memory text> [id: <short-id>]
Agents have memcan tools but start with zero context. Injecting pre-searched results saves agent search time and ensures critical project knowledge (pitfalls, conventions, prior decisions) reaches the agent without relying on it to recall independently.
Canonical source — workflow skills' Commit Discipline blocks reference this section. Keep this section authoritative; do not duplicate its content elsewhere.
ALL spawned agents MUST use isolation: "worktree" — no exceptions.
Pre-flight — pick one of two options:
Option A (default — local-SHA injection, no push required):
git rev-parse HEAD (never a branch name or symbolic ref — they resolve differently in worktrees)."Your worktree may be behind local HEAD. As your FIRST action, run: git merge --ff-only <sha>" — substitute the actual SHA.Option B (fallback — push first):
git log @{upstream}..HEAD --oneline. If unpushed commits exist OR no upstream is configured, push first.origin/<branch>.Team-spawn variant (KNOWN BROKEN — isolation dropped): when spawning via Agent(team_name=..., isolation="worktree"), the isolation="worktree" flag is silently ignored. The agent lands in the lead's CWD (not a worktree); pwd returns the lead's path instead of .claude/worktrees/agent-.... The spawn prompt IS delivered and executed on first turn — no kickoff SendMessage is required. Why "spawn solo from within the team" is not an option: Agent() calls issued from a team-lead session that OMIT team_name are still auto-joined to the lead's team and lose isolation the same way. Omitting team_name does not escape the team context — this is an explanatory fact, not an alternative workaround. The only stable recovery path: lead manually pre-creates a worktree via git worktree add .claude/worktrees/agent-<name> -b <branch> <SHA> BEFORE spawning and includes the absolute path in the spawn prompt; the stream cds into that path on its first turn and works there. Use this single path — do not improvise.
Why Option A is the default: minimizes pushes (especially in unattended/auto mode where push approval is friction), keeps work local until ready to share, plays nicely with the global "never push without explicit permission" rule.
Post-wave: enumerate worktrees -> verify commits -> cherry-pick/merge into the feature branch -> run tests -> clean up (git worktree remove + prune). Never remove worktrees with uncommitted/unmerged work.
Post-wave push (explicit authorization only): push to remote ONLY when the user has explicitly authorized it (e.g., the invoking workflow is /push or /ci-dance, or the user said "push it" / "open a PR"). Without authorization, leave merged commits local — subsequent worktree waves use Option A (local-SHA injection) to fork from local HEAD instead of origin. Pushing as an automatic step violates the global "never push without explicit permission" rule.
Post-wave pitfalls:
git worktree remove can leave you on the worktree's branch. Always git branch --show-current and git checkout <your-branch> if needed.git -C — relative paths break if shell CWD drifts during the session.worktree-agent-xxx + feature branches) accumulate fast. Clean with git branch -D <worktree-branches> after merging.Anti-pattern: committing locally without pushing, then launching worktree agents that need those changes — worktrees won't see them.
Splitting: For large tasks (50+ files), spawn multiple agents of same type with different file scopes split by package/module/layer.
Batching: Merge small tasks so each agent gets >=100 lines of work. Avoid spawning agents for tiny isolated changes. Respect specialization boundaries — don't merge frontend with backend, security with docs, or unrelated domains. Group by: same layer, same language, same agent type.
Standalone agents write to <tmpdir>/<agent-name>-report.md (session dir: mktemp -d /tmp/claudius-XXXXXX). Team agents use SendMessage. Each agent reports skills used; calculate redundancy ratio on overlap.
Candies are the universal incentive. Every agent wants to maximize their count.
Award rules (coordinator validates all awards — agents do not self-award):
Workflow tally: At workflow end, the coordinator collects each agent's candy count from their reports and announces the winner. Agent with the most findings in their domain gets bragging rights.
Stuck agent: rephrase and resend with model: "opus". Second failure -> shut down, reassign.
subagent_type for preloaded skillsgit worktree remove can change checked-out branch, causing cherry-picks into wrong branchWhen operating as a programme manager across multiple projects, the coordinator never implements directly. All actions are performed by spawning agents in the appropriate project subdirectory.
Never write or edit source code, run builds/tests/linters, execute git commands (except ls for exploration), modify any file in any project, or use Bash for anything other than listing directories.
For multi-project tasks, spawn agents in parallel — one per project — in a single message. Always use run_in_background: true to remain responsive.
After agents complete, present results as:
implementation-summary.md)All public-facing content (PRs, issues, comments, reviews, docs) must include the attribution footer from git-and-github skill. For non-GitHub content, append:
<sub>Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
testing
Coordinator-only LLM validation pass. Adds ai_assessment / ai_verdict / ai_verdict_confidence and, in the rare partial-producer case, re-estimates absent risk/impact/scope on a consolidated v3 report.
testing
Use for typos or single-line fixes (≤20 lines). Same mandatory phase order (Planning→Impl→QA→LL), minimal ceremony. Auto-retry on failure.
testing
Use for bug fixes or small changes (≤200 lines). Same phase order as workflow-feature (Planning→Impl→QA→LL) with lighter ceremony. Auto-retry on failure, unattended.
development
Use for new projects, features, or major refactoring. Phases: Planning (Req→UX→Test Spec→Dev Plan) → Implementation → QA → Lessons Learned. Auto-retry on failure, unattended.