prlisted
Install: claude install-skill chanmuzi/git-claw
## Determine Base Branch
Resolve the target base branch before proceeding. Use the first matching rule:
1. **Explicit override**: If `$ARGUMENTS` contains `--base <branch>`, use that branch.
2. **Project config**: Read the project's CLAUDE.md for a `Branch Strategy` section:
```
## Branch Strategy
- default-base: dev
- release-base: main
- direct-to-release: hotfix/*
```
Apply rules:
- Release PR → use `release-base`
- Current branch matches a `direct-to-release` pattern → use `release-base`
- Current branch equals `default-base` (e.g., you are on `dev`) → use `release-base`
- Otherwise → use `default-base`
3. **Auto-detect** (if no project config found):
a. Check for an integration branch: `git branch -r | grep -E 'origin/(dev|develop)$'`
b. If found:
- Current branch IS the integration branch (`dev`/`develop`) → base = `main`
- Otherwise, compare fork points:
```
dev_base=$(git merge-base HEAD origin/dev 2>/dev/null)
main_base=$(git merge-base HEAD origin/main 2>/dev/null)
```
The more recent merge-base indicates the parent branch. If equal, default to the integration branch.
c. If no integration branch exists → use the repo default branch.
Do NOT ask for user confirmation. Instead, briefly state which base branch was selected and why (one line) when presenting the PR.
## Flag Detection
| Flag | Default | Description |
|------|---------|-------------|
| `-g\|--graph` | off | I