[Feature]: Machine-readable output for workflow run, resume, and status
Problem Statement
specify workflow run, workflow resume, and workflow status emit only human-formatted (Rich) output. Terminal states — completed, paused, failed, aborted — and the run id are not available in any machine-readable form. External tooling and automation that drive workflows non-interactively currently have to scrape prose (e.g. parse a Status: line) or read the internal .specify/workflows/runs/<id>/state.json files, neither of which is a stable public contract.
Proposed Solution
Add an additive, opt-in --json flag to workflow run, workflow resume, and workflow status that prints a single machine-readable object to stdout, for example:
{ "run_id": "bb05423f", "workflow_id": "probe-clar", "status": "paused", "current_step_id": "ask" }
Design intent:
- General-purpose workflow reporting — not specific to any agent, orchestrator, or use case.
- Default human output is unchanged; JSON is emitted only when
--jsonis passed. - No change to semantic exit codes.
- Does not expose internal state-file layout as a public contract; the JSON is a defined output surface.
This adds a new CLI argument, so per CONTRIBUTING.md ("introducing new ... arguments ... make sure that it was discussed and agreed upon by the project maintainers") I'm opening this as a discussion issue first and intentionally not attaching a PR until there's agreement on whether this is wanted and on the exact shape.
Alternatives Considered
- Parsing the human
Status:line from stdout — fragile and unversioned. - Reading
.specify/workflows/runs/<id>/state.jsondirectly — couples callers to internal layout.
Component
Specify CLI (initialization, commands)
AI Agent (if applicable)
None — engine/CLI feature, agent-independent.
Use Cases
- A non-interactive runner needs to detect that a run paused vs. completed vs. failed and react accordingly.
- CI capturing a run id for later
workflow resume/statuswithout scraping prose.
Acceptance Criteria
--jsonon run/resume/status prints one parseable object including at leastrun_id,workflow_id, andstatus.- Without
--json, output is byte-identical to today. - Exit codes unchanged.
Additional Context
AI disclosure: this issue was drafted with AI assistance (Claude); the current output behaviour was verified against main before filing.
@mnriem could you help take a look at this? i also opened an PR for this issue, please help check as well