优化: speckit.checklist 产物内容项按优先级排序(P)
背景
当前 speckit.checklist 的产物中,内容项输出顺序不稳定/不体现优先级,导致阅读与执行顺序不明确。
优化目标
在 speckit.checklist 产物生成时,对内容项进行排序(P),确保输出顺序一致且可预期。
期望行为
- 按约定优先级(P)对内容项排序后再输出。
- 相同优先级下保持稳定顺序(避免每次生成顺序波动)。
- 不改变原有字段语义,仅调整展示/输出顺序。
验收标准
- [ ] 生成的 checklist 内容项按优先级(P)有序。
- [ ] 多次生成同一输入时,顺序一致。
- [ ] 现有相关流程与命令可正常运行,无回归。
备注
如当前尚无明确优先级规则,建议在规范中补充并统一到生成逻辑。
LLM translation in english (@bigsmartben ) does this sound correct if can validate?
#Background In the current output of speckit.checklist, the order of the content items is unstable and does not reflect their priority. This results in an unclear order for reading and execution.
#Optimization Objective When generating the speckit.checklist output, sort the content items by priority (P) to ensure that the output order is consistent and predictable.
#Expected Behavior Sort the content items based on the agreed-upon priority (P) before outputting.
Maintain a stable order for items with the same priority (to prevent the order from fluctuating with each generation).
Do not alter the semantics of the original fields; only adjust the display/output order.
#Acceptance Criteria The generated checklist content items are sorted sequentially by priority (P).
The order remains consistent when the output is generated multiple times from the same input.
Existing related processes and commands operate normally without any regressions.
#Notes If there are currently no clear rules for priority, it is recommended to define them in the specifications and integrate them into the generation logic.
looks like a good candidate for discussion @mnriem
While I have no issue with sorting or ordering in general what goal is it specifically trying to accomplish here? As long as all the items are accounted for we are good?
Posted on behalf of @bigsmartben by Codex (model: GPT-5).
I checked the current fork implementation at bigsmartben/spec-kit@dc199f4a8761707dbff15d91609dc9b6d9c2e1f0 and want to narrow this issue based on what the command currently does.
In templates/commands/checklist.md, checklist generation is framed as requirements-quality validation, grouped by quality dimensions. The only explicit prioritization rule I found is the content consolidation rule: when raw candidate items exceed 40, prioritize by risk/impact, then merge near-duplicates. The generated structure otherwise uses category headings plus globally increasing CHK### IDs, and appends to an existing checklist while preserving prior content.
So, based on the current implementation, there is not a separate P priority field or priority-tag ordering model for checklist items. The concrete goal I had in mind was readability/execution stability: higher-risk requirement-quality gaps should appear before lower-risk/narrow duplicates when the generated checklist would otherwise become large. That appears to be covered by the current risk/impact prioritization rule, not by a P-based sort.
Suggested outcome: I think this issue can either be closed as already covered by the current risk/impact consolidation behavior, or reframed into a smaller docs/wording improvement that explicitly says checklist ordering is category + risk/impact based, not a separate P0/P1/P2 ordering scheme.
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed in 30 days if no further activity occurs.
This issue has been automatically closed after 90 days without activity. To request reconsideration, please provide updated reproduction details, the currently affected version or environment, and the present impact. Ask a maintainer to reopen this issue if it is fundamentally the same problem. If the scope or reproduction has materially changed, create a new issue, link this one, and explain what has changed.