Problem Statement
ExtensionCommand and preset command entries model fields such as type, name, file, description, and strategy, but do not expose artifact (the repo-relative output path a command produces), optional (whether a flow can skip it), or handoffs (declarative follow-on commands).
handoffs currently lives in command frontmatter and is stripped by several markdown integrations, including Forge. This forces downstream consumers such as wizard UIs, flow runners, and pipeline visualizers to re-parse markdown frontmatter and prevents these semantics from being consistently available through the command manifest model.
Proposed Solution
Add optional artifact, optional, and handoffs fields to extension and preset command manifest entries:
commands:
- name: speckit.plan
file: commands/speckit.plan.md
description: "..."
artifact: specs/{feature}/plan.md
optional: false
handoffs:
- to: speckit.tasks
when: "plan.status == 'done'"
message: "Ready to break plan into tasks"
Parse command frontmatter during manifest loading and merge its handoffs into the command entry when the manifest does not declare them. If both sources provide handoffs, the manifest value takes precedence.
Keep handoffs in the in-memory model, while continuing to strip it on the Forge export path. Define how the existing frontmatter shape (label, agent, prompt, send) maps to or coexists with the manifest shape (to, when, message).
Alternatives Considered
- Leave
handoffs frontmatter-only and require consumers to parse it. Rejected because downstream consumers would duplicate parsing.
- Derive
artifact from the command file. Rejected because a command may produce multiple artifacts or none.
- Bump
schema_version without a compatibility strategy. Current validators use exact-version matching, so a bump would reject existing manifests. Prefer an additive change under the current version unless compatibility policy is deliberately changed.
Component
Specify CLI (initialization, commands)
AI Agent (if applicable)
Not applicable
Use Cases
- A wizard renders a Spec-Driven Development pipeline graph by walking
handoffs edges without opening markdown files.
- A flow runner shows a skip action for commands with
optional: true and refuses to auto-skip mandatory commands.
- An audit joins a command's
artifact path to files in the repository.
Acceptance Criteria
Additional Context
Blocks preset info --json / extension info --json, which are tracked separately.
Relevant implementation locations include src/specify_cli/extensions/__init__.py, src/specify_cli/presets/__init__.py, src/specify_cli/_utils.py::relative_extension_path_violation, and src/specify_cli/integrations/forge/__init__.py. Existing command frontmatter examples include templates/commands/plan.md.
Problem Statement
ExtensionCommandand preset command entries model fields such astype,name,file,description, andstrategy, but do not exposeartifact(the repo-relative output path a command produces),optional(whether a flow can skip it), orhandoffs(declarative follow-on commands).handoffscurrently lives in command frontmatter and is stripped by several markdown integrations, including Forge. This forces downstream consumers such as wizard UIs, flow runners, and pipeline visualizers to re-parse markdown frontmatter and prevents these semantics from being consistently available through the command manifest model.Proposed Solution
Add optional
artifact,optional, andhandoffsfields to extension and preset command manifest entries:Parse command frontmatter during manifest loading and merge its
handoffsinto the command entry when the manifest does not declare them. If both sources providehandoffs, the manifest value takes precedence.Keep
handoffsin the in-memory model, while continuing to strip it on the Forge export path. Define how the existing frontmatter shape (label,agent,prompt,send) maps to or coexists with the manifest shape (to,when,message).Alternatives Considered
handoffsfrontmatter-only and require consumers to parse it. Rejected because downstream consumers would duplicate parsing.artifactfrom the command file. Rejected because a command may produce multiple artifacts or none.schema_versionwithout a compatibility strategy. Current validators use exact-version matching, so a bump would reject existing manifests. Prefer an additive change under the current version unless compatibility policy is deliberately changed.Component
Specify CLI (initialization, commands)
AI Agent (if applicable)
Not applicable
Use Cases
handoffsedges without opening markdown files.optional: trueand refuses to auto-skip mandatory commands.artifactpath to files in the repository.Acceptance Criteria
artifact(string),optional(bool, defaultfalse), andhandoffs(list of{to, when?, message?}).handoffswhen the manifest does not declare its own value.handoffstakes precedence over frontmatter.handoffsfrom exported frontmatter.artifactis validated as repo-relative;handoffs[].toresolves to a known command;optionalis validated as a boolean.handoffssemantics are documented in the relevant existing documentation.Additional Context
Blocks
preset info --json/extension info --json, which are tracked separately.Relevant implementation locations include
src/specify_cli/extensions/__init__.py,src/specify_cli/presets/__init__.py,src/specify_cli/_utils.py::relative_extension_path_violation, andsrc/specify_cli/integrations/forge/__init__.py. Existing command frontmatter examples includetemplates/commands/plan.md.