Prepare execution plan

From Fr-e-d/GAAI-framework · View interactive version

Prepare execution plan is an AI agent skill from the GitHub repository Fr-e-d/GAAI-framework. Decompose a high-level delivery plan into a precise, file-level execution sequence with explicit ordering, edge cases, and test checkpoints. Activate after delivery-high-level-plan for complex or multi-phase Stories before implementation begins.

How to use this skill

Skill file

Prepare Execution Plan

Purpose / When to Activate

Activate after delivery-high-level-plan when the Story meets at least one of:

For simple Stories (1-2 files, clear criteria, no order constraints), delivery-high-level-plan output is sufficient — skip this skill.


Process

CRITICAL — Frontmatter Contract (MUST apply to every file this skill writes):

Read the plan template at contexts/artefacts/plans/_template.plan.md and open every

output with its YAML frontmatter block. Both type: artefact and id: are required —

artefact validation reads those two fields and rejects a file that lacks either. The

requirement applies equally to {id}.execution-plan.md and {id}.plan-blocked.md;

both live under contexts/artefacts/plans/ and are validated identically.

When updating an existing file, never overwrite frontmatter that is already there —

add only what is missing.

at the # heading, with no frontmatter anywhere in its instructions, while the template

it never told anyone to read did carry it. Generated plans therefore failed artefact

validation from the start, and because sibling skills (story generation) do instruct

reading their template, the gap showed up as plans being the one artefact class that

failed en masse. Fixing the backlog of files without fixing this instruction would

simply regenerate the defect on the next delivery.

CRITICAL — Anti-Collision Guard (MUST execute before writing any output file):

Before writing contexts/artefacts/plans/{id}.execution-plan.md (or {id}.plan-blocked.md), check if the target file already exists on disk:

This guard prevents the silent data loss incident of 2026-03-17 where concurrent sessions overwrote story files.

Phase 0 — Required Skills Contract Resolution

Execute this phase FIRST, before any codebase mapping.

  1. Read the Story frontmatter required_skills field.

The plan MUST NOT include any step that invokes a custom skill.

Proceed directly to Phase 1.

a. Resolve skill X: check that a SKILL.md file exists for X in the skill catalog

(.gaai/core/skills/** or .gaai/project/skills/**).

path with: `PLAN BLOCKED: required_skills entry "${X}" cannot be resolved — no

matching SKILL.md found. Check the skill name and that the skill file exists.`

Exit non-zero. Do not proceed.

b. Identify the bound output AC co-declared with X in the story.

(A required_skills entry without a co-declared output AC is rejected by

validate-artefacts before the plan runs — treat its absence here as a STOP

condition identical to an unresolvable skill.)

c. Emit an explicit plan step: "Invoke skill X [path to SKILL.md] — satisfies bound

output AC: [AC text]".

Autonomy-never-originates invariant (hard constraint, no exceptions): the plan MUST

contain a contracted skill step for each required_skills entry and MUST NOT contain any

custom skill step not present in required_skills. The planning agent may not discover,

invent, or suggest a custom skill not declared by the human in Discovery.

Phase 1 — Codebase Mapping

  1. Identify all files that will be created or modified
  2. Map dependencies between those files (who imports whom)
  3. Identify shared state, interfaces, or contracts that must remain stable across changes
  4. Flag any files with existing tests that may be affected

Phase 2 — Implementation Sequence

  1. Order changes to minimize broken states at each intermediate step:
  1. Mark explicit checkpoints: points where partial work is testable and safe to commit
  2. Identify rollback boundaries: the last safe state before each risky change

Phase 3 — Edge Cases and Error Paths

  1. For each acceptance criterion, enumerate:
  1. Map each edge case to an explicit test checkpoint

Phase 4 — Test Sequence

  1. Define test order aligned with implementation order:
  1. Flag which tests must pass before proceeding to the next implementation step

Phase 5 — Risk Register

  1. Surface any remaining ambiguities or risks:
  1. For each risk: proposed mitigation or escalation condition

Phase 6 — Consistency Gate

  1. Before finalizing: if the Story references multiple artefacts (Epic, PRD, prior decisions), flag any contradictions found between the plan and those artefacts. Record them in the Risk Register. Do not write the plan artefact if contradictions exist — write a {id}.plan-blocked.md instead with the specific inconsistencies listed. The Planning Sub-Agent (not this skill) is responsible for invoking consistency-check before this skill runs.

Outputs

---
type: artefact
artefact_type: execution-plan
id: {Story ID}
track: delivery
related_backlog_id: {Story ID}
created_at: {YYYY-MM-DD}
updated_at: {YYYY-MM-DD}
---

# Execution Plan — {Story ID}: {Story Title}

## Implementation Sequence

| Step | Action | Files | Checkpoint |
|------|--------|-------|------------|
| 1 | {action} | {files} | {test or review gate} |
| 2 | {action} | {files} | {test or review gate} |

## Edge Cases

### {Acceptance Criterion 1}
- Happy path: {behavior}
- Boundary: {condition → expected behavior}
- Error path: {condition → expected behavior}

## Test Checkpoints

1. After step N: {what must pass}
2. After step M: {what must pass}
3. Final QA gate: all acceptance criteria pass

## Risk Register

| Risk | Severity | Mitigation |
|------|----------|------------|
| {risk} | high/medium/low | {action} |

## Rollback Boundaries

- Safe state after step N: {what is stable}
- Full rollback point: {last known good state}

Saves to contexts/artefacts/plans/{id}.execution-plan.md.


Quality Checks


Non-Goals

This skill must NOT:

A precise execution plan makes implementation mechanical. Mechanical is auditable. Auditable is governed.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.