/repo-platform-skills:repo-platform-sync-prfrom Repo Platform Skills
Handle an automated sync PR from Vivswan/repo-platform - read its report, clear every row, keep local content in its owned place, and follow the failure path. Use when a PR arrives on branch automation/repo-platform, for "the repo-platform bot PR", "the sync PR", "the automation branch PR", when a sync PR says "Hold for review: yes", reports "replaced local edits", a held retirement, or a replaced mirror, when "the sync PR deleted my local section", or when a "[repo-platform] sync failed" issue appears in the repository.
Ships in Repo Platform Skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The platform writes its files into managed repos from the outside. A sync run opens (or refreshes) one PR on the automation/repo-platform branch for each repo whose tree differs from the build; a repo already matching gets none, and its stale sync PR is closed.
The PR body is the writer's report, and this skill is how to read that report, decide every row, and escalate when the sync itself failed.
Work in this order, always:
automation/repo-platformHold for review: yes[repo-platform] sync failed issue appeared in the repositoryfiles/ tree (managed files whole, split files only between their BEGIN/END REPO-PLATFORM MANAGED markers, starters once when absent). The one rendered file is .github/settings.yml, folded from the fleet settings layers and the repo's own .github/settings.local.yml. Nothing is three-way merged and no conflict marker ever lands in the branch..github/repo-platform-manifest.json, which records a hash per managed file and per split region. A managed file, or a split region, whose content is neither the recorded hash nor the new content is replaced and reported with a diff.all-green, plus pr-title where selected). A run dispatched with manual=true, or any hold reason, waits for a human.Find and open the PR from the repo:
gh pr list --head automation/repo-platform --json number,title,url
gh pr view <number>
Exactly one open sync PR should exist per repo; when none exists, or more than one does, stop and report that instead of guessing.
| Section | Content | What to verify |
|---|---|---|
| header | Build sha, the modules the registration selected, the visibility | The module list matches .repo-platform.yml; visibility matches the repo |
| Written | one row per selected path: class and change (created, updated, unchanged, replaced local edits, region added, held) | Each change per the Written table below. A starter is only ever created, unchanged, or held |
| Replaced local edits | one unified diff per replaced file or region (40 lines shown, the rest counted) | Decide per diff: the content moves into a repo-owned hook or upstream, or it was a stray edit and goes |
| Retired | one row per file the platform no longer writes here: deleted, region removed, held, released | Each outcome per the Retired table below |
| Registration notes | one line per note: an unreadable manifest, a placeholder with no value, a manifest record at an unclean path, a stale record no entry declares, a mirror record no declaration reaches, or an except path no entry writes (the exact forms below) | Fix the registration. An unreadable manifest is rewritten by this sync; a managed file or region that differs from the incoming content reads as replaced in the same report. A dropped mirror record means that copy is the repository's own now |
| Mirrors | one row per declared target: written, current, replaced local edits (its diff below), replaced with a detail naming what was removed | replaced local edits: decide per diff like a managed file; replaced: a directory stood at the target or a file where a directory had to be, and the diff shows what went. A declaration the writer cannot honour never reaches the report: the sync fails instead (the failure path below) |
| Review | Hold for review: yes with one line per reason, or no | Every listed reason resolved before merging |
The Written changes:
| Change | What to verify |
|---|---|
created | the path was absent before: a first sync, a new module, or a path the platform newly declares for a selected module |
updated, unchanged | need no look |
replaced local edits | a managed file, or a split file's region; its diff is below |
region added | a split file that had no markers, its whole prior content now below the new region |
held | wrote nothing; its Detail says why (the list below) |
The Retired outcomes:
| Outcome | What it did |
|---|---|
deleted | removed the platform's own content |
region removed | took the managed region and its markers out of a split file and left the repository-owned content as a plain file; the record leaves with it, so the row appears once |
held | left a file whose content differs from the recorded write, for your decision |
released | dropped the record of a path the registration's except names and touched nothing (yours) |
The Registration notes, exactly:
.github/repo-platform-manifest.json <problem>; every existing file is judged as unrecorded: the manifest could not be read, so this sync rewrites itplaceholder `{{<name>}}` has no value: set <key> in .repo-platform.yml: every file rendering that placeholder is held; an empty value counts as nonemanifest record for `<path>` ignored: the path <problem>: an unclean pathmanifest record for `<path>` had no writer: no files.yml entry declares the path now; it is retired as a stale record (the Retired row has the outcome): read that Retired row; deleted removed a file the record vouched for, held left one it did not, for your decision (the Held retirement case below)manifest record for `<path>` dropped: no mirror in .repo-platform.yml reaches it now, so the file is the repository's own (a mirror declared again adopts it while it still holds the source's content)`except` names `<path>`, a path no files.yml entry writes: the registration excepts a path the platform never writes; remove it from except, or spell the path files.yml writesThe held details of a Written row, exactly:
a symbolic link sits where a file is declared (a managed or split entry; the writer never reads through a link)a regular file sits where a link is declaredno value for {{<placeholder>}} (a Registration note names the key to set)<what> sits at the path, and the writer will not replace it: a directory, or something that is neither a regular file nor a link, stands where an entry of any class is declaredThree more held details land on the rendered .github/settings.yml; the Settings row of the table below says what to do:
no overlay at .github/settings.local.yml (its starter is held or missing).github/settings.local.yml is <what>, which the render does not read through: a directory, a symbolic link, or something that is not a regular file stands at the overlay path.github/settings.local.yml, or a tracking label the plan refuses, in the plan's wordsA written row (replaced local edits, region added, unchanged) may carry the detail class changed from <old> to <new>; the record was stale, so the file was judged unrecorded.
That detail means the recorded class differs from the one the selection declares now, and the file was not provably the platform's last write. So the sync judges it as an unrecorded file by the declared class and restamps a successful outcome; the change says what that outcome was.
The hold reasons, exactly:
local edits replaced in <path><path>: the managed region was added above repository-owned content<path> held: <detail>retirement of <path> held: <detail>retirement of <path>: the managed region was removed and the repository-owned content keptmirror <target> replaced: <detail>registration: <note>The report lists what the writer did; the diff is what lands. Compare them before pushing any repair commit of your own (afterwards, diff the sync's own commit instead: git diff origin/main...<sync commit>):
gh pr diff <number> --name-only
Every changed path must be one of:
unchangeddeleted or region removedwritten, replaced local edits, or replaced (a replaced row also explains the deleted paths under its target and the ancestor file its detail names).github/repo-platform-manifest.json (rewritten every sync, no row)Any other path with no row in the sync's own commit is a sync bug: do not merge, report it on Vivswan/repo-platform.
One exception: a body carrying a section-ending warning of the form <N> characters of this section were cut to fit GitHub's body limit. lost the rows after the cut. Read those paths' classes from .github/repo-platform-manifest.json (the PR head's; the base's for a path the sync retired) and judge them by references/file-ownership.md instead.
A replaced diff cut at 40 lines is read in full from git:
git fetch origin main automation/repo-platform
git diff origin/main...origin/automation/repo-platform -- <path>
| Case | What happened | What to do |
|---|---|---|
| Replaced local edits | Someone edited a managed file (ci.yml, a module workflow, a pin dotfile) or the managed region of a split file | Read the diff; move the need (below). The platform version stays |
| Held retirement | A file the platform stopped writing here differs from its recorded write: a managed file edited, a split file's region edited or its markers gone | Keep what matters, delete the rest yourself; the row returns every sync until the file is gone |
| Removed region | A split file the platform stopped writing here carried repository-owned content around its recorded region: the region and its markers went, the rest stayed as a plain file | Read the file that remains; it is yours now, and no row returns for it |
| Replaced mirror | A declared target held other content (replaced local edits, diff below), or a directory or a blocking file stood in the target's way (replaced, the detail names it) | Read the diff; the platform's copy or link, by the declared kind, stays. Content worth keeping moves to a path no declaration names |
| Settings | .github/settings.yml reads replaced local edits (someone edited the rendered file, or the repository carried a hand-written one the sync had not recorded) or held (one of the three overlay details under Read the report) | replaced local edits: move what the diff removed into .github/settings.local.yml (the rendered file is never edited by hand); the holds name the registration key or the overlay line to fix |
Something that matches none of the above: do not merge; waiting loses nothing. Escalate with an issue on Vivswan/repo-platform.
A sync PR that retires a workflow or reshapes the CI legs orphans the comments that named the old shape, so grep the repository's own markdown and workflow comments for every path in the Retired section and rewrite every hit. A comment that names a workflow the repository no longer has is a false statement about the repository.
automation/repo-platform BEFORE merging, never a separate PR: a follow-up PR leaves the merged tree wrong in between.A split file (AGENTS.md, LICENSE.md, .gitignore, .editorconfig, .gitattributes, .github/CODEOWNERS) has one managed region between BEGIN REPO-PLATFORM MANAGED and END REPO-PLATFORM MANAGED. Everything above BEGIN and below END is the repository's own and rides through every sync byte-for-byte. A file that never mentions the markers gets the region placed above its content, so its whole prior content becomes the tail.
.editorconfig, CODEOWNERS, .gitignore) put overrides below END, where later entries win.| The change was in | Move it to |
|---|---|
ci.yml (a job, a step) | checks.yml for gate jobs; release-gate.yml for release acceptance tests; post-green.yml for green-gated work on main; update-release.yml / update-release-pr.yml for release-time logic |
| the managed region of a split file | above BEGIN or below END of the same file |
| a module workflow or a pin dotfile | the platform's files/ (a PR there reaches the whole fleet; one that feeds a platform action a new input may add the input in the same PR: build provenance), or a repo-owned workflow beside it |
| a module setting | the module's key in .repo-platform.yml (labels.*, site.*) |
the rendered .github/settings.yml (a label, a ruleset, an identity key) | .github/settings.local.yml, the overlay the render reads; the next sync re-renders the managed file from it |
| a site build command | the repo-owned .github/actions/site-build/action.yml hook (its dist output names the built directory) |
A stale local copy of the branch bites; always reset to the remote:
git fetch origin
git checkout -B automation/repo-platform origin/automation/repo-platform
# move content into its owned place
git add -A && git commit -m "fix: keep repository-local lines after the sync"
git push origin automation/repo-platform
Copilot and other bots leave review comments on sync PRs; do not merge with any of them unaddressed. Read them all (gh pr view <number> --comments, plus gh api repos/{owner}/{repo}/pulls/<number>/comments for inline ones). Fix the valid ones on the branch, reply on the thread explaining why an invalid one is rejected, and resolve the thread.
When a human does the merging, your job ends with the branch resolved, pushed, and green:
.github/repo-platform-manifest.json by hand.A sync leg that fails files (or refreshes) one issue in the target repository titled [repo-platform] sync failed, with the error. The operator run's job log (gh run view <id> --log on Vivswan/repo-platform) shows the row as row <i>: failed, report filed in the target repository; the line carries an index from 0, never the repository's name.
Fix what the issue names, usually the registration:
| Cause | How it is named |
|---|---|
a module files.yml does not offer (the registration) | .repo-platform.yml: module "<name>" is not a module files.yml offers (known: ...) |
| a mirror declaration the writer cannot honour (the registration) | .repo-platform.yml: mirrors: source '<s>', target '<t>': <reason> |
| a manifest record the writer cannot read | counted in the log, and named by the repository's own validate-managed-files check |
| a split file's markers | - |
Then dispatch again:
gh workflow run sync-repos.yml -R Vivswan/repo-platform -f repo=<owner>/<name> -f manual=true
A row reading failed before the target was resolved; re-run the workflow means the run broke before reaching the repo: re-run it, and escalate on Vivswan/repo-platform when it repeats.
Closing the PR is not an opt-out: the next run opens a fresh PR with the same report. To pause syncs, revoke the fleet token's access to the repo or delete .repo-platform.yml. To detach permanently, see the platform's docs/eject.md.
Worked examples of report rows and their resolutions are in references/worked-examples.md; the class of every platform-written path is recorded in the PR head's .github/repo-platform-manifest.json, and what each class means is in references/file-ownership.md.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub vivswan/repo-platform --plugin repo-platform-skills3 skills in this plugin
/repo-platform-add-moduleAdd or remove a Vivswan/repo-platform module in a managed repository - edit the modules list in .repo-platform.yml, bring the module files onto the PR with a branch sync (or dispatch add_modules), merge it, and finish the companion steps. Use when someone says "add a module", "enable the fuzzer", "add nightly CI to this repo", "publish a site", "add the bun toolchain", "add Python support to this repo", "add Rust support", "start cutting releases here", "publish the docs site", "check PR titles on this repo", "remove a module", "drop the fuzzer", "disable nightly", asks "what modules does this repo have", or asks how to change a module setting like the nightly label, the fuzzer label, or the docs mount path./repo-platform-new-projectCreate or adopt a repository managed by Vivswan/repo-platform - create the repo, write .repo-platform.yml, grant the fleet token, run the first sync, review its report, and watch the first CI run. Use when someone wants a new repo on the platform, says "new project on the platform", "create a repo-platform repo", "set this repo up with repo-platform", "set it up like my other repos", "with my standard CI setup", "scaffold a repo with my usual standards", "bring this repo into the fleet", or asks how to bring a project under fleet management.Other plugins' skills for the same job