[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QJ0TM0V89J0C8CPQC6E4GM":3,"skill-same:01M6QJ0TM0V89J0C8CPQC6E4GM":71},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":51,"commitSha":52,"skillDirectory":53,"forksCount":13,"repositoryHtmlUrl":54,"repositoryHomepageUrl":6,"ownerHtmlUrl":55,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":56,"install":57,"resources":70},"01M6QJ0TM0V89J0C8CPQC6E4GM","git-rebase-safety",null,"Master safe rebasing: when to use rebase vs merge, how to handle conflicts, and how to ensure history integrity. Use when user mentions rebasing, git rebase, rebase conflicts, rebase vs merge, or when they're unsure about rebasing strategy. Triggers especially when user says \"should I rebase?\", \"rebase vs merge\", \"how to resolve rebase conflicts\", or \"is it safe to rebase?\".","ImaginerLabs\u002Fskill-manager","ImaginerLabs","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F214277308?v=4","01M6QGGDPNF15RMMT1RCFDH9FN","01M6QGGDTH5BY64DQ123NR8M33",0,"MIT","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fcoding\u002Fgit-rebase-safety\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"git rebase safety","git rebase","git","Safety","rebase","strategy","re","how to","triggers","conflict","conflicts","master","use","safe","history","coding","how","integrity","merge","workflow","2026-11-10 10:12:30",false,"---\nname: git-rebase-safety\ndescription: >-\n  Master safe rebasing: when to use rebase vs merge, how to handle conflicts, and how to ensure history integrity. Use when user mentions rebasing, git rebase, rebase conflicts, rebase vs merge, or when they're unsure about rebasing strategy. Triggers especially when user says \"should I rebase?\", \"rebase vs merge\", \"how to resolve rebase conflicts\", or \"is it safe to rebase?\".\ncategory: coding\npriority: P1\ntrigger_patterns:\n  - \"should I rebase\"\n  - \"rebase vs merge\"\n  - \"rebase conflict\"\n  - \"safe rebase\"\n  - \"git rebase\"\n  - \"rebase workflow\"\n  - \"interactive rebase\"\n---\n\n# Git Rebase Safety — When and How to Rebase\n\n## Overview\n\nGit-rebase-safety is a **behavioral specification skill** that encapsulates the judgment of **when to rebase, when to merge, and how to handle rebasing safely**.\n\nThis skill embodies the expertise of developers who've experienced both the power and the pitfalls of rebasing and know how to use it without causing problems.\n\n## Core Philosophy\n\n### The Rebase Golden Rule\n\n> **\"Never rebase public history.\"**\n\nIf a branch has been shared with others (pushed to remote, PR created), rebasing rewrites shared history and causes problems for everyone who has that history.\n\n### When Rebase is Safe\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    REBASE SAFETY MATRIX                        │\n│                                                               │\n│  ┌─────────────────┬─────────────────┬───────────────────┐  │\n│  │                 │   LOCAL ONLY    │   SHARED\u002FREMOTE   │  │\n│  ├─────────────────┼─────────────────┼───────────────────┤  │\n│  │ YOUR OWN BRANCH │   ✅ SAFE       │   ⚠️ RISKY        │  │\n│  │                 │   (personal)    │   (causes issues) │  │\n│  ├─────────────────┼─────────────────┼───────────────────┤  │\n│  │ OTHERS' BRANCH  │   ⚠️ CAUTION   │   ❌ DANGEROUS    │  │\n│  │                 │   (coordinate)  │   (never do this)  │  │\n│  └─────────────────┴─────────────────┴───────────────────┘  │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## Decision Framework\n\n### Rebase vs Merge Decision Tree\n\n```\n                    ┌─ Is this branch local only?\n                    │   └─ NO → Use MERGE\n                    │       └─ YES → Continue\n                    │\n                    └─ Is this branch shared with others?\n                        └─ YES → Use MERGE\n                        └─ NO → Continue\n                                │\n                                └─ Do you prefer clean linear history?\n                                    └─ YES → Use REBASE\n                                    └─ NO → Use MERGE\n```\n\n### When to REBASE\n\n| Situation | Recommendation | Why |\n|-----------|---------------|-----|\n| Local feature branch | ✅ Rebase | Clean, personal history |\n| Updating feature branch with main | ✅ Rebase | Keep feature isolated |\n| Cleaning up commits before PR | ✅ Rebase (interactive) | Improve reviewability |\n| Maintaining feature branch sync | ✅ Rebase | Avoid merge bubbles |\n| Personal experimental branches | ✅ Rebase | Full control |\n\n### When to MERGE\n\n| Situation | Recommendation | Why |\n|-----------|---------------|-----|\n| Branch is shared (pushed\u002FPR) | ⚠️ Merge | Don't rewrite shared history |\n| Merging release branch | ⚠️ Merge | Need version markers |\n| Team prefers merge commits | ⚠️ Merge | Team convention |\n| Complex conflict resolution | ⚠️ Merge | Single merge commit easier |\n| Public branches | ❌ Never Rebase | Rewrites shared history |\n\n## Behavioral Specification\n\n### Phase 1: Pre-Rebase Assessment\n\n#### 1.1 Safety Checklist\n\n```\nPRE-REBASE SAFETY CHECKLIST\n============================\n\n□ Is this branch local only?\n□ Has this branch been pushed to remote?\n□ Has a PR been created from this branch?\n□ Have others checked out this branch?\n□ Is this branch shared with teammates?\n\nIf ALL NO → REBASE is safe\nIf ANY YES → Use MERGE instead\n```\n\n#### 1.2 Risk Assessment\n\n```markdown\n## Risk Analysis\n\n| Factor | Risk Level | Action |\n|--------|-----------|--------|\n| Branch never pushed | LOW | Rebase freely |\n| Branch pushed but no PR | MEDIUM | Coordinate with team |\n| PR already reviewed | HIGH | Use merge |\n| Team uses this branch | CRITICAL | Never rebase |\n\nRisk Score: [LOW\u002FMEDIUM\u002FHIGH\u002FCRITICAL]\nRecommendation: [REBASE\u002FMERGE]\n```\n\n### Phase 2: Rebase Execution\n\n#### 2.1 Standard Rebase\n\n```bash\n# Update your feature branch with main\ngit checkout feature\u002FPROJ-123\ngit fetch origin\ngit rebase origin\u002Fmain\n\n# If conflicts occur → resolve then continue\ngit rebase --continue\n\n# If you want to abort\ngit rebase --abort\n```\n\n#### 2.2 Interactive Rebase (Cleanup)\n\n```bash\n# Clean up last N commits\ngit rebase -i HEAD~3\n\n# Commands in interactive mode:\n# pick = use commit as-is\n# squash = combine with previous (keep changes)\n# fixup = combine, discard commit message\n# reword = change commit message\n# drop = remove commit entirely\n```\n\n```bash\n# Example: cleanup 3 commits\npick abc1234 Add user authentication\nfixup def5678 Fix typo\nfixup ghi9012 WIP\n\n# Result: 1 clean commit\n```\n\n### Phase 3: Conflict Resolution\n\n#### 3.1 Conflict Resolution Protocol\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    CONFLICT RESOLUTION                        │\n│                                                               │\n│  1. REBASE STOPS AT CONFLICTING COMMIT                      │\n│     └─ \"CONFLICT: src\u002Fauth.ts\"                             │\n│                                                               │\n│  2. IDENTIFY CONFLICTING FILES                             │\n│     └─ git status shows \"both modified\"                     │\n│                                                               │\n│  3. EDIT CONFLICTING FILES                                  │\n│     └─ Keep desired changes                                  │\n│     └─ Remove conflict markers \u003C\u003C\u003C === >>>                  │\n│                                                               │\n│  4. STAGE RESOLVED FILES                                    │\n│     └─ git add \u003Cresolved-file>                              │\n│                                                               │\n│  5. CONTINUE OR ABORT                                        │\n│     └─ git rebase --continue (if resolved)                  │\n│     └─ git rebase --abort (if messed up)                     │\n└─────────────────────────────────────────────────────────────┘\n```\n\n#### 3.2 Conflict Resolution Strategy\n\n**DON'T:**\n- Pick all \"ours\" or \"theirs\" blindly\n- Delete conflict markers without choosing\n- Ignore the conflict\n\n**DO:**\n- Understand what both changes do\n- Choose the correct combination\n- Test after resolution\n\n```bash\n# View both versions\ngit show :1:filename  # common ancestor\ngit show :2:filename  # ours (current branch)\ngit show :3:filename  # theirs (incoming branch)\n```\n\n### Phase 4: Post-Rebase Validation\n\n#### 4.1 Verification Checklist\n\n```markdown\nPOST-REBASE CHECKLIST\n======================\n\n□ Run tests to ensure functionality preserved\n□ Verify no unexpected changes in git log\n□ If pushed before, force push with care:\n  └─ git push --force-with-lease (safer than --force)\n□ Notify team if shared branch was affected\n□ Verify all commits are intact\n```\n\n#### 4.2 Force Push Safety\n\n```bash\n# SAFE: force push with lease\ngit push --force-with-lease origin feature\u002FPROJ-123\n\n# What --force-with-lease does:\n# - Refuses to push if remote has commits you don't have\n# - Prevents accidentally overwriting others' work\n\n# NEVER use plain --force\ngit push --force  # DON'T DO THIS\n```\n\n## Common Scenarios\n\n### Scenario 1: \"My feature branch is behind main, how do I update?\"\n\n```markdown\nAnalysis:\n- Feature branch exists\n- Main has new commits\n- Branch not shared\n\nOptions:\nA) git merge main\n   └─ Creates merge commit\n   └─ Preserves exact history\n\nB) git rebase main\n   └─ Clean linear history\n   └─ No merge commit\n\nRecommendation: REBASE (cleaner for feature branches)\n```\n\n### Scenario 2: \"I need to clean up my commits before PR\"\n\n```bash\n# Interactive rebase to squash\u002Ffixup\ngit rebase -i HEAD~5\n\n# Change 'pick' to 'fixup' for commits to combine\n# Change 'pick' to 'reword' to edit messages\n# Change 'pick' to 'drop' to remove commits\n```\n\n### Scenario 3: \"Rebase created conflicts, should I abort?\"\n\n```markdown\nAnalysis:\n- Conflict occurred during rebase\n- 5 files affected\n- Complex changes\n\nOptions:\nA) Continue and resolve\n   └─ Takes time but resolves cleanly\n   └─ Preserves rebased history\n\nB) Abort and merge instead\n   └─ Faster\n   └─ Creates merge commit\n   └─ May be easier for complex conflicts\n\nRecommendation:\n- If you understand both sides → Resolve\n- If confused\u002Funcomfortable → Abort and merge\n```\n\n### Scenario 4: \"I accidentally rebased a shared branch\"\n\n```markdown\nINCIDENT: Pushed branch rebased, team affected\n\nIMMEDIATE ACTION:\n1. Notify team immediately\n2. Don't push further changes\n3. Help team recover:\n   └─ git pull (creates duplicate commits)\n   └─ Or: reset to pre-rebase state\n\nPREVENTION:\n1. Always check if branch is shared\n2. Use --force-with-lease\n3. Prefer merge for shared branches\n```\n\n## The Rebase Decision Checklist\n\n```\nREBASE DECISION CHECKLIST\n==========================\n\n□ Where will this branch be used?\n  └─ Local only → REBASE allowed\n  └─ Shared\u002Fremote → Use MERGE\n\n□ What is your team's convention?\n  └─ Rebase workflow → Follow it\n  └─ Merge workflow → Use MERGE\n\n□ How complex are the changes?\n  └─ Simple → REBASE fine\n  └─ Complex → Consider MERGE\n\n□ Do you need to preserve exact history?\n  └─ Yes → MERGE\n  └─ No → REBASE\n\nRECOMMENDATION: [REBASE \u002F MERGE]\n```\n\n## Rebase Best Practices\n\n### DO\n\n1. **Rebase local branches before pushing**\n2. **Use --force-with-lease instead of --force**\n3. **Resolve conflicts completely before continuing**\n4. **Test after rebase**\n5. **Notify team when rebasing shared branches**\n6. **Use interactive rebase to clean up commits**\n\n### DON'T\n\n1. **Never rebase public\u002Fshared history**\n2. **Don't rebase if you don't understand the conflicts**\n3. **Don't ignore conflicts**\n4. **Don't force push without checking**\n5. **Don't rebase mid-PR without coordination**\n\n## Rebase Workflow Patterns\n\n### Pattern 1: Trunk-Based Rebasing\n\n```bash\n# Daily: sync with trunk\ngit checkout main\ngit pull\ngit checkout feature\u002FPROJ-123\ngit rebase main\n\n# Feature complete: PR\ngit push --force-with-lease\n```\n\n### Pattern 2: Pre-PR Cleanup\n\n```bash\n# Before creating PR, clean up commits\ngit rebase -i HEAD~5\n\n# Squash: combine related commits\n# Reword: improve commit messages\n# Drop: remove unnecessary commits\n```\n\n## Key Principles\n\n### 1. Rebase = Rewrite History\n\nEvery rebase rewrites commits. This is fine locally, dangerous on shared history.\n\n### 2. Merge Commits = Recorded Truth\n\nMerge commits show exactly when integration happened and what both branches contained.\n\n### 3. Clean History Has Value\n\nLinear history with rebase makes `git log` and `git bisect` easier.\n\n### 4. Team Convention Trumps Personal Preference\n\nIf your team uses merge, use merge. Consistency matters more than purity.\n\n### 5. When in Doubt, Merge\n\nIf you're unsure about rebasing, merge is the safer choice.\n\n## Relationship to Other Skills\n\n- `git-branch-strategy` — Branch creation affects rebase strategy\n- `git-commit` — Interactive rebase affects commit organization\n- `git-merge-resolution` — Alternative to rebasing\n- `git-history-rewrite` — More advanced history manipulation\n- `pre-commit-review` — Review process after rebase\n","# Git Rebase Safety — When and How to Rebase\n\n## Overview\n\nGit-rebase-safety is a **behavioral specification skill** that encapsulates the judgment of **when to rebase, when to merge, and how to handle rebasing safely**.\n\nThis skill embodies the expertise of developers who've experienced both the power and the pitfalls of rebasing and know how to use it without causing problems.\n\n## Core Philosophy\n\n### The Rebase Golden Rule\n\n> **\"Never rebase public history.\"**\n\nIf a branch has been shared with others (pushed to remote, PR created), rebasing rewrites shared history and causes problems for everyone who has that history.\n\n### When Rebase is Safe\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    REBASE SAFETY MATRIX                        │\n│                                                               │\n│  ┌─────────────────┬─────────────────┬───────────────────┐  │\n│  │                 │   LOCAL ONLY    │   SHARED\u002FREMOTE   │  │\n│  ├─────────────────┼─────────────────┼───────────────────┤  │\n│  │ YOUR OWN BRANCH │   ✅ SAFE       │   ⚠️ RISKY        │  │\n│  │                 │   (personal)    │   (causes issues) │  │\n│  ├─────────────────┼─────────────────┼───────────────────┤  │\n│  │ OTHERS' BRANCH  │   ⚠️ CAUTION   │   ❌ DANGEROUS    │  │\n│  │                 │   (coordinate)  │   (never do this)  │  │\n│  └─────────────────┴─────────────────┴───────────────────┘  │\n└─────────────────────────────────────────────────────────────┘\n```\n\n## Decision Framework\n\n### Rebase vs Merge Decision Tree\n\n```\n                    ┌─ Is this branch local only?\n                    │   └─ NO → Use MERGE\n                    │       └─ YES → Continue\n                    │\n                    └─ Is this branch shared with others?\n                        └─ YES → Use MERGE\n                        └─ NO → Continue\n                                │\n                                └─ Do you prefer clean linear history?\n                                    └─ YES → Use REBASE\n                                    └─ NO → Use MERGE\n```\n\n### When to REBASE\n\n| Situation | Recommendation | Why |\n|-----------|---------------|-----|\n| Local feature branch | ✅ Rebase | Clean, personal history |\n| Updating feature branch with main | ✅ Rebase | Keep feature isolated |\n| Cleaning up commits before PR | ✅ Rebase (interactive) | Improve reviewability |\n| Maintaining feature branch sync | ✅ Rebase | Avoid merge bubbles |\n| Personal experimental branches | ✅ Rebase | Full control |\n\n### When to MERGE\n\n| Situation | Recommendation | Why |\n|-----------|---------------|-----|\n| Branch is shared (pushed\u002FPR) | ⚠️ Merge | Don't rewrite shared history |\n| Merging release branch | ⚠️ Merge | Need version markers |\n| Team prefers merge commits | ⚠️ Merge | Team convention |\n| Complex conflict resolution | ⚠️ Merge | Single merge commit easier |\n| Public branches | ❌ Never Rebase | Rewrites shared history |\n\n## Behavioral Specification\n\n### Phase 1: Pre-Rebase Assessment\n\n#### 1.1 Safety Checklist\n\n```\nPRE-REBASE SAFETY CHECKLIST\n============================\n\n□ Is this branch local only?\n□ Has this branch been pushed to remote?\n□ Has a PR been created from this branch?\n□ Have others checked out this branch?\n□ Is this branch shared with teammates?\n\nIf ALL NO → REBASE is safe\nIf ANY YES → Use MERGE instead\n```\n\n#### 1.2 Risk Assessment\n\n```markdown\n## Risk Analysis\n\n| Factor | Risk Level | Action |\n|--------|-----------|--------|\n| Branch never pushed | LOW | Rebase freely |\n| Branch pushed but no PR | MEDIUM | Coordinate with team |\n| PR already reviewed | HIGH | Use merge |\n| Team uses this branch | CRITICAL | Never rebase |\n\nRisk Score: [LOW\u002FMEDIUM\u002FHIGH\u002FCRITICAL]\nRecommendation: [REBASE\u002FMERGE]\n```\n\n### Phase 2: Rebase Execution\n\n#### 2.1 Standard Rebase\n\n```bash\n# Update your feature branch with main\ngit checkout feature\u002FPROJ-123\ngit fetch origin\ngit rebase origin\u002Fmain\n\n# If conflicts occur → resolve then continue\ngit rebase --continue\n\n# If you want to abort\ngit rebase --abort\n```\n\n#### 2.2 Interactive Rebase (Cleanup)\n\n```bash\n# Clean up last N commits\ngit rebase -i HEAD~3\n\n# Commands in interactive mode:\n# pick = use commit as-is\n# squash = combine with previous (keep changes)\n# fixup = combine, discard commit message\n# reword = change commit message\n# drop = remove commit entirely\n```\n\n```bash\n# Example: cleanup 3 commits\npick abc1234 Add user authentication\nfixup def5678 Fix typo\nfixup ghi9012 WIP\n\n# Result: 1 clean commit\n```\n\n### Phase 3: Conflict Resolution\n\n#### 3.1 Conflict Resolution Protocol\n\n```\n┌─────────────────────────────────────────────────────────────┐\n│                    CONFLICT RESOLUTION                        │\n│                                                               │\n│  1. REBASE STOPS AT CONFLICTING COMMIT                      │\n│     └─ \"CONFLICT: src\u002Fauth.ts\"                             │\n│                                                               │\n│  2. IDENTIFY CONFLICTING FILES                             │\n│     └─ git status shows \"both modified\"                     │\n│                                                               │\n│  3. EDIT CONFLICTING FILES                                  │\n│     └─ Keep desired changes                                  │\n│     └─ Remove conflict markers \u003C\u003C\u003C === >>>                  │\n│                                                               │\n│  4. STAGE RESOLVED FILES                                    │\n│     └─ git add \u003Cresolved-file>                              │\n│                                                               │\n│  5. CONTINUE OR ABORT                                        │\n│     └─ git rebase --continue (if resolved)                  │\n│     └─ git rebase --abort (if messed up)                     │\n└─────────────────────────────────────────────────────────────┘\n```\n\n#### 3.2 Conflict Resolution Strategy\n\n**DON'T:**\n- Pick all \"ours\" or \"theirs\" blindly\n- Delete conflict markers without choosing\n- Ignore the conflict\n\n**DO:**\n- Understand what both changes do\n- Choose the correct combination\n- Test after resolution\n\n```bash\n# View both versions\ngit show :1:filename  # common ancestor\ngit show :2:filename  # ours (current branch)\ngit show :3:filename  # theirs (incoming branch)\n```\n\n### Phase 4: Post-Rebase Validation\n\n#### 4.1 Verification Checklist\n\n```markdown\nPOST-REBASE CHECKLIST\n======================\n\n□ Run tests to ensure functionality preserved\n□ Verify no unexpected changes in git log\n□ If pushed before, force push with care:\n  └─ git push --force-with-lease (safer than --force)\n□ Notify team if shared branch was affected\n□ Verify all commits are intact\n```\n\n#### 4.2 Force Push Safety\n\n```bash\n# SAFE: force push with lease\ngit push --force-with-lease origin feature\u002FPROJ-123\n\n# What --force-with-lease does:\n# - Refuses to push if remote has commits you don't have\n# - Prevents accidentally overwriting others' work\n\n# NEVER use plain --force\ngit push --force  # DON'T DO THIS\n```\n\n## Common Scenarios\n\n### Scenario 1: \"My feature branch is behind main, how do I update?\"\n\n```markdown\nAnalysis:\n- Feature branch exists\n- Main has new commits\n- Branch not shared\n\nOptions:\nA) git merge main\n   └─ Creates merge commit\n   └─ Preserves exact history\n\nB) git rebase main\n   └─ Clean linear history\n   └─ No merge commit\n\nRecommendation: REBASE (cleaner for feature branches)\n```\n\n### Scenario 2: \"I need to clean up my commits before PR\"\n\n```bash\n# Interactive rebase to squash\u002Ffixup\ngit rebase -i HEAD~5\n\n# Change 'pick' to 'fixup' for commits to combine\n# Change 'pick' to 'reword' to edit messages\n# Change 'pick' to 'drop' to remove commits\n```\n\n### Scenario 3: \"Rebase created conflicts, should I abort?\"\n\n```markdown\nAnalysis:\n- Conflict occurred during rebase\n- 5 files affected\n- Complex changes\n\nOptions:\nA) Continue and resolve\n   └─ Takes time but resolves cleanly\n   └─ Preserves rebased history\n\nB) Abort and merge instead\n   └─ Faster\n   └─ Creates merge commit\n   └─ May be easier for complex conflicts\n\nRecommendation:\n- If you understand both sides → Resolve\n- If confused\u002Funcomfortable → Abort and merge\n```\n\n### Scenario 4: \"I accidentally rebased a shared branch\"\n\n```markdown\nINCIDENT: Pushed branch rebased, team affected\n\nIMMEDIATE ACTION:\n1. Notify team immediately\n2. Don't push further changes\n3. Help team recover:\n   └─ git pull (creates duplicate commits)\n   └─ Or: reset to pre-rebase state\n\nPREVENTION:\n1. Always check if branch is shared\n2. Use --force-with-lease\n3. Prefer merge for shared branches\n```\n\n## The Rebase Decision Checklist\n\n```\nREBASE DECISION CHECKLIST\n==========================\n\n□ Where will this branch be used?\n  └─ Local only → REBASE allowed\n  └─ Shared\u002Fremote → Use MERGE\n\n□ What is your team's convention?\n  └─ Rebase workflow → Follow it\n  └─ Merge workflow → Use MERGE\n\n□ How complex are the changes?\n  └─ Simple → REBASE fine\n  └─ Complex → Consider MERGE\n\n□ Do you need to preserve exact history?\n  └─ Yes → MERGE\n  └─ No → REBASE\n\nRECOMMENDATION: [REBASE \u002F MERGE]\n```\n\n## Rebase Best Practices\n\n### DO\n\n1. **Rebase local branches before pushing**\n2. **Use --force-with-lease instead of --force**\n3. **Resolve conflicts completely before continuing**\n4. **Test after rebase**\n5. **Notify team when rebasing shared branches**\n6. **Use interactive rebase to clean up commits**\n\n### DON'T\n\n1. **Never rebase public\u002Fshared history**\n2. **Don't rebase if you don't understand the conflicts**\n3. **Don't ignore conflicts**\n4. **Don't force push without checking**\n5. **Don't rebase mid-PR without coordination**\n\n## Rebase Workflow Patterns\n\n### Pattern 1: Trunk-Based Rebasing\n\n```bash\n# Daily: sync with trunk\ngit checkout main\ngit pull\ngit checkout feature\u002FPROJ-123\ngit rebase main\n\n# Feature complete: PR\ngit push --force-with-lease\n```\n\n### Pattern 2: Pre-PR Cleanup\n\n```bash\n# Before creating PR, clean up commits\ngit rebase -i HEAD~5\n\n# Squash: combine related commits\n# Reword: improve commit messages\n# Drop: remove unnecessary commits\n```\n\n## Key Principles\n\n### 1. Rebase = Rewrite History\n\nEvery rebase rewrites commits. This is fine locally, dangerous on shared history.\n\n### 2. Merge Commits = Recorded Truth\n\nMerge commits show exactly when integration happened and what both branches contained.\n\n### 3. Clean History Has Value\n\nLinear history with rebase makes `git log` and `git bisect` easier.\n\n### 4. Team Convention Trumps Personal Preference\n\nIf your team uses merge, use merge. Consistency matters more than purity.\n\n### 5. When in Doubt, Merge\n\nIf you're unsure about rebasing, merge is the safer choice.\n\n## Relationship to Other Skills\n\n- `git-branch-strategy` — Branch creation affects rebase strategy\n- `git-commit` — Interactive rebase affects commit organization\n- `git-merge-resolution` — Alternative to rebasing\n- `git-history-rewrite` — More advanced history manipulation\n- `pre-commit-review` — Review process after rebase\n",{"name":5,"category":33,"priority":43,"description":7,"trigger_patterns":44},"P1",[45,46,47,48,19,49,50],"should I rebase","rebase vs merge","rebase conflict","safe rebase","rebase workflow","interactive rebase","main","b9a52d8e27455bdad953d64928696d028223ea1b","skills\u002Fcoding\u002Fgit-rebase-safety","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager","https:\u002F\u002Fgithub.com\u002FImaginerLabs","2026-04-18 16:27:13",{"source":8,"skillName":5,"commands":58,"prompt":68,"zipAvailable":69},[59,62,65],{"tool":60,"command":61},"npx","npx skills add ImaginerLabs\u002Fskill-manager --skill git-rebase-safety",{"tool":63,"command":64},"bunx","bunx skills add ImaginerLabs\u002Fskill-manager --skill git-rebase-safety",{"tool":66,"command":67},"pnpm","pnpm dlx skills add ImaginerLabs\u002Fskill-manager --skill git-rebase-safety","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fcoding\u002Fgit-rebase-safety\u002FSKILL.md",true,[],[72,97,118,138,164,181],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":38},"01M6QJCB2SD5KHC41ZDQC0GA1T","meeting-minutes","Generate concise, actionable meeting minutes for internal meetings. Includes metadata, attendees, agenda, decisions, action items (owner + due date), and follow-up steps.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fwriting\u002Fmeeting-minutes\u002FSKILL.md",[],[79,80,81,82,83,84,85,86,87,88,74,51,89,90,91,92,93,94,95,96],"meeting minutes","meeting","minutes","writing","github","copilot","generate","decisions","meetings","up","agenda","actionable","concise","follow-up","tree","true","action","for",{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":38},"01M6QJC71RRGTGNNFEHJG6S20G","documentation-writer","Diátaxis Documentation Expert. An expert technical writer specializing in creating high-quality software documentation, guided by the principles and structure of the Diátaxis technical documentation authoring framework.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fwriting\u002Fdocumentation-writer\u002FSKILL.md",[],[104,105,106,82,83,84,107,108,109,110,111,112,51,113,114,115,116,93,94,117],"documentation","documentation writer","writer","https","quality","technical","technical writer","expert","documentation expert","structure","authoring","software","principles","high",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":38},"01M6QJC0V3C7C4R9768J1AJYWY","doc-coauthoring","Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fwriting\u002Fdoc-coauthoring\u002FSKILL.md",[],[125,126,82,37,127,104,128,129,130,131,132,133,51,134,135,114,136,137,93,96],"doc coauthoring","doc","official","tasks","decision","write","context","proposals","guide","refine","iteration","trigger","co",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":144,"publishedAt":38},"01M6QJBJ0YPVEWGEXZH3PJRRTT","code-review-workflow","Executes comprehensive 4-phase code review: basic review, quality check, bundle analysis, and test coverage. Should be used when the user mentions comprehensive code review, checking code quality, or reviewing staged changes with multi-phase analysis. This is the comprehensive review workflow, distinct from focused skills like frontend-code-review, staged-code-review, or code-change-test-designer.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Ftesting\u002Fcode-review-workflow\u002FSKILL.md",[],[145,146,37,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163],"code review","review","code","code review workflow","testing","frontend","test","change","code quality","code-review","analysis","check","coverage","quality check","basic","multi","comprehensive code review","with","phase",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":38},"01M6QJB7XNHV3VEEQF4W7FMWF6","code-change-test-designer","Analyzes code changes and designs comprehensive test cases. Reads diffs, summarizes capability changes, and designs test cases covering main flows and edge cases. Should be used when the user mentions test coverage, designing tests for code changes, or analyzing diff\u002Fcommit for testing purposes. Distinguished from code-review-workflow which provides comprehensive review, this skill focuses on test case design for code changes.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Ftesting\u002Fcode-change-test-designer\u002FSKILL.md",[],[151,152,147,171,172,149,173,174,37,175,154,176,157,177,51,178,179,180,96,163],"designer","code change test designer","design","diffs","commit","edge","diff","tests","flows","which",{"skillNo":182,"name":183,"nameZh":6,"description":184,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":185,"categories":186,"keywords":187,"publishedAt":38},"01M6QJB195WD7DCJWDMKWKB29S","skill-creator","Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.","https:\u002F\u002Fgithub.com\u002FImaginerLabs\u002Fskill-manager\u002Fblob\u002Fmain\u002Fskills\u002Fmeta-skills\u002Fskill-creator\u002FSKILL.md",[],[188,189,190,191,127,192,193,194,195,196,155,197,198,199,51,200,201,93,96,183],"skill creator","creator","performance","run evals","variance analysis","create","run","benchmark","Meta","improve","edit","evals","optimize","existing skill"]