sync-repo
Skill9 starsChanged 50 days agoMITView on GitHub
Sync the current repository with trunk. Commit only the files that this session changed, push them, raise a PR to trunk, approve it, complete it with a merge commit, and pull trunk back down. Works in the main repository and in a worktree. Use only when Mr. Das asks for it.
- Commits and pushes
2 other projects use a version of this.
Adopted by
Most recently taken up by
- ronaksharma-simform/claude-skillstheir own version, first seen Sep 18, 2026
- jparkerweb/ai-assist-skillstheir own version, first seen Aug 20, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- jparkerweb/ai-assist-skills★ 88same name
- ronaksharma-simform/claude-skills★ 0same 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 repository8 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- blindspotsSkill
- broSkill
- coding-loopSkill
- interview-feedbackSkill
- teamsSkill
- yagniSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
23 rules. About 0 are common, 19 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈19
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 12
Use this skill to put the work of this session on trunk in one step.
- Distinctive: line 24
Commit only the files that this session changed.
- Distinctive: line 27
Do not force push. Do not bypass hooks.
- Distinctive: line 28
Do not switch branches. Do not create worktrees.
- Distinctive: line 29
Do not update the main repository when you run from a worktree.
- Distinctive: line 30
If a step fails, stop. Report the step, the command, and the error.
- Very specific: line 31
Run each git command to origin with -c credential.helper= -c "http.extraheader=AUTHORIZATION: bearer <token>", with the token from az …
- Distinctive: line 35
Run these commands in the current working directory:
- Distinctive: line 46
If the current branch is empty (detached HEAD), stop.
- Distinctive: line 60
If the session history was compacted, also query the local session store for the current session:
- Distinctive: line 67
Run git status --porcelain.
- Distinctive: line 69
If a session file also has changes from a different session, you cannot split them.
- Distinctive: line 72
If no session file has a change, go to step 4.
- Distinctive: line 82
Do not use git add ., git add -A without paths, or git commit -a.
- Distinctive: line 83
Make sure that git diff --cached --name-only shows only the session files.
- Distinctive: line 84
Commit. Write the message in Plain Language.
- Very specific: line 89
If nothing is ahead of trunk, there is nothing to merge.
- Distinctive: line 97
If the push is rejected because the remote branch moved, stop.
- Distinctive: line 109
If there is no PR, create one.
- Very specific: line 129
Read the status until it is completed.
- Very specific: line 135
If a policy or a merge conflict blocks the completion, stop.
- Distinctive: line 147
If the fast-forward fails, stop.
- Distinctive: line 165
All warnings (for example, a file with changes from a different session).
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 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.
Files
Sync the repository
Use this skill to put the work of this session on trunk in one step.
Preconditions
- Mr. Das asked for the sync. The skill commits to trunk through a PR. This is permitted only by the exemption in guardrail 3. Do not run it for a different human or for unattended agent work.
az loginis done. Theazure-devopsextension ofazis installed.- The branch policy of trunk lets the PR author approve their own PR.
Rules
- Commit only the files that this session changed. Other sessions can work in the same repository at the same time. Do not stage, stash, reset, or discard a file that this session did not change.
- Do not force push. Do not bypass hooks. Do not bypass branch policies.
- Do not switch branches. Do not create worktrees.
- Do not update the main repository when you run from a worktree.
- If a step fails, stop. Report the step, the command, and the error.
- Run each git command to
originwith-c credential.helper= -c "http.extraheader=AUTHORIZATION: bearer <token>", with the token fromaz account get-access-token --resource 499b84ac-1321-427f-aa17-267ca6975798.
Step 1: Find the context
Run these commands in the current working directory:
git rev-parse --show-toplevel
git branch --show-current
git symbolic-ref --short refs/remotes/origin/HEAD
git remote get-url origin- Trunk is the output of the third command without
origin/. If the command fails, use the fallback indocs/design.md. - If the current branch is empty (detached HEAD), stop.
- Get the organization, project, and repository from the remote URL. The URL
has the form
https://<user>@dev.azure.com/<org>/<project>/_git/<repo>. Use--org https://dev.azure.com/<org>in allaz reposcommands. - Set the source branch:
- On trunk:
sync/<yyyyMMdd-HHmmss>, with the local time. - On a different branch (for example
wi/<id>in a worktree): the current branch.
- On trunk:
Step 2: Find the files of this session
- List each file that this session created, edited, renamed, or deleted. Use your tool history. Include files that shell commands of this session changed (for example a move or a generated file).
If the session history was compacted, also query the local session store for the current session:
SELECT DISTINCT file_path FROM session_files WHERE session_id = '<current session id>'- Run
git status --porcelain. Keep only the session files that have a change. Record the other changed files as "not touched". - If a session file also has changes from a different session, you cannot split them. Commit the file and tell the human in the report.
If no session file has a change, go to step 4.
Step 3: Commit
Stage only the session files. This also stages deletions:
git add -A -- <path1> <path2> ...Do not use
git add .,git add -Awithout paths, orgit commit -a.- Make sure that
git diff --cached --name-onlyshows only the session files. - Commit. Write the message in Plain Language. Use a subject of 72 characters or fewer and a short body. Add the commit trailers of the current session.
Step 4: Push
If nothing is ahead of trunk, there is nothing to merge. Go to step 7. To
find out, run git rev-list --count origin/<trunk>..HEAD. A result of 0 means
that nothing is ahead.
git push origin HEAD:refs/heads/<source branch>If the push is rejected because the remote branch moved, stop.
Step 5: Raise the PR
Find an active PR from the source branch to trunk:
az repos pr list --org <org url> --project <project> --repository <repo> `
--source-branch <source branch> --target-branch <trunk> --status active `
--query "[0].pullRequestId" -o tsvIf there is no PR, create one. Write the title and description in Plain Language:
az repos pr create --org <org url> --project <project> --repository <repo> `
--source-branch <source branch> --target-branch <trunk> `
--title "<title>" --description "<description>" --query pullRequestId -o tsvStep 6: Approve and complete the PR
az repos pr set-vote --org <org url> --id <pr id> --vote approve
az repos pr update --org <org url> --id <pr id> --status completed --squash false `
--delete-source-branch <true for sync/ branches, false for other branches> `
--merge-commit-message "<PR title>"--squash falsemakes a merge commit (no fast-forward). Awi/<id>branch then stays in step with trunk. Do not delete awi/<id>branch.Read the status until it is
completed. Wait up to 5 minutes:az repos pr show --org <org url> --id <pr id> --query "{status:status, merge:mergeStatus}"- If a policy or a merge conflict blocks the completion, stop. Do not use
--bypass-policy.
Step 7: Pull trunk down
git fetch origin --prune
git merge --ff-only origin/<trunk>- The merge commit of the PR has the local commit as a parent. Thus a fast-forward is the expected result.
- If the fast-forward fails, stop. Do not stash, reset, or make a merge commit. A typical cause: trunk changes a file that has uncommitted changes of a different session.
On a branch other than trunk, push the branch again so that the remote branch is equal to the local branch:
git push origin HEAD:refs/heads/<source branch>
Step 8: Report
Tell the human:
- The PR, as a link with short text, for example
[PR #123](url). - The merge commit on trunk.
- The files that you committed.
- The changed files that you did not touch.
- All warnings (for example, a file with changes from a different session).
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.

