.codex/skills/branch-out/SKILL.md
Isolate a subset of changes from a dirty local worktree (usually on main) into a clean feature branch, then commit, push, and open a PR. Use when the user asks to "branch out", "isolate my changes", "move this work to a new branch", or create a clean PR from only selected files/hunks.
npx skillsauth add inline-chat/inline branch-outInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Take only the requested changes from a dirty tree, land them on a new branch, and produce a clean PR without sweeping unrelated local work.
Run:
git rev-parse --abbrev-ref HEAD
git status -sb
git status --short
git fetch --prune origin
git status -sb
git rev-list --left-right --count HEAD...origin/main
If MERGE_HEAD, REBASE_HEAD, or cherry-pick state exists, stop and ask user whether to finish that operation first.
Default assumption is a dirty main branch. If current branch is not main, ask whether to continue from the current branch or switch strategy.
Use this rule:
Always print the selected scope before staging. Capture the original session prompt now; it must be included in the PR description later.
If user did not provide a branch name, propose one and confirm. Before creating it, ensure the name does not collide:
git show-ref --verify --quiet refs/heads/<branch-name>
git ls-remote --exit-code --heads origin <branch-name>
If either exists, propose <branch-name>-2 (or another clear suffix) and confirm.
Then run:
git switch -c <branch-name>
This keeps all current working-tree changes present so only selected changes can be committed.
Use:
git add -- <path>git add -p -- <path>git add -u -- <path>Then verify:
git diff --cached --name-status
git diff --cached
If unrelated changes are staged, unstage them surgically (git restore --staged <path>), then re-check.
Commit message:
If only whole-file staging was used, prefer:
scripts/committer "<message>" <file1> <file2> ...
If partial hunk staging was used, preserve the curated index and commit directly:
git commit -m "<message>"
Before committing, ensure staged files are exactly intended:
git diff --cached --name-only
If nothing is staged, stop and ask the user to re-select scope.
main (safe in dirty trees)First inspect post-commit working tree:
git status --short
Then choose path:
origin/main.If rebase path is chosen, run:
git fetch origin
git rebase origin/main
If conflicts appear during rebase:
git status -sb
git diff --name-only --diff-filter=U
Resolve file-by-file, stage, then continue:
git add <resolved-file>
git rebase --continue
If user explicitly approves temporary stash flow, use:
git stash push -u -m "branch-out-temporary"
git rebase origin/main
git stash pop
If stash pop conflicts, resolve conflicts before continuing.
Use committed diff as scope:
git diff --name-only origin/main...HEAD
Run targeted checks mapped to touched paths (typecheck/tests/build checks for impacted packages only). Do not push on red checks.
Push the new branch:
git push -u origin <branch-name>
If the branch was already pushed and then rebased, use:
git push --force-with-lease
Create PR (preferred with gh) and include a structured description that always has:
Original Prompt: the user's original request in this session (quote or paraphrase faithfully).Summary of Changes: concise bullet list of what was changed.gh pr create --base main --head <branch-name> --title "<title>" --body "<body>"
Suggested body format:
## Original Prompt
<original user request from this session>
## Summary of Changes
- <change 1>
- <change 2>
## Validation
- <focused checks run and result>
If the original prompt is unclear or missing from context, ask the user before opening the PR.
Always report:
git reset --hard, broad restore, rm) unless user explicitly approves.tools
Explain and use the Inline CLI (`inline`) for authentication, chats, users, spaces, messages, search, bots, typing, notifications, tasks, schema, attachments, downloads, JSON output, and configuration. Use when asked how to use the Inline CLI or its commands, flags, outputs, or workflows.
development
Reads commits and changed files within a timeframe specified by user and compiles a changelog for both iOS and macOS.
testing
Safely sync local commits with remote by rebasing onto origin/main and then push, following a GitHub Desktop-style flow. Use when asked to push/sync a branch, reconcile local and remote state, resolve rebase conflicts, run targeted tests or typechecks, and push only if checks pass.
development
Write, review, or improve SwiftUI code following best practices for state management, view composition, performance, macOS-specific APIs, and iOS 26+ Liquid Glass adoption. Use when building new SwiftUI features, refactoring existing views, reviewing code quality, or adopting modern SwiftUI patterns.