post-merge-sync
Synchronize a local checkout after a pull request has been integrated: verify a clean worktree, switch to the base branch, fast-forward from the remote…
Skill by docs-as-code-toolkit
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/docs-as-code-toolkit-post-merge-sync
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: agent-building
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/post-merge-sync
What's inside
- Skill name
post-merge-sync- Description
- Synchronize a local checkout after a pull request has been integrated: verify a clean worktree, switch to the base branch, fast-forward from the remote, confirm the PR changes are present, and clean up local and remote PR branches when safe. Use when an agent is asked to clean up after an integrated PR or return the repository to the latest base branch.
- License
- MIT
- Instructions
- 79 lines in SKILL.md · view on GitHub
Files (1)
- SKILL.md
SKILL.md (first lines)
# Post-Merge Sync Use this workflow after a pull request has been integrated so future work starts from the updated base branch instead of an obsolete PR branch. Pull requests are normally integrated with a linear history by `gh pr merge <number> --rebase --delete-branch`; this workflow verifies the result and finishes safe local cleanup. ## Workflow 1. Inspect the current branch and worktree. 2. If unrelated local changes are present, do not switch branches until those changes are preserved or the user confirms how to handle them. 3. Identify the pull request base branch, usually `main`. 4. Switch to the base branch. 5. Fetch or pull from the remote with a fast-forward-only update. 6. Confirm GitHub reports the pull request as integrated and the base branch contains the PR changes. 7. Delete the local PR branch only when it has no unmerged local commits. 8. Delete the remote PR branch after successful integration when GitHub confirms the PR was integrated and there are no anomalies. 9. Report the final branch, latest commit, and whether cleanup was completed or skipped. Determine the base branch from the pull request metadata when possible, for example with `gh pr view <pr> --json baseRefName`, or from the repository default branch when the PR context is unavailable. ## Commands Prefer non-destructive commands: ```sh git status --short --branch git switch <base-branch> git pull --ff-only git branch --merged <base-branch> git branch -d <merged-branch> git push origin --delete <merged-branch> ``` Use the actual base branch when the pull request targeted something other than `main`. When a separate fetch step is clearer, prefer: ```sh git fetch origin git merge --ff-only origin/<base-branch> ``` Run `git fetch --prune origin` before listing merged branches when remote branch state may be stale. If GitHub already deleted the remote branch, treat that as a successful no-op. ## Safety Rules - Never use `git reset --hard` for post-merge cleanup. - Never delete a branch with `git branch -D` unless the user explicitly asks for forced deletion and understands that unmerged local commits may be lost. - Do not delete local or remote branches when there are warning signs, such as failed or unknown checks, unresolved merge state, a diverged local branch, unpushed local commits, uncertain PR state, or unclear branch ownership. Report the situation and let the developer decide. - Delete the remote PR branch by default after successful integration when GitHub confirms the PR was integrated and no warning signs are present. - If the remote update cannot fast-forward, stop and explain the divergence. Preserve local commits by creating a backup branch before asking the user how to proceed. - If the branch was already deleted locally or remotely, report that as a harmless no-op. ## Relationship To Issue Implementation After a pull request opened through `../implement-issue-workflow/SKILL.md` is merged, use this skill to return the checkout to the latest base branch before starting new issue work.
From docs-as-code-toolkit/architecture-knowledge-toolkit, MIT.
More from docs-as-code-toolkit/architecture-knowledge-toolkit
- 0.569score
adr
docs-as-code-toolkit
Create proposed Architecture Decision Records and analyze their impact on related architecture artifacts.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
architecture-impact
docs-as-code-toolkit
Analyze and document architecture impact for feature requests, Epic issues, UserStory issues, refactoring tasks, issue implementation, and review tasks.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
clock-in
docs-as-code-toolkit
Start a working session from repository evidence instead of memory, pick up one topic, and orient both the project layer and the user's private journal.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
clock-out
docs-as-code-toolkit
End a working session by refreshing the topics touched, writing the project diary entry, and carrying the day's findings up into the user's private journal.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
convergence-check
docs-as-code-toolkit
Check that a completed change tells one consistent story across request, behaviour specification, architecture knowledge, implementation, tests, and delivery…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
implement-issue-workflow
docs-as-code-toolkit
Implement GitHub issue work using the repository workflow: start from the latest main branch, create an issue_<number> branch, make focused changes, verify…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
pr-review
docs-as-code-toolkit
Review GitHub pull requests and proposed branch changes for correctness, regressions, missing tests, documentation-contract violations, traceability gaps, and…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
risk
docs-as-code-toolkit
Create proposed architecture risk artifacts and analyze their traceability to ADRs, quality scenarios, requirements, components, controls, and evidence.
SkillBFreshness: B★ 4Claude Code +9 - 0.524score
presentation
docs-as-code-toolkit
Create or update docs-as-code presentation material as AsciiDoc reveal.js decks rendered with docs-toolbox.
SkillCFreshness: C★ 4Claude Code +9 - 0.519score
traceability-review
docs-as-code-toolkit
Review explicit architecture traceability metadata for gaps, inconsistencies, unsupported claims, stale links, dangling references, and metamodel violations.
SkillCFreshness: C★ 4Claude Code +9 - 0.519score
bdd-specification
docs-as-code-toolkit
Enforce Living Documentation through Behaviour-Driven Development by writing a language-agnostic Gherkin feature specification for any new or changed…
SkillCFreshness: C★ 4Claude Code +9 - 0.519score
slice-issues
docs-as-code-toolkit
Slice GitHub parent issues into reviewable real sub-issues.
SkillCFreshness: C★ 4Claude Code +9
Signals
- Stars
- 4
- Forks
- 2
- Open issues
- 44
- Last commit (this folder)
- Jul 7, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from docs-as-code-toolkit
- 0.569score
architecture-impact
docs-as-code-toolkit
Analyze and document architecture impact for feature requests, Epic issues, UserStory issues, refactoring tasks, issue implementation, and review tasks.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
adr
docs-as-code-toolkit
Create proposed Architecture Decision Records and analyze their impact on related architecture artifacts.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
clock-in
docs-as-code-toolkit
Start a working session from repository evidence instead of memory, pick up one topic, and orient both the project layer and the user's private journal.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
clock-out
docs-as-code-toolkit
End a working session by refreshing the topics touched, writing the project diary entry, and carrying the day's findings up into the user's private journal.
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
convergence-check
docs-as-code-toolkit
Check that a completed change tells one consistent story across request, behaviour specification, architecture knowledge, implementation, tests, and delivery…
SkillBFreshness: B★ 4Claude Code +9 - 0.569score
implement-issue-workflow
docs-as-code-toolkit
Implement GitHub issue work using the repository workflow: start from the latest main branch, create an issue_<number> branch, make focused changes, verify…
SkillBFreshness: B★ 4Claude Code +9
Cite this page
post-merge-sync skill. Agent Mart. https://agentmart.dev/skills/docs-as-code-toolkit-post-merge-sync (last updated 2026-10-24)