Agent SkillsasJEI/vscode › sync

sync

GitHub

同步当前会话分支与上游,或发布至远程。处理拉取、变基、推送及设置上游。若分支已同步则跳过;有未提交更改先提交。冲突时询问用户。新分支需选择远程并设置上游。严禁无批准强制推送或丢弃提交。

src/vs/sessions/skills/sync/SKILL.md asJEI/vscode

触发场景

sync a branch pull latest changes rebase onto upstream push current branch publish branch set upstream

安装

npx skills add asJEI/vscode --skill sync -g -y
更多选项

非标准路径

npx skills add https://github.com/asJEI/vscode/tree/main/src/vs/sessions/skills/sync -g -y

不安装直接使用

npx skills use asJEI/vscode@sync

指定 Agent (Claude Code)

npx skills add asJEI/vscode --skill sync -a claude-code -g -y

安装 repo 全部 skill

npx skills add asJEI/vscode --all -g -y

预览 repo 内 skill

npx skills add asJEI/vscode --list

SKILL.md

Frontmatter
{
    "name": "sync",
    "description": "Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream."
}

Sync Changes

Sync the current session branch with its upstream branch, or publish the current session branch to a remote. Use when the user asks to sync a branch, pull latest changes, rebase onto upstream, push current branch, publish branch, or set upstream.

Guidelines

  • Never force-push (--force, --force-with-lease) without explicit user approval.
  • Never skip pre-push hooks (do not use --no-verify).
  • Never rewrite or drop commits during rebase without asking the user.
  • When in doubt about conflict resolution — ask the user.

Workflow

  1. Check for uncommitted changes first. If there are uncommitted changes, use the /commit skill to commit them before continuing.
  2. Check whether the current session branch has an upstream branch.
  3. If the current session branch has an upstream branch: 3.1. Fetch the upstream remote first so tracking refs are up to date.
    git fetch <upstream-remote>
    
    3.2. Check ahead/behind counts. If the branch is already in sync (0 ahead, 0 behind), stop and report that no sync is needed.
    git rev-list --left-right --count HEAD...@{u}
    
    3.3. If behind, rebase onto the upstream tracking branch.
    git rebase @{u}
    
    3.4. If there are merge conflicts, resolve them by preserving the intent of both sides. Stage the resolved files and continue the rebase.
    git add <resolved-files>
    git rebase --continue
    
    If conflict resolution is unclear, ask the user how to proceed. If the user wants to stop the rebase, abort it:
    git rebase --abort
    
    3.5. If the branch has local commits (ahead > 0), push them to the remote after a successful rebase.
    git push
    
    If the push is rejected because the rebase rewrote history, explain the situation to the user and ask for approval before force-pushing.
  4. If the current session branch does not have an upstream branch: 4.1. Determine the remote to publish to.
    • If there is only one remote, use it.
    • If there are multiple remotes, use the #tool:vscode/askQuestions tool to ask which remote to use. 4.2. Publish the current branch and set upstream in one step.
    git push -u <remote> HEAD
    

Validation

After the workflow completes, validate the result with explicit checks:

  1. Verify the working tree is clean:
    git status --porcelain
    
  2. Verify sync state (ahead/behind counts are both 0):
    git rev-list --left-right --count HEAD...@{u}
    
  3. If the branch was newly published, verify the upstream branch is configured:
    git rev-parse --abbrev-ref --symbolic-full-name @{u}
    

版本历史

  • ce4db66 当前 2026-07-19 08:58

同 Skill 集合

.agents/skills/launch/SKILL.md
.github/skills/accessibility/SKILL.md
.github/skills/add-policy/SKILL.md
.github/skills/agent-host-e2e-tests/SKILL.md
.github/skills/agent-host-logs/SKILL.md
.github/skills/author-contributions/SKILL.md
.github/skills/auto-perf-optimize/SKILL.md
.github/skills/azure-pipelines/SKILL.md
.github/skills/chat-customizations-editor/SKILL.md
.github/skills/chat-perf/SKILL.md
.github/skills/code-oss-logs/SKILL.md
.github/skills/component-fixtures/SKILL.md
.github/skills/cpu-profile-analysis/SKILL.md
.github/skills/design-philosophy/SKILL.md
.github/skills/fix-ci-failures/SKILL.md
.github/skills/fix-errors/SKILL.md
.github/skills/heap-snapshot-analysis/SKILL.md
.github/skills/hygiene/SKILL.md
.github/skills/integrated-browser/SKILL.md
.github/skills/integration-tests/SKILL.md
.github/skills/memory-leak-audit/SKILL.md
.github/skills/otel/SKILL.md
.github/skills/sessions/SKILL.md
.github/skills/smoke-tests/SKILL.md
.github/skills/symbolicate-crash-dump/SKILL.md
.github/skills/tool-rename-deprecation/SKILL.md
.github/skills/unit-tests/SKILL.md
.github/skills/update-screenshots/SKILL.md
.github/skills/ux-css-layout/SKILL.md
.github/skills/ux-theming/SKILL.md
.github/skills/vscode-dev-workbench/SKILL.md
extensions/copilot/.agents/skills/anthropic-sdk-upgrader/SKILL.md
extensions/copilot/.agents/skills/launch/SKILL.md
src/vs/sessions/skills/act-on-feedback/SKILL.md
src/vs/sessions/skills/code-review/SKILL.md
src/vs/sessions/skills/commit/SKILL.md
src/vs/sessions/skills/create-draft-pr/SKILL.md
src/vs/sessions/skills/create-pr/SKILL.md
src/vs/sessions/skills/fix-ci/SKILL.md
src/vs/sessions/skills/generate-run-commands/SKILL.md
src/vs/sessions/skills/merge/SKILL.md
src/vs/sessions/skills/sync-upstream/SKILL.md
src/vs/sessions/skills/troubleshoot/SKILL.md
src/vs/sessions/skills/update-pr/SKILL.md
src/vs/sessions/skills/update-skills/SKILL.md
extensions/copilot/.agents/skills/github-copilot-upgrader/SKILL.md

元信息

文件数
0
版本
ce4db66
Hash
db067254
收录时间
2026-07-19 08:58

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-07-21 18:17
浙ICP备14020137号-1 $访客地图$