Skills-Sync Pipeline — End-to-End Summary
A multi-agent CI pipeline that watchesvelt-js/docs, detects when a merge to main should change rules in velt-js/agent-skills, edits the right files, validates the build, and opens (or updates) a single review-ready PR — automatically. Plus auto-propagation downstream into velt-plugin-cursor and velt-plugin-claude.
How the pipeline works
Trigger
Every push tovelt-js/docs/main touching one of the watched paths runs .github/workflows/docs-sync-skills.yml:
Three jobs
Job 1 —plan (Stage 0 script + Agent 1, Opus 4.7)
compute-diff.shproduces a structured diff of the docs change.Agent-1-docs-diff-plannerreadsmapping.mdand emitsplan.json:tickets[]— one entry per impacted skill ({skill, paths, intent, changes})unmapped[]— feature paths with no current skill (issues filed, no auto-create)
update-skill (matrix, one job per ticket; Agent 2 variant, Opus 4.7)
dispatch-updater-variant.sh maps each skill to one of six variants:
| Variant | Skills |
|---|---|
2a frontend-async | comments, notifications, activity, recorder |
2b frontend-realtime | presence, cursors, huddle, single-editor-mode, crdt |
2c setup | velt-setup-best-practices |
2d backend | rest-apis, self-hosting-data |
2e infra | proxy-server, yjs |
2f ai | rewriter (extensible for future AI features) |
metadata.json version, optionally adds a new category to _sections.md.
Job 3 — validate-and-pr (Agent 3 Haiku 4.5, Agent 4 Opus 4.7)
- Resolve branch: queries
gh pr list --label skills-sync --state open. If a PR is open, checks out its branch and exportsEXISTING_PR_NUMBER. Otherwise createsskills-sync/<short-sha>. apply-patches.shmerges all matrix artifacts onto the branch.Agent-3-skill-format-validatorrunsnpm run validate && npm run buildto regenerateAGENTS.md/AGENTS.full.md.Agent-4-skill-pr-composereither updates the existing PR (gh pr editbody,--add-reviewer yoen-velt,gh pr commentfor timeline visibility) or opens a new one (--reviewer yoen-velt, labelsskills-sync+automated).
Sync downstream to plugins (automatic, separate workflow)
The merge toagent-skills/main triggers agent-skills/.github/workflows/sync-to-plugins.yml, which copies skills/** into velt-plugin-cursor and velt-plugin-claude and opens sync PRs there.
Weekly drift check (independent, no PRs)
docs/.github/workflows/skills-sync-drift-check.yml runs every Monday at 14:00 UTC, comparing the docs feature tree to the agent-skills inventory and filing (or updating) a rollup issue in agent-skills if anything has drifted out of sync.
Guardrails on the receiving end
agent-skills/.github/workflows/skills-sync-guardrails.yml fires on every PR labeled skills-sync and rejects:
- Edits inside
*-workspace/**or**/evals/**. - Rewrites of
metadata.json.abstractor.authorwithout themanual-skill-rewritelabel. metadata.json.versionnot bumping when rule files change (unless labeleddocs-prose-only).AGENTS.mdchanges without a sibling rule change.
Visual
File map
Pipeline definition (in velt-js/docs)
| File | Purpose |
|---|---|
.github/workflows/docs-sync-skills.yml | Main pipeline trigger + 3-job orchestration. |
.github/workflows/skills-sync-drift-check.yml | Weekly Monday drift audit. |
.claude/agents/skills-sync/Agent-1-docs-diff-planner.md | Plans which skills to touch. (Opus 4.7) |
.claude/agents/skills-sync/Agent-2a..f-*-skill-updater.md | One variant per skill family. (Opus 4.7) |
.claude/agents/skills-sync/Agent-3-skill-format-validator.md | npm run validate && build. (Haiku 4.5) |
.claude/agents/skills-sync/Agent-4-skill-pr-composer.md | Opens / updates the PR. (Opus 4.7) |
scripts/skills-sync/*.sh | Plumbing — diff, dispatch, apply, smoke-test. |
scripts/skills-sync/reference-artifacts/mapping.md | Frozen docs-path → skill mapping. |
scripts/skills-sync/reference-artifacts/format-guide.md | Authoritative skill-file format. |
Receiving end (in velt-js/agent-skills)
| File | Purpose |
|---|---|
.github/workflows/skills-sync-guardrails.yml | PR-level guardrails (rule-bump, workspace-edit blocks). |
.github/workflows/sync-to-plugins.yml | Propagates merged changes to both plugin repos. |
.github/CODEOWNERS | Ownership documentation only. Not the review-routing mechanism. |
skills/<name>/SKILL.md, metadata.json, rules/shared/_sections.md | Source-of-truth files updater agents edit. |
skills/<name>/AGENTS.md, AGENTS.full.md | Build artifacts. Never hand-edited. |
Required secrets (in velt-js/docs)
| Secret | Used for |
|---|---|
ANTHROPIC_API_KEY | All four Claude agents. |
AGENT_SKILLS_PAT | Cross-repo writes (checkout, push, PR, issues) on velt-js/agent-skills. |
How we set it up (chronological steps)
- Tested the pipeline on a no-op commit (
44ae9b9“Added proxy server to docs”) — Plugin-Agent-1 correctly returnedhasDeltas: falsebecause the agent-skills repo already reflected that change. - Tested the pipeline on a real release (
650d917e“v5.0.2-beta.18”) — Plugin-Agent-1 produced 3 Comments deltas and parked 2 Rewriter deltas (no library existed yet). - Manually scaffolded
velt-rewriter-best-practicesinvelt-js/agent-skills(per the policy that the pipeline never auto-creates new skills — it files an issue, humans decide). - Plugin-Agent-2 patched the 3 Comments rule files (
mode-inline-comments.md,ui-wireframes.md,config-ui-behavior.md) and the 2 new Rewriter rule files (api-default-ui-toggle.md,types-ai-model.md). - Caught and fixed a fabricated component name in
ui-wireframes.md— Plugin-Agent-1 had inferredVeltInlineCommentsSectionWireframe.ShowMorefrom prose; the real components areVeltCommentDialogWireframe.ThreadCard.Message.ShowMore/.ShowLess. - Diagnosed two build bugs surfaced by
npm run build: proxy-server’smetadata.jsonused a non-canonical schema ({name, author, ruleCount, categories}) so the build emittedundefined|undefined; self-hosting-data’s_sections.mdwas missing entries fordata/andpython-sdk/so 5 rule files were orphaned. - Migrated proxy-server’s
metadata.jsonto the canonical schema ({version, organization, date, abstract, references}) used by every other library. - Reformatted proxy-server’s
_sections.mdfrom the flat-list format to the canonical## N. Title (folder)+**Impact:**shape the parser expects. - Reconnected self-hosting-data’s orphaned folders by adding Sections 6 (Data Types) and 7 (Python SDK) to its
_sections.md(Debugging renumbered to 8). - Created
_sections.mdfor the new Rewriter library definingapi/andtypes/sections. - Created a new Agent-2f variant (
Agent-2f-ai-skill-updater.md) for AI/productivity features, modeled on the infra variant; updatedmapping.mdanddispatch-updater-variant.shso rewriter routes to it. - Added
ai/rewriter/**→velt-rewriter-best-practicesrouting tomapping.mdso future docs changes in that path land on the right library. - Retired the old
docs-sync.ymlworkflow (it was a single-job shell pipeline that opened PRs in 3 repos on every**/*.mdxchange) — superseded by the new agent-drivendocs-sync-skills.yml. - Wired Agent 4 to reuse open PRs — if a
skills-syncPR is already open, the next pipeline run commits onto its branch andgh pr edits the body, rather than opening a parallel PR. - Changed review routing from CODEOWNERS to direct
@yoen-velt— Agent 4 now passes--reviewer yoen-velton PR creation and--add-reviewer yoen-velton PR edit; CODEOWNERS file is kept for ownership documentation only. - Added the Rewriter row to
agent-skills/.github/CODEOWNERSin a new “AI / productivity” section for completeness. - Reconciled rule counts to match build output — Comments 71→69, Recorder 21→23, Self-Hosting-Data 13→21 (+8 from reconnected sections), Rewriter +2 new, Total 277→282.
- Regenerated all 10 buildable libraries’
AGENTS.md/AGENTS.full.mdfiles vianpm run build(Comments now correctly indexes the new beta.18 content; proxy-server is no longer broken). - Updated customer-facing docs — added a Rewriter Card to
docs/get-started/skills.mdx, added a use-case bullet and mapping row, updated counts indocs/get-started/plugins.mdxfor both plugin trees. - Confirmed
ANTHROPIC_API_KEYalready exists as a GitHub Actions secret onvelt-js/docs(rotated since it was exposed in chat). - Committed 3 commits to agent-skills/main (
Workflow fix,v5.0.2-beta.18 ...,Build fix + AGENTS regen ...) and pushed. - Committed 2 commits to a docs feature branch (
Add docs-sync-skills pipeline ...,v5.0.2-beta.18 docs ...). - Cherry-picked just those 2 commits onto
docs/mainand pushed — pipeline is now live. Other wireframe-variables work stayed on the feature branch for normal PR review.
Carryover / out-of-scope workstreams
These exist but are intentionally not part of this auto-updater work:- 5 libraries still lack
metadata.jsonin the canonical schema: presence, cursors, huddle, rest-apis, yjs. They aren’t picked up by the build and theirAGENTS.mdfiles remain stale. The customer-facing rule counts for those (presence 13, cursors 11, huddle 10, rest-apis 9) are inherited and unverified. - The
@velt-js/ai-ownersteam handle inCODEOWNERSis a placeholder. Since review routing is direct to@yoen-velt, this is harmless — but worth resolving when CODEOWNERS becomes the routing mechanism for any other workflow. - Wireframe-variables work (~30 pages of new per-feature wireframe-variables docs) is still sitting on the feature branch
wireframe-variables-non-comments-notifications— 8 commits ahead of main. Not pushed tomainbecause that’s normal-PR-review territory.
Verifying the pipeline works
Next time you merge a docs PR tomain that touches a watched path:
- Actions tab → docs-sync-skills: watch the three jobs (
plan,update-skill,validate-and-pr) run end-to-end. Should finish in ~5–10 min. - agent-skills → Pull Requests: filter
is:pr is:open label:skills-sync. Expect either a new PR or a new commit on an existing one, with@yoen-veltrequested. - Worst-case diagnostic: download the workflow run’s
outputs/pr-composer-result.jsonartifact for the status code and any error message.

