agentleFS
AirMileAirMile/claude-config/skills/project-sync/SKILL.md

project-sync

Skill0 starsChanged 4 months agoMITView on GitHub

Sync durable .project/ state via the state branch. Use with /project-sync.

2 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    All procedures live in .claude/skills/shared/STATE-SYNC.md.

    line 18

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Project Sync

Sync the durable subset of a project's gitignored .project/ folder across your own devices, via the orphan branch claude/state. Backlog, dashboard, seed, learnings, archive, and feature dossiers travel with the repo without ever being tracked on a working branch — Model A stays intact.

All procedures live in .claude/skills/shared/STATE-SYNC.md; this skill wires them to the push / pull / status modes and reports the result.

Trigger

/project-sync [push|pull|status] — no argument → mode is chosen in PHASE 1.

Platform

Detect platform: Windows ($PSVersionTable exists) → PowerShell; macOS/Linux → bash. Command variants for both OSes are in shared/STATE-SYNC.md.

Process

PHASE 0: Pre-flight

Follow shared/STATE-SYNC-PUSH.md § Preflight & temp-worktree hygiene. Concretely:

  1. Main-checkout gate — compute main_root / current_root. If current_root != main_root → exit: "project-sync only runs on the main checkout. You are in worktree {current_root}. Run ExitWorktree(action: keep) first, then retry." (Worktree .project/ is symlinks back to main.)
  2. Repo + remote — inside a git repo with a non-empty git remote; else exit: "state sync requires a git remote."
  3. .project/ exists — else exit: "no .project/ to sync — run /core-setup first."
  4. Hygiene — git worktree prune; remove any dangling $STATE_WT.
  5. Branch resolution — per shared/STATE-SYNC.md § 2. If project.json#team.mode == "team" and no branch is recorded in .project/session/state-sync.json, and the mode (PHASE 1) is push → AskUserQuestion for the branch name (first option claude/state-{user} = recommended). Persist the choice.

PHASE 1: Mode dispatch

Argument push / pull / status. No argument → AskUserQuestion:

  • "Status (Recommended)" — show what would sync, change nothing
  • "Push" — send local durable state to the state branch
  • "Pull" — bring remote state into this device

PHASE 2: Execute

  • status — git fetch origin "$STATE_BRANCH"; show the resolved branch, remote SHA vs state-sync.json#lastSyncedSha, local drift (the collect-into-LAST-worktree check from STATE-SYNC.md § 7, reported as a changed-file count), and last push/pull timestamps. No writes.
  • push — follow shared/STATE-SYNC-PUSH.md § Push procedure (incl. first-time orphan and push-rejected retry). Update state-sync.json.
  • pull — follow shared/STATE-SYNC.md § 7 (Pull procedure & conflict matrix). Update state-sync.json.

PHASE 3: Report

ASCII table:

STATE SYNC ─ {mode}
───────────────────────────────────────────
Branch          claude/state[-user]
Remote SHA      {shortsha}   (was {last shortsha})
Pushed          {n} file(s)  | —
Pulled          {n} file(s)  | —
Merged          {n} file(s)  | —
Conflicts       {n resolved} | —
lastSyncedSha   {shortsha}
───────────────────────────────────────────

Fill only the rows relevant to the mode (status shows drift counts, no SHA change).

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.