关于 ralph-github-create-issues
ralph-github-create-issues 是将本地 PRD 或计划转换为 GitHub Issues 的技能。它指导创建父级功能及故事问题,并处理检测到的依赖关系,最后询问是否删除本地源文件。
主要功能
- 01在常见目录中查找 PRD 和计划
- 02创建父级问题与故事问题
- 03记录问题之间的依赖关系
- 04检查 GitHub CLI 身份验证
适用场景
- 01将已批准的计划转为可跟踪的 GitHub 工作
- 02把 PRD 拆分为父级问题和故事问题
- 03表达计划功能之间的依赖
安装
复制下面的命令,在终端中运行。
$
npx skills add https:/ / github.com/ richtabor/ agent-skills --skill ralph-github-create-issues安装后在 Claude Code 中输入/ralph-github-create-issues确认已加载。
附带文件references/best-practices.md
详细介绍
创建 PRD 问题
将本地 PRD 或计划文件转换为 GitHub Issues。
用法
/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/— plan mode 保存已批准计划的位置。这是主要来源。plans/— 项目级计划目录。prds/— 未通过 plan mode 生成的独立 PRD。
如果多个位置都存在文件,请列出所有文件并询问要转换哪个。如果只找到一个文件,则直接使用。如果所有位置都未找到文件,请向用户询问 PRD/计划文件的路径。
扫描 PRD Markdown 中的依赖引用(“依赖于 X”、“参见 feature.md”)。记录匹配项以供后续使用。
注意: 假设 gh sub-issue 和 gh issue-dependency 已安装。不要尝试安装它们。直接运行命令——如果运行失败,则跳过该步骤并继续。
创建问题
父问题
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
实施顺序
- 故事一
- 故事二 EOF )"
### Sub-Issues
For each story:
```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)
如果是,请删除源文件。GitHub Issue 现在是事实来源。
评论
支持 Markdown