# Chunk Plan Template

Use this template to turn approved requirements into ordered implementation chunks.

Artifact filenames follow `ai/standards/artifact-naming.md`.

## Input

- Requirements file:
- Requirements review verdict:
- Requirements lifecycle state:
- Constraints:
- Existing related chunks:

## Planning Checklist

- Confirm requirements are approved or have a current Requirements Review PASS.
- Use `ai/commands/requirements-state.sh <path>` when practical.
- Split product work, tooling work, docs work, and test hardening when useful.
- Keep chunks small and independently testable.
- Preserve dependencies between chunks.
- Include validation commands per chunk.
- Include runtime smoke expectations when relevant.
- For Angular/frontend chunks, include data-flow/view-model acceptance criteria
  from `ai/standards/angular-ui-data-flow.md` and the advisory architecture
  report command when relevant.
- For backend/Runtime chunks, include layered-boundary acceptance criteria from
  `ai/standards/backend-node-nestjs-architecture.md` and the advisory backend
  architecture report command when relevant.
- For assertive-solving packages, include whether local feasible blockers may be
  solved inside the package, when prerequisite chunks should be inserted, and
  why any CFD is deferred instead of fixed now.
- Avoid mixing unrelated concerns.
- Group chunks into milestones when the plan will feed a work package.

## Chunk Plan Format

```md
## Chunk Plan

### Chunk N: <title>

- Suggested Filename: ai/chunks/drafts/chunk-000001-<slug>.md
- Goal:
- Scope:
- Out Of Scope:
- Depends On:
- Files Likely Affected:
- Acceptance Criteria:
- Validation:
- Runtime Smoke:
- Milestone:
- Notes:
```

When creating work-package input, also include:

- milestone name.
- milestone human review expectation.
- automation constraints.
- dependencies between milestones.

## Handoff

Include the standard handoff block from `ai/standards/workflow-handoff.md`:
use this as an output shape, while the handoff standard remains canonical for
field semantics and command categories.

```md
## Handoff

- Canonical State: chunk_planning
- Gate Checked: ai/commands/requirements-state.sh <path>
- Result: chunks_planned | blocked
- Blockers: None | <planning blockers>
- Recommended Next Action: <create draft chunks | activate first chunk | orchestrator review | manual intervention>
- Immediate Next Step: <create draft chunks | activate first chunk | orchestrator review | manual intervention>
- Human Review Command: not_applicable
- Prompt Handoff Command: not_applicable
- Transition Command: ai/commands/new-chunk.sh <slug> [draft|backlog|active]
- Post-Approval Command: ai/commands/new-chunk.sh <slug> [draft|backlog|active]
- Trusted Daemon Git Commands: not_applicable
- Optional Prompt Review Command: not_applicable
- Human Approval Needed: yes | no
```

## Pass History Entry

```md
### Chunk Planning Pass N

- Role: Chunk Planner
- Date: YYYY-MM-DDTHH:mm:ss.sssZ
- Goal: <planning goal>
- Result: <chunk plan summary>
- Blockers: None | <missing dependencies>
- Validation: <planning checks performed>
- Cleanup: Not applicable.
- Recommended Next Action: <create chunks | orchestrator review | manual intervention>
```
