Token导航 LogoToken导航

Agent Skill · 研究检索

restack(restack 搜索)

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

restack 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在研究检索类的 73,674 个 Skill 里排第 71,089。

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

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/shhac/skills --skill restack

这个 Skill 是做什么的

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

用于查找、检索和筛选相关信息,支持关键词匹配和线索定位。适合在开发中快速获取候选方案或技术资料。restack 属于研究检索类 Skill,可作为该场景下的辅助能力补充。可结合来源仓库和 README 进一步核验具体实现方式。安装前应确认是否会触发联网、命令执行或文件读写操作。

注意权限范围和仓库维护状态,避免误用或安全风险。

来源仓库内路径:skills/restack

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/shhac/skills --skill restack;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

restack 怎么安装?

在终端执行 npx skills add https://github.com/shhac/skills --skill restack。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

restack 支持哪些 AI 工具?

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

restack 需要什么权限?

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

restack 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

restack 用的人多吗?

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

restack 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

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

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 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调用外部服务未明确有提醒
restack

restack 搜索 · 本页

196—需要联网未明确通过

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

SKILL.md 原文

Restack

Manage stacked branches without external tooling. Infers the dependency graph from git history (merge-base ancestry + commit distance) — no metadata files, no init step, no account.

Handles the common stacking pain points:

  • Trunk advances → cascade rebases through the stack
  • Mid-stack edit → rebase descendants onto the changed branch
  • PR lands → detect merged branches, clean up, re-parent descendants
  • What's my stack? → show tree structure with per-branch state

Usage

/restack [status | sync | <description of what to do>]

  • With no arguments — run status and ask the user what they'd like to do.
  • With status — show the current stack state.
  • With sync — fetch trunk, detect landed branches, restack.
  • With a description — interpret intent and act.

Helper script

This skill includes scripts/restack.py — a deterministic Python helper for graph inference and status detection. Requires Python 3.9+ (stdlib only).

Locate the script relative to this skill file. Invoke as:

python3 <skill-dir>/scripts/restack.py <subcommand> [options]

Subcommands: status, graph, restack, sync, cleanup. Run with --help for full usage. Default output is compact key-value (LLM-friendly). Add --json for structured output.

Branch selection

The script supports three modes for selecting which branches to analyze:

  • --branches a,b,c — explicit list
  • --prefix paul/ — all branches matching a prefix
  • Neither — all local branches with commits ahead of trunk

If the user has a naming convention (e.g., paul/* branches), use --prefix. Otherwise, let it auto-discover.

Instructions

You are managing stacked branches. Follow the steps below. This skill uses incremental discovery — read reference files only when triggered by specific conditions.

Reference files live in references/ adjacent to this skill.

Step 1: Determine Context

  1. Check for interrupted operation. Look for branches matching restack/pre-rebase/*. If found, a previous restack was interrupted. Show the user what backups exist and offer to restore or clean up (python3 <script> cleanup).
  2. Identify trunk. The script auto-detects main or master. If neither exists, ask the user.
  3. Identify branches. If the user specified branches, use those. Otherwise, detect from context:

- If the user has a branch prefix in their git config or CLAUDE.md, use --prefix - Otherwise, let the script auto-discover all local branches ahead of trunk

  1. Guard working tree. If there are uncommitted changes: git stash push -m "restack: uncommitted changes"

Step 2: Assess State

Run the status command:

python3 <script> status [--trunk <trunk>] [--prefix <prefix> | --branches <list>]

This outputs a tree showing each stack with per-branch state:

  • ok — branch is based on the current tip of its parent
  • needs-restack — parent has moved, branch needs rebasing
  • landed — all patches are in trunk (PR was merged)
  • orphaned — no detectable parent

Incremental discovery triggers from status output:

  • ⚠️ If ambiguous entries appear → read references/ambiguous-graph.md
  • ⚠️ If landed branches appear → read references/landed-branch.md
  • ⚠️ If orphaned branches appear → ask the user what to do (rebase onto trunk, skip, or specify parent)

If the user ran /restack with no arguments, present this status and ask what they'd like to do.

Step 3: Execute

Based on user intent and status, pick the appropriate flow:

Restack (trunk advanced)

→ Read references/trunk-advance.md for the basic cascade pattern.

Then read the matching topology reference based on the graph structure:

Topology detectedRead this file
Linear stack (A→B, no branching)trunk-advance.md is sufficient
Three or more branches in a chain (A→B→C→D)references/deep-chain.md
Multiple branches off the same parent (B,C on A)references/fan-out.md
Fan-out with depth (A→B,C and C→D→E)references/deep-fan.md
Fan-out, reconverge, fan-out again (hourglass)references/fan-deep-fan.md
Multiple independent stacks side by sidereferences/independent-stacks.md
Mixed (combination of above)Read ALL applicable files
  1. Run the restack command to see the plan: python3 <script> restack [--trunk <trunk>] [--branches <list>] This creates backup refs and outputs the rebase plan.
  2. Present the plan to the user. Wait for confirmation.
  3. Execute the rebases in topological order (the order from the output):

- If parent is trunk: git rebase --empty=drop <trunk> <branch> - If parent is another stacked branch (strategy: onto-backup): git rebase --empty=drop --onto <parent> restack/pre-rebase/<parent> <branch> - The backup ref restack/pre-rebase/<parent> captures the parent's pre-rebase tip — this is the correct --onto cut point.

  1. If a rebase conflicts, resolve the conflict, then git rebase --continue. Continue with the next branch in the cascade.
  2. After each successful rebase, push with --force-with-lease.
  3. After all rebases complete, clean up: python3 <script> cleanup
Mid-stack edit (user amended a branch)

→ Read references/mid-stack-edit.md for the cascade pattern.

The --branch flag restacks only the descendants of the edited branch (not the branch itself, since the user already changed it).

  1. Run: python3 <script> restack --branch <edited-branch> [--trunk <trunk>]
  2. The plan output shows the rebase strategy for each branch:

- Immediate children of the edited branch (strategy: onto-merge-base): Use the merge-base as the cut point, NOT the backup ref. This is because the backup captures the post-edit state: git rebase --empty=drop --onto <parent> <merge-base> <child> Any of the parent's old commits that get replayed are dropped by --empty=drop. - Deeper descendants (strategy: onto-backup): Use the normal backup ref approach.

  1. Execute in topological order, resolve conflicts, push, clean up.
Sync (fetch trunk + detect landed + restack)

→ Read references/landed-branch.md for landed branch handling.

  1. Fetch the remote and update local trunk: git fetch origin git checkout <trunk> && git merge --ff-only origin/<trunk>
  2. Run the sync command to analyze: python3 <script> sync [--trunk <trunk>] [--branches <list>]
  3. If landed branches are detected, confirm with the user before deleting them:

- Delete local: git branch -D <branch> - Delete remote: git push origin --delete <branch> - ⚠️ If a mid-stack branch landed (not the bottom of the stack) → read references/mid-stack-landing.md

  1. After landed branches are cleaned up, re-run status. If remaining branches need restacking, proceed with the restack flow above.

Rebase Strategy Reference

Two --onto strategies depending on context:

Strategy: onto-backup (normal restack — parent was rebased by this operation):

git rebase --empty=drop --onto <parent> restack/pre-rebase/<parent> <child>

The backup ref is the parent's pre-rebase tip. Takes only the child's unique commits.

Strategy: onto-merge-base (mid-stack edit — parent was changed outside this operation):

mb=$(git merge-base <parent> <child>)
git rebase --empty=drop --onto <parent> $mb <child>

Uses the merge-base because the backup ref would capture the post-edit state. Any parent commits that get replayed are dropped as empty.

Without --onto, a plain git rebase <parent> would replay ALL commits from the merge-base, including the parent's old commits that now have new SHAs — causing duplicates and conflicts.

Rules

  • Always show the plan before executing rebases. Wait for confirmation unless the user explicitly asked to just do it.
  • Use --force-with-lease when pushing rebased branches, never --force.
  • Create backups before any rebases. The script handles this via restack/pre-rebase/* refs.
  • Clean up after success. Run python3 <script> cleanup to remove backup refs.
  • Don't delete landed branches without user confirmation.
  • Handle conflicts inline. When a rebase conflicts, resolve it yourself (git rebase --continue), then continue the cascade. Only involve the user if the conflict is genuinely ambiguous.
  • Preserve the user's working state. Stash before starting, restore the original branch and pop stash after.

平台分布

Codex

35.04%
按下载量换算22

Claude

33.01%
按下载量换算21

Cursor

17.22%
按下载量换算11

Gemini CLI

10.25%
按下载量换算6

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills