Loading...
Loading...
Supports commands: [commit|commit_a commit_b] [--verify] [--apply] [--commit] Interactive git diff review skill. Parses git diff output into individual hunks, presents each hunk to the user with analysis for accept/reject decisions, verifies complete coverage, and generates a Markdown review report.
npx skill4agent add hankjs/hank-skills interactive-diff-review$ARGUMENTS| Command | Usage | Description |
|---|---|---|
| | Default. Full interactive review: parse → review → report |
| | Check report exists, matches current diff, and all hunks passed |
| | Fix code based on rejected hunks' review suggestions |
| | Generate and execute git commit (requires |
<commit><commit_a> <commit_b>/interactive-diff-review --apply --commit$ARGUMENTSreviewDiff Review Progress:
- [ ] Step 1: Resolve & Parse
- [ ] 1.1 Run resolve_diff.py to get diff + language
- [ ] 1.2 Verify no error, inform user of diff source + language
- [ ] 1.3 Run parse_hunks.py to split into hunks
- [ ] 1.4 Handle edge cases ⚠️ Load references/edge-cases.md
- [ ] Step 2: Interactive Review ⚠️ CORE LOOP
- [ ] Load references/review-format.md
- [ ] 2.1 Display hunk (index/total, file, type, diff body)
- [ ] 2.2 Provide analysis (summary, impact, risks, suggestions)
- [ ] 2.3 Collect decision via ask_user_input (Accept / Reject / Skip)
- [ ] 2.4 If rejected, ask reason (open-ended text follow-up)
- [ ] 2.5 Show running tally, advance to next hunk
- [ ] 2.6 Repeat 2.1–2.5 until all hunks done
- [ ] 2.7 Loop back for any skipped hunks
- [ ] Step 3: Coverage Verification ⚠️ REQUIRED
- [ ] 3.1 Re-run resolve_diff.py + parse_hunks.py
- [ ] 3.2 Compare new hunks against reviewed hunks (file + header + body)
- [ ] 3.3 If new/changed hunks → review them (back to Step 2)
- [ ] 3.4 Confirm full coverage before proceeding
- [ ] Step 4: Generate Report
- [ ] Load references/report-template.md
- [ ] 4.1 Build Markdown report (detected language, diff order)
- [ ] 4.2 Save to /mnt/user-data/outputs/diff-review-report.md
- [ ] 4.3 Present to userpython scripts/resolve_diff.py # auto: staged → workspace
python scripts/resolve_diff.py <commit> # single commit
python scripts/resolve_diff.py <commit_a> <commit_b> # commit range{ source, ref, language, diff, error }errordiff# Write the diff field to a temp file (agent should use Write tool or shell redirect)
# e.g. write resolve output's .diff value to /tmp/diff.txt
python scripts/parse_hunks.py --file /tmp/diff.txt{ total, hunks: [{ index, file, header, body, type, status, reason }] }references/edge-cases.mdreferences/review-format.mdresolve_diff.pyparse_hunks.pyfile + header + bodyreferences/report-template.mddiff-review-report.md--verifydiff-review-report.mdreviewresolve_diff.pyparse_hunks.pyreview--applydiff-review-report.md--verifyreview--applyreview--verify--commit--verifygit add -Agit commit| Parameter | Type | Description |
|---|---|---|
| (none) | — | Default |
| string | Commit hash, short hash, tag, or ref |
| string | Commit range |
| flag | Run verification check on existing report |
| flag | Apply fixes for rejected hunks |
| flag | Verify + generate git commit |
git log --oneline -10resolve_diff.pygit-diff-review/
├── SKILL.md # This file — workflow orchestration
├── scripts/
│ ├── resolve_diff.py # Diff source + language detection
│ └── parse_hunks.py # Unified diff → structured hunks
└── references/
├── review-format.md # Step 2: display, analysis, decisions
├── report-template.md # Step 4: Markdown report template
└── edge-cases.md # Step 1.4: edge case handling