/groundwork:plan-task [task-number-or-description] [--project name]from groundwork
Plans a task or feature by loading context, clarifying requirements, spawning a Plan agent, and persisting the validated plan to a project-scoped directory.
Ships in groundwork. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Plans a task or feature by loading context, optionally clarifying requirements, spawning a Plan agent, and persisting the validated plan to the project-scoped .groundwork-plans/ directory.
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.
If session context contains GROUNDWORK_RUNNER_MODE=true:
GROUNDWORK_BATCH_MODE=true as authoritative: do not call AskUserQuestion.RESULT: FAILURE instead of asking..gitignore; the runner keeps .groundwork-plans/ out of Git state.RESULT: PLANNED contract unchanged.This skill orchestrates planning workflows. Every turn re-reads the full context window, so unnecessary turns are expensive.
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. Otherwise ask via AskUserQuestion (header "Model check"; options "Continue anyway" / "Cancel — I'll switch first"):
"Do you want to switch? Planning benefits from consistent multi-domain reasoning.
Recommended: Sonnet or Opus at high effort.
To switch: cancel, run
/effort high(and/model sonnetif on Haiku), then re-invoke this skill."
If the user selects "Cancel — I'll switch first": output the switching commands and stop. Do not proceed with the skill. Ask once per conversation: a skill invoked by another skill skips this step when the recommendation was already shown. In a non-interactive run (--noninteractive, GROUNDWORK_RUNNER_MODE=true, or GROUNDWORK_BATCH_MODE=true), skip the prompt and continue on the current model.
.groundwork.yml exist at the repo root?
{{project_name}} non-empty?
Skill(skill="groundwork:select-project") to select a project, then restart this skill.{{project_name}}, specs at {{specs_dir}}/.--project.
.groundwork.yml: the repo root or the selected project's path → fine, proceed; no project's path → proceed without warning (shared directory).--noninteractive, keep the selected project and continue; otherwise 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").
Parse the input from the caller's conversation context. Three modes:
4, or full format like TASK-004): Set mode=task, task_id=TASK-NNN (zero-padded to 3 digits).mode=feature, blurb=<text>.mode=task+blurb, task_id=TASK-NNN, blurb=<text>.RESULT: FAILURE | No task ID or feature description provided. and stop.mode=task or mode=task+blurb)Locate task file:
{{specs_dir}}/tasks.md{{specs_dir}}/tasks/
Search for ### TASK-NNN: pattern.
Error: Task not found → Output RESULT: FAILURE | TASK-NNN not found in {{specs_dir}}/tasks/ and stop.Read task definition — only the ### TASK-NNN: section (goal, action items, acceptance criteria, test seams, dependencies, status). Do NOT read full specs/architecture/design files.
Validate task is workable:
Complete → Output RESULT: FAILURE | TASK-NNN is already Complete. and stop.RESULT: FAILURE | TASK-NNN is blocked by: [list]. and stop.node ${CLAUDE_PLUGIN_ROOT}/lib/task-resume.js check TASK-NNN (add --project <name> in monorepos). If the check reports existing implementation work (resume_at is implement, validate, finalize, or done), re-planning would invalidate a resumable run — output RESULT: FAILURE | TASK-NNN has existing in-flight work (resume_at: <value>). Resume it via work-on instead of re-planning. and stop, surfacing the check's evidence.Verify spec paths exist (use Glob, not Read):
{{specs_dir}}/product_specs.md or {{specs_dir}}/product_specs/{{specs_dir}}/architecture.md or {{specs_dir}}/architecture/{{specs_dir}}/design_system.mdIf specs missing: Report which are missing and suggest running /groundwork:design-product or /groundwork:design-architecture first. In runner mode, return RESULT: FAILURE instead of asking. Otherwise use AskUserQuestion to confirm proceeding without them.
If design system missing: Proceed without it.
Set identifier=TASK-NNN, branch_prefix=task.
mode=feature)Load existing specs (check for and read if they exist):
{{specs_dir}}/product_specs.md (or {{specs_dir}}/product_specs/ directory) → PRD_CONTEXT{{specs_dir}}/architecture.md (or {{specs_dir}}/architecture/ directory) → ARCHITECTURE_CONTEXT{{specs_dir}}/design_system.md → DESIGN_CONTEXTFor each, check for a single file first (it takes precedence), then a directory. Read a directory as all its .md files recursively — _index.md first, then numerically-prefixed files, then alphabetically.
If none exist, that's fine — proceed without them.
Clarify requirements: Call Skill(skill="groundwork:understanding-feature-requests")
Do NOT attempt to gather requirements yourself. The skill handles this.
If existing specs were loaded, provide them as context so the clarification skill can:
Follow the skill to gather: problem being solved, target user/persona, expected outcome, edge cases and scope boundaries. Continue until requirements are clear and internally consistent.
Generate feature identifier:
FEATURE-<slug>FEATURE-user-login, "Export reports to PDF" → FEATURE-pdf-exportSet identifier=FEATURE-<slug>, branch_prefix=feature.
Spawn a Plan agent with mode-appropriate context:
Agent(
subagent_type="Plan",
description="Plan TASK-NNN",
prompt="Plan the implementation of a task.
TASK DEFINITION:
[Paste the task section read in Step 2 — goal, action items, acceptance criteria, test seams]
[If mode=task+blurb, add:]
ADDITIONAL CONTEXT FROM USER:
[blurb text]
SPEC PATHS (read these yourself for full context):
- Product specs: [path or 'not found']
- Architecture: [path or 'not found']
- Design system: [path or 'not found']
- Tasks file: [path]
CONSTRAINTS:
1. Work happens in an isolated git worktree — the plan must instruct the implementer to resolve it with `node ${CLAUDE_PLUGIN_ROOT}/lib/worktree-identity.js <task-id>` and use the returned `path` and `branch` verbatim (never hand-derived `.worktrees/<task-id>` paths)
2. Implementation must follow TDD — write failing tests first, then make them pass
3. Tests target the task's recorded Test Seams. If the task records none, or a recorded seam cannot reach the behavior, plan tests at the highest existing seam that reaches it — the plan states this choice so the implementer never has to ask
4. Plan covers implementation only — validation and merge are handled separately by the caller
5. If a design system is present, the plan must reference design tokens, colors, and component patterns from it
"
)
Agent(
subagent_type="Plan",
description="Plan FEATURE-slug",
prompt="Plan the implementation of a feature.
FEATURE DEFINITION:
- Identifier: [FEATURE-slug]
- Description: [1-2 sentence summary from clarification]
REQUIREMENTS:
[Bulleted list of clarified requirements]
ACCEPTANCE CRITERIA:
[Bulleted list of acceptance criteria]
OUT OF SCOPE:
[Bulleted list of exclusions, or 'None specified']
SPEC PATHS (read these yourself for full context):
- Product specs: [path or 'not found']
- Architecture: [path or 'not found']
- Design system: [path or 'not found']
CONSTRAINTS:
1. Work happens in an isolated git worktree — the plan must instruct the implementer to resolve it with `node ${CLAUDE_PLUGIN_ROOT}/lib/worktree-identity.js <feature-id>` and use the returned `path` and `branch` verbatim (never hand-derived `.worktrees/<feature-id>` paths)
2. Implementation must follow TDD — write failing tests first, then make them pass
3. Tests are planned at the highest existing seam that reaches each behavior — the plan names those seams, so the implementer never has to ask
4. Plan covers implementation only — validation and merge are handled separately by the caller
5. If a design system is present, the plan must reference design tokens, colors, and component patterns from it
"
)
Validate the plan:
If ANY unchecked: Reject plan, state what's missing, re-invoke Plan agent.
After the plan is validated, persist it to disk in the same turn as receiving the Plan agent's output:
Create the plans directory and ensure it's gitignored:
mkdir -p {{plans_dir}}
grep -qxF '.groundwork-plans/' .gitignore 2>/dev/null || printf '.groundwork-plans/\n' >> .gitignore
{{plans_dir}} resolves inside the selected project's root (mirroring {{specs_dir}}), so overlapping identifiers across monorepo projects cannot collide. The .gitignore pattern is unanchored, so it covers plan directories at any project depth.
Set plan_file_path={{plans_dir}}/{identifier}-plan.md (substitute the actual identifier). One plan per identifier — re-running planning on the same identifier overwrites the previous plan, which is intentional. The .gitignore append is idempotent so it is safe to run on every invocation.
Use the Write tool to save the plan. Format the file as:
# Implementation Plan: {identifier} [Title]
## Context
- Mode: task | feature | task+blurb
- Identifier: {identifier}
- Branch prefix: {branch_prefix}
- Specs dir: {{specs_dir}}
- Tasks path: {path to tasks file, or N/A for features}
## Requirements (blurb/feature mode only)
[Clarified requirements, acceptance criteria, out-of-scope — omit this section in task mode]
## Plan
<verbatim Plan agent output>
This is the only turn where the plan content appears in orchestrator context.
Output exactly:
RESULT: PLANNED | plan_file_path={plan_file_path} | identifier={identifier} | branch_prefix={branch_prefix}
Do NOT restate, summarize, or re-quote the plan in any subsequent turn. Refer to plan_file_path only.
DO NOT proceed past this step. The caller handles implementation.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
task-planning, feature-planning, project-planning, groundwork
Generated from the plugin's indexed repository (etr/groundwork) — no native marketplace selected
npx claudepluginhub p/etr-groundwork44 skills in this plugin
/build-unplannedBuild a feature from a description with worktree isolation and TDD. Optional flag - --on-unrelated-failure stop-and-ask|expand-and-fix|ignore-and-merge - how validation treats gate failures unrelated to the active project (default stop-and-ask)./check-specs-alignmentVerify alignment between code and specs./create-tasksGenerate implementation tasks from architecture document./debugUse when investigating bugs, unexpected behavior, test failures, or any code that does not work as expected - enforces systematic root cause analysis before any fix/design-architectureUse when the user asks to design system architecture, make architectural decisions, or translate PRD into technical design/design-it-twiceUse before committing to a non-trivial module, service boundary, or public API - generate 2-3 divergent interface designs, compare them on depth/locality/seam, and recommend oneOther plugins' skills for the same job