neolabhq/context-engineering-kit1 file

Plan Task

Refine a draft task specification into a fully planned, implementation-ready task with acceptance criteria, architecture, per-step sub-task files and verifiable phases

Specification
Skill ID
neolabhq/context-engineering-kit/plan-task
Publisher
neolabhq
Repository
context-engineering-kit
Installs
0
Files
1
Synced
Sep 23, 2026
How to use it

Open any RiverX project, open the Skills panel in the chat, and search for this identifier. The files are fetched from the source repository at install time.

neolabhq/context-engineering-kit/plan-taskInstalls these files
  • SKILL.md

What this skill tells the agent

Refine Task Workflow

Role

You are a task refinement orchestrator. Take a draft task file created by /add-task and refine it through a coordinated multi-agent workflow with quality gates after each phase.

Goal

This workflow command refines an existing draft task through:

  1. Parallel Analysis - Research, codebase analysis, and business analysis (description, acceptance criteria, test strategy) in parallel
  2. Architecture Synthesis - Combine findings into architectural overview
  3. Decomposition - Break into per-step sub-task files, grouped into independently verifiable phases with dependencies, parallel groups, agent/model assignments and a reviewer model per phase
  4. Promote - Move refined task from draft/ to todo/

All model-assigned phases include judge validation to prevent error propagation and ensure quality thresholds are met.

User Input

$ARGUMENTS

Command Arguments

Parse the following arguments from $ARGUMENTS:

Argument Definitions

ArgumentFormatDefaultDescription
task-filePath to task fileRequiredPath to draft task file (e.g., .specs/tasks/draft/add-validation.feature.md)
--continue--continue [stage]NoneContinue refining from a specific stage. Stage is optional - resolve from context if not provided.
--target-quality--target-quality X.X3.5Target threshold value (out of 5.0) for judge pass/fail decisions.
--max-iterations--max-iterations N3Maximum implementation + judge retry cycles per phase before moving to next stage (regardless of pass/fail).
--included-stages--included-stages stage1,stage2,...All stagesComma-separated list of stages to include.
--skip--skip stage1,stage2,...NoneComma-separated list of stages to exclude.
--fast--fastN/AAlias for --target-quality 3.0 --max-iterations 1 --included-stages business analysis,decomposition - same stages as --one-shot, but judges still run, at a lowered threshold with a single retry.
--one-shot--one-shotN/AAlias for --included-stages business analysis,decomposition --skip-judges - same stages as --fast, but no judge runs at all and no quality gate is applied.
--human-in-the-loop--human-in-the-loop phase1,phase2,...NonePhases after which to pause for human verification.
--skip-judges--skip-judgesfalseSkip all judge validation checks - phases proceed without quality gates.
--refine--refinefalseIncremental refinement mode - detect changes against git and re-run only affected stages (top-to-bottom propagation).
--model`haiku\sonnet\opus`auto-selected per the policyExplicit user override for all sub-agents. When omitted, resolve each phase's tier per the Model Selection Policy. See Role Pairing for the override's effect and the Escalation Rule for how escalation interacts with it.
--strict--strictfalseDisable the Iteration Discretion Rule - a phase passes ONLY when score >= THRESHOLD, otherwise retry until MAX_ITERATIONS is reached.

Stage Names (for --included-stages / --skip)

Stage NamePhaseDescription
research2aGather relevant resources, documentation, libraries
codebase analysis2bIdentify affected files, interfaces, integration points
business analysis2cRefine description and create acceptance criteria (checklist, regular checks, rubric, test strategy, definition of done)
architecture synthesis3Synthesize research and analysis into architecture
decomposition4Break into per-step sub-task files grouped into verifiable phases, with dependencies, parallel groups and agent/model assignments

Configuration Resolution

Parse $ARGUMENTS and resolve configuration as follows:


# Extract task file path (first positional argument, required)
TASK_FILE = first argument that is a file path (must exist in .specs/tasks/draft/)

# Parse alias flags first (they set multiple defaults)
if --fast present:
    THRESHOLD = 3.0
    MAX_ITERATIONS = 1
    INCLUDED_STAGES = ["business analysis", "decomposition"]

if --one-shot present:
    INCLUDED_STAGES = ["business analysis", "decomposition"]
    SKIP_JUDGES = true

# Initialize defaults
THRESHOLD ?= --target-quality || 3.5
MAX_ITERATIONS ?= --max-iterations || 3
INCLUDED_STAGES ?= --included-stages || ["research", "codebase analysis", "business analysis", "architecture synthesis", "decomposition"]
SKIP_STAGES = --skip || []
HUMAN_IN_THE_LOOP_PHASES = --human-in-the-loop || []
SKIP_JUDGES = --skip-judges || false
REFINE_MODE = --refine || false
STRICT_MODE = --strict || false
CONTINUE_STAGE = null

# Model tiers - governed in full by the Model Selection Policy
MODEL_OVERRIDE = --model || null
BASELINE_TIER = MODEL_OVERRIDE || tier of the overall task per the Selection Rules


if --continue [stage] present:
    CONTINUE_STAGE = stage or resolve from context

# Compute final active stages
ACTIVE_STAGES = INCLUDED_STAGES - SKIP_STAGES

Context Resolution for --continue

When --continue is used without explicit stage:

  1. Stage Resolution:
  • Parse the task file for completion markers (e.g., [x] checkboxes)
  • Identify the last completed phase/judge
  • Resume from the next incomplete phase

Refine Mode Behavior (--refine)

When --refine is used:

  1. Change Detection:
  • First check file status: git status --porcelain -- <TASK_FILE>
  • Compare current task file against last git commit: git diff HEAD -- <TASK_FILE>
  • This captures both staged and unstaged changes vs HEAD
  • If file is untracked or has no git history, compare against the original task structure
  • Identify which sections have been modified by the user
  • Look for // comment markers indicating user feedback/corrections
  1. Top-to-Bottom Propagation:
  • Determine the earliest modified section (highest in document)
  • Re-run only stages that correspond to or come after the modified section
  • Earlier stages (above the modification) are preserved as-is
  1. Section-to-Stage Mapping:
Modified SectionRe-run From Stage
Description / Acceptance Criteria (checklist, regular checks, rubric, test strategy, definition of done)business analysis (Phase 2c)
Architecture Overviewarchitecture synthesis (Phase 3)
Implementation Process (Parallelization Overview / Phase Overview), or any sub-task file under .specs/sub-tasks/<task-name>/decomposition (Phase 4)

The Implementation Process section and the sub-task files are produced by the same phase, so a change to either re-runs Phase 4 as a whole.

  1. Refine Execution:
  • Skip research (2a) and codebase analysis (2b) unless explicitly requested
  • Pass user modifications and // comments as additional context to agents
  • Agents should incorporate user feedback while preserving unchanged content
  1. Example:
   # User edited the Architecture Overview section
   /plan .specs/tasks/todo/my-task.feature.md --refine
   
   # Detects Architecture section changed → re-runs from Phase 3 onwards
   # Skips: research, codebase analysis, business analysis
   # Runs: architecture synthesis, decomposition

Human-in-the-Loop Behavior

Human verification checkpoints occur:

  1. Trigger Conditions:
  • After implementation + judge verification PASS for a phase in HUMAN_IN_THE_LOOP_PHASES
  • After implementation + judge + implementation retry (before the next judge retry)
  1. At Checkpoint:
  • Display current phase results summary
  • Display generated artifacts with paths

Use this skill in a project

Open any RiverX project, search the Skills panel for neolabhq/context-engineering-kit/plan-task, and install it in one click.

Use this skill