Work a GitHub issue to completion in a branch, including review follow-ups, then PR for human review
/plugin marketplace add open-horizon-labs/bottle/plugin install miranda@open-horizon-labsThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Like mouse, but for GitHub issues instead of ba tasks. Claims an issue, works it to completion in an isolated branch, PR for human review.
/oh-task <issue-number> [branch]
<issue-number> - the GitHub issue number (e.g., 123 or #123)[branch] - optional base branch (default: origin/main)Use [branch] for stacked PRs where this issue depends on another in-flight PR.
Determine the target branch:
[branch] specified: use that branch (strip origin/ prefix if present)mainSync with target branch from origin:
git fetch origin
git checkout -B <target-branch> origin/<target-branch>
Fetch and validate issue:
gh issue view <issue-number> --json number,title,body,state,assignees
Abort if issue is closed or already assigned to someone else.
Claim issue (assign to self):
gh issue edit <issue-number> --add-assignee @me
No commit needed - state is on GitHub.
Read dive context (if available) for project background:
cat .wm/dive_context.md 2>/dev/null || echo "No dive context"
Read and understand the issue:
Create worktree from base branch:
git fetch origin
git worktree add .worktrees/issue-<number> -b issue/<number> --no-track origin/<target-branch>
cd .worktrees/issue-<number>
sg init
Work until issue is resolved
Stage changes (git add)
Run sg review on staged changes (do NOT use code-reviewer agent)
Handle review findings:
gh issue create --title "..." --body "Parent: #<issue-number>"Commit code changes
CRITICAL: Complete ALL child issues before PR.
Any gh issue create during this session = child that blocks PR.
No "follow-ups" - if you create it, you work it now.
While ANY unclosed issues created in this session:
gh issue edit <child-number> --add-assignee @mesg review (each issue gets its own review!)ALL issues addressed -> push and create PR:
git push -u origin issue/<number>
gh pr create --base <target-branch> --title "<issue-title>" --body "$(cat <<'EOF'
Closes #<issue-number>
## Also Closes
- #<child-1>
- #<child-2>
## Summary
<brief description of changes>
EOF
)"
The "Closes #N" syntax auto-closes issues when PR merges.
Wait for CodeRabbit review, then iterate:
gh pr view <pr-number> --comments to check for CodeRabbit feedbacksg review (CodeRabbit fixes get sg reviewed too!)Return to main repo and signal completion (if $MIRANDA_PORT is set):
cd <original-dir>
curl -sS -X POST "http://localhost:${MIRANDA_PORT}/complete" \
-H "Content-Type: application/json" \
-d "{\"session\": \"$TMUX_SESSION\", \"status\": \"success\", \"pr\": \"<pr-url>\"}"
CRITICAL: Signal BEFORE cleanup. If still in worktree when it's deleted, curl fails.
Cleanup worktree:
git worktree remove .worktrees/issue-<number>
Exit and report PR URL
.worktrees/issue-<number>issue/<number> branchThe PR is the only human review point. Everything before is autonomous.
CRITICAL: You MUST signal completion when done. If $MIRANDA_PORT is set, you are running under Miranda and MUST curl the completion endpoint. This is the LAST thing you do.
# Run this as your FINAL action:
curl -sS -X POST "http://localhost:${MIRANDA_PORT}/complete" \
-H "Content-Type: application/json" \
-d "{\"session\": \"$TMUX_SESSION\", \"status\": \"success\", \"pr\": \"<pr-url>\"}"
Signal based on outcome:
| Outcome | Status | Payload |
|---|---|---|
| PR created & reviewed | success | "pr": "<url>" |
| Unrecoverable failure | error | "error": "<reason>" |
| Needs human decision | error | "error": "Blocked: <reason>" |
If you don't signal, Miranda won't know you're done and the session becomes orphaned.
$ /oh-task 42
Fetching issue #42...
Issue: "Fix validation bug in auth module"
State: open, unassigned
Claiming issue #42...
Assigned to @me
Reading dive context...
No dive context found.
Reading issue details...
Issue: Input validation fails silently on empty strings
Approach: Add explicit empty string check before processing
No clarifying questions needed, proceeding.
Creating worktree .worktrees/issue-42 on branch issue/42
Initializing superego...
Working on issue...
Staging changes...
Running sg review...
Found 2 issues:
- P3: Add test for edge case -> non-trivial, created issue #43 (Parent: #42)
- P4: Consider renaming variable -> discarded (nitpick)
Review clean (P3 spawned as issue, P4 discarded)
[commit] fix: validate input before processing
Working on child issue #43...
Claiming issue #43...
Staging changes...
Running sg review...
No issues found.
[commit] test: add edge case coverage
All issues complete.
Pushing issue/42...
Creating PR...
PR created: https://github.com/org/repo/pull/99
Body includes: Closes #42, Closes #43
Waiting for CodeRabbit review...
CodeRabbit found 2 issues:
- "Add nil check before dereferencing" -> trivial, fixing inline
- "Consider refactoring to reduce complexity" -> nit, ignoring
[commit] fix: add nil check per CodeRabbit
Pushing...
CodeRabbit review passed.
Returning to main repo...
Signaling completion to Miranda...
Cleaning up worktree...
Done.
$ /oh-task 42
# Claims issue #42 on main
# Creates PR #99: issue/42 -> main (Closes #42)
$ /oh-task 43 issue/42
# Checks out issue/42, claims issue #43
# Creates PR #100: issue/43 -> issue/42 (Closes #43)
$ /oh-task 44 issue/43
# Checks out issue/43, claims issue #44
# Creates PR #101: issue/44 -> issue/43 (Closes #44)
$ /drummer
# Merges in order: #99 -> main, rebases #100 -> main, rebases #101 -> main
Use when working with Payload CMS projects (payload.config.ts, collections, fields, hooks, access control, Payload API). Use when debugging validation errors, security issues, relationship queries, transactions, or hook behavior.