T-A7PL-sdlc-p2-workflows
State: closed/done · Impact: high · Complexity: medium
Today every lifecycle stage (implement, check, review, respond, close-out) is a
hard-coded sequence of skill/CLI calls scattered across skills and ops. Phase 2’s
orchestrator loops need one runner-agnostic place that says what steps compose each
named stage, with sane built-in defaults and a project-level override/append/prepend
seam — so sdlc orchestrate run (and, later, flowline) can execute a workflow without
knowing which skill or verb backs it.
| Location | Role today |
|---|---|
solutions/ontological/lib/config/load.ts | SdlcConfigSchema — no workflows: section |
solutions/ontological/lib/config/verbs.ts | resolveVerb cascade + trust gating, reused by workflow run: steps |
solutions/ontological/skills/orchestrate/SKILL.md | prose loop hard-coding stage order (task-work, pr-check, etc.) |
solutions/ontological/lib/registry.ts | op descriptor pattern new ops (workflow list, workflow show) must follow |
Proposed
Section titled “Proposed”SdlcConfigSchemagains aworkflows:section: a map of workflow name → ordered step list. Each step is a discriminated union:{ skill, args? },{ run }(a verb name resolved viaresolveVerb),{ script }(a path), or{ prompt }(literal text). Built-in defaults forimplement,check,judge,pr-review,pr-respond,pr-update,close-out,define(two steps:task-ensure-readythentask-auto-define) live in code, not in a shippedsdlc.yaml.- A project’s
sdlc.yamlentry for a workflow name either replaces the whole step list, or suppliesprepend:/append:step lists that wrap the (possibly still-default) resolved list. Replacement and prepend/append are mutually exclusive per workflow entry — validate against both being set. resolveWorkflow(name, projectRoot)returns the resolved ordered step list plus, per step, itssource: 'default' | 'override' | 'prepend' | 'append'.sdlc workflow listprints every known workflow name (built-in ∪ project-defined).sdlc workflow show <name>prints the resolved step list with each step’s source, as both a new op inlib/registry.tsand a CLI command.- The step grammar itself carries no runner logic (no host/engine coupling) so a future flowline runner can execute the same resolved list.
Approach
Section titled “Approach”- Add the Zod step-union schema and
workflows:section toSdlcConfigSchemainlib/config/load.ts, with per-key.describe()s consistent with the rest of the file’s documented style. - Add
lib/config/workflows.ts: built-in default step lists as a typed const map, plusresolveWorkflow(name, projectRoot, opts?)implementing the override/prepend/append merge and per-step source tagging. Validate the mutual-exclusion rule and surface a clearOpErroron violation. - Add
lib/services/workflow/ops/{list,show}.tsfollowing the existing op descriptor pattern (see an existing simple op such aslib/services/pr/ops/classify.tsfor shape), registered inlib/registry.ts, wired into the CLI (sdlc workflow list|show <name>). - Update
solutions/ontological/skills/orchestrate/SKILL.mdonly insofar as this task’s step vocabulary needs naming consistency; the full skill rewrite to a thin--oncewrapper is T-XRFD’s job, not this one. - Unit tests (also tracked by T-REME, but the resolver’s own tests belong with its implementation): default resolution, full override, prepend, append, and the mutual-exclusion validation error.
| Area | Note |
|---|---|
solutions/ontological/lib/config/load.ts | add workflows: section to SdlcConfigSchema |
solutions/ontological/lib/config/workflows.ts | built-in defaults + resolveWorkflow |
solutions/ontological/lib/services/workflow/ops/list.ts | workflow list op |
solutions/ontological/lib/services/workflow/ops/show.ts | workflow show <name> op |
solutions/ontological/lib/registry.ts | register the two new ops |
solutions/ontological/lib/config/workflows.test.ts | resolver unit tests |
Acceptance criteria
Section titled “Acceptance criteria”- AC-1:
sdlc workflow listprints all eight built-in workflow names with no project config present. - AC-2:
sdlc workflow show implementon a project overridingimplementprints the overridden steps withsource: overrideon each. - AC-3: a project supplying only
append:forcheckprints the built-in steps first (source: default) followed by the appended step(s) (source: append), and likewise forprepend:. - AC-4: supplying both a full replacement and
prepend/appendfor the same workflow entry fails config validation with a clear message. - AC-5:
resolveVerbis reused (not reimplemented) forrun:steps, so trust gating on an untrusted repo still applies to a workflow’srun:step.
Out of scope
Section titled “Out of scope”- The
claude/codex/cursorper-engine skill-to-first-message mapping (T-AD81 / Phase 6). - Executing a workflow (that’s
sdlc session launch, T-AD81, and the loop engine, T-XRFD) — this task only resolves the step list. - Making
workflows:meta-defined (category/consumers/…) — that’s Phase 5.
Dependencies
Section titled “Dependencies”- none
Discovery context
Section titled “Discovery context”Phase 2 of docs/planning/notes/N-S4AJ-sdlc-0-8-plan.md (“Workflows in sdlc.yaml”).