Overview
Mark the just-completed slice or slice batch (if any), update the completed slices list, and select the next unfinished execution unit from a software delivery plan stored in .stencila/plans/. Given a just-finished slice name and a list of already-completed slices, append the finished slice or slices, identify the next unit of work to execute based on phase ordering and dependency constraints, validate its package references against the codebase, and report the unit details along with the updated completed list. If all slices are complete, report that no slices remain.
This skill determines slice exhaustion — whether there are more execution slices to select — not full plan completion. Many plans include a ## Definition of Done section with plan-level closure checks (e.g., all tests passing, linting clean, generated types updated, documentation complete). This skill does not evaluate those checks. When all slices have been selected and completed, the skill reports that no slices remain, but the caller must verify Definition of Done items separately before treating the plan as finished.
This skill reads a plan file, parses its structure, tracks completions, and determines what comes next. It does not write code, create tests, modify the plan, or manage any external state beyond reporting its findings. It also acts as a normalizer of planning granularity: plan-authored slices are advisory, and the selected execution unit may consist of one slice or several adjacent compatible slices when that would reduce workflow overhead without creating an unmanageably broad TDD loop.
Required Inputs
| Input |
Required |
Description |
| Just-completed slice |
No |
The slice name that was just completed (empty on first invocation) |
| Completed slices |
No |
A list of slice names already finished (empty if starting fresh) |
| Plan name or goal |
No |
Which plan to read (defaults to the only or most recent plan) |
When used standalone, these inputs come from the user or the agent's prompt. When used within a workflow, the workflow's stage prompt will specify how to obtain them.
Outputs
| Output |
Description |
| Updated completed slices |
The completed slices list with the just-finished slice or slices appended (if provided) |
| Selected slice name |
The selected execution unit name or identifier, or a signal that no slices remain |
| Included slices |
The underlying plan slice identifiers covered by the selected execution unit |
| Scope |
A concise description of what the selected execution unit covers |
| Acceptance criteria |
The criteria for the selected execution unit |
| Packages |
The packages, crates, modules, or directories involved |
| Status |
Whether an execution unit was selected (more slices remain) or no slices remain (slice exhaustion, but not necessarily plan-level Definition of Done) |
Steps
Mark the just-completed slice or slice batch (if provided):
- If a just-completed slice name is provided and non-empty:
- Take the provided completed slices list (may be a comma-separated string, a JSON array, or empty/absent)
- Determine whether the just-completed name refers to a single slice or to a previously selected combined execution unit by re-parsing the plan and matching against the same selection rules used below
- If it matches a combined execution unit, append each underlying plan slice identifier that is not already in the list
- Otherwise, if the just-completed slice is not already in the list, append it
- Produce the updated completed slices list in the same format as the input, defaulting to comma-separated if starting fresh
- If no just-completed slice is provided (first invocation), use the completed slices list as-is
Locate the delivery plan:
- Use
glob with pattern .stencila/plans/*.md to discover available plans
- If the goal or prompt names a specific plan, locate it in the results
- If only one plan exists, use it
- Use
read_file to load the full plan content
- If no plans exist, report the error — there is nothing to execute
Parse the plan structure:
- Identify all phases and their slices (TDD slices within phases, or tasks that serve as slices)
- Record the name, scope, acceptance criteria, and relevant packages for each slice
- Note dependency ordering — slices within a phase are ordered sequentially, and phases are ordered so earlier phases complete before later ones
- A "slice" is typically a TDD slice defined in a phase's Testing section (e.g., "Slice 1: write failing test for X..."), but if the plan uses numbered tasks without explicit TDD slices, treat each task as a slice
- Note whether the plan contains a
## Definition of Done section. Record its presence for use in the final reporting step, but do not convert Definition of Done items into slices
Determine which slices are already completed:
- Use the updated completed slices list from step 1 (may be a comma-separated string, a JSON array, or empty/absent meaning none completed)
- Build a set of completed slice identifiers
Select the next unfinished execution unit:
- Walk the plan in order: phases first (Phase 1 before Phase 2), then slices within each phase in order
- Skip any slice whose identifier is in the completed set
- Start with the first unfinished slice as the candidate execution unit
- Consider combining the candidate with following adjacent unfinished slices in the same phase when all of the following are true:
- the slices are contiguous in the plan and there is no unfinished slice between them
- there is no explicit dependency boundary that requires the earlier slice to be validated independently
- they touch the same package, crate, module, or tightly related directory area
- they are small and closely related enough that one Red-Green-Refactor cycle remains tractable
- combining them is likely to reduce workflow overhead materially relative to doing them one-by-one
- Stop combining when adding another slice would make the execution unit too broad, too risky, cross a package or subsystem boundary, or obscure a meaningful review checkpoint
- When synthesizing scope and acceptance criteria for the selected unit, preserve documentation or other non-test deliverables from the plan, but do not frame them as implying mandatory unit/integration tests; downstream stages may satisfy them through implementation, review notes, or explicit existence checks instead of Red-phase tests
- If all slices are completed, go to step 8
Validate package references against the codebase:
- Use
glob and grep to verify that the packages, crates, or directories mentioned in the slice actually exist in the workspace
- If a package reference appears stale or incorrect, note it in the scope description so downstream work is aware
- Do not block selection over a stale reference — it can be resolved during implementation
Report the selected execution unit:
- Present the selected unit with its full details:
- Updated completed slices: the full list including the newly completed slice (if any)
- Slice name: the execution unit name or identifier (e.g.,
Phase 1 / Slice 2 for a single slice, or Phase 1 / Slices 2-3 for a combined unit)
- Included slices: the underlying plan slice identifiers included in the execution unit
- Scope: a concise description of what this execution unit covers, derived from the plan
- Acceptance criteria: the acceptance criteria for the unit, combining the included slices' intent while keeping the scope coherent
- Packages: the packages, crates, modules, or directories involved, derived from the plan and validated against the codebase
- Status: more work remains
- Stop
All slices complete:
- If no unfinished slices remain, report:
- Updated completed slices: the full list
- That all execution slices have been completed and no slices remain for selection
- If the plan contains a
## Definition of Done section, include a note: "All execution slices are complete. The plan includes a Definition of Done section — verify those plan-level completion checks separately before treating the plan as finished."
- If the plan does not contain a
## Definition of Done section, include a note: "All execution slices are complete. Verify any plan-level completion criteria separately before treating the plan as finished."
- Status: all slices are complete
- Stop
Output Format
Always end your response with a structured report using exactly these labeled fields so the caller can reliably extract each value:
Updated completed slices: <comma-separated list, or "(none)" if empty>
Slice name: <selected slice identifier, or "ALL SLICES COMPLETE" if no slices remain>
Included slices: <comma-separated list of exact plan slice identifiers included in the selected execution unit; use "(none)" only when Slice name is "ALL SLICES COMPLETE">
Scope: <concise scope description>
Acceptance criteria: <the criteria for this slice>
Packages: <comma-separated list of packages, crates, or directories>
Status: <"more work remains" or "all slices are complete">
When all slices are complete, omit the Scope, Acceptance criteria, and Packages fields and set Included slices to (none). Include a Definition of Done note if the plan has one:
Updated completed slices: Phase 1 / Slice 1, Phase 1 / Slice 2
Slice name: ALL SLICES COMPLETE
Included slices: (none)
Status: all slices are complete
Note: All execution slices are complete. The plan includes a Definition of Done section — verify those plan-level completion checks separately before treating the plan as finished.
Narrative explanation or warnings (e.g. stale package references) may precede the structured block, but the block itself must always appear last and use the exact field labels above.
When the selected execution unit consists of a single plan slice, the Included slices field should contain just that one slice identifier. When the selected execution unit combines several adjacent plan slices, the Slice name should be a concise synthesized label and Included slices must enumerate the exact underlying plan slices in execution order. Do not use ranges, abbreviations, or paraphrases in Included slices; use the exact deterministic slice identifiers that should be added to completed_slices once the unit is accepted.
Slice Identification
Slices are identified using a combination of phase and slice number or name. Use a consistent naming scheme:
- If the plan has explicit slice names (e.g., "Token parsing validation"), use those prefixed with the phase:
Phase 1 / Token parsing validation
- If the plan uses numbered slices (e.g., "Slice 1", "Slice 2"), use:
Phase 1 / Slice 1
- If the plan uses numbered tasks without slices, use:
Phase 1 / Task 1
Consistency matters because the names produced here may be used later to track completions — the name must be deterministic and reproducible for the same plan input.
Dependency and Ordering Rules
- Complete all slices in Phase N before starting any slice in Phase N+1
- Within a phase, preserve slice ordering. You may combine adjacent compatible slices into one execution unit, but never reorder them
- If the plan explicitly marks a slice as depending on another, respect that dependency even if it crosses phases
- Never skip a slice. If a slice seems unnecessary, still include it either as its own execution unit or within a combined adjacent unit
Granularity Normalization Rules
- Treat plan-authored slices as advisory execution hints, not mandatory one-iteration boundaries
- Prefer one coherent execution unit per workflow iteration, not necessarily one literal plan slice
- Prefer combining slices only when they are adjacent, small, and tightly related
- Do not combine across phase boundaries
- Do not combine across explicit dependency boundaries that call for independent validation
- Do not combine slices that span unrelated packages, crates, modules, or subsystems unless the plan clearly frames them as one inseparable change
- Bias toward fewer, more meaningful iterations when the plan is overly granular, but keep each execution unit small enough for one tractable Red-Green-Refactor cycle and one human review
- When uncertain, prefer a modest combination of two or a few closely related slices over a large batch
Examples
Example 1: First slice selection with no prior completions
Plan has Phase 1 (3 slices) and Phase 2 (2 slices). No just-completed slice. No completed slices provided.
Action:
- No completion to record (first invocation)
- Updated completed slices: (empty)
- Select Phase 1 / Slice 1
- Report: slice name = "Phase 1 / Slice 1", included slices = "Phase 1 / Slice 1", scope = "Define AuthToken and AuthError types", acceptance criteria = "AuthToken struct compiles with sub, exp, iat, roles fields; AuthError enum has MalformedToken variant", packages = "rust/auth"
- Status: more work remains
Example 2: Mark completion and select next slice
Just-completed slice: "Phase 1 / Slice 2". Completed slices: "Phase 1 / Slice 1".
Action:
- Append "Phase 1 / Slice 2" to completed list
- Updated completed slices: "Phase 1 / Slice 1, Phase 1 / Slice 2"
- Select Phase 1 / Slice 3
- Report slice details including included slices
- Status: more work remains
Example 3: Combine adjacent narrow slices into one execution unit
Plan has Phase 1 / Slice 1 = add parser tests, Phase 1 / Slice 2 = add parser implementation, and Phase 1 / Slice 3 = add parser error formatting. Slices 2 and 3 both affect the same module and are both small.
Action:
- Completed slices: "Phase 1 / Slice 1"
- Candidate next slice is
Phase 1 / Slice 2
- Combine with adjacent
Phase 1 / Slice 3 because both are small, contiguous, same-package changes with no meaningful review boundary between them
- Report: slice name = "Phase 1 / Slices 2-3", included slices = "Phase 1 / Slice 2, Phase 1 / Slice 3", scope = "Implement parser behavior and error formatting", acceptance criteria = "Parser behavior matches tests and error formatting is emitted as specified", packages = "rust/parser"
- Status: more work remains
Example 4: Mark completion crossing a phase boundary
Just-completed slice: "Phase 1 / Slice 3". Completed slices: "Phase 1 / Slice 1, Phase 1 / Slice 2".
Action:
- Append "Phase 1 / Slice 3" to completed list
- Updated completed slices: "Phase 1 / Slice 1, Phase 1 / Slice 2, Phase 1 / Slice 3"
- All Phase 1 slices complete, move to Phase 2
- Select Phase 2 / Slice 1
- Report slice details
- Status: more work remains
Example 5: Mark final completion — no slices remain
Just-completed slice: "Phase 2 / Slice 2". Completed slices: "Phase 1 / Slice 1, Phase 1 / Slice 2, Phase 1 / Slice 3, Phase 2 / Slice 1". The plan contains a ## Definition of Done section.
Action:
- Append "Phase 2 / Slice 2" to completed list
- Updated completed slices: "Phase 1 / Slice 1, Phase 1 / Slice 2, Phase 1 / Slice 3, Phase 2 / Slice 1, Phase 2 / Slice 2"
- No remaining slices
- Note: All execution slices are complete. The plan includes a Definition of Done section — verify those plan-level completion checks separately before treating the plan as finished.
- Status: all slices are complete
Edge Cases
- No delivery plan found: Report the error clearly. Do not fabricate a plan.
- Plan has no identifiable slices or phases: If the plan structure does not contain phases, TDD slices, or numbered tasks, treat the entire plan as a single slice. Select it on the first pass.
- Ambiguous slice boundaries: When the plan describes work narratively without clear slice demarcation, use phase-level tasks as slices. Prefer too few coherent slices over many tiny ones.
- No completed slices provided: Treat this as zero completions. Start from the first slice.
- Completed slices format varies: Accept both comma-separated strings ("Slice A, Slice B") and JSON arrays (
["Slice A", "Slice B"]). Write back in whichever format was read, defaulting to comma-separated if starting fresh.
- Just-completed slice already in completed list: Do not duplicate it. Proceed with selection as normal.
- Just-completed slice name does not match any plan slice: Still append it. The plan may have been updated, or the name may use a slightly different format. Report the mismatch as a warning.
- Package references are stale: If a referenced package or directory no longer exists, note this in the scope description but still select the slice.
- Plan was updated between selections: If the plan file has changed since the last selection (new slices added, slices reordered), re-parse the full plan and reconcile against the completed slices. Previously completed slices remain completed; new slices are eligible for selection in order.
- Plan is overly granular: Combine adjacent compatible slices into one execution unit when doing so will materially reduce workflow overhead without making the TDD cycle too broad.
1---2name: software-slice-selection3description: Mark the just-completed slice or slice batch (if any), update the completed slices list, select the next unfinished execution unit from a delivery plan based on phase ordering and dependency constraints, and report whether more slices remain. Determines slice exhaustion, not full plan completion — does not verify plan-level Definition of Done items. Combines completion tracking with next-work selection in a single step. Reads plans from .stencila/plans/, parses phase and slice structure, validates package references against the codebase, and can normalize overly narrow plan slices by combining adjacent compatible slices into one execution unit.4---56## Overview78Mark the just-completed slice or slice batch (if any), update the completed slices list, and select the next unfinished execution unit from a software delivery plan stored in `.stencila/plans/`. Given a just-finished slice name and a list of already-completed slices, append the finished slice or slices, identify the next unit of work to execute based on phase ordering and dependency constraints, validate its package references against the codebase, and report the unit details along with the updated completed list. If all slices are complete, report that no slices remain.910This skill determines **slice exhaustion** — whether there are more execution slices to select — not full plan completion. Many plans include a `## Definition of Done` section with plan-level closure checks (e.g., all tests passing, linting clean, generated types updated, documentation complete). This skill does not evaluate those checks. When all slices have been selected and completed, the skill reports that no slices remain, but the caller must verify Definition of Done items separately before treating the plan as finished.1112This skill reads a plan file, parses its structure, tracks completions, and determines what comes next. It does not write code, create tests, modify the plan, or manage any external state beyond reporting its findings. It also acts as a normalizer of planning granularity: plan-authored slices are advisory, and the selected execution unit may consist of one slice or several adjacent compatible slices when that would reduce workflow overhead without creating an unmanageably broad TDD loop.1314## Required Inputs1516| Input | Required | Description |17|---------------------|----------|--------------------------------------------------------------------|18| Just-completed slice | No | The slice name that was just completed (empty on first invocation) |19| Completed slices | No | A list of slice names already finished (empty if starting fresh) |20| Plan name or goal | No | Which plan to read (defaults to the only or most recent plan) |2122When used standalone, these inputs come from the user or the agent's prompt. When used within a workflow, the workflow's stage prompt will specify how to obtain them.2324## Outputs2526| Output | Description |27|--------------------------|----------------------------------------------------------------------------------|28| Updated completed slices | The completed slices list with the just-finished slice or slices appended (if provided) |29| Selected slice name | The selected execution unit name or identifier, or a signal that no slices remain |30| Included slices | The underlying plan slice identifiers covered by the selected execution unit |31| Scope | A concise description of what the selected execution unit covers |32| Acceptance criteria | The criteria for the selected execution unit |33| Packages | The packages, crates, modules, or directories involved |34| Status | Whether an execution unit was selected (more slices remain) or no slices remain (slice exhaustion, but not necessarily plan-level Definition of Done)|3536## Steps37381. Mark the just-completed slice or slice batch (if provided):39 - If a just-completed slice name is provided and non-empty:40 - Take the provided completed slices list (may be a comma-separated string, a JSON array, or empty/absent)41 - Determine whether the just-completed name refers to a single slice or to a previously selected combined execution unit by re-parsing the plan and matching against the same selection rules used below42 - If it matches a combined execution unit, append each underlying plan slice identifier that is not already in the list43 - Otherwise, if the just-completed slice is not already in the list, append it44 - Produce the updated completed slices list in the same format as the input, defaulting to comma-separated if starting fresh45 - If no just-completed slice is provided (first invocation), use the completed slices list as-is46472. Locate the delivery plan:48 - Use `glob` with pattern `.stencila/plans/*.md` to discover available plans49 - If the goal or prompt names a specific plan, locate it in the results50 - If only one plan exists, use it51 - Use `read_file` to load the full plan content52 - If no plans exist, report the error — there is nothing to execute53543. Parse the plan structure:55 - Identify all phases and their slices (TDD slices within phases, or tasks that serve as slices)56 - Record the name, scope, acceptance criteria, and relevant packages for each slice57 - Note dependency ordering — slices within a phase are ordered sequentially, and phases are ordered so earlier phases complete before later ones58 - A "slice" is typically a TDD slice defined in a phase's Testing section (e.g., "Slice 1: write failing test for X..."), but if the plan uses numbered tasks without explicit TDD slices, treat each task as a slice59 - Note whether the plan contains a `## Definition of Done` section. Record its presence for use in the final reporting step, but do not convert Definition of Done items into slices60614. Determine which slices are already completed:62 - Use the updated completed slices list from step 1 (may be a comma-separated string, a JSON array, or empty/absent meaning none completed)63 - Build a set of completed slice identifiers64655. Select the next unfinished execution unit:66 - Walk the plan in order: phases first (Phase 1 before Phase 2), then slices within each phase in order67 - Skip any slice whose identifier is in the completed set68 - Start with the first unfinished slice as the candidate execution unit69 - Consider combining the candidate with following adjacent unfinished slices in the same phase when all of the following are true:70 - the slices are contiguous in the plan and there is no unfinished slice between them71 - there is no explicit dependency boundary that requires the earlier slice to be validated independently72 - they touch the same package, crate, module, or tightly related directory area73 - they are small and closely related enough that one Red-Green-Refactor cycle remains tractable74 - combining them is likely to reduce workflow overhead materially relative to doing them one-by-one75 - Stop combining when adding another slice would make the execution unit too broad, too risky, cross a package or subsystem boundary, or obscure a meaningful review checkpoint76 - When synthesizing scope and acceptance criteria for the selected unit, preserve documentation or other non-test deliverables from the plan, but do not frame them as implying mandatory unit/integration tests; downstream stages may satisfy them through implementation, review notes, or explicit existence checks instead of Red-phase tests77 - If all slices are completed, go to step 878796. Validate package references against the codebase:80 - Use `glob` and `grep` to verify that the packages, crates, or directories mentioned in the slice actually exist in the workspace81 - If a package reference appears stale or incorrect, note it in the scope description so downstream work is aware82 - Do not block selection over a stale reference — it can be resolved during implementation83847. Report the selected execution unit:85 - Present the selected unit with its full details:86 - **Updated completed slices**: the full list including the newly completed slice (if any)87 - **Slice name**: the execution unit name or identifier (e.g., `Phase 1 / Slice 2` for a single slice, or `Phase 1 / Slices 2-3` for a combined unit)88 - **Included slices**: the underlying plan slice identifiers included in the execution unit89 - **Scope**: a concise description of what this execution unit covers, derived from the plan90 - **Acceptance criteria**: the acceptance criteria for the unit, combining the included slices' intent while keeping the scope coherent91 - **Packages**: the packages, crates, modules, or directories involved, derived from the plan and validated against the codebase92 - **Status**: more work remains93 - Stop94958. All slices complete:96 - If no unfinished slices remain, report:97 - **Updated completed slices**: the full list98 - That all execution slices have been completed and no slices remain for selection99 - If the plan contains a `## Definition of Done` section, include a note: "All execution slices are complete. The plan includes a Definition of Done section — verify those plan-level completion checks separately before treating the plan as finished."100 - If the plan does not contain a `## Definition of Done` section, include a note: "All execution slices are complete. Verify any plan-level completion criteria separately before treating the plan as finished."101 - **Status**: all slices are complete102 - Stop103104## Output Format105106Always end your response with a structured report using exactly these labeled fields so the caller can reliably extract each value:107108```109Updated completed slices: <comma-separated list, or "(none)" if empty>110Slice name: <selected slice identifier, or "ALL SLICES COMPLETE" if no slices remain>111Included slices: <comma-separated list of exact plan slice identifiers included in the selected execution unit; use "(none)" only when Slice name is "ALL SLICES COMPLETE">112Scope: <concise scope description>113Acceptance criteria: <the criteria for this slice>114Packages: <comma-separated list of packages, crates, or directories>115Status: <"more work remains" or "all slices are complete">116```117118When all slices are complete, omit the Scope, Acceptance criteria, and Packages fields and set `Included slices` to `(none)`. Include a Definition of Done note if the plan has one:119120```121Updated completed slices: Phase 1 / Slice 1, Phase 1 / Slice 2122Slice name: ALL SLICES COMPLETE123Included slices: (none)124Status: all slices are complete125Note: All execution slices are complete. The plan includes a Definition of Done section — verify those plan-level completion checks separately before treating the plan as finished.126```127128Narrative explanation or warnings (e.g. stale package references) may precede the structured block, but the block itself must always appear last and use the exact field labels above.129130When the selected execution unit consists of a single plan slice, the `Included slices` field should contain just that one slice identifier. When the selected execution unit combines several adjacent plan slices, the `Slice name` should be a concise synthesized label and `Included slices` must enumerate the exact underlying plan slices in execution order. Do not use ranges, abbreviations, or paraphrases in `Included slices`; use the exact deterministic slice identifiers that should be added to `completed_slices` once the unit is accepted.131132## Slice Identification133134Slices are identified using a combination of phase and slice number or name. Use a consistent naming scheme:135136- If the plan has explicit slice names (e.g., "Token parsing validation"), use those prefixed with the phase: `Phase 1 / Token parsing validation`137- If the plan uses numbered slices (e.g., "Slice 1", "Slice 2"), use: `Phase 1 / Slice 1`138- If the plan uses numbered tasks without slices, use: `Phase 1 / Task 1`139140Consistency matters because the names produced here may be used later to track completions — the name must be deterministic and reproducible for the same plan input.141142## Dependency and Ordering Rules143144- Complete all slices in Phase N before starting any slice in Phase N+1145- Within a phase, preserve slice ordering. You may combine adjacent compatible slices into one execution unit, but never reorder them146- If the plan explicitly marks a slice as depending on another, respect that dependency even if it crosses phases147- Never skip a slice. If a slice seems unnecessary, still include it either as its own execution unit or within a combined adjacent unit148149## Granularity Normalization Rules150151- Treat plan-authored slices as advisory execution hints, not mandatory one-iteration boundaries152- Prefer one coherent execution unit per workflow iteration, not necessarily one literal plan slice153- Prefer combining slices only when they are adjacent, small, and tightly related154- Do not combine across phase boundaries155- Do not combine across explicit dependency boundaries that call for independent validation156- Do not combine slices that span unrelated packages, crates, modules, or subsystems unless the plan clearly frames them as one inseparable change157- Bias toward fewer, more meaningful iterations when the plan is overly granular, but keep each execution unit small enough for one tractable Red-Green-Refactor cycle and one human review158- When uncertain, prefer a modest combination of two or a few closely related slices over a large batch159160## Examples161162### Example 1: First slice selection with no prior completions163164Plan has Phase 1 (3 slices) and Phase 2 (2 slices). No just-completed slice. No completed slices provided.165166Action:167- No completion to record (first invocation)168- Updated completed slices: (empty)169- Select Phase 1 / Slice 1170- Report: slice name = "Phase 1 / Slice 1", included slices = "Phase 1 / Slice 1", scope = "Define AuthToken and AuthError types", acceptance criteria = "AuthToken struct compiles with sub, exp, iat, roles fields; AuthError enum has MalformedToken variant", packages = "rust/auth"171- Status: more work remains172173### Example 2: Mark completion and select next slice174175Just-completed slice: "Phase 1 / Slice 2". Completed slices: "Phase 1 / Slice 1".176177Action:178- Append "Phase 1 / Slice 2" to completed list179- Updated completed slices: "Phase 1 / Slice 1, Phase 1 / Slice 2"180- Select Phase 1 / Slice 3181- Report slice details including included slices182- Status: more work remains183184### Example 3: Combine adjacent narrow slices into one execution unit185186Plan has `Phase 1 / Slice 1` = add parser tests, `Phase 1 / Slice 2` = add parser implementation, and `Phase 1 / Slice 3` = add parser error formatting. Slices 2 and 3 both affect the same module and are both small.187188Action:189- Completed slices: "Phase 1 / Slice 1"190- Candidate next slice is `Phase 1 / Slice 2`191- Combine with adjacent `Phase 1 / Slice 3` because both are small, contiguous, same-package changes with no meaningful review boundary between them192- Report: slice name = "Phase 1 / Slices 2-3", included slices = "Phase 1 / Slice 2, Phase 1 / Slice 3", scope = "Implement parser behavior and error formatting", acceptance criteria = "Parser behavior matches tests and error formatting is emitted as specified", packages = "rust/parser"193- Status: more work remains194195### Example 4: Mark completion crossing a phase boundary196197Just-completed slice: "Phase 1 / Slice 3". Completed slices: "Phase 1 / Slice 1, Phase 1 / Slice 2".198199Action:200- Append "Phase 1 / Slice 3" to completed list201- Updated completed slices: "Phase 1 / Slice 1, Phase 1 / Slice 2, Phase 1 / Slice 3"202- All Phase 1 slices complete, move to Phase 2203- Select Phase 2 / Slice 1204- Report slice details205- Status: more work remains206207### Example 5: Mark final completion — no slices remain208209Just-completed slice: "Phase 2 / Slice 2". Completed slices: "Phase 1 / Slice 1, Phase 1 / Slice 2, Phase 1 / Slice 3, Phase 2 / Slice 1". The plan contains a `## Definition of Done` section.210211Action:212- Append "Phase 2 / Slice 2" to completed list213- Updated completed slices: "Phase 1 / Slice 1, Phase 1 / Slice 2, Phase 1 / Slice 3, Phase 2 / Slice 1, Phase 2 / Slice 2"214- No remaining slices215- Note: All execution slices are complete. The plan includes a Definition of Done section — verify those plan-level completion checks separately before treating the plan as finished.216- Status: all slices are complete217218## Edge Cases219220- **No delivery plan found**: Report the error clearly. Do not fabricate a plan.221- **Plan has no identifiable slices or phases**: If the plan structure does not contain phases, TDD slices, or numbered tasks, treat the entire plan as a single slice. Select it on the first pass.222- **Ambiguous slice boundaries**: When the plan describes work narratively without clear slice demarcation, use phase-level tasks as slices. Prefer too few coherent slices over many tiny ones.223- **No completed slices provided**: Treat this as zero completions. Start from the first slice.224- **Completed slices format varies**: Accept both comma-separated strings ("Slice A, Slice B") and JSON arrays (`["Slice A", "Slice B"]`). Write back in whichever format was read, defaulting to comma-separated if starting fresh.225- **Just-completed slice already in completed list**: Do not duplicate it. Proceed with selection as normal.226- **Just-completed slice name does not match any plan slice**: Still append it. The plan may have been updated, or the name may use a slightly different format. Report the mismatch as a warning.227- **Package references are stale**: If a referenced package or directory no longer exists, note this in the scope description but still select the slice.228- **Plan was updated between selections**: If the plan file has changed since the last selection (new slices added, slices reordered), re-parse the full plan and reconcile against the completed slices. Previously completed slices remain completed; new slices are eligible for selection in order.229- **Plan is overly granular**: Combine adjacent compatible slices into one execution unit when doing so will materially reduce workflow overhead without making the TDD cycle too broad.