workspace-sync
Skill97 starsChanged 57 days agoApache-2.0View on GitHub
Deterministic synchronization of trunk, PR evaluation worktrees, and drift reporting in Deliberate Lab's bare repository workspace.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- voxlo-dev/Lean-Coding-Workspacetheir own version, first seen Nov 8, 2026
- flurdy/agent-skillstheir own version, first seen Nov 1, 2026
- mazze93/claude-code-skillstheir own version, first seen Nov 1, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- flurdy/agent-skills★ 9same name
- voxlo-dev/Lean-Coding-Workspace★ 2same name
- mazze93/claude-code-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- frontend/AGENTS.mdAGENTS.md
- functions/AGENTS.mdAGENTS.md
- scripts/AGENTS.mdAGENTS.md
- utils/AGENTS.mdAGENTS.md
- eval-prSkill
- ghSkill
- pr-test-planSkill
- retrospectiveSkill
- workspace-overviewSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 1 is distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
1
Distinctive
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
- Very specific: line 62
Dependency Notice: If package.json or package-lock.json changed during the update, reminds you to run npm ci in that worktree.
- Distinctive: line 66
If a feature branch is behind, suggests running git rebase main inside that worktree when the author is ready.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Workspace Sync
Synchronize all branches and worktrees in Deliberate Lab's bare repository layout against upstream and origin.
This skill replaces manual, multi-step git operations with a single deterministic automation script that fast-forwards trunk, mirrors PR evaluation worktrees, identifies merged/closed PRs for cleanup, and reports feature branch drift.
When to use
Invoke this skill when asked to:
- "Sync workspace"
- "Update all PR worktrees"
- "Pull latest changes"
- "Catch up with upstream"
- "Check branch drift"
- "Sync my fork"
Procedure
1. Run the Synchronization Script
From any worktree directory or the parent repository container:
./.agents/skills/workspace-sync/scripts/workspace-sync.shTo preview changes without altering any git refs or worktree checkouts:
./.agents/skills/workspace-sync/scripts/workspace-sync.sh --dry-runTo only sync trunk and feature branch status without touching PR worktrees:
./.agents/skills/workspace-sync/scripts/workspace-sync.sh --skip-pr-mirrorThe script visibly echoes the underlying git commands by default (prefixed with [dry-run] during dry-run mode) and formats all worktree targets with actionable relative paths. If the sync report exceeds 7 KB, it automatically saves to a temporary file via mktemp and provides the path for lossless inspection via view_file (ADR 0003).
2. Understanding the Execution Phases
The script executes four deterministic stages:
- Remote Pruning: Runs
git fetch --all --pruneto refresh all remotes and clean up deleted remote-tracking refs. - Trunk Synchronization (
main):- Ensures
main/is clean before touching it. - Fast-forwards
maintoupstream/main(git merge --ff-only upstream/main). - Pushes
maintoorigin/mainto keep your personal fork in sync.
- Ensures
- PR Worktree Mirroring (
pr-<number>):- Finds all sibling worktrees matching
pr-[0-9]*. - Safety First: Any worktree with uncommitted changes (
git status --porcelain) is skipped to prevent data loss. - Lifecycle Awareness & Automated Cleanup: Queries GitHub CLI (
gh pr view) to see if the PR isMERGEDorCLOSED. If so and the worktree is clean, automatically removes the worktree (git worktree remove) and deletes the local branch (git branch -D), keeping the workspace free of zombie checkouts. - Exact Mirroring: For open PRs, fetches
upstream pull/<number>/headand resets the local branch toFETCH_HEAD. - Dependency Notice: If
package.jsonorpackage-lock.jsonchanged during the update, reminds you to runnpm ciin that worktree.
- Finds all sibling worktrees matching
- Feature Branch Drift Awareness:
- Inspects active development branches (e.g.
<issue>-<slug>). - Reports commit counts ahead and behind
main. - If a feature branch is behind, suggests running
git rebase maininside that worktree when the author is ready.
- Inspects active development branches (e.g.
Safety Rules
- Never rebase or merge PR evaluation worktrees: External PRs must remain exact mirrors of their upstream head.
- Never clobber dirty worktrees: Any worktree with unstaged or uncommitted changes is protected and skipped.
- Do not auto-rebase active feature branches: Feature branches may be in the middle of active development or testing. The script only reports divergence; rebasing is left to the developer or agent at an intentional time.
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
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.

