en un clic
repo-setup
// Clone or refresh a GitHub repo and prepare the working tree. Load this before any situation skill.
// Clone or refresh a GitHub repo and prepare the working tree. Load this before any situation skill.
Auto-merge a PR after it is marked ready-for-review, if the change is small, non-disruptive, and all checks pass.
Diagnose and fix failing CI on a PR. Capped at 3 attempts. Load repo-setup first.
Promote a draft PR to ready-for-review after CI passes and self-review is clean. Assigns reviewers and adds labels.
Resolve a GitHub issue end-to-end — explore, plan, implement, clean up, and open a draft PR.
Triage and respond to comments on a PR. Fix if actionable, reply either way. Load repo-setup first.
Review a pull request. Self-fix on own PRs, post a review on others'. Load repo-setup first.
| name | repo-setup |
| description | Clone or refresh a GitHub repo and prepare the working tree. Load this before any situation skill. |
| license | Apache-2.0 |
| metadata | {"audience":"autonomous-agents"} |
Clone or refresh the repo and create an isolated worktree for the branch.
The main clone at ~/dev/<owner>/<repo> is shared across sessions. Working
directly in it causes concurrent sessions to overwrite each other's changes.
Git worktrees give each branch its own directory with its own working tree
and index, while sharing the object store.
Clone (or refresh) the bare-ish main clone:
gh repo clone <owner>/<repo> ~/dev/<owner>/<repo> -- --depth=50 2>/dev/null || true
cd ~/dev/<owner>/<repo>
git fetch --all --prune
Determine the branch name:
issue-<number>-<slug> (e.g. issue-42-fix-login)BRANCH=$(gh pr view <number> --json headRefName --jq .headRefName)
Create or reuse a worktree for the branch:
WORKTREE=~/dev/<owner>/<repo>-wt/<branch>
$WORKTREE already exists, just cd "$WORKTREE" and skip to step 4.DEFAULT_BRANCH=$(gh repo view --json defaultBranchRef --jq .defaultBranchRef.name)
git worktree add "$WORKTREE" -b <branch> "origin/$DEFAULT_BRANCH"
git fetch origin "<branch>:<branch>" 2>/dev/null || true
git worktree add "$WORKTREE" "<branch>"
Work in the worktree — all subsequent commands run from $WORKTREE:
cd "$WORKTREE"
Clean up (optional, after push): if the worktree is no longer needed:
git -C ~/dev/<owner>/<repo> worktree remove "$WORKTREE" --force
git reset --hard or git clean -fd in the main clone — other
worktrees depend on the shared objects.~/dev/<owner>/<repo>-wt/<branch> keeps
worktrees adjacent to the main clone without nesting inside it.