create_tasks
Purpose
Produce a scope-faithful task graph and compact execution index. The primary writes; research agents supply evidence only.
Inputs
$ARGUMENTS: explicit feature root/name or descendant requirements artifact;--depth xs|light|standard|comprehensive(defaultstandard); mutually exclusive--tasks-onlyor--finalize-index; optional--orchestrated.- Read selected scope/summary, PRD, plan, UX, context, and research in full. Plan
Out-of-BoundsandVerificationare load-bearing. Thin requirements route tospectre-plan; never invent scope.
Working Set
- Reuse a managed
FEATURE_ROOTonly when explicit/current-thread evidence ties it to this work (physical directory wins; never branch/recency/lifecycle/scans); distinct work ignores ambient roots. Otherwise, including on collision, standalone MUST first load and followSkill(spectre-feature-root)through DONE; orchestrated calls escalate. Keep writes beneath it and pass it unchanged. - Repair stale feature/root metadata in artifacts this workflow touches.
- Ensure
{FEATURE_ROOT}/specs. Default pair:EXECUTE_FILE={FEATURE_ROOT}/specs/execute.md,DETAIL_FILE={FEATURE_ROOT}/specs/tasks.json; use same-basename feature-scoped pairs on collision. Fixtures:references/tasks.example.json,execute.example.md. - When targets/patterns are unclear, use read-only
@spectre_finder,@spectre_analyst, or@spectre_patterns; skip for LIGHT/clear work. Agents return <=2,000 tokens; fold accepted evidence intotask_context.md.
Outputs + DONE
tasks.json is indented, reparsed JSON with exactly meta and phases top-level keys:
meta:feature,feature_root,generated_at,schema_version,objective,scope,out_of_bounds,requirements_trace,architecture_context,coverage_summary.- Phase:
id,title,summary,parents[]. - Parent:
id,title,description,predecessor,unblocks, optionalrisk,subtasks[]. - Subtask:
id,title,type,produces,consumed_by,replaces,context[], optionalpredecessor,acceptance_criteria[]. - Context:
path,anchor,note. Criterion:type(test|observable|state),text. - Task definitions are immutable during Execute: no lifecycle status, run/check/evidence data,
index,indexes,wave_plan, orwaves. Execution progress lives only in the local workflow store.
execute.md starts with Feature:/Feature Root: and sections Document Manifest, Task Detail Source, Execution Summary, Wave Plan, Parent Task Index, Slicing Rules. It declares discovered artifacts/root/JSON path, graph counts, and parents without bodies/criteria/context/status; tells executors not to read JSON whole. Waves have id, label, parent_task_ids, after, rationale; slicing may span phases.
DONE when files satisfy these contracts; tasks.json reparses/self-locates; every REQ/Verification signal maps to a criterion; meta.out_of_bounds is preserved and obeyed; every parent has predecessor/unblocks; every build has produces/consumed_by/replaces; criteria, RED/context/slicing, consumers, and targeted index reads are valid.
Method / guardrails
- Build
Phase -> Parent -> Subtask -> Acceptance criterionids (1,1.1,1.1.1) from numbered REQs. STRICT COMPLIANCE: deliver only explicit scope. - Phase 0 exists only for a real external dependency or capability precondition that must be verified before implementation; depth alone never creates it.
- Use 2-3 single-purpose criteria per subtask. Split on an independently implementable outcome, dependency edge, ownership boundary, or required mid-task scope judgment; file/LOC size is a warning, never a split by itself.
- Put RED-before-GREEN in each behavior-changing build subtask. Create a separate RED subtask only when its failing contract/fixture is independently dispatchable and consumed by later work; LIGHT requires RED when risky, ambiguous, or regression-prone.
- Context is 2-4 file:line references plus one canonical pattern and one plan anchor for STANDARD/COMPREHENSIVE; LIGHT uses 1-2 references plus a plan anchor. Provide evidence, not snippets or implementation scripts.
- Mark parent
riskonly when a named threatened invariant and downstream consumer cross an auth/trust, persistence/migration, concurrency/order/retry, destructive, high-fan-out, or shared-contract boundary. Omit it when focused checks settle the risk. Derive semantic predecessor/unblocks edges and topological waves at parent granularity; phases are organizational. - Execution slicing only: depth shapes granularity after planning; this workflow never derives Plan size or overrides
spectre-plan-route.xs= one explicitly rerouted parent;light= 1-3 parents/optional waves;standard= concise graph;comprehensive= full context, RED, coverage, semantic dependencies, post-review waves. - Validate coverage, verification mapping, integration consumers, dependencies, and Out-of-Bounds before writing. Do not add terminal verification/E2E tasks for checks Execute or Prove owns; a qualification task is valid only when it produces an explicit prerequisite or product-consumed artifact at a product-owned path. Never encode vague criteria or orphan outputs.
Mode contract
- Default: write/reparse
tasks.jsonand deriveexecute.mdfrom the same in-memory graph. --tasks-only: write/reparse onlytasks.json; semantic review follows comprehensive orchestration.--finalize-index: require finalizedtasks.json; project onlymeta, phase ids/titles, parent ids/titles, subtask ids,predecessor,unblocks, andrisk; leave JSON byte-for-byte unchanged; derive counts/index/topological waves intoexecute.mdonce.
The primary directly writes only the selected canonical artifacts. Do not delegate their authorship/revision or emit tasks.md, fallbacks, converters, compilers, or persistent projections.
Handoff
Report mode, written paths, and {X} phases, {Y} parents, {Z} subtasks; add {N} waves only for a finalized index. --orchestrated omits user-facing Next Steps. Standalone load-bearing user-facing behavior without adequate UX/prototype acceptance evidence routes to spectre-ux if unresolved, else spectre-prototype; regenerate tasks. Comprehensive --tasks-only routes to spectre-task_review; otherwise route to spectre-execute {EXECUTE_INDEX} --origin plan, plus a pause handoff when stopping.
Escalate-If
plan.mdsaysExecution Mode: direct-> stop; require explicit structured re-route and update it before task writes.- Requirements are too thin ->
spectre-scopeorspectre-plan. - Out-of-Bounds or Verification is missing -> flag it; proceed only with otherwise-clear scope.
- A requirement cannot become an executable
test|observable|statecriterion -> surface it. - Any task would expand scope -> stop for confirmation.
Next step: follow the mode- and state-specific handoff above.