| name | megacode-workflow-author |
| description | Convert an approved MegaCode ultracode plan into a validated `.megacode/workflows/<name>.yaml` file. Use after plan review passes, not during initial brainstorming. |
| disable-model-invocation | true |
MegaCode Workflow Author
Convert an approved plan into a workflow YAML file the supervisor can execute.
Inputs
- Approved ultracode plan (11 sections) or explicit phase list.
- Target workflow name (kebab-case).
- Optional trigger (
manual, github_issue) and inputs schema.
Output
- Complete
.megacode/workflows/<name>.yaml.
- Short validation report (schema fields satisfied, missing optional fields noted).
Authoring steps
- Read
schemas/workflow.schema.json (or .megacode/../schemas/workflow.schema.json when seeded).
- Map each plan phase to a workflow phase with unique
id, valid type, and depends_on DAG (no cycles).
- Set
profile, model, prompt_template, concurrency, and worktree per phase.
- Use
shell phases with verification for local CI — prefer pnpm verify; fallback npm test and npm run typecheck as separate verification entries when no pnpm script exists.
- Name final verification gate
local-verify-watch, not ci-watch. Do not reference GitHub Actions or workflow run IDs.
- Set
worktree.mode and foldback from the plan.
- Emit
model_policy caps from the plan.
Validation (fail-closed)
Before finishing, confirm:
name, version, and phases are present.
- Every phase has a unique
id.
- Every
depends_on target exists.
- Phase
type is one of: codex_run, codex_batch, team, shell, gate, cross_check, foldback_gate, github_pr, cloud_task.
verification arrays contain shell commands only (no remote CI URLs).
- No Linear MCP or Agents SDK phase types.
If validation fails, fix the YAML or list blocking schema errors — do not write an invalid file.
Locked constraints
- Local CI only (
pnpm verify / npm scripts).
- GitHub Issues for intake; no Linear.
- App-server primary for
codex_run / codex_batch workers.