Extract the existing PR review-and-fix workflow into a repository skill and invoke it from the git-wt hook. Commit and push verified fixes automatically, then reuse the pull-requests skill to follow CI and review rounds to completion. Preserve the existing PR status and leave merging to the maintainer. Move the shared conflict-resolution script into the pull-requests skill.
31 lines
819 B
Bash
Executable File
31 lines
819 B
Bash
Executable File
#!/bin/sh
|
|
# Invoked by @zkochan/git-wt after `git wt <pr-number>` creates a worktree.
|
|
# Silently no-ops for contributors who don't have the requested agent installed.
|
|
case "${1:-}" in
|
|
'')
|
|
AGENT_CLI=claude
|
|
;;
|
|
*[!0-9]*)
|
|
AGENT_CLI=$1
|
|
;;
|
|
*)
|
|
AGENT_CLI=${2:-claude}
|
|
;;
|
|
esac
|
|
|
|
command -v "$AGENT_CLI" >/dev/null 2>&1 || exit 0
|
|
|
|
PROMPT="Use the review-and-fix-pr skill in .agents/skills/review-and-fix-pr/SKILL.md to review and fix PR $PR_NUMBER. Commit and push the fixes, then follow the existing PR through CI and review using the pull-requests skill."
|
|
|
|
case "$AGENT_CLI" in
|
|
claude)
|
|
exec "$AGENT_CLI" --dangerously-skip-permissions "$PROMPT"
|
|
;;
|
|
codex)
|
|
exec "$AGENT_CLI" --dangerously-bypass-approvals-and-sandbox "$PROMPT"
|
|
;;
|
|
*)
|
|
exec "$AGENT_CLI" "$PROMPT"
|
|
;;
|
|
esac
|