From spec-first
Compiles settled spec-plans into derived task packs for spec-work execution or validates existing packs. Use when splitting large plans into tasks with explicit dependencies and verification.
npx claudepluginhub sunrain520/spec-firstThis skill uses the workspace's default tool permissions.
`spec-write-tasks` is an optional derived layer between `spec-plan` and `spec-work`.
Use when you need to create an execution plan from a feature spec - handles worktree context, dispatches subagent for task decomposition, validates quality, analyzes dependencies, groups into phases, and commits the plan
Decomposes specifications into dependency-aware task graphs via TaskCreate/TaskUpdate. Use after cw-spec before cw-dispatch to plan sequenced, executable tasks.
Generates plan.json task plans from Spec documents, OpenSpec changes, SpecKit files, or free-text requirements for /orchestrate execution.
Share bugs, ideas, or general feedback.
spec-write-tasksspec-write-tasks is an optional derived layer between spec-plan and spec-work.
It does not execute code. It compresses a settled plan into a task pack that is easier for spec-work to consume, reducing context load and making dependencies, file boundaries, verification focus, and parallelization opportunities explicit.
spec-work.spec-work has lower carrying cost.When skipping, say explicitly that this is not an omission; this case does not need another derived layer.
spec-plan is always the single source of truth for the technical approach.spec-work must include spec_id, verifiable source_plan, and source_plan_hash metadata so wrong-chain or stale tasks are not executed silently.spec-write-tasks does not introduce its own CRG lifecycle hook. CRG query references may appear only as context_refs, entry_hint, test_focus, or orientation evidence; spec-work later calls spec-first crg hook before-work --task-pack=<tasks.md> to return to the source plan handoff.First classify the input, then follow the matching path.
When the input is docs/plans/*-plan.md or another explicit plan file:
Requirements Trace, Scope Boundaries, Technical Approach, Implementation Units, Files, Test Scenarios, Verification, and Deferred to Implementation.spec_id. If the source plan is a legacy plan without spec_id, do not write an executable task pack; return to spec-plan to add plan frontmatter, or produce only a draft/transient task pack that is explicitly not valid spec-work input.spec-work.spec_id from the source plan.Before writing task cards, you may inspect code only until task boundaries are accurate enough.
MVP provider order:
CRG evidence is advisory. It must not turn the current implementation state into new tasks, replace source reading, or override the source plan. If source orientation reveals missing scope, contract, acceptance, or verification decisions, return return-to-plan or draft-only instead of inventing task scope.
Serena/LSP may be introduced as a Phase 2 orientation provider, but do not require it for MVP task-pack generation.
Phase 2 provider rule:
When the input is docs/tasks/*-tasks.md or a file whose frontmatter has type: task-pack:
source_plan, and source plan.generated_by: spec-write-tasks, mode/status, spec_id, source_plan, source_plan_hash, required task-card fields, dependency references, and repo-relative files.source_plan_hash does not match the current source plan, stop. Do not normalize and continue; require rebuilding from the source plan.spec_id, report it as missing identity and not executable handoff. Do not normalize and continue.spec_id, they must match. A mismatch is a wrong-chain handoff; stop and require rebuilding from the source plan.spec_id, report identity as unverifiable weak trace. Stop for executable handoff; return to spec-plan to add plan frontmatter or rebuild a draft/transient task pack.spec-work.When the input is a natural-language request such as "split this plan into tasks":
docs/plans/*-plan.md and state that inference.Before generating a task pack, decide whether the source plan is task-ready.
It must have:
spec_id when generating an executable task pack,Choose exactly one branch:
compile: the plan is clear enough; generate an executable task pack.skip: the plan is small or task-pack value is low; recommend direct spec-work.return-to-plan: key scope, verification, architecture, or contract decisions are missing; recommend revising spec-plan.draft-only: a non-executable draft can help discussion, but it must not be handed to spec-work.Only continue with unresolved information when it is explicitly an implementation-time unknown. Record that risk in the relevant task's risk_note and stop_if. Do not use a task pack to invent decisions the plan did not make.
This is an LLM semantic analysis order, not a script state machine. It does not require each step to be persisted and it does not create workflow state.
Before outputting a task pack, verify:
test_focus and observable done_signal,stop_if that can prevent scope creep.See Task Quality Guide for detailed quality guidance.
Do not mechanically convert each implementation unit into one task. A unit may contain multiple independently verifiable user stories; multiple units may also share one foundation task.
Executable task packs must be written to:
docs/tasks/YYYY-MM-DD-NNN-<type>-<slug>-tasks.md
Only produce a non-executable draft when the user explicitly asks for temporary slicing or when the environment cannot produce a verifiable hash. In that case, mark the result as draft/non-executable and do not recommend handing it directly to spec-work.
The body must include:
When writing a task pack, read Task Pack Schema and use its frontmatter, task-card fields, and regeneration rules.
Every spec-write-tasks run must end with a compact decision envelope. The envelope is a handoff summary for this run, not persisted workflow state:
decision: compile | skip | return-to-plan | draft-only | validate-only
source_plan: docs/plans/... | null
task_pack: docs/tasks/... | null
task_pack_validity: valid | draft | stale | wrong-chain | invalid | unverifiable | not-applicable
deterministic_handoff: true | false
validity_scope: identity-freshness-structure-only
semantic_posture: generated-this-run | reviewed-existing | unchecked-existing | not-applicable
reason: <one sentence>
validation:
spec_id: matched | missing | mismatch | not_checked
source_plan_hash: matched | missing | mismatch | unavailable | not_checked
hash_tool: available | unavailable
source_plan_path: resolved | missing | invalid
task_pack_contract: valid | invalid | not_checked
orientation:
provider: crg | direct-repo-reads | serena-lsp | mixed | skipped
posture: bounded | degraded | skipped-small-plan | unavailable
evidence_refs: []
limitations: []
next_action: spec-work-task-pack | review-task-pack | spec-work-plan | revise-plan | stop
next_action: spec-work-task-pack is allowed only when deterministic_handoff: true and semantic_posture is generated-this-run or reviewed-existing. deterministic_handoff proves identity, freshness, and structure only; it does not prove semantic task quality.
Every task card must express:
task_id: stable identifier.source_unit: matching plan U-ID; use null when no U-ID exists and point context_refs to the source section.requirement_refs: related requirements or acceptance refs.goal: one-sentence task goal.dependencies: prerequisite task IDs.files: repo-relative paths the task is allowed to touch.context_refs: plan sections, code patterns, contracts, research, or references the executor must read.entry_hint: where to start reading; not a step-by-step implementation script.test_focus: primary verification focus.done_signal: observable completion signal.parallelizable: whether the task can run in parallel.risk_note: main risk.stop_if: condition that should send execution back to spec-plan or user confirmation.wave: execution wave.source_plan_hash must be the canonical source plan body hash produced by spec-first tasks hash <plan-path>.
spec_id is copied from the source plan and is not part of freshness. It links the task pack to the same spec chain; source_plan_hash proves the task pack is still derived from the current source plan body.
If the source plan has no spec_id, do not generate an executable task pack. Return to spec-plan to add the plan-local identity, or produce only a draft / transient output that is not valid spec-work input.
Hash rules:
CRLF / CR to LF.---, remove the complete frontmatter block; if closing frontmatter is missing, fail closed.status and spec_id are not part of freshness; identity is checked separately.A task pack that can be handed to spec-work must use a concrete canonical source plan body hash, for example sha256:<64-hex>.
If the current environment has no deterministic hash capability, do not pretend validation happened. Only produce a draft/non-executable task pack or explain that hash tooling is required first. Do not use pending-tooling, unknown, empty values, or guessed whole-file hashes as executable handoff.
spec-workspec-work should prefer the task pack.spec-work can consume the plan directly.spec_id mismatch, or conflicts with the plan, reject handoff and rebuild from the plan.When consuming a task pack, spec-work must still read relevant code, discover tests, and identify execution-time facts. A task pack is a better input, not a replacement for execution judgment.
Every generated task must include stop_if. Common stop signals:
done_signal cannot be proven by the available tests or verification path,When a stop signal triggers, return to spec-plan or rerun spec-write-tasks. Do not expand scope in place.
A script may run deterministic lint for:
source_plan exists,source_plan_hash format,Task Pack Contract fenced JSON block exists and parses,task_id,Do not let scripts judge whether task splitting is semantically good. Splitting, merging, waves, and boundaries are LLM semantic decisions.