just-do-it-swarming
Execute all remaining tasks using agent teams for context isolation. Each task runs in its own session. Usage /groundwork:just-do-it-swarming [--parallel]
etr · 已有静态检查记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add etr/groundwork --skill just-do-it-swarming技能说明
name: just-do-it-swarming description: Execute all remaining tasks using agent teams for context isolation. Each task runs in its own session. Usage /groundwork:just-do-it-swarming [--parallel] allowed-tools: ["Read", "Edit", "Write", "Bash", "Glob", "Grep", "Task", "AskUserQuestion", "Skill"] disable-model-invocation: true
Swarming Batch Task Execution
Executes all remaining tasks using agent teams for context isolation. Each task runs in a separate teammate session with its own context window. Teammates are full Claude Code sessions that can spawn subagents (Plan, task-executor, 9 validators), solving the context accumulation problem of inline batch execution.
When to use this vs /groundwork:just-do-it:
- Use this (
/groundwork:just-do-it-swarming) for large batches (>5 tasks) where context accumulation is a concern - Use
/groundwork:just-do-itfor small batches or when agent teams are not available
Requirement: Agent teams must be enabled (CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS: "1" in settings.json env section).
Model: Teammates spawn with model: "opus" for extended context.
Pre-flight: Model Recommendation
Your current effort level is {{effort_level}}.
Skip this step silently if effort is high, xhigh, or max (the scale is low < medium < high < xhigh < max, so xhigh and max are already above high) AND you are Sonnet or Opus.
If effort is low or medium (i.e. below high), you MUST show the recommendation prompt — regardless of model.
If you are not Sonnet or Opus, you MUST show the recommendation prompt - regardless of effort level.
Otherwise → use AskUserQuestion:
{
"questions": [{
"question": "Do you want to switch? Team orchestration with worktree coordination across agents benefits from consistent reasoning.\n\nTo switch: cancel, run `/effort high` (and `/model sonnet` if on Haiku), then re-invoke this skill.",
"header": "Recommended: Sonnet or Opus at high effort",
"options": [
{ "label": "Continue" },
{ "label": "Cancel — I'll switch first" }
],
"multiSelect": false
}]
}
If the user selects "Cancel — I'll switch first": output the switching commands above and stop. Do not proceed with the skill.
Workflow
Step 0: Resolve Project Context
Before loading tasks, ensure project context is resolved:
- Monorepo check: Does
.groundwork.ymlexist at the repo root?- If yes → Is
{{project_name}}non-empty?- If empty → Invoke
Skill(skill="groundwork:select-project")to select a project, then restart this skill. - If set → Project is
{{project_name}}, specs at{{specs_dir}}/.
- If empty → Invoke
- If no → Continue (single-project repo).
- If yes → Is
- CWD mismatch check (monorepo only):
- Skip if not in monorepo mode or if the project was just selected in item 1 above.
- If CWD is the repo root → fine, proceed.
- Check which project's path CWD falls inside (compare against all projects in
.groundwork.yml). - If CWD is inside the selected project's path → fine, proceed.
- If CWD is inside a different project's path → warn via
AskUserQuestion:"You're working from
<cwd>(inside [cwd-project]), but the selected Groundwork project is [selected-project] ([selected-project-path]/). What would you like to do?"- "Switch to [cwd-project]"
- "Stay with [selected-project]"
If the user switches, invoke
Skill(skill="groundwork:select-project").
- If CWD doesn't match any project → proceed without warning (shared directory).
- Proceed with the resolved project context. All
{{specs_dir}}/paths will resolve to the correct location.
Step 1: Load and Analyze Tasks
-
Read the tasks file to find all tasks:
- Single file:
{{specs_dir}}/tasks.md - Directory:
{{specs_dir}}/tasks/(aggregated in sorted order)
- Single file:
-
Parse all tasks and extract:
- Task ID (e.g.,
TASK-001) - Title
- Status (
Not Started,In Progress,Complete,Blocked) - Dependencies (
Blocked by:field)
- Task ID (e.g.,
-
Build dependency graph and calculate execution order:
- Topological sort respecting dependencies
- Blocked tasks cannot execute until dependencies complete
Detection: Check for file first (takes precedence), then directory.
Step 2: Present Summary and Confirm
Present a summary to the user:
Swarming Batch Execution Summary
Mode: Agent Teams (swarming) Total tasks: X Already complete: Y Remaining: Z
Context Isolation
Each task runs in a separate teammate session with its own context window:
- Teammates are full Claude Code sessions with the complete system prompt
- Each teammate can spawn subagents (Plan, task-executor, 9 validation agents)
- Context is fully isolated between tasks — no accumulation in the lead's conversation
- Changes merged after each task completes
Worktree Isolation
Each task also executes in an isolated git worktree:
- Branch:
task/TASK-NNNcreated from current HEAD - Working directory:
.worktrees/TASK-NNN - Changes merged automatically after each task completes successfully
- Worktrees cleaned up after successful merge
Execution Order
- TASK-NNN: [Title]
- TASK-NNN: [Title] ...
Blocked Tasks (will execute after dependencies complete)
- TASK-NNN: [Title] (blocked by TASK-XXX)
Ask for confirmation before proceeding.
If user declines, stop and suggest alternatives:
/groundwork:just-do-itfor inline execution (no agent teams required)/groundwork:work-on Nto work on a specific task/groundwork:work-on-next-taskto work on just the next available task
Step 2.5: Validate Agent Teams Enabled
Before creating the team, verify agent teams are available by checking if the team creation tools are accessible.
If agent teams are not enabled:
阅读完整来源 ↗"Agent teams are required for swarming mode but are not enabled. To enable them, add this to your settings.json:
{ "env": {