Token导航 LogoToken导航

Agent Skill · 研究检索

blocklet-branch(小块分支)

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

blocklet-branch 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证为 MIT,暂无第三方扫描结果,按安装量在研究检索类的 73,675 个 Skill 里排第 71,089。

总安装 196周安装 8GitHub Stars 公开资料未说明下载 63核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

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

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

命令行安装

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

AgentSkills.tonpx skills
npx skills add arcblock/agent-skills --skill "blocklet-branch"

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。支持基于关键词、任务场景或来源线索进行信息筛选与匹配。通过 npx skills add arcblock/agent-skills --skill "blocklet-branch" 安装使用。

安装前需确认权限范围、维护状态及是否触发联网或文件操作。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/blocklet-branch

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add arcblock/agent-skills --skill "blocklet-branch";命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要需要联网,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

blocklet-branch 怎么安装?

在终端执行 npx skills add arcblock/agent-skills --skill "blocklet-branch"。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

blocklet-branch 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

blocklet-branch 需要什么权限?

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

blocklet-branch 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

blocklet-branch 用的人多吗?

公开数据是累计安装 196 次,近一周安装 8 次,下载 63 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

blocklet-branch 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
blocklet-branch

小块分支 · 本页

196—需要联网MIT未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
blocklet-branch
description
Git branch management tool. Detects main iteration branch and branch naming conventions, handles branch creation and switching. Referenced by blocklet-dev-setup, blocklet-pr, and other skills.

Blocklet Branch

Unified Git branch management tool providing branch detection, creation, and switching capabilities.

Core Philosophy

"Detect dynamically, never assume."

Branch management must not hardcode main or master. Different ArcBlock repositories follow different branch conventions. By analyzing PR history dynamically, branch operations adapt to each repository automatically.

Design Principles

  • Never assume the main branch is main or master; detect dynamically through merged PR history
  • Learn branch naming conventions from project history
  • Must handle uncommitted changes before switching branches

1. Repository Information Retrieval

1.1 Parse Remote Repository

REMOTE_URL=$(git remote get-url origin)

# Parse org/repo
ORG=$(echo $REMOTE_URL | sed -E 's/.*[:/]([^/]+)\/([^/]+)(\.git)?$/\1/')
REPO=$(echo $REMOTE_URL | sed -E 's/.*[:/]([^/]+)\/([^/]+)(\.git)?$/\2/' | sed 's/\.git$//')

echo "Repository: $ORG/$REPO"

1.2 Get Current Branch

CURRENT_BRANCH=$(git branch --show-current)
echo "Current branch: $CURRENT_BRANCH"

2. Main Iteration Branch Detection

Important: Must determine the main iteration branch by analyzing the last 10 merged PRs, rather than simply assuming it is main or master.

2.1 Detect Main Iteration Branch

# Get target branches of the last 10 merged PRs, count occurrences to find the main iteration branch
MAIN_BRANCH=$(gh pr list --repo $ORG/$REPO --state merged --limit 10 --json baseRefName \
  | jq -r '.[].baseRefName' | sort | uniq -c | sort -rn | head -1 | awk '{print $2}')

# Get detection rationale
BRANCH_STATS=$(gh pr list --repo $ORG/$REPO --state merged --limit 10 --json baseRefName \
  | jq -r '.[].baseRefName' | sort | uniq -c | sort -rn)

echo "Main iteration branch: $MAIN_BRANCH"
echo "Detection rationale (target branch statistics from last 10 merged PRs):"
echo "$BRANCH_STATS"

2.2 Output Variables

VariableDescriptionExample
MAIN_BRANCHDetected main iteration branchmain, develop, master
MAIN_BRANCH_REASONDetection rationale"8 out of 10 recent merged PRs targeted main"

3. Branch Naming Convention Detection

Important: Determine branch naming prefix conventions by analyzing the last 10 merged PRs.

3.1 Analyze Historical Branch Naming

# Get source branch names from the last 10 merged PRs, analyze naming conventions
BRANCH_NAMES=$(gh pr list --repo $ORG/$REPO --state merged --limit 10 --json headRefName \
  | jq -r '.[].headRefName')

# Extract prefixes (supports both / and - separators)
BRANCH_PREFIXES=$(echo "$BRANCH_NAMES" | sed -E 's/^([a-zA-Z]+)[\/\-].*/\1/' | sort | uniq -c | sort -rn)

echo "Branch naming prefix statistics (from last 10 merged PRs):"
echo "$BRANCH_PREFIXES"

# Detect separator style (/ or -)
if echo "$BRANCH_NAMES" | grep -q '/'; then
    SEPARATOR="/"
else
    SEPARATOR="-"
fi
echo "Separator style: $SEPARATOR"

3.2 Common Branch Prefixes

PrefixPurposeExample
feat / featureNew featurefeat/add-login, feature/user-profile
fix / bugfixBug fixfix/login-error, bugfix/issue-123
choreRoutine maintenancechore/update-deps
refactorCode refactoringrefactor/auth-module
docsDocumentation updatedocs/api-guide
testTest-relatedtest/add-unit-tests
styleCode stylestyle/format-code
perfPerformance optimizationperf/optimize-query

3.3 Output Variables

VariableDescriptionExample
BRANCH_PREFIX_CONVENTIONPrimary prefix conventionfeat, fix
BRANCH_SEPARATORSeparator style/ or -

4. Uncommitted Changes Handling

Important: Before switching branches, uncommitted changes must be handled first.

4.1 Check Change Status

UNCOMMITTED_CHANGES=$(git status --porcelain)

if [ -n "$UNCOMMITTED_CHANGES" ]; then
    echo "⚠️ Uncommitted changes detected:"
    git status --short
fi

4.2 Handle Changes

If there are uncommitted changes, use AskUserQuestion to ask the user:

Uncommitted changes detected. Please choose how to proceed:

Options:
A. Stash changes (git stash) - can be restored later (Recommended)
B. Commit changes - create a temporary commit
C. Discard changes (git checkout .) - ⚠️ cannot be undone
D. Cancel operation

Execute handling:

# Option A: Stash
git stash push -m "Auto stash before branch switch"

# Option B: Commit
git add -A && git commit -m "WIP: auto commit before branch switch"

# Option C: Discard
git checkout . && git clean -fd

5. Branch Switching

5.1 Switch to Main Iteration Branch

# Ensure local has latest remote branch info
git fetch origin

# Switch to main iteration branch and update
git checkout $MAIN_BRANCH
git pull origin $MAIN_BRANCH

echo "✅ Switched to main iteration branch: $MAIN_BRANCH"

5.2 Switch to Specified Branch

TARGET_BRANCH="feat/my-feature"

# Check if branch exists
if git show-ref --verify --quiet refs/heads/$TARGET_BRANCH; then
    # Local branch exists
    git checkout $TARGET_BRANCH
elif git show-ref --verify --quiet refs/remotes/origin/$TARGET_BRANCH; then
    # Remote branch exists, create local tracking branch
    git checkout -b $TARGET_BRANCH origin/$TARGET_BRANCH
else
    echo "❌ Branch $TARGET_BRANCH does not exist"
fi

6. Working Branch Creation

6.1 Generate Branch Name Suggestion

Generate suggested branch name based on task type and repository naming conventions:

# Input parameters
TASK_TYPE="fix"           # feat, fix, chore, refactor, docs, test
TASK_DESCRIPTION="login"  # Brief description
ISSUE_NUMBER=""           # Optional issue number

# Generate branch name
if [ -n "$ISSUE_NUMBER" ]; then
    SUGGESTED_BRANCH="${TASK_TYPE}${BRANCH_SEPARATOR}issue-${ISSUE_NUMBER}-${TASK_DESCRIPTION}"
else
    SUGGESTED_BRANCH="${TASK_TYPE}${BRANCH_SEPARATOR}${TASK_DESCRIPTION}"
fi

echo "Suggested branch name: $SUGGESTED_BRANCH"

6.2 Create Working Branch

Prerequisite: Must be created based on the latest main iteration branch.

# 1. Ensure main iteration branch is up to date
git fetch origin $MAIN_BRANCH
git checkout $MAIN_BRANCH
git pull origin $MAIN_BRANCH

# 2. Create and switch to new branch
NEW_BRANCH="feat/my-new-feature"
git checkout -b $NEW_BRANCH

echo "✅ Created and switched to branch: $NEW_BRANCH (based on $MAIN_BRANCH)"

6.3 User Confirmation Flow

Use AskUserQuestion to confirm branch name:

Will create new branch based on {MAIN_BRANCH}.

Please select branch name:

Options:
A. {SUGGESTED_BRANCH} (Recommended)
B. Enter custom branch name
C. Cancel operation

7. Branch Status Check

7.1 Check If on Main Iteration Branch

if [ "$CURRENT_BRANCH" = "$MAIN_BRANCH" ]; then
    echo "⚠️ Currently on main iteration branch"
    ON_MAIN_BRANCH=true
else
    ON_MAIN_BRANCH=false
fi

7.2 Check Branch Naming Convention Compliance

# Check if branch name follows common prefix conventions
if echo "$CURRENT_BRANCH" | grep -qE "^(feat|fix|chore|refactor|docs|test|style|perf|hotfix|release)[/\-]"; then
    echo "✅ Branch naming follows convention"
    BRANCH_NAME_VALID=true
else
    echo "⚠️ Branch naming does not follow common conventions: $CURRENT_BRANCH"
    BRANCH_NAME_VALID=false
fi

7.3 Check Branch Sync Status with Remote

# Get local and remote differences
git fetch origin

LOCAL_COMMIT=$(git rev-parse HEAD)
REMOTE_COMMIT=$(git rev-parse origin/$CURRENT_BRANCH 2>/dev/null || echo "")

if [ -z "$REMOTE_COMMIT" ]; then
    echo "📤 Branch not yet pushed to remote"
    SYNC_STATUS="not_pushed"
elif [ "$LOCAL_COMMIT" = "$REMOTE_COMMIT" ]; then
    echo "✅ Branch is in sync with remote"
    SYNC_STATUS="synced"
else
    AHEAD=$(git rev-list origin/$CURRENT_BRANCH..HEAD --count)
    BEHIND=$(git rev-list HEAD..origin/$CURRENT_BRANCH --count)
    echo "📊 Local is $AHEAD commits ahead, $BEHIND commits behind"
    SYNC_STATUS="diverged"
fi

8. Usage Scenarios

Scenario A: Development Environment Setup (blocklet-dev-setup)

  1. Detect main iteration branch
  2. Handle uncommitted changes
  3. Switch to main iteration branch and update
  4. (Optional) Create working branch

Scenario B: Submit PR (blocklet-pr)

  1. Detect main iteration branch
  2. Detect branch naming conventions
  3. Check current branch

- If on main iteration branch → Must create working branch - If on working branch → Check naming convention compliance

Scenario C: Switch Tasks

  1. Handle uncommitted changes (stash/commit/discard)
  2. Switch to target branch
  3. Restore previous changes (if needed)

9. Referenced by Other Skills

This skill is referenced by the following skills:

SkillFeatures Used
blocklet-dev-setupDetect main iteration branch, handle uncommitted changes, switch branches, create working branch
blocklet-prDetect main iteration branch, branch naming conventions, enforce working branch creation

How to reference:

Refer to blocklet-branch skill for branch operations.
Skill location: `blocklet-branch/SKILL.md`

10. Error Handling

ErrorCauseSolution
Cannot get PR historygh not authenticated or network issueRun gh auth status to check authentication
Branch switch failedConflicting uncommitted changesHandle uncommitted changes first
Branch creation failedBranch name already existsUse different branch name or switch to existing branch
Cannot detect main iteration branchRepository has no merged PRsFall back to default branch gh repo view --json defaultBranchRef

平台分布

OpenCode

26.92%
按下载量换算17

Cursor

23.38%
按下载量换算15

Codex

17.31%
按下载量换算11

Claude Code

13.92%
按下载量换算9

Antigravity

8.61%
按下载量换算5

Gemini CLI

3.43%
按下载量换算2

安全审计

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

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills