Engineering

Spec to Task Shards

Make the agent split the work before it starts swinging a hammer.

Use when

The request is too large or vague for a single coding-agent prompt but not large enough to justify a full project plan ceremony.

difficultyIntermediate
categoryEngineering
sourceAdapted from public agentic-coding handbook patterns

Cadence

Before multi-file feature work or migrations

Verification

A written spec, non-goals, acceptance checks, and ordered task shards exist before implementation begins.

Structured loop spec

FieldValue
NameSpec to Task Shards
CategoryEngineering
TriggerBefore multi-file feature work or migrations
ObjectiveMake the agent split the work before it starts swinging a hammer.
Allowed inputsRelevant files, source notes, logs, tests, screenshots, metrics, or task state for this loop
Allowed actionsRead the relevant code, docs, tickets, and constraints before proposing implementation.; Write a short spec with goal, non-goals, affected files, risks, and acceptance checks.; Break the spec into small task shards that can each be implemented and verified independently.; Order shards by risk: scaffold, tests, smallest behavior, integrations, cleanup, docs.; Stop and ask for approval if the spec exposes ambiguous product behavior, data migration risk, or security impact.
VerificationA written spec, non-goals, acceptance checks, and ordered task shards exist before implementation begins.
Stop conditionStop when the verifier passes, the budget is exhausted, no progress is made, a blocker appears, or approval is required.
BudgetSet a time, turn, token, retry, file, or dollar cap before running the loop.
Approval boundaryHuman approval required before publishing, sending, deleting, spending, changing accounts, touching production, or making reputational/legal/financial commitments.
Safe outputPull request, patch, report, or evidence log
Works withClaude Code, OpenAI Codex, Cursor, Gemini CLI, any tool-using coding agent

Steps

  1. Read the relevant code, docs, tickets, and constraints before proposing implementation.
  2. Write a short spec with goal, non-goals, affected files, risks, and acceptance checks.
  3. Break the spec into small task shards that can each be implemented and verified independently.
  4. Order shards by risk: scaffold, tests, smallest behavior, integrations, cleanup, docs.
  5. Stop and ask for approval if the spec exposes ambiguous product behavior, data migration risk, or security impact.

Prompt

Run the Spec to Task Shards loop. Inspect the relevant code and docs, then write a concise spec with goal, non-goals, affected files, risks, and acceptance checks. Split it into independently verifiable task shards ordered by risk. Do not implement until the spec and shard list are coherent. Stop for approval if product behavior, data migration, billing, or security scope is ambiguous.

Run in Claude Code

Paste this into Claude Code (or any tool-using agent) to run the loop bounded: one change per round, the same verification every round, durable state files, and explicit stop conditions.

Run the "Spec to Task Shards" loop from AI Loop Library (https://ailooplibrary.com/loops/spec-to-task-shards/) as a bounded loop.
Goal: Make the agent split the work before it starts swinging a hammer.
Rules: one change per round; run the same verification every round (A written spec, non-goals, acceptance checks, and ordered task shards exist before implementation begins.); append each round to docs/loops/spec-to-task-shards/progress.md and update docs/loops/spec-to-task-shards/state.json; stop on verifier pass, 8 rounds, 3 consecutive failed verifications, no progress, a blocker, or anything needing human approval (money, production, outbound, deletion). Finish with a proof report: rounds used, changes made, verification output, remaining risk, and the next human decision.

Get the MCP server + agent pack

Tags

spec-firstplanningtask decompositionagent coding

Related loops

Browse all 68 loops