/groundwork:work-on-next-taskfrom groundwork
Finds and executes the next uncompleted task from project specs, with flags for session takeover and failure handling. Useful for structured project workflows.
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.
Finds the next uncompleted task from {{specs_dir}}/tasks/ (or {{specs_dir}}/tasks.md) and delegates execution to the work-on skill.
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? Dependency resolution and task selection benefits from consistent 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.
IMPORTANT: Your job is NOT to build a plan or build anything, it is to exclusively to find the next task to execute. Don't do planning or building until the full workflow is executed. If you find yourself planning or executing, STOP and follow the workflow.
.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").
Read only the task index to find available tasks — do NOT read individual task files:
{{specs_dir}}/tasks/_index.md (preferred — contains status table){{specs_dir}}/tasks.mdDetection: Check for {{specs_dir}}/tasks/_index.md first, then {{specs_dir}}/tasks.md. Do NOT aggregate all task files — the index contains the status table with all the information needed to find the next task.
Parse the status table in _index.md to find the next task:
| # | Task | Milestone | Status | Blocked by |
|---|------|-----------|--------|------------|
| TASK-001 | Auth setup | M1 | Complete | None |
| TASK-002 | Login UI | M1 | In Progress | TASK-001 |
| TASK-003 | Dashboard | M2 | Not Started | TASK-002 |
Resume candidates first: Look for rows with Status = In Progress. For each, run node ${CLAUDE_PLUGIN_ROOT}/lib/task-resume.js check <TASK-NNN> (add --project <name> in monorepos). A row whose check reports a worktree, branch, or validation session is in flight from a prior session — it is the top-priority candidate; delegate to work-on with that ID (the resume gate inside work-on continues at the right phase). An In Progress row with no artifacts anywhere is a stale marker: offer to reset it to Not Started, then treat it as a normal candidate.
Look for all rows with Status = Not Started
Check dependencies — filter to unblocked tasks (all tasks in Blocked by column are Complete)
Detect ambiguity:
candidates = unblocked not-started tasksnext_sequential = lowest numbered candidate (e.g., TASK-004)completed_after = any complete task with number > next_sequentialIf ambiguous (completed tasks exist after candidates): Present options to user with context about the gap:
"Multiple tasks are available. Tasks 1,2,3,5 are complete.
- TASK-004: [Title] - Earlier in sequence, may have been skipped intentionally
- TASK-006: [Title] - Next sequential after completed work
Which would you like to work on? (or use
/groundwork:work-on Nto select a specific task)"
Wait for user selection before proceeding.
If unambiguous: Select the first unblocked, not-started task
Dependency check: A task is blocked if its Blocked by column lists any task that is not Complete in the status table.
Fallback: If _index.md has no status table, read individual task files to find statuses (legacy single-file format).
Tip: For direct task selection, use /groundwork:work-on N to work on a specific task by number.
| Situation | Response |
|---|---|
No specs/ directory | "No specs directory found. Run /groundwork:design-product to start defining your project." |
| Missing tasks file | "Tasks file not found. Run /groundwork:create-tasks to generate tasks from your PRD and architecture." |
| No tasks found | "No tasks found in {{specs_dir}}/tasks/. The directory may need to be regenerated with /groundwork:create-tasks." |
| All tasks complete | "All tasks complete! Consider running /groundwork:source-product-specs-from-code to update documentation or plan the next phase." |
| Only blocked tasks | "All remaining tasks are blocked. Blocked tasks: [list]. Would you like to override and work on one anyway?" |
| Parse error | "Could not parse tasks.md. Expected format: ### TASK-NNN: Title with **Status:** field." |
You MUST call the Skill tool now: Skill(skill="groundwork:work-on", args="<task-id> [--take-over] [--on-unrelated-failure <mode>]")
Replace <task-id> with the identified task identifier (e.g., TASK-004); append --take-over only when this skill's own invocation carried it, and append --on-unrelated-failure <mode> only when this skill's own invocation carried it.
Do NOT load project context, explore the codebase, present summaries, or begin task execution yourself. The work-on skill handles the complete workflow including worktree setup, TDD, and validation.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
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