Loading...
Loading...
PRを作成する前の分割commitが必要な時に自律的に呼び出す必要があるスキルです。 Trigger: need split commit, prepare commit, organize commit
npx skill4agent add hikaruegashira/agent-skills process-commitgit-sequential-stagegit-sequential-stage# hunk番号を指定して部分的にステージング
git-sequential-stage -patch="path/to/changes.patch" -hunk="src/main.go:1,3,5"
# ファイル全体をステージング(ワイルドカード使用)
git-sequential-stage -patch="path/to/changes.patch" -hunk="src/logger.go:*"
# 複数ファイルの場合(ワイルドカードと番号指定の混在も可能)
git-sequential-stage -patch="path/to/changes.patch" \
-hunk="src/main.go:1,3" \
-hunk="src/utils.go:*" \
-hunk="docs/README.md:*"git ls-files --others --exclude-standard | xargs git add -N
# より安定した位置特定のため
git diff HEAD > .claude/tmp/current_changes.patch# 全体のhunk数
grep -c "^@@" .claude/tmp/current_changes.patch
# 各ファイルのhunk数
git diff HEAD --name-only | xargs -I {} sh -c 'printf "%s: " "{}"; git diff HEAD {} | grep -c "^@@"'git-sequential-stage# git-sequential-stageを実行(内部で逐次ステージングを安全に処理)
# 部分的な変更をステージング(hunk番号指定)
git-sequential-stage -patch=".claude/tmp/current_changes.patch" -hunk="src/calculator.py:1,3,5"
# ファイル全体をステージング(意味的に一体の変更の場合)
git-sequential-stage -patch=".claude/tmp/current_changes.patch" -hunk="tests/test_calculator.py:*"
# 複数ファイルの場合(混在使用)
git-sequential-stage -patch=".claude/tmp/current_changes.patch" \
-hunk="src/calculator.py:1,3,5" \
-hunk="src/utils.py:2" \
-hunk="docs/CHANGELOG.md:*"
# コミット実行
git commit -m "$COMMIT_MSG"