agent/skills/tools/jj-hunk/SKILL.md
Programmatic hunk selection for Jujutsu — split, commit, or squash specific hunks without interactive prompts. Use when making partial commits or selective squashes.
npx skillsauth add knoopx/pi jj-hunkInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Programmatic hunk selection for Jujutsu. Split, commit, or squash specific hunks without interactive prompts.
List available hunks, create a spec file, then apply:
# See what hunks exist
jj-hunk list
jj-hunk list --format text # Human-readable output
jj-hunk list --files # Files with hunk counts only
# Split changes using a spec file
jj-hunk split --spec-file /tmp/spec.yaml "feat: add feature A"
# Commit specific files, leave rest uncommitted
jj-hunk commit --spec-file /tmp/commit-spec.yaml "fix: handle edge case"
# Squash into parent
jj-hunk squash --spec-file /tmp/squash-spec.yaml
Targets any revision with -r <rev> (default is @ for working copy). Read specs from stdin with -.
YAML files control which hunks to keep or reset:
files:
src/main.rs:
hunks: [0, "hunk-7c3d..."] # Select by index or stable id
path/to/skip:
action: reset # Discard all changes
default: reset # Unlisted files get this action
hunks: [indices|ids] — select by 0-based index or stable id from jj-hunk listids: ["hunk-..."] — select by id string (sha256-based, stable across runs)action: keep / action: reset — keep or discard all changes in a filedefault — action for unlisted filesUse jj-hunk list --spec-template to generate an ID-based starting spec. IDs are more reliable than indices since they're stable across runs.
# 1. List hunks
jj-hunk list --format text
# Output: M src/main.rs — hunk 0 insert hunk-abc123, hunk 1 insert hunk-def456
# 2. Create spec for first hunk only
cat > /tmp/split-spec.yaml << 'EOF'
files:
src/main.rs:
hunks: [0]
default: reset
EOF
# 3. Split — first hunk becomes commit A, rest stays in working copy
jj-hunk split --spec-file /tmp/split-spec.yaml "feat: add feature A"
cat > /tmp/commit-spec.yaml << 'EOF'
files:
src/fix.rs:
action: keep
default: reset
EOF
jj-hunk commit --spec-file /tmp/commit-spec.yaml "fix: handle edge case"
--files for a quick summary without full hunk detailscat spec.yaml | jj-hunk commit - "message"-r <rev> with split/squash to target any revisionconcat(), description field)tools
Inform the user what is happening — skip passive lookups
development
Renders markdown to self-contained HTML with a custom dark stylesheet and opens in browser. Use when previewing markdown documents, generating styled HTML from README or report files.
content-media
Manage version control with Jujutsu (jj) — no staging area, immediate changes, smart rebasing. Use when navigating history, squashing, or pushing to Git remotes.
development
Gather facts from the web using evidence-first approach with mandatory citations. Use when researching topics, answering factual questions, or any task requiring web-sourced evidence.