Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[Feature]: Add artifact, optional, and handoffs to the command manifest schema

未关闭
#4,209 5 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
64/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
活跃
技术栈
python
领域
cli, tooling

调研方向

从 src/specify_cli/extensions/init.py 和 src/specify_cli/presets/init.py 开始,然后检查 src/specify_cli/_utils.py 中的 relative_extension_path_violation 以及 Forge 集成。将 templates/commands/plan.md 中现有的 command frontmatter 与 manifest models 进行比较,并确定 normalized handoff mapping。当 validation、precedence、向后兼容的 schema 行为、Forge stripping 和 documentation 都通过 implementation verification 得到覆盖时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

enhancement feature-assess feature-go
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). In other words, add handoffs to the normalized in-memory command model and JSON output. Accept an explicit manifest declaration as an optional override, but derive it from command frontmatter when absent. Authors should not need to duplicate handoffs in both files.

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
  1. A wizard renders a Spec-Driven Development pipeline graph by walking handoffs edges without opening markdown files.
  2. A flow runner shows a skip action for commands with optional: true and refuses to auto-skip mandatory commands.
  3. An audit joins a command's artifact path to files in the repository.
Acceptance Criteria
  • Extension and preset command schemas accept optional artifact (string), optional (bool, default false), and handoffs (list of {to, when?, message?}).
  • The manifest loader merges command-file frontmatter handoffs when the manifest does not declare its own value.
  • Manifest-declared handoffs takes precedence over frontmatter.
  • Forge export continues to strip handoffs from exported frontmatter.
  • artifact is validated as repo-relative; handoffs[].to resolves to a known command; optional is validated as a boolean.
  • The schema-version decision is recorded, with backward-compatible behavior for existing manifests.
  • Valid and malformed manifest entries, frontmatter merge precedence, and Forge stripping are covered by the implementation verification.
  • The manifest schema and handoffs semantics are documented in the relevant existing documentation.
Additional Context

Impacts 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.

主要语言
Python
星标
138k
派生
12.4k
平均合并
3 天 4 小时
30 天内合并 PR
154

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/spec-kit 的其他 Issue

查看 github/spec-kit 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。