Token导航 LogoToken导航TokenDH.com
开发需要联网github未标认证来源可访问许可证需确认审计未展示

dev%3arebaseDEV 3arebase 命令行

Agent Skill

dev%3arebase 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

291

周安装

12

GitHub Stars

公开资料未说明

下载量

95
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:dev%3arebase(DEV 3arebase 命令行)
来源仓库:https://github.com/cloudvoyant/codevoyant
仓库路径:skills/dev%3Arebase
安装命令:
npx skills add https://github.com/cloudvoyant/codevoyant --skill dev:rebase
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/cloudvoyant/codevoyant --skill dev:rebase

简介

用于处理 GitHub 仓库、Issue 和 Pull Request 协作信息,适合跟踪代码变更。

  • 可结合来源仓库和原始 README 核验具体用法和协作流程。
  • 安装前建议确认权限范围和维护状态,避免触发不必要的网络请求。
  • 适用于需要围绕仓库状态进行整理的场景,如代码审核或协作管理。
  • dev%3arebase 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Compatibility: Designed for Claude Code only. This skill uses hooks or ${CLAUDE_SKILL_DIR} which are not available on other platforms. Run on Claude Code or adapt before using elsewhere.

Safely rebase the current branch onto an updated base branch (typically main), using a pre-rebase intent snapshot to drive every conflict resolution correctly.

The core problem this skill solves

During git rebase main, conflict marker sides are counter-intuitive:

  • <<<<<<< HEAD (ours) = main's version (the base being rebased onto)
  • >>>>>>> {sha} (theirs) = your branch's commit being replayed

Claude (and humans) routinely pick the wrong side, silently discarding the branch's intended changes. This skill prevents that by capturing a full intent snapshot before the rebase starts, then using it as the ground truth for every conflict.

Usage

/dev:rebase              # rebase current branch onto origin/main (no push)
/dev:rebase main         # rebase onto a specific base branch (no push)
/dev:rebase --push       # rebase and push when done

When run on main (or master) itself, the skill fast-forwards main to match origin/main via git pull --rebase rather than doing a full branch rebase.

Step 0: Parse Arguments

BASE_BRANCH=""      # first non-flag argument, or auto-detected
PUSH=false          # --push flag — push only if explicitly requested

# Auto-detect base branch if not specified:
# Try origin/main → origin/master → main → master

Step 1: Orientation

Run the following and show results:

CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
CURRENT_DIR=$(pwd)

# Detect if we're in a worktree
COMMON_DIR=$(git rev-parse --git-common-dir 2>/dev/null)
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null)
if [ "$COMMON_DIR" != "$GIT_DIR" ]; then
  IN_WORKTREE=true
  MAIN_REPO_ROOT=$(cd "$COMMON_DIR/.." && pwd)
else
  IN_WORKTREE=false
  MAIN_REPO_ROOT="$CURRENT_DIR"
fi

# Detect if we're on the main/master branch itself
if [ "$CURRENT_BRANCH" = "main" ] || [ "$CURRENT_BRANCH" = "master" ]; then
  ON_MAIN=true
else
  ON_MAIN=false
fi

If ON_MAIN is true: skip the full rebase flow and do a targeted update instead (see "Rebasing main" section below).

Detect the base branch:

if [ -n "$BASE_BRANCH" ]; then
  # User provided — use it directly
  REBASE_TARGET="$BASE_BRANCH"
else
  # Auto-detect: prefer remote tracking branch
  if git rev-parse --verify origin/main >/dev/null 2>&1; then
    REBASE_TARGET="origin/main"
  elif git rev-parse --verify origin/master >/dev/null 2>&1; then
    REBASE_TARGET="origin/master"
  elif git rev-parse --verify main >/dev/null 2>&1; then
    REBASE_TARGET="main"
  else
    REBASE_TARGET="master"
  fi
fi

Report orientation to the user:

Branch  : {CURRENT_BRANCH}
Target  : {REBASE_TARGET}
Worktree: {yes — main repo at MAIN_REPO_ROOT | no}

Rebasing main (fast-forward update)

If ON_MAIN is true, skip Steps 2–5 and run this shortened flow instead:

# 1. Abort if uncommitted changes exist
if ! git diff --quiet || ! git diff --cached --quiet; then
  echo "Error: Uncommitted changes detected. Stash or commit before rebasing."
  exit 1
fi

# 2. Fetch latest from origin
git fetch origin

# 3. Show what's incoming
git log HEAD..origin/${CURRENT_BRANCH} --oneline

Report to user:

Fetching origin/${CURRENT_BRANCH}...

Incoming commits:
{list from git log, or "Already up to date."}

If already up to date, exit here.

Ask user to confirm before proceeding.

# 4. Rebase (fast-forward) main onto origin/main
git rebase origin/${CURRENT_BRANCH}

If conflicts arise, resolve them using the same intent-based approach from Steps 4a–4e below.

# 5. If PUSH is true, push (regular push — main has no diverged history)
git push origin ${CURRENT_BRANCH}

Then follow /dev:ci to monitor CI.

Exit after this section — do not continue to Step 2.

Step 2: Capture Pre-Rebase Intent Snapshot

This snapshot is the source of truth for all conflict resolution. Build it before touching git.

# Fetch latest so we're comparing against real upstream
git fetch origin 2>/dev/null || true

# The merge base: where this branch diverged from the target
MERGE_BASE=$(git merge-base HEAD "$REBASE_TARGET")

Capture and store:

# 1. Full diff of everything this branch introduces
INTENT_DIFF=$(git diff "$MERGE_BASE"...HEAD)

# 2. List of every file this branch touches
INTENT_FILES=$(git diff --name-status "$MERGE_BASE"...HEAD)

# 3. Per-file snapshots of this branch's version of every changed file
#    (so we can compare during conflict resolution)
git diff --name-only "$MERGE_BASE"...HEAD | while read file; do
  BRANCH_VERSION=$(git show HEAD:"$file" 2>/dev/null || echo "[deleted on branch]")
  BASE_VERSION=$(git show "$MERGE_BASE":"$file" 2>/dev/null || echo "[did not exist at branch point]")
  # Store both for reference during conflict resolution
done

# 4. Commit log of what this branch is doing
INTENT_LOG=$(git log --oneline "$REBASE_TARGET"..HEAD)

Show the intent summary:

Branch intent ({N} commits, {M} files changed):
{INTENT_LOG}

Files this branch modifies:
{INTENT_FILES}

Ask user to confirm before proceeding:

Ready to rebase {CURRENT_BRANCH} onto {REBASE_TARGET}.
Proceed?

Wait for confirmation. If declined, exit without changes.

Step 3: Start the Rebase

git rebase "$REBASE_TARGET"

If rebase exits cleanly (no conflicts) → jump to Step 6.

If rebase stops with conflicts → enter Step 4.

Step 4: Conflict Resolution Loop

Repeat until git rebase --continue succeeds or rebase is complete.

4a. Identify all conflicted files

CONFLICTED=$(git diff --name-only --diff-filter=U)

4b. For each conflicted file — resolve with intent

For each file in CONFLICTED:

1. Show the conflict in context:

cat {file}   # shows conflict markers in full file context

2. Look up this file in the pre-rebase snapshot:

  • What did this branch change in this file? (from INTENT_DIFF, filtered to this file)
  • What is the branch's HEAD version of this file?
  • What was the file at the merge base?

3. Understand the conflict sides:

<<<<<<< HEAD         ← THIS IS MAIN'S VERSION (not our branch)
{main's code}
=======
{our branch's code}  ← THIS IS WHAT OUR BRANCH INTENDED
>>>>>>> {sha}

4. Determine the correct resolution:

The goal is: start from main's version and apply this branch's intended change on top.

Do NOT simply pick one side. Instead:

  • Read main's version of the surrounding code (HEAD side)
  • Read what this branch was trying to do (snapshot + theirs side)
  • Produce a merged result that incorporates the branch's intent into main's current context
  • If the branch was adding something: add it to main's version
  • If the branch was changing something: apply that change to main's current version of the thing
  • If the branch was deleting something that main also changed: use judgment — prefer deletion if the branch intent was to remove it entirely

5. Write the resolved file — no conflict markers remaining.

6. Explain the resolution:

Resolved {file}:
  Main had: {brief description of HEAD side}
  Branch intended: {brief description based on intent snapshot}
  Resolution: {what was kept/merged and why}

7. Stage the file:

Check if the file is gitignored before staging — gitignored files require -f or git add silently fails, making --continue impossible (and tempting a destructive --skip):

if git check-ignore -q {file}; then
  git add -f {file}
else
  git add {file}
fi

4c. After all conflicts in this commit are resolved

git rebase --continue

If this triggers another conflict set (next commit), loop back to 4a.

4d. Don't use --skip during conflict resolution

git rebase --skip discards the entire commit being replayed — not just the conflicted file. So even if only one irrelevant or gitignored file is conflicted, --skip silently throws away all of that commit's intended changes. Always resolve the conflict (accepting one side wholesale if needed), stage with -f if required, then --continue.

4e. If a conflict is genuinely ambiguous

If you cannot determine the correct resolution with confidence:

  • Do NOT guess
  • Stop the resolution, show both sides clearly, and ask the user: Ambiguous conflict in {file}: Main's version: {HEAD side} Branch intended: {theirs side + relevant context from intent snapshot} What should the resolved version be?
  • Apply the user's answer, then continue.

Step 5: Post-Rebase Verification

After the rebase completes, verify the branch's intent survived.

# New diff of the rebased branch vs target
POST_DIFF=$(git diff "$REBASE_TARGET"..HEAD)

# New file list
POST_FILES=$(git diff --name-only "$REBASE_TARGET"..HEAD)

Check 1 — No files silently dropped: Compare INTENT_FILES against POST_FILES. Report any file that was in the intent but is no longer changed by the branch:

⚠️  Warning: {file} was modified by the branch before rebase but is no longer changed.
    This may mean the branch's changes were lost during conflict resolution.
    Review this file before pushing.

Check 2 — Intent diff is structurally preserved: For each file this branch modified, compare the pre-rebase branch version against the post-rebase version. Flag large unexplained differences:

⚠️  Warning: {file} looks significantly different post-rebase.
    Pre-rebase branch version: {line count / key lines}
    Post-rebase branch version: {line count / key lines}
    Verify the intended changes are still present.

Check 3 — Format and lint:

Run formatters first (they auto-fix, so any changes get committed if the user later commits):

npx @codevoyant/agent-kit task-runner run format 2>/dev/null || true

Then run linters — block push if they fail:

npx @codevoyant/agent-kit task-runner run lint 2>/dev/null || \
npx @codevoyant/agent-kit task-runner run check 2>/dev/null || true

If the formatter modified files: stage and amend them onto the last rebased commit:

if ! git diff --quiet; then
  git add -A
  git commit --amend --no-edit
fi

Check 4 — Run tests if available:

npx @codevoyant/agent-kit task-runner run test 2>/dev/null || true

If tests or linting fail: report errors and stop. Do not proceed to push.

Show verification summary:

✓ Rebase complete

  Commits replayed : {N}
  Files changed    : {M}
  Intent check     : {PASS | {N} warnings — review above}
  Format           : {applied | clean | skipped}
  Lint             : {passed | FAILED — fix before pushing | skipped}
  Tests            : {passed | FAILED | skipped}

Step 6: Push

If PUSH is false (the default): report the following and exit:

✓ Rebase done — push skipped (default)
  When ready: git push --force-with-lease origin {CURRENT_BRANCH}
  Or rerun with: /dev:rebase --push

If PUSH is true, push immediately — rebase always requires a force push:

git push --force-with-lease origin {CURRENT_BRANCH}

--force-with-lease (not --force) — fails safely if the remote was updated since the last fetch.

Then follow the full workflow defined in /dev:ci:

  • Detects GitHub vs GitLab automatically
  • Monitors all runs in real time
  • On failure: shows error logs and offers to fix

Skip CI monitoring if:

  • Repo has no CI workflows configured
  • Neither gh nor glab CLI is installed (inform but don't block)

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

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

平台分布

Codex

34.98%
按下载量换算33

Claude

32.63%
按下载量换算31

Cursor

19.59%
按下载量换算19

Gemini CLI

8.57%
按下载量换算8

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

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

安装前确认

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

来源信息

继续浏览同类 Skills