Global switching and task selection are different
trellis workflow --template <workflow-id> replaces the global
.trellis/workflow.md. Use it when the project as a whole should move to a
different workflow.
Dynamic selection keeps variants under .trellis/workflows/ and resolves one
at runtime for the active task. It does not overwrite the global workflow.
Save workflow variants to the project library
List bundled, marketplace, and already-saved workflows:trellis update does not overwrite files in this library. Re-run
trellis workflow --save <workflow-id> --force when you intentionally want to refresh
a saved template.
Pin a workflow to a task
Choose the workflow when creating a task:task.json:
.trellis/workflows/tdd.md exists. A missing or
invalid variant prints a warning and falls through to the next default.
Configure personal and team defaults
Runtime resolution uses one precedence chain:
Set a team default:
native while
the team default remains tdd. An explicit task pin still wins over both.
When a layer is unset, invalid, or points to a missing file, resolution
continues downward. If none of the optional layers apply, behavior is
identical to reading .trellis/workflow.md directly.
What changes at runtime
The resolved workflow supplies all runtime workflow content:- the Phase Index shown at session start
- the per-turn
[workflow-state:*]breadcrumb - phase and step details returned by
get_context.py --mode phase - Codex inline versus sub-agent dispatch guidance
Keep variant files compatible
A workflow variant is executable input, not only prose. Keep these parser markers:- a
## Phase Indexsection #### X.Ystep headings[workflow-state:STATUS]...[/workflow-state:STATUS]blocks- any platform routing markers used by your workflow
trellis workflow --save warns when a saved template is missing the standard
markers. The warning does not block custom workflows, but missing markers can
degrade session-start context, breadcrumbs, or phase lookup.
Workflow ids must match [A-Za-z0-9_-]+. This keeps every id inside
.trellis/workflows/ and prevents path traversal.
Current limits
- Selection is explicit. Trellis does not infer a workflow from task type.
- Pi Agent and Oh My Pi extensions still read the global
.trellis/workflow.md; task, personal, and team selection does not apply to those two extensions yet. - A saved marketplace workflow is a local copy. It does not update until you
save it again with
--force.