sync-architecture · v6 · 2026-09-13 · sha256 ac4df23d9ef00f7b
sync-architecture v6A
Immutable. This exact content never changes and is served at /api/v1/blob/ac4df23d9ef00f7b.
---
name: sync-architecture
description: "Use when the user mentions syncing architecture, pulling template updates, updating parcel machinery, 'sync tools', 'pull latest skills/agents', or wants this workspace's .devops machinery refreshed from the template repo. Runs scripts/pull-architecture.ps1 against the current workspace root and reports drift."
version: 6
updated: 2026-09-13
---
# SKILL: Sync Architecture (`sync-architecture`)
Refresh this satellite workspace's transportable machinery (skills, agents, rules, templates,
scripts, `.vscode`) from the template repo recorded in `.ptp-source`. Thin wrapper over
`scripts/pull-architecture.ps1`, which delegates to the template's `sync-architecture.ps1`.
## Workflow
1. **Identify the workspace root** (cwd). Refuse if no `.devops/` directory exists there —
that is the wrong kind of workspace; tell the user to bootstrap from the template first
(see `.devops/templates/SATELLITE-BOOTSTRAP.md`).
2. **Run the pull script** with the switch matching the user's intent:
| User asks | Command |
|---|---|
| "what's new" / "check" / "is anything outdated" | `powershell -NoProfile -File scripts\pull-architecture.ps1 -Check` |
| "preview" / "show me what would change" | `powershell -NoProfile -File scripts\pull-architecture.ps1 -DryRun` |
| "sync" / "update machinery" / "pull latest" | `powershell -NoProfile -File scripts\pull-architecture.ps1` |
| "verify" / "is my satellite wired up correctly" / "check my bootstrap" | `powershell -NoProfile -File scripts\pull-architecture.ps1 -Verify` |
Never pass `-Source` unless the user explicitly supplies one — `.ptp-source` remembers it.
If no `.ptp-source` exists, relay the script's hint: run once with `-Source <path-or-git-url>`.
3. **Interpret the verdict table** (`-Check` output) in plain language:
| Verdict | Meaning | Action |
|---|---|---|
| `CURRENT` | identical | none |
| `UPGRADE` | newer version upstream | safe to pull |
| `DRIFT` | same version, different bytes | **locally customized copy — do not blindly overwrite; ask the user.** Offer to show the diff before re-running without `-Check` |
| `MISSING` | never installed here | will be created by a sync |
| `SOURCE-ABSENT` | manifest bug in the template | report to the template repo owner |
| `PRUNE` | retired upstream but present in the target | a sync will delete it — **counts as out of sync** |
Summarize counts + the IN SYNC / OUT OF SYNC line. Exit code 1 = out of sync (any
`UPGRADE`/`DRIFT`/`MISSING`/`SOURCE-ABSENT`/`PRUNE` verdict). A retired file reports
`PRUNE` on its own line, never a parent-directory `DRIFT`.
3b. **Interpret `-Verify` output** (never writes; exit 0 = `VERIFIED`):
- `[FAIL]` rows name exactly what is missing or mis-wired: `AGENTS.md` machinery
markers, `opencode.json` keys (`instructions` / `skills.paths`), `base-context.md`,
the wiki anchor (`.wiki/core/00-system-index.md`), or machinery a sync should have
materialised. Fix the named item, then re-run.
- `[WARN]` rows are advisory only (e.g. `.ptp-source` not yet recorded) and never fail
the run.
- Machinery gates run check-only (prefix check without `-Sync`, UTF-8, wiki lint).
A gate failure means the machinery itself is broken — report verbatim.
4. **First-time satellite** (many `MISSING` rows): after syncing, tell the user which
repo-specific files still need authoring from the seed templates in `.devops/templates/`:
`AGENTS.md`, `opencode.json`, `.opencode/plans/base-context.md` — then
`scripts\check-parcel-prefix.ps1 -Sync` once parcel agents exist.
## Rules
- `-Check` never writes; it is always safe to run first. Prefer starting any sync request with
`-Check` and presenting findings before mutating.
- A real sync regenerates PREFIX-LOCKED agent prefixes from *this* workspace's `base-context.md`
and runs the verification gates (prefix, UTF-8, wiki lint). Report gate failures verbatim —
never suppress them with `-NoVerify` unless the user insists.
- **Registry propagation.** A sync rewrites the target's `opencode.json` model values and its
`base-context.md` registry rows, and **inserts** rows the target is missing (machinery v40+),
so a template-side Model Registry growth reaches an already-bootstrapped satellite with no
manual edit. A key absent from the target's `opencode.json` agent block is reported
`BINDING-SKIP` — sync never restructures that repo-specific file.
- After any machinery edit in the template repo itself, the wrap-up discipline bumps per-skill
`version` / `machinery-version`; this skill only consumes those numbers, never edits them.