resume-wave-prep · diff
git:20260528.f458872 to git:20260528.79283a8
49 added, 32 removed. Audit A to A.
---
name: resume-wave-prep
description: 'Resumes an interrupted wave-forge preparation from prior artefacts. Reads existing WavePlan, review result, and generated script to determine where to continue: at review, replan, or reforge.'
---
- Use this skill when returning to a wave-forge session that was interrupted before the final script was launched, or when a previously forged script needs updating after the WavePlan was revised.
+ Use this skill when a `copilot_prepare_orchestration` session ended before the script was written, or when you want to reforge the script for an existing PDE working folder.
## When to use
- - A prior `scan-and-plan` produced a WavePlan but the session ended before `review-wave-plan` or `forge-wave-script`
- - A prior `review-wave-plan` returned **REVISE** and the WavePlan has since been corrected
- - A generated script exists but paths or plugin dirs need to be updated
+ - The bash function ran but reported "Script NOT found" — the session ended mid-forge
+ - You want to retry a failed or incomplete session without re-running the slow bash scan
+ - A previously forged script exists but needs to be regenerated with updated paths or phases
+ ## How PDE working folders work
+
+ `copilot_prepare_orchestration` always creates `.pde/<yyMMddHHmm>--<uuid>/` in the cwd. That folder contains:
+ - `scan-context.md` — the bash-built scan of target dirs, kits, and all available agents
+ - `prompt.md` — the complete forge instructions (references scan-context inline)
+ - `orchestration-*.sh` — the output script (written by copilot during the session)
+
## Process
- ### Step 1 — Locate prior artefacts
+ ### Step 1 — Locate the PDE working folder
- Search the current working directory (and its subdirectories up to 2 levels) for:
- - Files matching `*WavePlan*.md` or `*-waveplan.md`
- - Files matching `review-wave-plan*.md` or `*-review.md`
- - Files matching `orchestration-*.sh`
- - Files in `.coaia/` folder matching any wave-related pattern
+ ```bash
+ ls -lt .pde/ | head -20
+ ```
- List all found artefacts with their modification timestamps.
+ List `.pde/` subfolders sorted by modification time. The most recent one is the target session. Report its full path.
- ### Step 2 — Determine resume point
+ ### Step 2 — Inspect the PDE folder
- Read each found artefact and classify the current state:
+ ```bash
+ ls -lh .pde/<ts>--<uuid>/
+ ```
- | State | Condition | Resume action |
- |-------|-----------|---------------|
- | **No WavePlan** | No WavePlan file found | Run `scan-and-plan` from scratch |
- | **WavePlan only** | WavePlan exists, no review result | Run `review-wave-plan` on the existing WavePlan |
- | **Blocked by REVISE** | Review result exists with REVISE verdict | Show the failing checks; ask user to fix the WavePlan, then run `review-wave-plan` again |
- | **Ready to forge** | ADVANCE verdict exists, no script yet | Run `forge-wave-script` with the existing WavePlan |
- | **Script exists** | Script file exists; user wants update | Determine what changed (desire, paths, agent names) and decide: replan or reforge only |
+ Check for the presence of:
+ - `scan-context.md` — if missing, the bash scan didn't complete (rare; rerun `copilot_prepare_orchestration`)
+ - `prompt.md` — if missing, same situation
+ - `orchestration-*.sh` — if present, the session succeeded; if absent, we need to retry the forge
- Report the determined state before taking any action.
+ ### Step 3 — Determine resume action
- ### Step 3 — Execute the resume action
+ | State | Condition | Action |
+ |-------|-----------|--------|
+ | **Script exists** | `orchestration-*.sh` found in PDE folder | Report success — script is at that path; no action needed |
+ | **No script, prompt exists** | `prompt.md` present, no script | Retry the forge (Step 4) |
+ | **PDE folder empty or missing key files** | `scan-context.md` or `prompt.md` absent | Tell user to rerun `copilot_prepare_orchestration` from scratch |
- Execute only the identified resume action. Do not re-run earlier phases that already have valid artefacts.
+ ### Step 4 — Retry the forge (when no script exists)
- - If resuming at `review-wave-plan`: read the WavePlan from the file and invoke the skill.
- - If resuming at `forge-wave-script`: read the WavePlan and ADVANCE verdict, then invoke the skill.
- - If reforging an existing script: invoke Wave Script Forge with the original WavePlan and the updated output script name (append `-r2`, `-r3`, etc. to distinguish from prior versions).
+ The `prompt.md` already contains all scan context and instructions. Pass it via `@file`:
- ### Step 4 — Report
+ ```bash
+ copilot \
+ --model claude-sonnet-4.6 \
+ --add-dir ".pde/<ts>--<uuid>" \
+ -p "@.pde/<ts>--<uuid>/prompt.md"
+ ```
- After completing the resume action, report:
+ Do NOT re-run the bash scan. Do NOT invoke skills. Write the script directly per the prompt.md instructions.
+
+ If retrying a second time (first retry also failed), append `-r2` to the script name in prompt.md before relaunching.
+
+ ### Step 5 — Report
+
```
- Resume point: <state name>
- Action taken: <what was run>
- Outcome: <result>
- Next: <what to do now — e.g. "run bash ./orchestration-....sh" or "fix WavePlan item X and re-run review-wave-plan">
+ PDE folder : .pde/<ts>--<uuid>/
+ Resume point: <No script | Script exists>
+ Action taken: <Retry forge | None needed>
+ Script path : <path if created, else "not yet created">
+ Next : <run bash ./orchestration-....sh | retry with corrected prompt.md>
```