Work On Next Task logo

Work On Next Task

Community
etr
work-on-next-task

Execute next uncompleted task with full project context (PRD, architecture, tasks). Pass --take-over to resume an in-flight task past a possibly-live prior session without asking. Pass --on-unrelated-failure stop-and-ask|expand-and-fix|ignore-and-merge to choose how validation handles gate failures confidently unrelated to the active project (default stop-and-ask). Usage /groundwork:work-on-next-task [--take-over] [--on-unrelated-failure mode]

Overview

Publisheretr
Repositorygroundwork
Skill namework-on-next-task
Stars
45
Forks
4
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by etr on GitHub. Read the source before you install it.

Installation

Install the Work On Next Task AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/etr/groundwork/tree/main/skills/work-on-next-task
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/etr/groundwork.git /tmp/groundwork
mkdir -p .claude/skills
cp -r /tmp/groundwork/skills/work-on-next-task .claude/skills/work-on-next-task
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Work On Next Task in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Work On Next Task on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Work On Next Task is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Next Task Skill

Finds the next uncompleted task from {{specs_dir}}/tasks/ (or {{specs_dir}}/tasks.md) and delegates execution to the work-on skill.

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:

json
{
  "questions": [{
    "question": "Do you want to switch? Dependency resolution and task selection 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

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.

Step 0: Resolve Project Context

Before loading specs, ensure project context is resolved:

  1. Monorepo check: Does .groundwork.yml exist 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 no → Continue (single-project repo).
  2. 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).
  3. Proceed with the resolved project context. All {{specs_dir}}/ paths will resolve to the correct location.

Step 1: Load Task Index

Read only the task index to find available tasks — do NOT read individual task files:

  • Directory mode: {{specs_dir}}/tasks/_index.md (preferred — contains status table)
  • Single file fallback: {{specs_dir}}/tasks.md

Detection: 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.

Step 2: Find Next Task

Parse the status table in _index.md to find the next task:

markdown
| # | 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 |
  1. 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.

  2. Look for all rows with Status = Not Started

  3. Check dependencies — filter to unblocked tasks (all tasks in Blocked by column are Complete)

  4. Detect ambiguity:

    • Let candidates = unblocked not-started tasks
    • Let next_sequential = lowest numbered candidate (e.g., TASK-004)
    • Let completed_after = any complete task with number > next_sequential
  5. If 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 N to select a specific task)"

    Wait for user selection before proceeding.

  6. 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.

Step 3: Handle Edge Cases

SituationResponse
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."

Step 4: Delegate to Execute Task

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.

Frequently asked questions

What does the Work On Next Task AI skill do?

Execute next uncompleted task with full project context (PRD, architecture, tasks). Pass --take-over to resume an in-flight task past a possibly-live prior session without asking. Pass --on-unrelated-failure stop-and-ask|expand-and-fix|ignore-and-merge to choose how validation handles gate failures confidently unrelated to the active project (default stop-and-ask). Usage /groundwork:work-on-next-task [--take-over] [--on-unrelated-failure mode]

Why use Work On Next Task on TypingMind?

Because you install it once and use it with any model. Work On Next Task is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Work On Next Task in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/etr/groundwork/tree/main/skills/work-on-next-task. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Work On Next Task?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Work On Next Task?

As many as you like. As long as a model supports skills, you can use Work On Next Task with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Work On Next Task AI skill free?

Yes. It is published on GitHub by etr under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇