Documentation: BC Phase Plan Generator
Generate the complete set of per-phase implementation plan files under openspec/plans/ from an approved (or near-approved) Business Central technical spec. Each phase listed in the spec's §8 Phase Overview becomes one .plan.md file. The plan files are the AL Developer's working backlog — they translate the spec's AL object inventory and ACs into a checkbox task list bounded by clear exit criteria.
When to use
The user has an approved technical spec under openspec/specs/ (status: approved in the frontmatter) and wants the per-phase implementation plans materialised as separate files, including phase-to-phase dependencies. Plan files MUST NOT be generated from a draft, in-review, or otherwise non-approved spec — approval is a human gate that signals the AL Architect has frozen the design.
Default output location
openspec/plans/<filename> — always. Do not ask the user where to save the files.
Workflow
Follow these steps in order. Do not skip the spec validation or the dependency-graph step.
Step 1 — Identify and validate the source spec
- If the user did not specify a SPEC ID, list files in
openspec/specs/and ask which one to plan viavscode_askQuestions. Only offer specs whose frontmatterstatusisapproved— surface draft/in-review specs only as disabled context, never as selectable targets. - Read the chosen spec file and verify
status: approvedin the frontmatter.- If
statusis anything other thanapproved(e.g.draft,in-review,rejected), stop immediately. Do not write any plan file. Report to the user: the spec path, its current status, and the next required action ("Setstatus: approvedin the spec frontmatter, then re-run this skill"). - Treat a missing or malformed
statusfield as not-approved.
- If
- Capture:
id(SPEC-NNN),title,user_story(US-NNN),ccn(if present),module,prefix,id_range, the full AL object inventory (§3), the technical Acceptance Criteria (§7) with theirAC-*ids, the §8 Phase Overview (phase number, phase name, scope, ACs satisfied, estimated effort), and any §11 Open Questions. - Read the linked user story under
openspec/userstories/(oropenspec/user-stories/) and capture US ACs to allow cross-referencing. - If the spec is missing a §8 Phase Overview or any phase lacks a name / ACs / effort estimate, stop and report the gap — do NOT invent phases.
Step 2 — Allocate the PLAN ID and feature branch
- The PLAN id is derived from the spec id:
PLAN-NNN-P<phase>, whereNNNis the SPEC numeric id and<phase>is the phase number (1, 2, 3, …). No padding on<phase>. - The shared feature branch is
feature/spec-NNN-<kebab-title>and MUST be identical across every phase file for the same spec. Take the kebab title from the spec filename. - If the user supplies a different branch convention, honour it but apply it uniformly to all phase files.
Step 3 — Build the dependency graph
- By default, each phase depends on the immediately preceding phase: Phase
Ndepends_on: [PLAN-NNN-P<N-1>]. Phase 1 hasdepends_on: []. - If the spec's §8 Phase Overview explicitly states a different dependency (e.g. Phase 4 depends on both Phase 2 and Phase 3), honour it — record it in
depends_onand reflect it in the §9 Dependencies body section. - Compute the downstream consumers for each phase (which later phases reference its outputs) and surface them in the Dependencies body section.
- Detect cycles. If a cycle exists, stop and report — do NOT write any plan file.
Step 4 — Verify standard BC assumptions per phase
For each phase whose tasks rely on a standard BC mechanism (RecordRef / FieldRef, EnqueueBackgroundTask, RapidStart configuration packages, No. Series, Permission Sets, virtual tables AllObj / Field, Document Attachment, etc.):
- Call
mcp_microsoftdocs_microsoft_docs_searchto confirm the mechanism exists on the BCapplicationversion fromapp.json. - If unverified, record the verification gap as a bullet in the phase's Notes for the AL Developer section.
- Never assert availability without verification.
Step 5 — Compose each phase's task list
For every phase:
- Translate the spec's §3 object inventory and §8 phase scope into concrete numbered checkbox tasks (
- [ ] **N.M** …). - Every task MUST be:
- Actionable (verb-led, specific object IDs, page properties, field numbers, etc. — pulled from the spec).
- Bounded (one object or one tight cluster of related objects per task).
- Traceable — every task that satisfies an AC cites it inline as
*(AC-…-NNN)*.
- Number tasks
<phase>.<M>starting at<phase>.1. Do not skip numbers. - If a phase contains a smoke test, RapidStart export/import, or manual verification, it MUST be its own numbered task.
Step 6 — Build the filename
Format: SPEC-NNN-phase-<N>-<kebab-phase-name>.plan.md
<N>is the phase number (no padding).<kebab-phase-name>is the lowercase, hyphen-separated phase name from §8 (diacritics stripped, non-alphanumerics removed, hyphens collapsed).- Validate every filename against
^SPEC-\d{3}-phase-\d+-[a-z0-9]+(-[a-z0-9]+)*\.plan\.md$before writing. - If a target filename already exists, stop and ask the user before overwriting.
Step 7 — Write all phase plan files
For each phase, create the file at openspec/plans/<filename> using the template in references/phase-plan-template.md. Each file MUST contain, in this exact order:
- YAML frontmatter:
---
id: PLAN-NNN-P<N>
title: <Spec short title> — Phase <N> — <Phase Name>
version: 1.0.0
spec: SPEC-NNN
user_story: US-NNN
ccn: <CCN-NNN or empty>
phase: <N>
status: not-started
estimated_hours: <hours from SPEC §8 or PLAN estimate>
branch: feature/spec-NNN-<kebab-title>
depends_on:
- PLAN-NNN-P<N-1>
assignee: <AL Developer or empty>
prepared_by: <author name>
created_date: <YYYY-MM-DD>
approved_date:
related_docs:
- openspec/specs/SPEC-NNN-<kebab-title>.spec.md
- openspec/userstories/US-NNN-<kebab-title>.userstory.md
# - docs/ccn/CCN-NNN-<kebab-title>.md # include only when a CCN exists
--- # Phase <N> — <Phase Name>H1.## References— bullet list with markdown links to the user story (with the specific US-AC numbers this phase satisfies), the relevant spec sections (e.g.SPEC-NNN §3.2,§5 Phase <N>,§7.x), the CCN if any, and a closing bullet listing the technical ACs satisfied by this phase.## Goal— 2–4 sentences describing the user-visible / developer-visible outcome at the end of the phase. Must be concrete enough to verify on a demo.## Branch— one line stating the shared feature branch, with explicit guidance ("Continue on …" for phases > 1, "Cut frommain…" for phase 1 unless otherwise stated).## Tasks— numbered checkbox list (see Step 5). Mandatory format- [ ] **N.M** <action> *(AC-…)*. Tasks that do not satisfy a specific AC may omit the inline AC citation but MUST cite the spec section they implement.## Exit criteria— bullet list. Every entry MUST be objectively verifiable. Minimum entries: all tasks ticked, every AC mapped to this phase demonstrably met,app.jsonversion bumped (patch), build green, tests green.## Out of scope for this phase— bullet list of items intentionally deferred. MUST cite the US Out-of-Scope or the spec phase that does own each item.## Dependencies— two-block subsection:- Prerequisites — every PLAN id listed in
depends_on, with a one-line summary of what each upstream phase delivers that this phase consumes. - Downstream consumers — every later PLAN id that lists this phase in its
depends_on, with a one-line summary of what each consumer needs from this phase. - If either block is empty, state explicitly: "None — this is the first phase." / "None — this is the final phase."
- Prerequisites — every PLAN id listed in
## Testing notes— bullet list describing the test strategy for this phase only: which test codeunits are added/extended, whether tests are mocked or live, what is deferred (e.g. live SharePoint tenant smoke test in a later phase), and any manual smoke-test scripts to run.## Notes for the AL Developer— free-form bullet list of hard-won implementation hints derived from the spec: caption / tooltip rules, lookup filters, fields that must be read-only, translation deferrals, performance caveats, verification gaps from Step 4, and anything the developer would have to dig out of the spec otherwise.
Step 8 — Optional spec back-link
If the source spec's §12 Phase Plans section is empty or contains placeholders, you MAY populate it with markdown links to the newly created plan files. Do not change the spec's status, frontmatter, or other content.