You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. ---
  2. name: 'step-01b-resume'
  3. description: 'Resume interrupted workflow from last completed step'
  4. outputFile: '{test_artifacts}/ci-pipeline-progress.md'
  5. ---
  6. # Step 1b: Resume Workflow
  7. ## STEP GOAL
  8. Resume an interrupted workflow by loading the existing progress document, displaying progress, verifying previously created artifacts, and routing to the next incomplete step.
  9. ## MANDATORY EXECUTION RULES
  10. - 📖 Read the entire step file before acting
  11. - ✅ Speak in `{communication_language}`
  12. ---
  13. ## EXECUTION PROTOCOLS:
  14. - 🎯 Follow the MANDATORY SEQUENCE exactly
  15. - 📖 Load the next step only when instructed
  16. ## CONTEXT BOUNDARIES:
  17. - Available context: Output document with progress frontmatter
  18. - Focus: Load progress and route to next step
  19. - Limits: Do not re-execute completed steps
  20. - Dependencies: Output document must exist from a previous run
  21. ## MANDATORY SEQUENCE
  22. **CRITICAL:** Follow this sequence exactly. Do not skip, reorder, or improvise.
  23. ### 1. Load Output Document
  24. Read `{outputFile}` and parse YAML frontmatter for:
  25. - `stepsCompleted` — array of completed step names
  26. - `lastStep` — last completed step name
  27. - `lastSaved` — timestamp of last save
  28. **If `{outputFile}` does not exist**, display:
  29. "⚠️ **No previous progress found.** There is no output document to resume from. Please use **[C] Create** to start a fresh workflow run."
  30. **THEN:** Halt. Do not proceed.
  31. ---
  32. ### 2. Verify Previously Created Artifacts
  33. Since this is a file-creation workflow, verify that artifacts from completed steps still exist on disk:
  34. - If `step-02-generate-pipeline` is in `stepsCompleted`, check that the pipeline config file exists (e.g., `.github/workflows/test.yml` or equivalent)
  35. - If any expected artifact is missing, warn the user and suggest re-running from the step that creates it
  36. ---
  37. ### 3. Display Progress Dashboard
  38. Display:
  39. "📋 **Workflow Resume — CI/CD Pipeline Setup**
  40. **Last saved:** {lastSaved}
  41. **Steps completed:** {stepsCompleted.length} of 4
  42. 1. Preflight Checks (step-01-preflight) — {✅ if in stepsCompleted, ⬜ otherwise}
  43. 2. Generate Pipeline (step-02-generate-pipeline) — {✅ if in stepsCompleted, ⬜ otherwise}
  44. 3. Configure Quality Gates (step-03-configure-quality-gates) — {✅ if in stepsCompleted, ⬜ otherwise}
  45. 4. Validate & Summary (step-04-validate-and-summary) — {✅ if in stepsCompleted, ⬜ otherwise}"
  46. ---
  47. ### 4. Route to Next Step
  48. Based on `lastStep`, load the next incomplete step:
  49. - `'step-01-preflight'` → Load `./step-02-generate-pipeline.md`
  50. - `'step-02-generate-pipeline'` → Load `./step-03-configure-quality-gates.md`
  51. - `'step-03-configure-quality-gates'` → Load `./step-04-validate-and-summary.md`
  52. - `'step-04-validate-and-summary'` → **Workflow already complete.** Display: "✅ **All steps completed.** Use **[V] Validate** to review outputs or **[E] Edit** to make revisions." Then halt.
  53. **If `lastStep` does not match any value above**, display: "⚠️ **Unknown progress state** (`lastStep`: {lastStep}). Please use **[C] Create** to start fresh." Then halt.
  54. **Otherwise**, load the identified step file, read completely, and execute.
  55. The existing content in `{outputFile}` provides context from previously completed steps. Use it as reference for remaining steps.
  56. ---
  57. ## 🚨 SYSTEM SUCCESS/FAILURE METRICS
  58. ### ✅ SUCCESS:
  59. - Output document loaded and parsed correctly
  60. - Previously created artifacts verified
  61. - Progress dashboard displayed accurately
  62. - Routed to correct next step
  63. ### ❌ SYSTEM FAILURE:
  64. - Not loading output document
  65. - Incorrect progress display
  66. - Routing to wrong step
  67. - Re-executing completed steps
  68. **Master Rule:** Resume MUST route to the exact next incomplete step. Never re-execute completed steps.