用途
该技能将本地的 PRD 或计划文件转换为 GitHub Issues,生成一个父 Issue 以及若干子 Issue(故事),并建立父子关联与依赖关系,供 ralph-github-start-loop 后续执行。适用于用户希望把 PRD 中的故事推送到 GitHub 的场景。
主要能力
- 将 PRD/计划 Markdown 文件转换为 GitHub Issues(父 Issue + 子 Issue)。
- 支持按名称转换指定的 PRD。
- 在预检阶段检查 gh 认证状态、查找计划/PRD 文件、确认 PRD 尚未成为 Issue、确保 prd 标签存在、获取已有 PRD 用于依赖匹配。
- 扫描 PRD Markdown 中的依赖引用(如 "depends on X"、"see feature.md"),并在创建后通过 GraphQL API 建立 blocked-by 关系。
- 创建完成后输出已创建的 Issue 编号、依赖关系、分支名,并提示运行 /ralph-github-start-loop。
- 询问是否删除本地计划/PRD 文件,删除后以 GitHub Issue 作为唯一事实来源。
使用方式
命令形式:
/ralph-create-github-issues # Looks in .claude/plans/ then prds/
/ralph-create-github-issues auth-flow # Convert specific PRD by name
关于故事粒度与验收标准指引,参见 references/best-practices.md。
预检步骤(关键项失败则停止):
# 1. Auth check
gh auth status
# 2. Find plan/PRD files — check all locations
ls .claude/plans/*.md 2>/dev/null
ls plans/*.md 2>/dev/null
ls prds/*.md 2>/dev/null
# 3. PRD not already an issue (stop if found open)
gh issue list --label prd --state all --json number,title,state
# 4. Ensure prd label exists
gh label create prd --description "Product Requirements Document" --color "0052CC" 2>/dev/null || true
# 5. Get existing PRDs for dependency matching
gh issue list --label prd --state open --json number,title
查找计划文件的位置顺序:
.claude/plans/— 计划模式保存已批准计划的位置,主要来源。plans/— 项目级计划目录。prds/— 非由计划模式生成的独立 PRD。
若多个位置存在文件,列出全部并询问转换哪一个;若只找到一个文件,直接使用;若任何位置都未找到,询问用户 PRD/计划文件路径。
注意:假定 gh sub-issue 与 gh issue-dependency 已安装,不要尝试安装它们。直接运行命令,若失败则跳过该步骤并继续。
创建父 Issue:
gh issue create \
--title "Feature Name" \
--label "prd" \
--label "enhancement" \
--body "$(cat <<'EOF'
## Overview
<From PRD intro>
## Branch
`feature/<name>`
## Quality Gates
```bash
npm run typecheck
npm run lint
npm test
Implementation Order
- Story one
- Story two EOF )"
创建子 Issue(每个故事):
```bash
# Create issue
gh issue create \
--title "Story Title" \
--body "$(cat <<'EOF'
**Files:** `path/to/file.tsx`
**Acceptance Criteria:**
- [ ] Specific change
- [ ] Typecheck passes
- [ ] Lint passes
**Notes:**
Context if needed.
EOF
)"
# Link to parent
gh sub-issue add <parent> <child>
依赖关系(若预检中检测到依赖,使用 GraphQL API,无需扩展):
# Get repo info
OWNER=$(gh repo view --json owner -q '.owner.login')
REPO=$(gh repo view --json name -q '.name')
# Get node IDs (replace 50 and 42 with actual issue numbers)
BLOCKED_ID=$(gh api graphql -f query="{ repository(owner: \"$OWNER\", name: \"$REPO\") { issue(number: 50) { id } } }" --jq '.data.repository.issue.id')
BLOCKING_ID=$(gh api graphql -f query="{ repository(owner: \"$OWNER\", name: \"$REPO\") { issue(number: 42) { id } } }" --jq '.data.repository.issue.id')
# Add blocked-by relationship
gh api graphql -f query="mutation { addBlockedBy(input: {issueId: \"$BLOCKED_ID\", blockingIssueId: \"$BLOCKING_ID\"}) { clientMutationId } }"
输出示例:
Created: #50 - Feature Name
→ #51 Story One
→ #52 Story Two
Dependencies: Blocked by #42 (Auth Flow)
Branch: feature/<name>
Run: /ralph-github-start-loop
随后询问:
Remove local plan/PRD file? <path> (y/n)
若回答 yes,删除源文件。GitHub Issue 即成为唯一事实来源。
适用场景
- 用户希望将 PRD 中的故事推送到 GitHub。
- 需要把本地计划/PRD 文件批量转换为带父子结构与依赖关系的 GitHub Issues。
- 作为 ralph-github-start-loop 的前置步骤,为后续执行准备 Issue。
限制
- 依赖 gh CLI 及 GitHub 认证;预检关键项失败则停止。
- 假定 gh sub-issue 与 gh issue-dependency 已安装,不负责安装;相关命令失败时跳过该步骤并继续。
- 依赖关系通过 GraphQL API 建立,需要仓库与 Issue 编号信息。
- 其他未在资料中说明的功能、收费、平台或效果暂未提供。