Overview
scripts/sync-prompts.py is the CLI that replaces each workflow step's instruction with the contents of its matching Markdown prompt. It loads workflow.json, reads every non-README .md file in a playbook directory, and rewrites the workflow in place before printing warnings for mismatches.
Why This Matters
Because the script rewrites every playbook’s workflow.json, a regression (missing prompt detection, incorrect matching, or malformed writes) could silently corrupt multiple workflows at once. Without automated tests, these issues would only be caught after damaging the JSON.
Files Needing Tests
scripts/sync-prompts.py (~102 lines)
Suggested Test Cases
Overview
scripts/sync-prompts.pyis the CLI that replaces each workflow step'sinstructionwith the contents of its matching Markdown prompt. It loadsworkflow.json, reads every non-README.mdfile in a playbook directory, and rewrites the workflow in place before printing warnings for mismatches.Why This Matters
Because the script rewrites every playbook’s
workflow.json, a regression (missing prompt detection, incorrect matching, or malformed writes) could silently corrupt multiple workflows at once. Without automated tests, these issues would only be caught after damaging the JSON.Files Needing Tests
scripts/sync-prompts.py(~102 lines)Suggested Test Cases
workflow.jsonand prompt files; assert instructions are updated and CLI output lists the synced steps..mdwithout a workflow step and assert it is reported under "Warning: .md files with no matching step" while the workflow remains valid JSON..mdand assert the script reports it under "Warning: steps with instructions but no matching .md file"..mdfiles (only README) and assert it exits non-zero after printing "No prompt .md files found".workflow.jsonand assert it exits non-zero with "Error: not found" without creating files.