repoint-branch
Extract independent changes from a feature branch into a new PR targeting main.
Best use case
repoint-branch is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Extract independent changes from a feature branch into a new PR targeting main.
Teams using repoint-branch should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/repoint-branch/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How repoint-branch Compares
| Feature / Agent | repoint-branch | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Extract independent changes from a feature branch into a new PR targeting main.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
## Context
- Current branch: !`git branch --show-current 2>/dev/null`
- Changed files (vs main): !`git diff --name-only origin/main...HEAD 2>/dev/null | head -50`
# Repoint Branch
Extract independent changes from a compound branch into a new branch targeting main.
## Usage
```bash
# Interactive - shows changes, asks what to extract
/repoint-branch
# Extract specific files/directories to auto-named branch
/repoint-branch .claude/guidelines/
# Extract multiple paths
/repoint-branch .claude/guidelines/ README.md src/config.py
# Glob pattern
/repoint-branch ".claude/**/*.md"
# Specify new branch name with --name
/repoint-branch .claude/guidelines/ --name feature/guidelines-lite
# Full example
/repoint-branch .claude/guidelines/ .claude/commands/ --name feature/claude-config-lite
```
## Reference Files (conditional — read only when needed)
- @~/.claude/skill-references/platform-detection.md - Platform detection for GitHub/GitLab
## Instructions
0. **Detect platform** — follow `@~/.claude/skill-references/platform-detection.md` to determine GitHub vs GitLab. Set `CLI`, `REVIEW_UNIT`, and API command patterns accordingly. All commands below use GitHub (`gh`) syntax; substitute GitLab equivalents if on GitLab.
1. **Parse arguments**:
- Extract `--name <branch-name>` if provided
- Remaining args are file paths, directories, or glob patterns
- If no paths provided, will prompt interactively
2. **Get current context**:
```bash
git branch --show-current # Current branch
git fetch origin main
git diff --name-only origin/main...HEAD # All changed files
```
3. **Determine files to extract** (store as `FILES_TO_EXTRACT`):
- If paths provided:
- Expand globs: `git diff --name-only origin/main...HEAD -- <patterns>`
- Filter to only files that actually changed
- If no paths:
- Show all changed files
- Ask user: "Which files/directories should be extracted to the new branch?"
- Store the resulting file list as `FILES_TO_EXTRACT` for use in later steps
4. **Validate independence**:
- Show the files to be extracted
- Ask: "These files will be extracted. Confirm they don't depend on other changes in this branch? (y/n)"
5. **Determine new branch name**:
- If `--name` provided, use it
- Otherwise, suggest based on current branch: `<current-branch>-lite`
- Ask user to confirm or provide alternative
6. **Create new branch from main**:
```bash
git checkout origin/main
git checkout -b <new-branch-name>
```
7. **Apply the changes**:
For each file in `FILES_TO_EXTRACT`:
```bash
# Ensure parent directories exist
mkdir -p $(dirname <filepath>)
# Get the file content from the original branch
git show <original-branch>:<filepath> > <filepath>
```
Stage and commit all extracted files:
```bash
git add <FILES_TO_EXTRACT>
git commit -m "<descriptive message>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>"
```
8. **Push and offer to create PR**:
```bash
git push -u origin <new-branch-name>
```
Ask: "Create a PR to main? (y/n)"
If yes, run `/pr` skill or:
```bash
gh pr create --base main --title "<title>" --body "..."
```
9. **Return to original branch**:
```bash
git checkout <original-branch>
```
Inform user: "Created `<new-branch-name>` with extracted changes. Your original branch is unchanged."
## Example Session
```
$ /repoint-branch .claude/guidelines/ --name feature/guidelines-lite
Current branch: feature/phase2 (based on feature/phase1)
Files to extract:
.claude/guidelines/git-workflow.md
.claude/guidelines/python-practices.md
These will be copied to new branch 'feature/guidelines-lite' targeting main.
Confirm these don't depend on feature/phase1 changes? (y/n) y
Creating branch from main...
Applying changes...
Committed: "Add git workflow and python practice guidelines"
Pushed to origin/feature/guidelines-lite
Create PR to main? (y/n) y
PR created: https://github.com/user/repo/pull/42
Returned to feature/phase2.
```
## When to Use This vs `/git:split-pr`
- **`/git:repoint-branch`** — You already know which files to extract into a separate PR. Provide paths and this skill handles branching, copying, committing, and PR creation.
- **`/git:split-pr`** — You have a large PR and need help analyzing *how* to split it. That skill proposes a strategy; use this one to execute each piece.
## Important Notes
- Original branch remains unchanged - changes are copied, not moved
- Only extracts file contents, not commit history
- Verify extracted files don't import/depend on code from parent branches
- If changes depend on parent branch code, this will create broken code on mainRelated Skills
analyzing-branches
Use when analyzing another branch's iteration journals to extract findings, decisions, and insights from divergent work
analyzing-branch-status
Use when user wants detailed status report for single autonomy branch including iteration timeline and metrics progression
squash-branch
Squash all commits on a feature branch into a single commit. Use when the user wants to clean up commit history, squash commits, or consolidate branch changes into one commit.
agent-ops-branch-workflow
Standardized branch creation with type detection, issue ID extraction, and worktree setup. Creates working branches (-WB) and integrates with selective-copy for clean PRs.
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
moai-lang-r
R 4.4+ best practices with testthat 3.2, lintr 3.2, and data analysis patterns.
moai-lang-python
Python 3.13+ development specialist covering FastAPI, Django, async patterns, data science, testing with pytest, and modern Python features. Use when developing Python APIs, web applications, data pipelines, or writing tests.
moai-icons-vector
Vector icon libraries ecosystem guide covering 10+ major libraries with 200K+ icons, including React Icons (35K+), Lucide (1000+), Tabler Icons (5900+), Iconify (200K+), Heroicons, Phosphor, and Radix Icons with implementation patterns, decision trees, and best practices.
moai-foundation-trust
Complete TRUST 4 principles guide covering Test First, Readable, Unified, Secured. Validation methods, enterprise quality gates, metrics, and November 2025 standards. Enterprise v4.0 with 50+ software quality standards references.
moai-foundation-memory
Persistent memory across sessions using MCP Memory Server for user preferences, project context, and learned patterns
moai-foundation-core
MoAI-ADK's foundational principles - TRUST 5, SPEC-First TDD, delegation patterns, token optimization, progressive disclosure, modular architecture, agent catalog, command reference, and execution rules for building AI-powered development workflows
moai-cc-claude-md
Authoring CLAUDE.md Project Instructions. Design project-specific AI guidance, document workflows, define architecture patterns. Use when creating CLAUDE.md files for projects, documenting team standards, or establishing AI collaboration guidelines.