synchronizing-local-and-github-state

Reconciles local and GitHub repository state with concurrent-change preflight and exact-SHA verification.

Updated Jul 9, 2026
One-click install
npx skills add https://github.com/alsdmlals4-eng/Base --skill synchronizing-local-and-github-state-alsdmlals4-eng
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: synchronizing-local-and-github-state
Source: https://github.com/alsdmlals4-eng/Base/tree/main/skills/synchronizing-local-and-github-state
Command: npx skills add https://github.com/alsdmlals4-eng/Base --skill synchronizing-local-and-github-state-alsdmlals4-eng

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Concurrent agents and developers working on the same GitHub repository risk overwriting each other's work, merging stale branches, or treating open PRs as free to mutate. This Skill provides a disciplined protocol for comparing, reconciling, publishing, and verifying local and GitHub state without destroying divergent history or bypassing review gates. ## Core Features & Use Cases - Concurrent-change preflight: Classifies workstream ownership, path and semantic overlap, and open PR state before any write, returning outcomes like CLEAR, STALE_BASE_SHA, WAITING_RESOURCE, DUPLICATE_WORK, or BLOCKED_UNVERIFIED. - Copy-integration workflow: Reproduces approved material deltas from latest main on a separate provisional integration branch instead of mutating open owner PRs, with absorbed/residual delta accounting. - Capability fallback and recovery: Routes GitHub operations through an authenticated connector when the gh CLI or local push auth is missing, and recovers safely from HTTP 409 stale-write conflicts, cancelled CI runs, and moved main branches. - Use Case: An AI agent about to push changes detects an open PR touching the same schema registry, keeps it read-only, rebases onto latest main, publishes via the GitHub connector, and verifies the exact post-merge main SHA. ## Quick Start Ask the AI to check whether my current branch is safe to publish to GitHub and reconcile it with the latest main before opening a pull request.

Frequently Asked Questions about synchronizing-local-and-github-state

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely sync a local branch with GitHub when others are working on the same repo?

Run a concurrent-change preflight before the first write: record the source and current main SHAs, intended paths, semantic resource locks, and open same-goal PRs. Only write when the result is CLEAR or an authorized provisional integration, and re-run the preflight before PR creation and merge.

What should I do when the GitHub CLI is not installed or push authentication fails?

Treat a missing gh CLI as MISSING_OPTIONAL_CLI, not a blocker. Prefer an authenticated GitHub connector for remote operations, keep local Git for local evidence, and use gh only for capabilities the connector does not cover. If no provider supports the required capability, report BLOCKED_UNVERIFIED.

How do I recover from an HTTP 409 or non-fast-forward error on GitHub?

Never blind-retry a stale write. Re-read the exact current blob or head SHA, compare your intended delta against the current content, preserve newer material, apply only the missing delta, and re-run regression checks before publishing again.

Can I merge or modify an open pull request that overlaps with my task?

Open, draft, or ready PRs are read-only by default regardless of inferred owner activity. Mutation requires explicit user authorization naming the PR number and allowed action; otherwise follow-up work starts from the latest completed main on a separate branch.

Does a cancelled CI run count as a passing check before merge?

No. A cancelled run is neither PASS nor a code failure. Look for a newer authoritative run on the same exact head, rerun cancelled or failed jobs on that head if none exists, and never promote NOT_RUN, BLOCKED, or CANCELLED states to PASS.