sw-sync

A repository-maintenance skill that updates Git remotes and the base branch, then identifies old local branches that are safe to remove. A Git branch is a separate line of code history used for development work.

In plain words
What is it for?
Use it to fetch and prune remotes, fast-forward the base branch when safe, preview stale branches, remove confirmed unprotected branches, and produce a sync summary.
Why use it?
It keeps a local repository current while protecting branches still used by active sessions or helper worktrees. It also reports stale work without taking over merge, rebase, or release decisions.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/obsidian-owl/specwright/sw-sync
Any agent
npx skills add Obsidian-Owl/specwright --skill sw-sync
Clone the repo
git clone --depth 1 https://github.com/Obsidian-Owl/specwright

Made for: Claude Code, Codex.

Per session 36 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,145 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00036 $0.01145
Opus 5 $0.00018 $0.00573
Sonnet 5 $0.00007 $0.00229
Haiku 4.5 $0.00004 $0.00114

Measured 2d ago against content hash f7f31769d992, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

sw-sync scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

core/skills/sw-sync/SKILL.md · 124 lines

How it starts

The opening of the file, as written. The whole thing — 124 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Specwright Sync

Goal

Keep the local repository current without deleting branches that are still claimed by a live Specwright session or a subordinate helper worktree.

Inputs

  • {projectArtifactsRoot}/config.json
  • {worktreeStateRoot}/session.json
  • {repoStateRoot}/work/*/workflow.json
  • git worktree list --porcelain

Outputs

  • Remotes fetched and pruned
  • Base branch fast-forwarded when safe
  • Candidate stale branches previewed, then deleted only after confirmation
  • Summary report: branches fetched, removed, skipped, protected, and any stale active works detected

Advisory Reporting

  • After fetch/prune completes, sw-sync may report stale active works against their recorded targets and latest known freshness state.
  • This report is advisory only and does not take ownership of reconcile-or-ship decisions away from the lifecycle skills.
  • sw-sync never rebases, merges, retargets, or clears a freshness block on behalf of sw-build, sw-verify, or sw-ship.

Constraints

Fetch (HIGH freedom):

  • Run git fetch --all --prune.

State-aware protection set (LOW freedom):

  • Build a branch protection set from:
    • the currently checked out branch
    • the configured base branch and perennial branches
    • branches recorded by live session.json files across git worktree list
    • branches recorded in attached work workflow.json.branch
    • helper branch patterns worktree-* and specwright-wt-*
  • Treat subordinate helper worktrees discovered via git worktree list --porcelain as protected branch owners even when they are not user-facing sessions.
  • Never delete a branch that appears in that protection set.

Stale branch detection (HIGH freedom):

  • Primary signal: git branch -vv entries with [gone]
  • Supplementary signal: git branch --merged against the configured base branch
  • Do not promote a branch to deletion solely because it is merged if a live session still references it.
  • Do not delete a branch when a live session or subordinate helper still claims it.
  • Classify confirmed stale branches into:
    • safe-delete for branches that should still use git branch -d
    • force-delete-candidate for [gone] branches only when they are not protected, not invalid, and not claimed by a live session or subordinate helper worktree

Read the full file on GitHub · 124 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 124 lines · 36 tokens per session scan A f7f31769d992

Subscribe to this mod's changes

sw-sync is a skill published in the GitHub repository Obsidian-Owl/specwright (9 stars, last pushed 4mo ago), licensed MIT. It adds 36 tokens to every session and 1,145 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

ai-spec-project-start

Install or upgrade SDAD; migrate an existing SDAD project; recover or repair sdad-state.yaml, INDEX, ledger, or handoff consistency; run or interpret SDAD Doctor; or diagnose the SDAD control plane. Use only for SDAD-specific bootstrap, migration, repair, and Doctor operations.

LiveTrack-X/spec-driven-ai-development · 67 tokens

phase-7-testing

Phase 7 — Test Strategy with pyramid, coverage gates, load tests, and Critical User Journeys.

exchanet/method_enterprise_builder_planning · 25 tokens

gsd-audit-milestone

Audit milestone completion against original intent before archiving.

open-gsd/gsd-core · 17 tokens

spec-kitty-charter-doctrine

Run charter interview, generation, context, and sync workflows for project governance in Spec Kitty 3.x. Access doctrine artifacts programmatically via DoctrineService. Resolve agent profiles. Load action-scoped governance context iteratively, not all at once. Triggers: "interview for charter", "generate charter"…

Priivacy-ai/spec-kitty · 135 tokens

create-mcp-server

Build, iterate, and evaluate Model Context Protocol (MCP) servers that expose external services as tools an LLM can call. Covers schema/tool design, error handling, pagination, MCP Inspector testing, and an eval set. Use when asked to "build an MCP server", "create an MCP tool", "wrap this API as MCP", "expose X to…

open-gsd/gsd-pi · 90 tokens

spk-team-auth

Handle Spec Kitty team authentication, hosted credentials, account selection, and auth-related recovery.

Priivacy-ai/spec-kitty · 22 tokens