worktree-pr

Creates isolated git worktrees for feature implementation and submits them as pull requests.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/Ouaish-Labs/ouaish.com --skill worktree-pr-ouaish-labs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: worktree-pr
Source: https://github.com/Ouaish-Labs/ouaish.com/tree/main/.claude/skills/worktree-pr
Command: npx skills add https://github.com/Ouaish-Labs/ouaish.com --skill worktree-pr-ouaish-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Developing features directly on the main branch risks destabilizing the codebase, and manually managing worktrees, branches, conflict checks, and PR review loops is error-prone. This Skill automates the full lifecycle of isolated feature development from worktree creation through PR submission and automated review. ## Core Features & Use Cases - Isolated Worktree Setup: Creates a git worktree under ~/Developer with a derived branch name, fetches linked GitHub issue context, and supports resuming existing worktrees by reconstructing state from git log and TODO.md. - Delegated Implementation: Runs the /parallel-implementation workflow inside the worktree with explicit working-directory instructions so subagents never edit the main repo by mistake. - Conflict and Completeness Gates: Checks whether origin/main has advanced before pushing, and for epic-linked work validates that every checklist item is closed, deferred to a tracked issue, or explicitly approved. - Automated Review Loop: Runs up to three rounds of PR review using pr-review-toolkit agents (fresh Sonnet in round 1, resumed Opus afterward), dispatches a fixer agent, and posts a final summary including external bot comments. - Use Case: A developer says "implement issue #500 as a PR" and the Skill creates the worktree, implements and tests the feature, checks for conflicts with main, pushes the branch, opens the PR, and iterates on automated review findings. ## Quick Start Ask the assistant to implement a feature or GitHub issue in an isolated worktree and submit it as a pull request.

Frequently Asked Questions about worktree-pr

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a git worktree and submit a PR for a feature?▼

Invoke the Skill with an issue number or feature description. It derives a branch name, creates a worktree at ~/Developer/<branch-name> off main, runs the implementation workflow inside it, pushes the branch, and opens the PR with gh pr create.

How does the automated PR review loop work?▼

After the PR is created, up to three review rounds run. Round 1 dispatches fresh pr-review-toolkit agents on Sonnet; rounds 2 and 3 resume those agents on Opus. A fixer agent addresses findings between rounds, and zero findings triggers an early APPROVED exit.

Can I resume an existing worktree instead of starting fresh?▼

Yes. If a worktree already exists at the target path, the Skill reconstructs state from git log, TODO.md, and uncommitted changes, then offers options to resume where work left off, recreate from main, or pick a different branch name.

What happens if main has advanced since my branch was created?▼

The conflict check phase fetches origin/main and reports new commits. You choose to merge, rebase, or ignore; the Skill never auto-merges. After a merge or rebase, the test suite is re-run before the PR is submitted.

Why did my subagent edit files in the main repo instead of the worktree?▼

Subagents inherit the main session's working directory, not the worktree. Every agent prompt must include an explicit cd ~/Developer/<branch-name> instruction, otherwise agents modify the main repo and you push an empty branch.

When should I not merge a PR from inside the worktree?▼

Never run gh pr merge from the worktree. The --delete-branch flag triggers a local checkout of main that fails inside a worktree, causing a silent partial success. Always merge from the main repo directory after all CI checks are green.