spec-to-issue
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesespec-to-issue — Spec to GitHub Issue
spec-to-issue — 从规格文档到GitHub Issue
Auto-generate GitHub Issues from spec directories ().
.specs/{feature}/从规格文档目录()自动生成GitHub Issue。
.specs/{feature}/Language Rules
语言规则
- Auto-detect input language → output in the same language
- Japanese input → Japanese issue, use as template reference
references/issue-template.ja.md - English input → English issue, use as template reference
references/issue-template.md - Explicit override takes priority
Reference file selection: Based on the detected output language, use the corresponding template:
- English →
references/issue-template.md - Japanese →
references/issue-template.ja.md
- 自动检测输入语言 → 输出与输入语言一致的内容
- 输入为日语时,生成日语Issue,使用作为模板参考
references/issue-template.ja.md - 输入为英语时,生成英语Issue,使用作为模板参考
references/issue-template.md - 显式设置优先级更高
参考文件选择:根据检测到的输出语言,使用对应的模板:
- 英语 →
references/issue-template.md - 日语 →
references/issue-template.ja.md
Execution Flow
执行流程
1. Locate Spec Directory
1. 定位规格文档目录
With argument: → use
spec-to-issue auth-feature.specs/auth-feature/Without argument: Scan and present a list → ask user to select
.specs/Spec directories found in .specs/:
1. auth-feature (requirement.md, design.md, tasks.md)
2. member-management (requirement.md, tasks.md)
Which spec do you want to create an issue from?带参数: → 使用
spec-to-issue auth-feature.specs/auth-feature/不带参数:扫描目录并列出可选项 → 询问用户选择
.specs/Spec directories found in .specs/:
1. auth-feature (requirement.md, design.md, tasks.md)
2. member-management (requirement.md, tasks.md)
Which spec do you want to create an issue from?2. File Validation
2. 文件验证
Required: must exist. Otherwise, exit with error.
Recommended: (if missing, generate a basic checklist)
Optional: (used as supplementary info if present)
requirement.mdtasks.mddesign.md必填项:必须存在,否则报错退出。
推荐项:(如果缺失,生成基础检查清单)
可选项:(如果存在,用作补充信息)
requirement.mdtasks.mddesign.md3. Spec Analysis
3. 规格文档分析
Extract from each file:
requirement.md:
- Title: First line, strip suffixes like "Requirements", "要件定義書"
# - Overview: or
## Overviewsection## 概要 - Key features: Sections starting with ,
### 1., etc.### 2. - Tech stack: or
## Technology Stacksection## 技術要件
tasks.md:
- Phases: Lines starting with or
## Phase## フェーズ - Tasks: headings within each phase, simplified for checklist
### - Done criteria: or
## Definition of Donesection## 完了の定義 - Notes: or
## Notessection## 注意事項
design.md (optional):
- Architecture overview (as supplementary info)
从每个文件中提取以下信息:
requirement.md:
- 标题:第一个行,去除“Requirements”、“要件定義書”等后缀
# - 概述:或
## Overview部分## 概要 - 核心功能:以、
### 1.等开头的部分### 2. - 技术栈:或
## Technology Stack部分## 技術要件
tasks.md:
- 阶段:以或
## Phase开头的行## フェーズ - 任务:每个阶段内的标题,简化后用作检查清单
### - 完成标准:或
## Definition of Done部分## 完了の定義 - 备注:或
## Notes部分## 注意事項
design.md(可选):
- 架构概述(用作补充信息)
4. Resolve Project Settings
4. 解析项目设置
Determine defaults in this priority order:
Command arguments > .specs/.config.yml > CLAUDE.md > Built-in defaultsFrom CLAUDE.md:
- Branch name: PR target branch from Git Workflow section → default
--branch - GitHub Organization: Inferred from repository URL
.specs/.config.yml (optional):
yaml
default-branch: develop
default-labels: [feature, spec-generated]
project-number: 7
assignee: username按以下优先级确定默认值:
Command arguments > .specs/.config.yml > CLAUDE.md > Built-in defaults从CLAUDE.md获取:
- 分支名称:Git Workflow部分中的PR目标分支 → 作为的默认值
--branch - GitHub组织:从仓库URL推断
.specs/.config.yml (optional):
yaml
default-branch: develop
default-labels: [feature, spec-generated]
project-number: 7
assignee: username5. Compose Issue Body
5. 编写Issue内容
See template details in the appropriate reference file (based on Language Rules):
- English: references/issue-template.md
- Japanese: references/issue-template.ja.md
根据语言规则,查看对应参考文件中的模板详情:
- 英语:references/issue-template.md
- 日语:references/issue-template.ja.md
6. Create Issue
6. 创建Issue
Without --preview (default): Show a brief summary and execute
gh issue createCreating Issue:
Title: [Feature] Member Management
Labels: feature, spec-generated
Phases: 3
Tasks: 12
→ Running gh issue create...
Issue #42 created: https://github.com/org/repo/issues/42With --preview: Display the full issue body, confirm, then execute
不带--preview(默认):显示简要摘要并执行
gh issue createCreating Issue:
Title: [Feature] Member Management
Labels: feature, spec-generated
Phases: 3
Tasks: 12
→ Running gh issue create...
Issue #42 created: https://github.com/org/repo/issues/42带--preview:显示完整的Issue内容,确认后再执行
7. Additional Actions (optional)
7. 附加操作(可选)
- : Apply specified labels
--label - : Add to GitHub Project board via
--projectgh project item-add - : Set assignee
--assignee
- : 应用指定标签
--label - : 通过
--project添加到GitHub项目看板gh project item-add - : 设置经办人
--assignee
Options
选项
| Option | Description | Default |
|---|---|---|
| Display issue body for confirmation | OFF |
| Comma-separated labels | |
| Add to GitHub Project | |
| Base branch for spec links | CLAUDE.md or |
| Set assignee | |
| 选项 | 描述 | 默认值 |
|---|---|---|
| 显示Issue内容供确认 | 关闭 |
| 逗号分隔的标签列表 | |
| 添加到GitHub项目 | |
| 规格文档链接的基础分支 | CLAUDE.md中指定的分支或 |
| 设置经办人 | |
Integration with spec-generator
与spec-generator集成
After spec-generator's phase completes, suggest:
fullAll three spec documents have been generated.
→ Create a GitHub Issue from them? (Y/n)If yes, run spec-to-issue on the same directory.
当spec-generator的阶段完成后,会提示:
fullAll three spec documents have been generated.
→ Create a GitHub Issue from them? (Y/n)如果用户确认(Y),则在同一目录下运行spec-to-issue。
Error Handling
错误处理
| Situation | Response |
|---|---|
| Error: Spec directory not found |
| Error: requirement.md is required |
| Warning: Use basic checklist as fallback |
| Error: Guide user to |
| Section not found | Use default value, show warning |
| 场景 | 响应 |
|---|---|
| 错误:未找到规格文档目录 |
缺失 | 错误:requirement.md为必填项 |
缺失 | 警告:使用基础检查清单作为备选 |
| 错误:引导用户执行 |
| 未找到指定部分 | 使用默认值,并显示警告 |
Usage Examples
使用示例
undefinedundefinedWith argument
With argument
/spec-to-issue auth-feature
/spec-to-issue auth-feature
Auto-detect and select
Auto-detect and select
/spec-to-issue
/spec-to-issue
With preview
With preview
/spec-to-issue auth-feature --preview
/spec-to-issue auth-feature --preview
With labels and Project
With labels and Project
/spec-to-issue auth-feature --label "feature,priority:high" --project 7
/spec-to-issue auth-feature --label "feature,priority:high" --project 7
After spec-generator
After spec-generator
"Create full spec for todo-app" → done → "Turn this into an issue"
"Create full spec for todo-app" → done → "Turn this into an issue"
Japanese
Japanese
「仕様書を全部作って」→ 完了 →「これをIssueにして」
undefined「仕様書を全部作って」→ 完了 →「これをIssueにして」
undefined