Skip to content

Commit 8ce4cb7

Browse files
authored
sessions: add sync-upstream built-in skill (microsoft#305771)
* feat: add update-branch skill for rebasing session branches * fix: update description for update-branch skill to clarify usage * feat: add sync-upstream skill for rebasing session branches
1 parent 5df4732 commit 8ce4cb7

1 file changed

Lines changed: 31 additions & 0 deletions

File tree

  • src/vs/sessions/skills/sync-upstream
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: sync-upstream
3+
description: Update a stale session branch by rebasing onto the latest origin. Use when the upstream has moved significantly and the session needs to catch up, resolving conflicts by preserving upstream changes and adapting session work to fit.
4+
---
5+
<!-- Customize this skill and select save to override its behavior. Delete that copy to restore the built-in behavior. -->
6+
7+
# Update Branch
8+
9+
Rebase the current session branch onto the latest upstream so the work stays grounded in origin.
10+
11+
## Workflow
12+
13+
1. If there are uncommitted changes, use the `/commit` skill to commit them first.
14+
2. Fetch the latest upstream and rebase onto it:
15+
```
16+
git fetch origin
17+
git rebase origin/main
18+
```
19+
Use the appropriate base branch if it is not `main`.
20+
21+
## Conflict Resolution
22+
23+
When conflicts arise, **upstream always wins**:
24+
25+
- **Never alter upstream logic, APIs, or patterns** to accommodate session changes.
26+
- **Adapt session work** to fit the new upstream — rename, restructure, or rewrite as needed while preserving the session's goals.
27+
- After resolving each conflict, `git add` the files and `git rebase --continue`.
28+
29+
## Validation
30+
31+
After the rebase completes, verify the result still compiles and meets the session's objectives. If session changes no longer make sense against the updated upstream, explain what changed and propose a revised approach.

0 commit comments

Comments
 (0)