Token导航 LogoToken导航

Agent Skill · 待分类

git-hunk(吉特大块头)

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

git-hunk 是待分类类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为执行命令;许可证信息还不明确,第三方扫描已通过,按安装量在待分类类的 11,209 个 Skill 里排第 1,665。

总安装 2,595周安装 106GitHub Stars 227下载 831核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/diodeinc/pcb --skill git-hunk

这个 Skill 是做什么的

这个 Skill 的分类还没最终确定,用法以来源仓库的说明为准。

git-hunk skill 用于精确检查、暂存与提交代码变更,支持快照、change_id 与 change_key 多种定位方式。适用于需要精准控制代码提交粒度的开发场景,如修复热补丁或审查特定代码块修改。

推荐使用 change_key 作为稳定选择器,避免依赖易变的行号范围,并通过 snapshot_id 保障操作安全。安装前请确保 git 环境可用,并注意该 skill 可能执行 shell 命令,建议在受控仓库中测试后再投入生产使用。git-hunk 属于待分类类 Skill,可作为该场景下的辅助能力补充。

来源仓库内路径:skills/git-hunk

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

git-hunk 怎么安装?

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

git-hunk 支持哪些 AI 工具?

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

git-hunk 需要什么权限?

权限级别是执行命令。安装流程涉及命令执行,可能通过 npx skills add https://github.com/diodeinc/pcb --skill git-hunk 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

git-hunk 是免费的吗?

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

git-hunk 用的人多吗?

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

git-hunk 安全吗?

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

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

值得选的地方

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

先想清楚的地方

  • 需要执行命令,装到常用环境前要先评估影响面。
  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

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

不太适合

  • 不能接受 Skill 在你机器上执行命令的人。
  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

待分类类 Skill 对比

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

infsh CLI · Codex、Claude

4,374,576382权限未标注未明确未收录
ai-video-generation

AI 视频生成 · Codex、Claude

4,313,376382调用外部服务未明确有提醒
lark-openapi-explorer

云雀 OpenAPI 浏览器 · Codex、Claude

2,064,1209,011需要联网未明确有提醒
lark-workflow-standup-report

Lark 工作流程站立报告 · Codex、Claude

2,041,6328,978需要联网未明确通过
use-my-browser

使用我的浏览器 · Codex、Claude

1,848,49140操作浏览器未明确未通过
git-hunk

吉特大块头 · 本页

2,595227执行命令未明确通过

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

SKILL.md 原文

Git Hunk

Use git-hunk to inspect, stage, unstage, and commit precise text changes without interactive prompts.

Prefer change_key over raw line ranges when you need selectors that survive unrelated rescans. Keep snapshot_id for safety, treat change_id as snapshot-local, and treat raw line ranges as a last resort.

Quick Start

  1. Scan the repo and capture a snapshot:
git-hunk scan --mode stage --json
  1. Inspect a selectable unit:
git-hunk show --mode stage <hunk-id>
git-hunk show --mode stage <change-id> --json
git-hunk show --mode stage <change-key> --json
  1. Apply a selection:
git-hunk stage --snapshot <snapshot-id> --hunk <hunk-id>
git-hunk stage --snapshot <snapshot-id> --change <change-id>
git-hunk stage --snapshot <snapshot-id> --change-key <change-key>
git-hunk stage --snapshot <snapshot-id> --hunk <hunk-id>:new:41-44
git-hunk stage --snapshot <snapshot-id> --change-key <change-key> --dry-run --json
  1. Commit the exact selection directly:
git-hunk commit -m "feat: message" --snapshot <snapshot-id> --change <change-id>
git-hunk commit -m "feat: message" --snapshot <snapshot-id> --change-key <change-key>
git-hunk commit -m "fix: message" --snapshot <snapshot-id> --hunk <hunk-id>:old:18-22
git-hunk commit -m "feat: message" --snapshot <snapshot-id> --change-key <change-key> --dry-run --json
  1. Resolve a file+line hint into durable selectors:
git-hunk resolve --mode stage --snapshot <snapshot-id> --path src/lib.rs --start 42 --json
  1. Recover stale selections without mutating anything:
git-hunk validate --mode stage --snapshot <snapshot-id> --change-key <change-key> --compact --json

Workflow

Stage mode

  • Use scan --mode stage for worktree changes relative to the index.
  • Select by whole hunk, change_id, change_key, or line range.
  • Prefer --json for agents; ids and snapshot_id come from scan output.
  • Use scan --compact --json when you want short previews and metadata without the full line arrays.
  • Use selector bundles from JSON output instead of reconstructing selectors by hand.

Unstage mode

  • Use scan --mode unstage for staged changes relative to HEAD.
  • Use the same selectors with unstage to remove only part of the index.
git-hunk unstage --snapshot <snapshot-id> --change <change-id>
git-hunk unstage --snapshot <snapshot-id> --change-key <change-key>
git-hunk unstage --snapshot <snapshot-id> --hunk <hunk-id>:old:10-12

Change keys

  • change_id is snapshot-bound and should be treated as ephemeral.
  • change_key_scheme is currently v1.
  • change_key is derived from the change content plus nearby context so it survives unrelated rescans, duplicate disambiguation, and hunk splitting caused by unrelated edits.
  • change_key is not guaranteed to survive nearby context edits, renames, or future scheme changes.
  • Prefer --change-key for multi-step agent workflows where a fresh scan may happen before mutation.
  • Use show, stage, unstage, and commit with a change_key exactly like a change_id.

Resolve helper

  • Use resolve when you know a file and approximate line range but do not want to reason about diff internals.
  • resolve returns recommended change_ids, change_keys, hunk selectors, selector bundles, and candidate metadata.
  • --side auto is the default; it prefers new lines in stage mode and old lines in unstage mode.
git-hunk resolve --mode stage --snapshot <snapshot-id> --path src/lib.rs --start 42 --end 47 --json
git-hunk resolve --mode unstage --snapshot <snapshot-id> --path src/lib.rs --start 42 --side old --json

Validation and dry-run previews

  • Use validate to compare an old snapshot_id against the current repo state and recover change_key selections before retrying a mutation.
  • Use stage --dry-run to preview what the index would look like after staging a selection.
  • Use unstage --dry-run to preview what would remain staged after removing a selection.
  • Use commit --dry-run to preview the exact files, diffstat, and patch that would be committed.
  • All dry-run commands use the real selection path against a temporary index, so they reflect actual behavior without mutating the repo.

Line-range selectors

  • Syntax: <hunk-id>:<old|new>:<start-end>.
  • Use new when selecting added or replacement lines from stage mode.
  • Use old when selecting the preimage side, especially in unstage mode.
  • Use show without --json when you want numbered lines in terminal output.
  • Agents should almost always prefer change_key, then change_id, then resolve, and only use raw line ranges when reproducing a user-specified range exactly.

Snapshot Discipline

  • Treat snapshot_id as mandatory for any mutating command.
  • Rescan after every successful stage, unstage, or commit.
  • If the command returns stale_snapshot, do not retry blindly; inspect error.details or run validate to recover with the fresh snapshot.
  • change_key can survive rescans, but the mutation still needs a fresh snapshot_id before it applies.

Plan Files

Use a plan file when passing many selectors or when another tool is driving the workflow.

{
  "snapshot_id": "s_123",
  "selectors": [
    { "type": "hunk", "id": "h_abc" },
    { "type": "change", "id": "c_def" },
    { "type": "change_key", "key": "ck_xyz" },
    {
      "type": "line_range",
      "hunk_id": "h_xyz",
      "side": "new",
      "start": 41,
      "end": 44
    }
  ]
}

Run it with:

git-hunk stage --plan plan.json --json
git-hunk stage --plan - --json < plan.json
git-hunk commit -m "refactor: split change" --plan plan.json --json

Failure Handling

  • If you get ambiguous_line_range, widen the range to cover the full atomic change or fall back to the change_id shown by scan.
  • Use error.category, error.retryable, and error.details from JSON errors to decide whether to rescan, retry, or fall back.
  • If a path appears under unsupported, do not try to force it through git-hunk; use normal git commands or a different workflow for conflicts, renames, copies, binary files, or non-UTF-8 diffs.
  • If there is nothing staged, commit fails unless --allow-empty is set.

Practical Defaults

  • Prefer change_key over line ranges whenever both are available.
  • Prefer resolve when you only have a file+line hint.
  • Prefer validate when an old snapshot goes stale but you still have change_keys.
  • Prefer stage --dry-run, unstage --dry-run, or commit --dry-run before a risky atomic mutation from a dirty tree.
  • Prefer commit with selectors when the user asked for a commit and you already know the exact changes.
  • Prefer stage first when you need to inspect the staged result before committing.
  • Keep commits atomic by scanning, selecting a minimal set, committing, then rescanning for the next commit.

平台分布

Codex

35.81%
按下载量换算298

Claude

31.63%
按下载量换算263

Cursor

17.95%
按下载量换算149

Gemini CLI

8.58%
按下载量换算71

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

执行命令

安装流程涉及命令执行,可能通过 npx skills add https://github.com/diodeinc/pcb --skill git-hunk 联网下载 Skill 或依赖。用户安装前应确认命令来源、仓库内容和执行环境。

安装前确认

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

继续浏览同类 Skills