ralph-github-start-loop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Loop GitHub Issues

循环处理GitHub Issues

Run the autonomous loop to execute features from GitHub Issues.
运行自主循环以执行GitHub Issues中的功能需求。

Usage

使用方法

/loop-github-issues              # Interactive: shows available PRDs and asks which to run
/loop-github-issues --all        # Run all available PRDs (no prompt)
/loop-github-issues auth-flow    # Run PRDs matching search term
/loop-github-issues 25           # Run with 25 iterations per PRD
/loop-github-issues --all 25     # Run all PRDs with 25 iterations each
When running non-interactively (background mode),
--all
is auto-enabled.
/loop-github-issues              # 交互式:显示可用PRD并询问要运行的目标
/loop-github-issues --all        # 运行所有可用PRD(无提示)
/loop-github-issues auth-flow    # 运行匹配搜索词的PRD
/loop-github-issues 25           # 每个PRD运行25次迭代
/loop-github-issues --all 25     # 所有PRD各运行25次迭代
在非交互式运行(后台模式)时,
--all
会自动启用。

Prerequisites

前提条件

  • gh
    CLI authenticated
  • PRD issues created via
    /ralph-github-create-issues
    (reads from
    .claude/plans/
    or
    prds/
    )
Note: Assume gh extensions are installed. Do NOT try to install them.
  • 已完成gh CLI认证
  • 通过
    /ralph-github-create-issues
    创建的PRD问题(读取自
    .claude/plans/
    prds/
    目录)
注意:假设gh扩展已安装,请勿尝试安装它们。

Process

执行流程

  1. Check prerequisites (
    gh auth status
    )
  2. Run the script directly - it handles PRD selection and filtering:
bash
~/.claude/skills/loop-github-issues/loop-github-issues.sh [iterations] [prd-search-term] [--all]
Use
run_in_background: true
to prevent timeout.
Monitoring progress:
  • Local status:
    cat /tmp/ralph-status-{repo}-{prd-number}.txt
  • GitHub: Comments are posted to the PRD issue as stories complete
Important: Don't list PRDs separately before running - the script shows available PRDs (excluding those with open PRs) and handles selection.
  1. 检查前提条件(执行
    gh auth status
  2. 直接运行脚本——它会处理PRD的选择和过滤:
bash
~/.claude/skills/loop-github-issues/loop-github-issues.sh [iterations] [prd-search-term] [--all]
使用
run_in_background: true
以避免超时。

What It Does

监控进度:

  1. Lists open PRD issues (identified by
    prd
    label) that don't already have open PRs
  2. Prompts user to select which PRD(s) to work on (or auto-selects in background mode)
  3. For each selected PRD:
    • Assigns issue to current user (shows as in progress)
    • Creates git worktree at
      ../{repo}-{feature}/
    • For each iteration:
      • Passes all open sub-issues to the agent
      • Agent picks the logical next story based on dependencies
      • Implements the story
      • Commits:
        feat: Story Title (closes #XXX)
      • Closes sub-issue with link to commit
    • When all sub-issues closed, creates PR (parent PRD closes on merge)
    • Cleans up worktree
  • 本地状态:执行
    cat /tmp/ralph-status-{repo}-{prd-number}.txt
    查看
  • GitHub:当需求故事完成时,会在PRD问题下发布评论
重要提示:运行前无需单独列出PRD——脚本会显示可用的PRD(排除已有开放PR的PRD)并处理选择。

Differences from
/ralph

功能说明

Aspect
/ralph
(JSON)
/loop-github-issues
(GitHub)
Story source
prds/*.json
GitHub Issues
Status tracking
passes: true/false
Issue open/closed
Dependencies
dependsOn
array
Native GitHub blocking
CompletionUpdate JSONClose issue
PRD doneAll stories passAll sub-issues closed
  1. 列出所有开放的PRD问题(通过
    prd
    标签识别)且该PRD尚未关联开放PR
  2. 提示用户选择要处理的PRD(或在后台模式下自动选择)
  3. 对于每个选中的PRD:
    • 将问题分配给当前用户(标记为进行中)
    • ../{repo}-{feature}/
      目录创建git工作区
    • 每次迭代:
      • 将所有开放的子问题传递给Agent
      • Agent根据依赖关系选择逻辑上的下一个需求故事
      • 实现该需求故事
      • 提交:
        feat: Story Title (closes #XXX)
      • 关闭子问题并关联提交链接
    • 当所有子问题关闭后,创建PR(合并父PRD时自动关闭)
    • 清理工作区

Dependencies

/ralph
的差异

Ralph-issues checks GitHub's native blocking relationships. PRDs with open blocking issues are skipped.
The script queries the
blockedBy
field via GraphQL to determine if a PRD is ready to start.
维度
/ralph
(JSON)
/loop-github-issues
(GitHub)
需求故事来源
prds/*.json
GitHub Issues
状态跟踪
passes: true/false
问题的开放/关闭状态
依赖关系
dependsOn
数组
GitHub原生阻塞机制
完成标记更新JSON文件关闭问题
PRD完成条件所有故事验证通过所有子问题关闭

Issue Conventions

依赖关系

Finding PRD Issues

bash
gh issue list --label prd --state open --json number,title,body
Ralph-issues会检查GitHub原生的阻塞关系,存在开放阻塞问题的PRD会被跳过。
脚本通过GraphQL查询
blockedBy
字段来判断PRD是否可以启动。

Finding Story Sub-Issues

问题规范

查找PRD问题

Uses the
gh-sub-issue
extension:
bash
gh sub-issue list <parent-number> --state open --json number,title,body
bash
gh issue list --label prd --state open --json number,title,body

Closing Issues

查找需求故事子问题

On story completion:
bash
gh issue close 101 --comment "Implemented in https://github.com/owner/repo/commit/abc123"
Parent PRD issues close automatically when the PR is merged (via
Closes #XX
in PR body).
使用
gh-sub-issue
扩展:
bash
gh sub-issue list <parent-number> --state open --json number,title,body

Branch Naming

关闭问题

Uses conventional prefixes parsed from the PRD issue body:
  • feature/<name>
    for enhancements
  • bugfix/<name>
    for bug fixes
当需求故事完成时:
bash
gh issue close 101 --comment "Implemented in https://github.com/owner/repo/commit/abc123"
父PRD问题会在PR合并时自动关闭(通过PR正文中的
Closes #XX
标记)。

Notes

分支命名

  • Run multiple Ralph instances in parallel on independent PRDs (separate terminals)
  • Each works in its own worktree, no conflicts
  • Commits include
    closes #XXX
    to auto-close issues on merge
使用从PRD问题正文中解析的常规前缀:
  • feature/<name>
    用于功能增强
  • bugfix/<name>
    用于Bug修复

注意事项

  • 可在独立PRD上并行运行多个Ralph实例(使用不同终端)
  • 每个实例在各自的工作区运行,无冲突
  • 提交信息包含
    closes #XXX
    ,以便合并时自动关闭问题