Skill
Community

rebasing-branches

Install
1
Install the plugin
$
npx claudepluginhub lennetech/claude-code --plugin lt-dev

Want just this skill?

Then install: npx claudepluginhub u/[userId]/[slug]

Description

Guides rebase workflows for updating feature branches onto the current development branch (dev/develop). Handles conflict resolution with priority ordering, extracts Linear ticket context from branch names for smarter conflict decisions, performs post-rebase optimization, and uses force-push-with-lease for safety. Activates when user mentions "rebase", "branch aktualisieren", "dev stand", "feature branch updaten", "merge conflicts", "rebase MRs", "force push", or "git rebase". NOT for merge request descriptions (use git:mr-description). NOT for general git operations.

Tool Access

This skill uses the workspace's default tool permissions.

Skill Content

Rebase Workflow Knowledge Base

This skill provides knowledge and strategy for rebasing feature branches onto a development branch. For automated execution, use the lt-dev:branch-rebaser agent via /lt-dev:git:rebase or /lt-dev:git:rebase-mrs.

When This Skill Activates

  • Rebasing feature branches onto dev/develop
  • Resolving merge conflicts during rebase
  • Batch-rebasing multiple MRs/PRs
  • Updating a branch to include latest dev changes
  • Planning rebase strategies for multiple branches

Skill Boundaries

User IntentCorrect Skill
"Rebase my branch onto dev"THIS SKILL
"Rebase all open MRs"THIS SKILL
"Branch aktualisieren"THIS SKILL
"Merge conflicts lösen"THIS SKILL
"Create MR description"git:mr-description
"Generate commit message"git:commit-message
"Update nest-server"nest-server-updating
"npm audit fix"maintaining-npm-packages

Related Skills

ElementPurpose
Agent: lt-dev:branch-rebaserAutonomous rebase execution
Command: /lt-dev:git:rebaseSingle branch rebase
Command: /lt-dev:git:rebase-mrsBatch rebase for MRs/PRs
Command: /lt-dev:reviewCode review after rebase
Skill: generating-nest-serversBackend code patterns
Skill: developing-lt-frontendFrontend code patterns
Skill: coordinating-agent-teamsParallel worktree execution for batch rebase (>2 branches)

Rebase Strategy

Single Branch Workflow

  1. Fetch latest from remote
  2. Rebase onto target branch (default: dev)
  3. Resolve conflicts using project context and Linear ticket info
  4. Optimize code based on new dev state (remove redundancies)
  5. Lint & format with oxfmt/oxlint
  6. Run tests to verify nothing broke
  7. Review changes for quality

Batch Workflow (MRs/PRs)

Same as single branch, plus:

  • List open MRs/PRs from GitHub (gh) or GitLab (glab)
  • User selects which branches to rebase
  • After each branch: commit changes + force push with lease
  • Generate summary report across all branches

Base Branch Detection

PrioritySourceMethod
1User argument--base=<branch>
2Common conventionCheck if dev or develop exists
3Default branchUse main or master
# Detect base branch
git branch -r | grep -E 'origin/(dev|develop)$' | head -1 | sed 's|origin/||;s/^[[:space:]]*//'

Linear Ticket Extraction

Branch names often contain Linear ticket IDs. Extract and load ticket context for better conflict resolution and code optimization.

Extraction Patterns

PatternExampleTicket ID
feat/DEV-123-descriptionfeat/DEV-123-add-authDEV-123
fix/DEV-456-descriptionfix/DEV-456-login-bugDEV-456
DEV-789/descriptionDEV-789/refactor-apiDEV-789
feature/PROJ-42-descfeature/PROJ-42-usersPROJ-42
# Extract ticket ID from branch name
git branch --show-current | grep -oE '[A-Z]+-[0-9]+'

Using Ticket Context

Once extracted, load via mcp__plugin_lt-dev_linear__get_issue:

  • Title & description: Understand the feature intent
  • Acceptance criteria: Verify rebase didn't break requirements
  • Comments: Additional context for conflict resolution

Conflict Resolution Strategy

Priority Order

  1. Incoming changes (dev) for infrastructure/config files
  2. Feature changes (current branch) for feature-specific code
  3. Linear ticket context to decide ambiguous conflicts
  4. Both changes when they affect different concerns

Common Conflict Patterns

File TypeStrategy
package.jsonAccept dev versions, keep feature-specific additions
*.lock filesRegenerate after resolving package.json
Config filesMerge both, prefer dev for shared settings
Model/DTO filesKeep both changes, resolve type conflicts
Test filesKeep both tests, fix import conflicts
Migration filesKeep both, verify execution order

After Conflict Resolution

# Continue rebase after resolving conflicts
git add .
git rebase --continue

# If rebase becomes unrecoverable
git rebase --abort

Post-Rebase Optimization

After successful rebase, check if new dev code makes parts of the feature branch redundant:

  1. Duplicate implementations: Feature branch added something that dev now provides
  2. Outdated workarounds: Feature branch worked around a bug that dev fixed
  3. API changes: Feature branch uses old patterns that dev updated
  4. Dependency conflicts: Feature branch pins a version that dev updated

Lint & Format Tools

oxfmt (Formatter)

# Format all files in a project
pnpm dlx oxfmt .

# Format specific files
pnpm dlx oxfmt src/path/to/file.ts

oxlint (Linter)

# Lint all files
pnpm dlx oxlint .

# Lint with auto-fix
pnpm dlx oxlint --fix .

Force Push Safety

Always use --force-with-lease instead of --force:

git push --force-with-lease

This prevents overwriting changes that someone else pushed to the same branch after your last fetch.


When to Use Commands

ScenarioCommand
Rebase current branch onto dev/lt-dev:git:rebase
Rebase with specific base branch/lt-dev:git:rebase --base=main
Rebase all open MRs for a project/lt-dev:git:rebase-mrs
Rebase selected MRs/PRs/lt-dev:git:rebase-mrs [project-url]
Stats
Stars0
Forks0
Last CommitMar 17, 2026

Similar Skills