Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

ralph-merge-worktrees拉尔夫合并工作树

Agent Skill

ralph-merge-worktrees 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

685

周安装

28

GitHub Stars

公开资料未说明

下载量

220
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:ralph-merge-worktrees(拉尔夫合并工作树)
来源仓库:https://github.com/ralphcrisostomo/nuxt-development-skills
仓库路径:skills/ralph-merge-worktrees
安装命令:
npx skills add https://github.com/ralphcrisostomo/nuxt-development-skills --skill ralph-merge-worktrees
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/ralphcrisostomo/nuxt-development-skills --skill ralph-merge-worktrees

简介

用于查找、检索和筛选相关信息。

  • 适合在需要根据关键词或任务场景快速定位候选结果时使用。
  • 可结合来源仓库和原始 README 核验具体用法。
  • 安装前建议确认权限范围和维护状态,避免触发联网或文件读写。
  • ralph-merge-worktrees 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Ralph Merge Worktrees

Analyze completed Ralph worktree PRDs, build a dependency-aware merge queue, and sequentially squash-merge each branch into main — removing the worktree after each successful merge.

Overview

Ralph worktrees live at .claude/worktrees/ralph/<feature>/ with PRDs at scripts/ralph/prd.json inside each worktree. A worktree is "completed" when every user story in its PRD has passes: true. This skill finds all completed worktrees, determines the safest merge order, presents the plan for approval, and then executes it one branch at a time.

Step 1: Scan and Identify Completed Worktrees

Read every .claude/worktrees/ralph/*/scripts/ralph/prd.json file. For each PRD:

  1. Parse the JSON — extract branchName, description, and userStories[]
  2. A worktree is completed when ALL stories have passes: true
  3. Skip any worktree whose PRD has at least one story with passes: false
  4. Also skip worktrees that don't have a prd.json (malformed or empty)

If no completed worktrees are found, tell the user and stop.

Step 2: Analyze Each Completed Branch

For each completed worktree, gather merge intelligence:

# From the main repo root, diff the branch against main
git diff main...<branchName> --stat
git diff main...<branchName> --name-only
git log main..<branchName> --oneline

Collect for each branch:

  • Files changed — the full list of modified/added/deleted files
  • Change categories — classify files into buckets:

- terraform — anything under terraform/ (infra, resolvers, functions, lambda) - types — anything under types/ - graphql — anything under app/graphql/ - services — anything under services/ - composables — anything under app/composables/ - components — anything under app/components/ - pages — anything under app/pages/ - layouts — anything under app/layouts/ - content — anything under content/ - config — root config files (nuxt.config.ts, terraform-scaffold.config.ts, etc.) - other — everything else

  • Commit count — number of commits on the branch
  • Story count — total user stories in the PRD
  • File count — total files changed
  • Overlap matrix — which files are touched by multiple branches (potential conflict zones)

Step 3: Build the Priority Queue

Rank branches for merge order using these heuristics (most important first):

3a. Dependency Layer Ordering

Merge bottom-up through the stack so downstream features inherit upstream changes:

  1. Infrastructure first — branches that primarily touch terraform/, types/, services/, config (schema, tables, resolvers, types)
  2. Data/API layer — branches focused on app/graphql/, app/composables/ (client-side data plumbing)
  3. UI layer last — branches primarily touching app/components/, app/pages/, app/layouts/, content/

Determine the "primary layer" by whichever category has the most changed files. If a branch spans multiple layers, it belongs to the lowest layer it touches (infra > api > ui).

3b. Within the Same Layer

When two branches are in the same layer, break ties using:

  1. Less file overlap first — branches that share fewer files with other pending branches get merged first (lower conflict risk after merge)
  2. Smaller changeset first — fewer files changed = less risk, gets quick wins merged early, and the larger branch can rebase more easily if needed
  3. Fewer commits first — proxy for scope/complexity

3c. Special Cases

  • If a branch only touches content/ files (e.g., legal pages, markdown), it's very low-risk — can go anywhere in the queue, but default to early since it won't conflict with code changes
  • If a branch touches terraform-scaffold.config.ts or terraform/envs/staging/main.tf, prefer merging it early — other branches may have stale copies of these high-contention files

Step 4: Present the Merge Plan

Show the user the proposed merge queue in a clear table format:

Ralph Merge Queue — N completed branches ready

Priority | Branch                          | Stories | Files | Layer        | Reason
---------|--------------------------------|---------|-------|--------------|------------------
1        | ralph/legal-pages              | 6/6     | 8     | content      | Content-only, low risk
2        | ralph/post-creation            | 12/12   | 34    | infra+ui     | Core data model, merge early
3        | ralph/like-thread-post-comment  | 8/8     | 15    | infra+ui     | Depends on thread model
...

File overlap warnings:
- terraform/envs/staging/main.tf: touched by 3 branches (post-creation, chat-and-messaging, like-thread-post-comment)
- terraform/envs/staging/schema.graphql: touched by 4 branches

Proceed with merge queue? (y/n)

Wait for user confirmation before proceeding. If the user wants to reorder or skip branches, adjust the queue accordingly.

Step 5: Execute the Merge Queue

For each branch in the queue, in order:

5a. Pre-merge Check

# Ensure main is clean and up to date
git checkout main
git status --porcelain

If there are uncommitted changes on main, stop and alert the user.

5b. Squash-Merge via /squash

Invoke the /squash skill with the branch name. This handles:

  • Pre-flight checks (branch exists, has diverged from main)
  • git merge --squash <branchName>
  • Delegates commit to /commit (Conventional Commits, Co-Authored-By trailer)
  • Post-merge verification
  • Local branch cleanup (git branch -d/-D)

If the squash-merge fails due to conflicts:

  1. git merge --abort
  2. Report which files conflicted
  3. Skip this branch — move it to the end of the queue or remove it
  4. Ask the user: "Branch X has conflicts. Skip it and continue with the next branch, or stop the queue?"
  5. Continue or stop based on the user's answer

5c. Remove the Worktree

After a successful merge and branch deletion:

# Remove the git worktree
git worktree remove .claude/worktrees/ralph/<feature-name>

# If worktree remove fails (dirty), force it since we already merged
git worktree remove --force .claude/worktrees/ralph/<feature-name>

Verify the worktree directory is gone. If the directory still exists after git worktree remove, it may need manual cleanup — warn the user but continue.

5d. Prune and Report

git worktree prune

Log the result:

[1/N] ralph/legal-pages — merged and worktree removed
[2/N] ralph/post-creation — merged and worktree removed
[3/N] ralph/chat-and-messaging — SKIPPED (merge conflict in schema.graphql)
...

5e. Continue to Next Branch

Move to the next branch in the queue. Each subsequent merge benefits from the prior merges already being on main, which reduces drift.

Step 6: Final Summary

After processing the entire queue:

Ralph Merge Complete
--------------------
Merged:  5 branches
Skipped: 1 branch (conflicts)
Remaining worktrees: 3 (incomplete PRDs)

Skipped branches (need manual resolution):
- ralph/chat-and-messaging: conflict in terraform/envs/staging/schema.graphql

Remaining incomplete worktrees:
- ralph/follow-and-unfollow (4/10 stories)
- ralph/test-coverage (0/8 stories)
- ralph/implement-reporting (2/6 stories)

If any branches were skipped due to conflicts, suggest next steps:

  1. Go into the skipped worktree
  2. git rebase main to incorporate the newly merged changes
  3. Resolve conflicts
  4. Re-run /ralph-merge-worktrees to merge the remaining completed branches

Important Notes

  • Always get user confirmation before starting the merge queue — this is a destructive operation (worktree removal)
  • Each merge builds on the last — if branch 2 conflicts, branches 3+ might have different conflict profiles than predicted. Re-check is automatic since we run /squash which does pre-flight
  • The skill reads PRD files from the worktree directories, not from main — each worktree has its own copy
  • Worktree paths use the feature name without the ralph/ prefix: .claude/worktrees/ralph/post-creation/ for branch ralph/post-creation
  • After all merges complete, run bun run lint on main to verify the combined codebase is healthy
  • Quote file paths with spaces in all git/bash commands (the project path contains spaces)

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.52%
按下载量换算76

Claude

31.63%
按下载量换算70

Cursor

20.14%
按下载量换算44

Gemini CLI

8.93%
按下载量换算20

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills