implement-task
Dispatches a planned task/feature to the task-executor agent for worktree-isolated TDD implementation
etr · Static checks on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add etr/groundwork --skill implement-taskAbout this skill
name: implement-task description: Dispatches a planned task/feature to the task-executor agent for worktree-isolated TDD implementation argument-hint: "[task-number-or-plan-path] [--project name]"
Task Implementation Skill
Dispatches a previously planned task or feature to the task-executor agent for worktree-isolated TDD implementation.
Explicit Project Input
If arguments include --project <name>, resolve that project directly from the repository's .groundwork.yml for this invocation. Treat it as authoritative; do not depend on or change persisted project selection. In runner mode, GROUNDWORK_PROJECT and GROUNDWORK_PROJECT_ROOT provide the same invocation-local selection.
Runner Mode
If session context contains GROUNDWORK_RUNNER_MODE=true:
- Skip the model recommendation pre-flight and all questions.
- In task mode, skip Step 2 entirely; the base checkout must remain clean. Tell the task-executor to record
In Progressinside the task worktree and include it in the implementation commit. - Forward the runner-supplied absolute worktree path exactly; do not let the executor choose another directory.
- Forward the runner-supplied task branch exactly; monorepos use a project-qualified branch to prevent overlapping task IDs from colliding.
- When the runner supplies
RESUME EXISTING WORKTREE=true, verify and reuse that exact registered worktree. Tell the executor to inspect existing commits, working state, tests, and plan progress; do not repeat completed implementation work. - Forward the runner receipt token exactly.
- The runner exclusively owns task-worktree creation, reconciliation, cleanup, staging, and commits. The task-executor edits and tests the precreated worktree, then proposes an expressive commit subject and body.
- Return the task-executor's versioned JSON
RESULT: IMPLEMENTEDreceipt unchanged.
Token Discipline
This skill orchestrates implementation dispatch. Every turn re-reads the full context window, so unnecessary turns are expensive.
- No narration turns. Do not output text-only turns like "Let me dispatch the task" or "Now I'll launch the executor." Combine text with a tool call in the same turn, or skip the text entirely.
- Batch tool calls. When multiple tool calls are independent, issue them all in one turn.
- No waiting updates. Do not output "Waiting for results..." turns. Wait silently until results arrive.
- Keep context lean. Do not read file contents you won't use directly. The task-executor agent has Read/Grep/Glob and will read files in its own context window.
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": "Implementation benefits from consistent multi-domain reasoning.\n\nTo switch: cancel, run `/effort high` (and `/model sonnet` if on Haiku), then re-invoke.",
"header": "Effort check",
"options": [
{ "label": "Continue" },
{ "label": "Cancel — I'll switch first" }
],
"multiSelect": false
}]
}
If the user selects "Cancel — I'll switch first": output the switching commands and stop. Do not proceed with the skill.
Step 0: Resolve Project Context
Before dispatching, 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
- Proceed with the resolved project context.
Step 1: Resolve Plan File
Parse input from the caller's conversation context. Three modes:
- plan_file_path provided → Read the plan file header to extract
Identifier,Mode,Branch prefix,Tasks path. - task_id only (no plan_file_path) → Derive path
.groundwork-plans/TASK-NNN-plan.md. If file does not exist, outputRESULT: FAILURE | No plan found for TASK-NNN. Run plan-task first.and stop. - task_id + plan_file_path → Use the provided plan file path. Verify it exists.
- Neither → Output
RESULT: FAILURE | No plan_file_path or task_id provided. Run plan-task first.and stop.
Read ONLY the ## Context header from the plan file to extract:
identifier(e.g.,TASK-004orFEATURE-user-login)mode(task, feature, or task+blurb)branch_prefix(task or feature)tasks_path(path to tasks file, or N/A)specs_dir
Do NOT read the full plan content into this orchestrator's context. The task-executor agent will read it.
Step 2: Update Task Status (task mode only)
Skip this step if identifier starts with FEATURE-.
Also skip this step if GROUNDWORK_RUNNER_MODE=true. Add the equivalent status update to the task-executor instructions so it occurs and is committed inside the task worktree, never in the base checkout.
Update the task file to **Status:** In Progress and update the status table in {{specs_dir}}/tasks/_index.md or {{specs_dir}}/tasks.md (change the task's row to In Progress).
Step 3: Dispatch to task-executor
Dispatch to the task-executor agent with a fresh context window. This agent has use-git-worktree and test-driven-development skills preloaded — it does not need to call Skill() or spawn subagents.
Build the Agent prompt — pass paths, not content.
Task mode (identifier starts with TASK-)
Agent(
subagent_type="groundwork:task-
Read the complete source ↗