Token导航 LogoToken导航

Agent Skill · 开发

jj-hunk(jj 帅哥)

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

jj-hunk 是开发类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为需要联网;许可证信息还不明确,第三方扫描已通过,按安装量在开发类的 21,746 个 Skill 里排第 20,462。

总安装 220周安装 9GitHub Stars 22下载 71核验 2026-05-01

安装说明

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

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/laulauland/jj-hunk --skill jj-hunk

这个 Skill 是做什么的

开发类 Skill 面向写代码、改代码和排查问题,一般会读写仓库文件,部分还会执行构建或测试命令。

用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息。适合围绕仓库状态、代码变更或协作事项进行整理和辅助分析。可结合来源仓库和 README 进一步验证实际用途和限制。

安装命令:npx skills add https://github.com/laulauland/jj-hunk --skill jj-hunk。注意权限范围和维护状态,避免触发联网、命令执行或文件读写。

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

上手步骤

4 步
  1. 1

    确认自己的宿主工具

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

  2. 2

    拿到安装命令

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

  3. 3

    安装后重启宿主

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

  4. 4

    按最小权限试用

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

常见问题

6 条

jj-hunk 怎么安装?

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

jj-hunk 支持哪些 AI 工具?

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

jj-hunk 需要什么权限?

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

jj-hunk 是免费的吗?

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

jj-hunk 用的人多吗?

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

jj-hunk 安全吗?

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

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

值得选的地方

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

先想清楚的地方

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

适不适合你

更适合

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

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

开发类 Skill 对比

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

技能审查员 · OpenClaw

8,779,018986操作浏览器MIT-0通过
ontology

本体论 · OpenClaw

6,636,960576只读MIT-0通过
entra-app-registration

内部应用程序注册 · Codex、Claude

6,631,872764接触敏感数据未明确通过
entra-app-registration

内部应用程序注册 · Codex、Claude

3,757,680201接触敏感数据未明确通过
nano-banana-pro

纳米香蕉专业版 · OpenClaw

3,526,898364接触敏感数据MIT-0有提醒
jj-hunk

jj 帅哥 · 本页

22022需要联网未明确通过

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

SKILL.md 原文

jj-hunk: Programmatic Hunk Selection

Use jj-hunk for non-interactive hunk selection in jj. Essential for AI agents that need to create clean, logical commits from mixed changes.

When to Use This Skill

  • Splitting a commit into multiple logical commits
  • Committing only specific hunks (partial commit)
  • Squashing only certain changes into parent
  • Any hunk selection that would normally require jj split -i or jj squash -i

Setup

cargo install jj-hunk

Add to ~/.jjconfig.toml:

[merge-tools.jj-hunk]
program = "jj-hunk"
edit-args = ["select", "$left", "$right"]

Core Workflow

1. List Hunks

jj-hunk list

# List hunks for a specific revision (diff vs parent)
# Note: revset must resolve to a single revision
jj-hunk list --rev @

# Emit YAML instead of JSON
jj-hunk list --format yaml

Options:

  • --rev <revset> — diff the revision against its parent (revset must resolve to a single revision)
  • --format json|yaml|text — output format (default: json)
  • --include <glob> / --exclude <glob> — filter paths (repeatable)
  • --group none|directory|extension|status — group output
  • --binary skip|mark|include — binary handling (default: mark)
  • --max-bytes <n> / --max-lines <n> — truncate before diffing
  • --spec <json|yaml> / --spec-file <path> — preview using a spec filter
  • --files — list files with hunk counts only
  • --spec-template — emit a spec template (JSON/YAML only)

Output (JSON):

{
  "files": [
    {
      "path": "src/foo.rs",
      "status": "modified",
      "hunks": [
        {
          "id": "hunk-7c3d...",
          "index": 0,
          "type": "replace",
          "removed": "old\n",
          "added": "new\n",
          "before": {"start": 1, "lines": 1},
          "after": {"start": 1, "lines": 1}
        },
        {
          "id": "hunk-2f91...",
          "index": 1,
          "type": "insert",
          "removed": "",
          "added": "// added\n",
          "before": {"start": 2, "lines": 0},
          "after": {"start": 2, "lines": 1}
        }
      ]
    },
    {
      "path": "src/bar.rs",
      "status": "modified",
      "hunks": [
        {
          "id": "hunk-aa12...",
          "index": 0,
          "type": "delete",
          "removed": "removed\n",
          "added": "",
          "before": {"start": 3, "lines": 1},
          "after": {"start": 3, "lines": 0}
        }
      ]
    }
  ]
}

Each hunk includes a stable id (sha256) alongside the 0-based index.

2. Build a Spec

Select hunks by index or id (emitted as hunk-<sha256>), or use file-level actions. Specs can be JSON or YAML:

{
  "files": {
    "src/foo.rs": {"hunks": [0, "hunk-7c3d..."]},
    "src/bar.rs": {"ids": ["hunk-aa12..."]},
    "src/baz.rs": {"action": "keep"},
    "src/qux.rs": {"action": "reset"}
  },
  "default": "reset"
}
SpecEffect
{"hunks": [0, 2]}Include only hunks 0 and 2
{"hunks": ["hunk-..."]}Include hunks by id string
{"ids": ["hunk-..."]}Include hunks by stable id
{"action": "keep"}Include all changes
{"action": "reset"}Discard all changes
"default": "reset"Unlisted files are discarded
"default": "keep"Unlisted files are kept

ids and hunks are merged if both are provided.

3. Execute

Specs can be provided inline, read from stdin with -, or loaded via --spec-file (omit <spec> when using --spec-file).

# Split: selected hunks → first commit, rest → second commit
jj-hunk split '<spec>' "commit message"

# Read spec from a file (JSON or YAML)
jj-hunk split --spec-file spec.yaml "commit message"

# Commit: selected hunks committed, rest stays in working copy
jj-hunk commit '<spec>' "commit message"

# Read spec from stdin
cat spec.json | jj-hunk commit - "commit message"

# Squash: selected hunks squashed into parent
jj-hunk squash '<spec>'

Examples

Split Mixed Changes into Logical Commits

You have refactoring and a new feature mixed together:

# 1. See what hunks exist
jj-hunk list

# 2. Split out the refactoring first
jj-hunk split '{"files": {"src/lib.rs": {"hunks": [0, 1]}}, "default": "reset"}' \
  "refactor: extract helper function"

# 3. Remaining changes become second commit
jj describe -m "feat: add new feature"

Commit Only Part of Your Changes

Keep experimental code in working copy while committing the fix:

jj-hunk commit '{"files": {"src/bug.rs": {"action": "keep"}}, "default": "reset"}' \
  "fix: handle null case"

Squash Specific Files into Parent

jj-hunk squash '{"files": {"src/tests.rs": {"action": "keep"}}, "default": "reset"}'

Keep Everything Except One File

jj-hunk split '{"files": {"src/wip.rs": {"action": "reset"}}, "default": "keep"}' \
  "feat: complete implementation"

Direct jj --tool Usage

The commands above are wrappers. For direct control:

# Write spec to file
echo '{"files": {"src/foo.rs": {"hunks": [0]}}, "default": "reset"}' > /tmp/spec.json

# Run jj with the tool
JJ_HUNK_SELECTION=/tmp/spec.json jj split -i --tool=jj-hunk -m "message"

Hunk Types

TypeMeaning
insertNew lines added
deleteLines removed
replaceLines changed (removed + added)

Agent Workflow Examples

Understanding the Output

Always start by inspecting what hunks exist:

jj-hunk list

Example output:

{
  "files": [
    {
      "path": "src/db/schema.ts",
      "status": "modified",
      "hunks": [
        {"id": "hunk-98af...", "index": 0, "type": "insert", "removed": "", "added": "import { pgTable }...\n", "before": {"start": 1, "lines": 0}, "after": {"start": 1, "lines": 1}},
        {"id": "hunk-21b3...", "index": 1, "type": "insert", "removed": "", "added": "export const users = pgTable...\n", "before": {"start": 2, "lines": 0}, "after": {"start": 2, "lines": 1}}
      ]
    },
    {
      "path": "src/api/routes.ts",
      "status": "modified",
      "hunks": [
        {"id": "hunk-cc19...", "index": 0, "type": "replace", "removed": "// TODO\n", "added": "app.get('/users', ...);\n", "before": {"start": 10, "lines": 1}, "after": {"start": 10, "lines": 1}},
        {"id": "hunk-4b20...", "index": 1, "type": "insert", "removed": "", "added": "app.get('/posts', ...);\n", "before": {"start": 11, "lines": 0}, "after": {"start": 11, "lines": 1}}
      ]
    },
    {
      "path": "src/lib/utils.ts",
      "status": "modified",
      "hunks": [
        {"id": "hunk-11bf...", "index": 0, "type": "replace", "removed": "function old()...\n", "added": "function new()...\n", "before": {"start": 5, "lines": 1}, "after": {"start": 5, "lines": 1}},
        {"id": "hunk-ee43...", "index": 1, "type": "insert", "removed": "", "added": "export function helper()...\n", "before": {"start": 6, "lines": 0}, "after": {"start": 6, "lines": 1}},
        {"id": "hunk-09ad...", "index": 2, "type": "delete", "removed": "// dead code\n", "added": "", "before": {"start": 20, "lines": 1}, "after": {"start": 20, "lines": 0}}
      ]
    }
  ]
}

File-Level Selection

When all hunks in a file belong to the same logical change:

# Keep entire file, reset everything else
jj-hunk split '{"files": {"src/db/schema.ts": {"action": "keep"}}, "default": "reset"}' "feat: add database schema"

Hunk-Level Selection

When a single file has mixed concerns (most powerful feature):

# src/lib/utils.ts has:
#   - hunks 0, 2: refactoring (rename + delete dead code)
#   - hunk 1: new feature (helper function)

# Extract just the refactoring
jj-hunk split '{"files": {"src/lib/utils.ts": {"hunks": [0, 2]}}, "default": "reset"}' "refactor: clean up utils"

# Hunk 1 remains in working copy for the next commit
jj describe -m "feat: add helper function"

Mixed Selection

Combine file-level and hunk-level in one spec:

# Keep all of schema.ts + only hunk 0 from routes.ts
jj-hunk split '{"files": {"src/db/schema.ts": {"action": "keep"}, "src/api/routes.ts": {"hunks": [0]}}, "default": "reset"}' "feat: add users table and endpoint"

# Next: remaining routes.ts hunk
jj-hunk split '{"files": {"src/api/routes.ts": {"action": "keep"}}, "default": "reset"}' "feat: add posts endpoint"

# Final: utils changes
jj describe -m "refactor: utils cleanup"

Complete Workflow Example

Starting with a messy commit containing schema, API, and refactoring changes:

# 1. Edit the commit
jj edit <revision>

# 2. Inspect all hunks
jj-hunk list

# 3. Split in narrative order

# Infrastructure first
jj-hunk split '{"files": {"src/db/schema.ts": {"action": "keep"}}, "default": "reset"}' "feat: add database schema"

# Refactoring second (specific hunks from utils.ts)
jj-hunk split '{"files": {"src/lib/utils.ts": {"hunks": [0, 2]}}, "default": "reset"}' "refactor: clean up utils"

# Feature using the refactored code
jj-hunk split '{"files": {"src/lib/utils.ts": {"action": "keep"}, "src/api/routes.ts": {"hunks": [0]}}, "default": "reset"}' "feat: add users endpoint"

# Remaining changes
jj describe -m "feat: add posts endpoint"

# 4. Verify
jj log -r 'trunk()..@'

Verifying Splits

After splitting, verify each commit has the right content:

# Check stats for each commit
jj diff -r <rev1> --stat
jj diff -r <rev2> --stat

# Or view the log
jj log

Tips

  • Always list first: Run jj-hunk list to see hunk indices/ids before building specs
  • Prefer ids for stability: Use ids when hunks might shift between list and apply
  • Use default wisely: "default": "reset" is safer (explicit inclusion), "default": "keep" is convenient for excluding specific files
  • Combine with jj: After splitting, use jj describe to refine commit messages
  • Exact paths required: File paths must match exactly (e.g., "src/lib.rs" not "src/")

平台分布

Codex

38.35%
按下载量换算27

Claude

29.24%
按下载量换算21

Cursor

19.02%
按下载量换算14

Gemini CLI

9.71%
按下载量换算7

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

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

继续浏览同类 Skills