원클릭으로
gh-dev
Pick up GitHub issues and develop them with worktree isolation. Works with any repo - auto-detects from current directory.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Pick up GitHub issues and develop them with worktree isolation. Works with any repo - auto-detects from current directory.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | gh-dev |
| description | Pick up GitHub issues and develop them with worktree isolation. Works with any repo - auto-detects from current directory. |
Pick up the next issue, assess it, and either complete it or document blockers. Works with any GitHub repository with worktree isolation.
Arguments: $ARGUMENTS (optional: issue number to work on specific issue)
REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner 2>/dev/null)
REPO_NAME=$(gh repo view --json name -q .name 2>/dev/null)
if [ -z "$REPO" ]; then
echo "Not in a GitHub repository."
exit 1
fi
Priority order:
ready label exists in repo → use labeled issuesready label → fall back to lowest open issue number# Check if ready label exists
HAS_READY=$(gh label list --json name -q '.[].name' | grep -q "^ready$" && echo "yes" || echo "no")
if [ "$HAS_READY" = "yes" ]; then
gh issue list --label ready --state open --json number,title,labels
else
gh issue list --state open --json number,title,labels | jq 'sort_by(.number) | .[0:5]'
fi
If in-progress label exists: Use it for locking (prevents parallel agents on same issue).
# Claim
gh issue edit <N> --add-label "in-progress"
# Release
gh issue edit <N> --remove-label "in-progress"
If no in-progress label: Skip locking (single-agent mode).
MANDATORY: Always create a worktree for issue work. Never work directly on main.
BASE_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
git worktree add .worktree/${REPO_NAME}-issue-<N> -b <type>/<N>-<desc> origin/${BASE_BRANCH}
WORKTREE_DIR="$(pwd)/.worktree/${REPO_NAME}-issue-<N>"
Use WORKTREE_DIR variable and subshells (cd "$WORKTREE_DIR" && ...) for all worktree commands.
NEVER in main directory:
git checkout <branch> # Changes branch for ALL agents
git switch <branch> # Same problem
ALWAYS use worktrees:
git worktree add .worktree/${REPO_NAME}-issue-<N> -b <type>/<N>-<desc>
START
│
├─ Argument provided? ──yes──▶ Work on issue #$ARGUMENTS
│ Skip to PHASE 2
│
├─ In worktree? ──yes──▶ Extract issue # from branch
│ Skip to PHASE 2
│
└─ In main directory ──▶ PHASE 1: Find next issue
│
▼
PHASE 2: Assess & Claim
│
┌───────────┴───────────┐
▼ ▼
Simple Complex
(≤3 files) (>3 files)
│ │
│ Use Plan agent
│ │
└──────────┬───────────┘
▼
Create worktree (MANDATORY)
│
▼
PHASE 3: Implement
│
▼
Run verification
│
▼
┌──── /code-review ◀────────┐
│ │ │
│ Findings? │
│ yes no │
│ │ │ │
│ ▼ ▼ │
│ Fix all Commit ────────┘
│ findings │
│ │ ▼
└──────┘ Push (pre-push
CodeRabbit --agent
gate; --no-verify
only if transient)
│
▼
Create PR
│
┌──────────┴──────────┐
▼ ▼
Success Blocked
│ │
▼ ▼
Merge Release lock
Cleanup WIP commit
│ Comment on issue
▼ │
PHASE 4: ▼
More issues? STOP
Skip if argument provided or already in worktree.
CURRENT=$(git branch --show-current)
if [ "$CURRENT" != "main" ] && [ "$CURRENT" != "master" ]; then
echo "ABORT: Shared checkout is on '$CURRENT', not main/master."
echo "Do NOT switch branches here; other worktrees/agents may depend on it."
echo "Restore it manually, then re-run."
exit 1
fi
git worktree list
Extract claimed issue numbers from branch names.
Using label-free fallback logic above. Exclude worktree-claimed issues.
# If in-progress label exists
gh issue edit <N> --add-label "in-progress"
sleep 2
gh issue view <N> --json number,title,body,labels,assignees
Abort conditions: Assignee added, conflicting comment, ready label removed.
| Criteria | Simple | Complex |
|---|---|---|
| Size label | size:small | size:medium+ |
| Files affected | ≤3 | >3 |
| Type | Bug fix | Feature, architectural |
Simple: Proceed to Phase 3. Complex: Use Plan agent first.
git fetch origin main || git fetch origin master
BASE_BRANCH=$(git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@')
git worktree add .worktree/${REPO_NAME}-issue-<N> -b <type>/<N>-<desc> origin/${BASE_BRANCH}
WORKTREE_DIR="$(pwd)/.worktree/${REPO_NAME}-issue-<N>"
Work on the issue. Follow acceptance criteria.
Check CLAUDE.md for ### Verification Commands. If found, run them:
(cd "$WORKTREE_DIR" && <commands from CLAUDE.md>)
If not configured, skip or ask user.
MANDATORY before opening a PR. Review the diff and resolve findings before pushing.
Do NOT run the CodeRabbit CLI here. Repos that gate on CodeRabbit run it at push time via a pre-push hook in agent mode (see 3f). Running it manually first doubles the work.
┌─────────────────────────────────────────┐
│ CODE REVIEW LOOP │
├─────────────────────────────────────────┤
│ │
│ 1. Run /code-review (or fallback) │
│ │ │
│ ▼ │
│ 2. Findings? ──no──▶ Proceed to commit │
│ │ │
│ yes │
│ ▼ │
│ 3. Fix each finding │
│ │ │
│ ▼ │
│ 4. Re-run verification commands │
│ │ │
│ └────────▶ Back to step 1 │
│ │
└─────────────────────────────────────────┘
Step 1: Run the review (auto-detect)
/code-review command is available in this environment, use it. It reviews the current diff for correctness bugs plus reuse/simplification/efficiency cleanups./code-review is unavailable, use the repo's configured reviewer (check CLAUDE.md ### Review Command). If none, self-review the diff against the issue's acceptance criteria.Step 2: Fix findings
Address each finding. For multiple findings, track them as tasks and mark completed as you go.
Step 3: Re-verify
After fixing, re-run verification commands (lint, test, build), then re-review. Only proceed when the review is clean.
Exit Conditions:
(cd "$WORKTREE_DIR" && git add -A && git commit -m "<type>: <desc>
Fixes #<N>")
(cd "$WORKTREE_DIR" && git push -u origin <branch>)
Some repos run a pre-push hook that gates the push on a CodeRabbit review. Detect a CodeRabbit gate specifically (not just any pre-push hook):
HOOK_FILE=""
[ -f .husky/pre-push ] && HOOK_FILE=".husky/pre-push"
[ -f .git/hooks/pre-push ] && HOOK_FILE=".git/hooks/pre-push"
if [ -n "$HOOK_FILE" ] && grep -qi "coderabbit" "$HOOK_FILE"; then
echo "CodeRabbit pre-push gate detected"
fi
When present, the hook runs CodeRabbit in agent mode (coderabbit review --agent, default-deny) and blocks the push on real findings. The --no-verify fallback below applies only to a CodeRabbit gate. If a hook runs other checks (tests, lint), do not bypass them blindly.
If the push is blocked, classify the cause:
| Cause | What to do |
|---|---|
| Real review findings reported | Address them (loop back to 3d), then push again. |
| Timeout, CLI unavailable, or unparseable output (infra failure, not findings) | Retry once with git push --no-verify to bypass the gate. |
Only use --no-verify for transient/infrastructure failures. Never bypass to skip real findings.
(cd "$WORKTREE_DIR" && gh pr create \
--title "<type>: <description> (#<N>)" \
--body "## Summary
<bullets>
## Test Plan
- [ ] <verification>
Closes #<N>")
gh pr checks <PR> --watch
gh pr merge <PR> --squash --delete-branch --auto
# Release lock if label exists
gh issue edit <N> --remove-label "in-progress" 2>/dev/null || true
# Refresh main (shared checkout is already on main) and clean worktree
git pull
git worktree remove .worktree/${REPO_NAME}-issue-<N>
git worktree prune
Check for more issues:
# Re-run issue fetch logic
Continue if: More issues AND autonomous mode. Stop if: No issues, blocker hit, or user interruption.
git commit -m "wip: partial #<N>" --no-verify && git push --no-verify (parking incomplete work; the review gate would block it)gh issue edit <N> --remove-label "in-progress"If project has ## GitHub Workflow section, read for:
### Verification Commands
```bash
npm run lint
npm run test:run
npm run build
```
### Branch Prefixes
- Bug: fix/
- Feature: feat/
- Chore: chore/
### Worktree Pattern
.worktree/<custom>-issue-<N>
Used by step 3d when /code-review is unavailable in the environment.
### Review Command
```bash
<repo-specific local review command>
```
## Issue #<N>: <title>
**Status:** Completed | Blocked **Branch:** `<branch>` **PR:** <url>
**Summary:** <what was done>
**Files Changed:**
- `file.ts`: <change>
## Session Summary
**Completed:** N issues **Blocked:** M issues
**Completed:**
1. #42: Title - PR #123
**Blocked:**
1. #44: Title - <reason>
Use when an epic or milestone may have drifted from reality - checklist items that could be stale, issues possibly in the wrong milestone, a "gated on
Create GitHub issues or triage existing ones. Works with any repo - auto-detects from current directory.
This skill helps Claude write secure web applications. Use when working on any web application to ensure security best practices are followed.