skills/split-commit/SKILL.md
Repackage branch into clean, tested, vertical commits. Triggers: 'split commits', 'repackage commits', 'reorganize commits', 'clean up branch history'. Not for single-commit branches — use /commit instead.
npx skillsauth add luan/dot-claude split-commitInstall 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.
Repackage branch changes into clean vertical commits. Each commit compiles + passes tests independently.
Parse: <base-branch>, optional --test='command'. If no base-branch arg, resolve at runtime: gh stack view --json 2>/dev/null | jq -r '.trunk // empty' || gt parent 2>/dev/null || gt trunk 2>/dev/null || git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/||'.
Noop check — git log --oneline <base>..HEAD | wc -l. If ≤1 → stop: "Nothing to repackage — use /commit."
Dispatch analysis subagent (general-purpose):
Analyze changes for repackaging into clean vertical commits.
Base branch: <base-branch>
Steps:
1. `git log --oneline <base>..HEAD | wc -l` + `git diff --stat <base>..HEAD | tail -40`
2. Full diff: `git diff <base>..HEAD` — Explore subagent for large diffs
3. Trace cross-file deps, group vertically, order: foundational → features → cleanup
4. For shared files, note which hunks belong where
Auto-detect test commands from justfile/Makefile/package.json/Cargo.toml. Use --test if provided.
Cross-file dep rules:
- File A imports B → same commit or B earlier
- Config/lock files go with the feature introducing the dep
- New types/interfaces go with first consumer
Output:
TEST_COMMANDS: <detected or provided>
COMMIT_PLAN:
1. `type(scope): message` — Files: <list>, Partial: <hunks>, Deps: <justification>, Rationale: <why>
DEPENDENCY_NOTES: <hunk splitting, ordering constraints>
--auto → proceed directly. Otherwise → present plan via AskUserQuestion: commit count, test commands, each commit + key files. "Proceed?"
Collapse into unstaged changes:
git reset --soft <base> && git reset HEAD
Dispatch a single execution subagent (model="sonnet") for ALL commits:
Create <total> commits from unstaged changes.
Commit plan: <full plan from analysis>
Test commands: <test-commands>
Per commit:
1. `git-surgeon hunks` — list available hunks
2. Stage target hunks: whole files → all hunks; partial → `git-surgeon show <id>`, stage matching
3. Run tests. FAIL → find missing dep, stage, retry once. Still failing → STOP with commit number + error.
4. `git commit -m "<message>"`
After last commit: `git diff --stat` — report remaining unstaged.
On failure: spawn fix subagent, then re-invoke execution subagent for remaining commits only.
Verify after all commits:
git status # should be clean
git log --oneline <base>..HEAD # N clean commits
Dirty tree → cleanup subagent: stage remaining, test, commit as chore: clean up remaining. Still fails → report.
tools
Tree-sitter indexed code navigator (ct sym CLI). Use INSTEAD OF Read/Grep/Glob/Bash when exploring existing code, understanding how something works, locating a symbol, tracing the call graph up (impact) or down (trace), finding implementations of an interface, scoping a diff to one symbol, or preparing to edit code you have not read yet. Triggers: 'how does X work', 'explain this class/file/symbol', 'walk me through X', 'what does X do', 'where is X defined', 'who calls X', 'what does X call', 'find implementations of', 'what breaks if I change X', 'outline this file', 'map imports', 'show me this symbol', exploring unfamiliar repo, tracing call graph, scoping diff to a symbol, preparing to edit code I haven't read, about to Read a file over ~500 lines to understand it. Do NOT use for: writing new code from scratch, editing prose or config, running tests, or when a stack trace already names the file and line.
development
Fully autonomous development workflow from prompt to commit. Chains spec → develop → review → commit. Triggers: /vibe, 'vibe this', 'autonomous workflow', 'just do it all', 'build this end-to-end', 'full pipeline', 'handle everything'.
development
Comprehensive vault maintenance — cross-references blueprints against codebase state to produce a maintenance plan: archive consumed artifacts, audit docs for staleness, propose new docs for undocumented stable systems. Triggers: 'vault sweep', 'sweep the vault', 'clean up vault', 'vault maintenance', 'what can we archive', 'audit blueprints', 'vault hygiene', 'blueprint cleanup'. Use whenever the user wants a holistic view of vault health rather than archiving a single artifact (that's /archive). Also use when the user asks what's stale, what needs docs, or whether artifacts can be cleaned up.
development
Analyze current diff, classify changes by risk, and produce structured manual test plan. Triggers: 'test plan', 'what should I test', 'manual testing', 'verification steps', 'QA checklist'. Exits early for trivial changes. Do NOT use when: writing automated tests — use /develop with TDD. Do NOT use when: reviewing code quality — use /crit instead.