speckit-specify by dceoy/speckit-agent-skills
npx skills add https://github.com/dceoy/speckit-agent-skills --skill speckit-specify.specify/ 脚本和模板的仓库上下文。如果描述缺失或不清晰,请在继续之前提出有针对性的问题。
请求中的用户功能描述就是输入。除非描述缺失,否则不要要求用户重复。
根据该功能描述,执行以下操作:
为分支生成简洁的短名称(2-4个单词):
在创建新分支前检查现有分支:
a. 首先,获取所有远程分支以确保我们拥有最新信息:
git fetch --all --prune
b. 为短名称查找所有来源中的最高功能编号:
* 远程分支:git ls-remote --heads origin | grep -E 'refs/heads/[0-9]+-<short-name>$'
* 本地分支:
* 规范目录:检查匹配 的目录
c. 确定下一个可用编号:
* 从所有三个来源中提取所有数字
* 找到最高数字 N
* 为新分支编号使用 N+1
d. 使用计算出的编号和短名称运行脚本 :
* 传递 和 以及功能描述
* Bash 示例:
* PowerShell 示例:
:
* 检查所有三个来源(远程分支、本地分支、规范目录)以找到最高编号
* 仅匹配具有精确短名称模式的分支/目录
* 如果未找到具有此短名称的现有分支/目录,则从编号 1 开始
* 每个功能你只能运行此脚本一次
* JSON 在终端中作为输出提供 - 始终参考它以获取你正在查找的实际内容
* JSON 输出将包含 BRANCH_NAME 和 SPEC_FILE 路径
* 对于参数中的单引号,如 "I'm Groot",使用转义语法:例如 'I'''m Groot'(或者如果可能,使用双引号:"I'm Groot")
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
git branch | grep -E '^[* ]*[0-9]+-<short-name>$'specs/[0-9]+-<short-name>.specify/scripts/bash/create-new-feature.sh --json "<feature description>"--number N+1--short-name "your-short-name".specify/scripts/bash/create-new-feature.sh --json --number 5 --short-name "user-auth" "Add user authentication".specify/scripts/bash/create-new-feature.sh -Json -Number 5 -ShortName "user-auth" "Add user authentication"加载 .specify/templates/spec-template.md 以了解所需部分。
遵循此执行流程:
使用模板结构将规范写入 SPEC_FILE,用从功能描述(参数)推导出的具体细节替换占位符,同时保留部分顺序和标题。
规范质量验证:编写初始规范后,根据质量标准进行验证:
a. 创建规范质量检查清单:使用检查清单模板结构在 FEATURE_DIR/checklists/requirements.md 生成一个检查清单文件,包含以下验证项:
```
# 规范质量检查清单:[功能名称]
**目的**:在进入规划阶段之前验证规范的完整性和质量
**创建日期**:[日期]
**功能**:[指向 spec.md 的链接]
## 内容质量
- [ ] 无实现细节(语言、框架、API)
- [ ] 专注于用户价值和业务需求
- [ ] 为非技术利益相关者编写
- [ ] 所有必填部分已完成
## 需求完整性
- [ ] 无剩余的 [NEEDS CLARIFICATION] 标记
- [ ] 需求是可测试且明确的
- [ ] 成功标准是可衡量的
- [ ] 成功标准与技术无关(无实现细节)
- [ ] 所有验收场景都已定义
- [ ] 边界情况已识别
- [ ] 范围界定清晰
- [ ] 依赖项和假设已识别
## 功能就绪度
- [ ] 所有功能需求都有明确的验收标准
- [ ] 用户场景涵盖主要流程
- [ ] 功能满足成功标准中定义的可衡量结果
- [ ] 无实现细节泄露到规范中
## 备注
- 标记为未完成的项目需要在 speckit-clarify 或 speckit-plan 技能之前更新规范
```
b. 运行验证检查:对照检查清单的每一项审查规范: * 对于每一项,确定是通过还是失败 * 记录发现的具体问题(引用相关规范部分) c. 处理验证结果: * 如果所有项目都通过:标记检查清单完成并继续步骤 6 * 如果有项目失败(不包括 [NEEDS CLARIFICATION]): 1. 列出失败的项目和具体问题 2. 更新规范以解决每个问题 3. 重新运行验证直到所有项目通过(最多 3 次迭代) 4. 如果 3 次迭代后仍然失败,在检查清单备注中记录剩余问题并警告用户 * 如果仍有 [NEEDS CLARIFICATION] 标记: 1. 从规范中提取所有 [NEEDS CLARIFICATION: ...] 标记 2. 限制检查:如果存在超过 3 个标记,只保留 3 个最关键的(按范围/安全/用户体验影响),其余的做出有根据的猜测 3. 对于每个需要的澄清项(最多 3 个),以以下格式向用户呈现选项: ``` ## 问题 [N]: [主题]
**上下文**:[引用相关规范部分]
**我们需要知道**:[来自 NEEDS CLARIFICATION 标记的具体问题]
**建议答案**:
| 选项 | 答案 | 影响 |
| ------ | ------------------------- | ------------------------------------- |
| A | [第一个建议答案] | [这对功能意味着什么] |
| B | [第二个建议答案] | [这对功能意味着什么] |
| C | [第三个建议答案] | [这对功能意味着什么] |
| Custom | 提供你自己的答案 | [解释如何提供自定义输入] |
**你的选择**:_[等待用户响应]_
```
4. **关键 - 表格格式**:确保 Markdown 表格格式正确:
* 使用一致的间距,管道对齐
* 每个单元格内容周围应有空格:`| 内容 |` 而不是 `|内容|`
* 标题分隔符必须至少有 3 个破折号:`|--------|`
* 测试表格在 Markdown 预览中是否正确呈现
5. 按顺序编号问题(Q1, Q2, Q3 - 最多 3 个)
6. 在等待响应之前一起呈现所有问题
7. 等待用户对所有问题做出选择(例如,"Q1: A, Q2: Custom - [details], Q3: B")
8. 通过用用户选择或提供的答案替换每个 [NEEDS CLARIFICATION] 标记来更新规范
9. 所有澄清项解决后重新运行验证
d. 更新检查清单:每次验证迭代后,使用当前的通过/失败状态更新检查清单文件
报告完成情况,包括分支名称、规范文件路径、检查清单结果以及下一阶段(speckit-clarify 或 speckit-plan)的就绪状态。
注意:脚本在写入之前会创建并检出新分支,并初始化规范文件。
specs/<feature>/spec.mdspecs/<feature>/checklists/requirements.md.specify/scripts/bash/create-new-feature.sh 创建的新功能分支生成规范后:
根据用户提示创建此规范时:
合理默认值的示例(不要询问这些):
成功标准必须是:
好的示例:
坏的示例(以实现为中心):
每周安装
82
仓库
GitHub 星标
49
首次出现
2026年1月29日
安全审计
安装于
opencode79
codex76
gemini-cli75
github-copilot74
amp72
kimi-cli72
.specify/ scripts and templates.If the description is missing or unclear, ask a targeted question before continuing.
The user's feature description in the request is the input. Do not ask them to repeat it unless it is missing.
Given that feature description, do this:
Generate a concise short name (2-4 words) for the branch:
Check for existing branches before creating new one :
a. First, fetch all remote branches to ensure we have the latest information:
git fetch --all --prune
b. Find the highest feature number across all sources for the short-name:
* Remote branches: `git ls-remote --heads origin | grep -E 'refs/heads/[0-9]+-<short-name>$'`
* Local branches: `git branch | grep -E '^[* ]*[0-9]+-<short-name>$'`
* Specs directories: Check for directories matching `specs/[0-9]+-<short-name>`
c. Determine the next available number:
* Extract all numbers from all three sources
* Find the highest number N
* Use N+1 for the new branch number
d. Run the script .specify/scripts/bash/create-new-feature.sh --json "<feature description>" with the calculated number and short-name:
* Pass `--number N+1` and `--short-name "your-short-name"` along with the feature description
* Bash example: `.specify/scripts/bash/create-new-feature.sh --json --number 5 --short-name "user-auth" "Add user authentication"`
* PowerShell example: `.specify/scripts/bash/create-new-feature.sh -Json -Number 5 -ShortName "user-auth" "Add user authentication"`
IMPORTANT :
* Check all three sources (remote branches, local branches, specs directories) to find the highest number
* Only match branches/directories with the exact short-name pattern
* If no existing branches/directories found with this short-name, start with number 1
* You must only ever run this script once per feature
* The JSON is provided in the terminal as output - always refer to it to get the actual content you're looking for
* The JSON output will contain BRANCH_NAME and SPEC_FILE paths
* For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'''m Groot' (or double-quote if possible: "I'm Groot")
3. Load .specify/templates/spec-template.md to understand required sections.
Follow this execution flow:
Write the specification to SPEC_FILE using the template structure, replacing placeholders with concrete details derived from the feature description (arguments) while preserving section order and headings.
Specification Quality Validation : After writing the initial spec, validate it against quality criteria:
a. Create Spec Quality Checklist : Generate a checklist file at FEATURE_DIR/checklists/requirements.md using the checklist template structure with these validation items:
# Specification Quality Checklist: [FEATURE NAME]
**Purpose**: Validate specification completeness and quality before proceeding to planning
**Created**: [DATE]
**Feature**: [Link to spec.md]
## Content Quality
- [ ] No implementation details (languages, frameworks, APIs)
- [ ] Focused on user value and business needs
- [ ] Written for non-technical stakeholders
- [ ] All mandatory sections completed
## Requirement Completeness
- [ ] No [NEEDS CLARIFICATION] markers remain
- [ ] Requirements are testable and unambiguous
- [ ] Success criteria are measurable
- [ ] Success criteria are technology-agnostic (no implementation details)
- [ ] All acceptance scenarios are defined
- [ ] Edge cases are identified
- [ ] Scope is clearly bounded
- [ ] Dependencies and assumptions identified
## Feature Readiness
- [ ] All functional requirements have clear acceptance criteria
- [ ] User scenarios cover primary flows
- [ ] Feature meets measurable outcomes defined in Success Criteria
- [ ] No implementation details leak into specification
## Notes
- Items marked incomplete require spec updates before the speckit-clarify or speckit-plan skills
b. Run Validation Check : Review the spec against each checklist item:
* For each item, determine if it passes or fails
* Document specific issues found (quote relevant spec sections)
c. Handle Validation Results :
* **If all items pass** : Mark checklist complete and proceed to step 6
* **If items fail (excluding [NEEDS CLARIFICATION])** :
1. List the failing items and specific issues
2. Update the spec to address each issue
3. Re-run validation until all items pass (max 3 iterations)
4. If still failing after 3 iterations, document remaining issues in checklist notes and warn user
* **If [NEEDS CLARIFICATION] markers remain** :
1. Extract all [NEEDS CLARIFICATION: ...] markers from the spec
2. **LIMIT CHECK** : If more than 3 markers exist, keep only the 3 most critical (by scope/security/UX impact) and make informed guesses for the rest
3. For each clarification needed (max 3), present options to user in this format:
## Question [N]: [Topic]
**Context**: [Quote relevant spec section]
**What we need to know**: [Specific question from NEEDS CLARIFICATION marker]
**Suggested Answers**:
| Option | Answer | Implications |
| ------ | ------------------------- | ------------------------------------- |
| A | [First suggested answer] | [What this means for the feature] |
| B | [Second suggested answer] | [What this means for the feature] |
| C | [Third suggested answer] | [What this means for the feature] |
| Custom | Provide your own answer | [Explain how to provide custom input] |
**Your choice**: _[Wait for user response]_
4. **CRITICAL - Table Formatting** : Ensure markdown tables are properly formatted:
* Use consistent spacing with pipes aligned
* Each cell should have spaces around content: `| Content |` not `|Content|`
* Header separator must have at least 3 dashes: `|--------|`
* Test that the table renders correctly in markdown preview
5. Number questions sequentially (Q1, Q2, Q3 - max 3 total)
6. Present all questions together before waiting for responses
7. Wait for user to respond with their choices for all questions (e.g., "Q1: A, Q2: Custom - [details], Q3: B")
8. Update the spec by replacing each [NEEDS CLARIFICATION] marker with the user's selected or provided answer
9. Re-run validation after all clarifications are resolved
d. Update Checklist : After each validation iteration, update the checklist file with current pass/fail status
NOTE: The script creates and checks out the new branch and initializes the spec file before writing.
specs/<feature>/spec.mdspecs/<feature>/checklists/requirements.md.specify/scripts/bash/create-new-feature.shAfter generating the spec:
When creating this spec from a user prompt:
Examples of reasonable defaults (don't ask about these):
Success criteria must be:
Good examples :
Bad examples (implementation-focused):
Weekly Installs
82
Repository
GitHub Stars
49
First Seen
Jan 29, 2026
Security Audits
Gen Agent Trust HubFailSocketPassSnykPass
Installed on
opencode79
codex76
gemini-cli75
github-copilot74
amp72
kimi-cli72
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
46,600 周安装