Repository navigation
fix(skills-sync): write only to real .agents/skills directories; require a current sync PR head - #212
Merged
Merged
Conversation
…ire a current sync PR head The sync resolved an .agents symlink and wrote managed skills to docs/agents/skills/ in consumers that had one. Every consumer now keeps .agents as a real directory, and ADR-0026 names .agents/skills/<name>/ as the managed path. The sync now refuses a symlink at .agents, .agents/skills or a managed skill directory before it writes a file, and stages the fixed path .agents/skills. The sync pull request procedure gains a step: the head must be current with the consumer's default branch (compare behind_by 0) before the label. A sync branch cut before a consumer's layout move merged green on its old base and put a skill outside .agents/skills/ (frostyard/chairlift#273, fixed by frostyard/chairlift#276).
…ehind_by direction in the docs test
bketelsen
approved these changes
Nov 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The skills sync and its docs still treated
docs/agents/skills/as a managed folder, and the sync pull request procedure did not require a current head..agentssymlink (scripts/lib/skills-sync-repo.sh,scripts/lib/skills-sync-containment.sh). In a consumer with.agents -> docs/agents, it wrote managed skills todocs/agents/skills/. Every consumer in.github/skills-sync.jsonnow has a real.agentsdirectory, and ADR-0026 names.agents/skills/<name>/as the managed path. The sync now refuses a symlink at.agents,.agents/skillsor a managed skill directory, before any mkdir, rsync or marker write, and it stages the fixed path.agents/skills. The existing containment checks stay first and unchanged.docs/agents/skills/to.agents/skills/. It merged after feat(organization): declare frostyard/frostmarks and enroll it in the skills sync #272, the skill landed outside.agents/skills/, and chairlift's docs-index check mademainred (fixed in fix(skills): move frostyard-readme into .agents/skills chairlift#276).docs/design/shared-skills.md, "Handling a sync pull request", gains step 4: the head is current with the consumer's default branch (gh api repos/OWNER/REPO/compare/BRANCH...HEAD_SHA --jq .behind_byprints0); otherwise run the sync again, which rebuilds the branch from the current default branch. In a consumer without a merge queue, a new default-branch commit before the merge takes the label off.docs/design/skills-sync-operations.md(real directories only; each run rebuilds the branch) and thefrostyard-onboard-repopitfall. The onboard skill is a synced skill, so its change goes out in the next sync.Risk tier
Risk tier: 3 —
risk:high: the PR touchesscripts/lib/skills-sync-*.shfrom.github/risk-paths.json(authentication and containment of the skills sync).scripts/lib/skills-sync-containment.sh: adds a fail-closed check,skills_sync_require_real_dir, after the containment checks and before any mutation. It only refuses more inputs; no write path and no credential handling changes.scripts/lib/skills-sync-repo.sh: removes the realpath computation of the staging path and stages.agents/skills. With the new check,.agents/skillsis a real directory, so the old computed path and the fixed path are the same. Authentication, push and PR steps are unchanged..agentsdirectory at their default branch today (checked withgh api repos/frostyard/<repo>/git/trees/HEAD), so no current sync breaks. A consumer with a symlink there fails loudly for that repository, as the containment checks already do.Docs housekeeping
.agents/skills/<name>/pathVerification
make verify: 388 tests pass, exit 0 (includesnode scripts/check-docs.mjsand the corrections check).test/sync-skills-containment.test.mjsreplaces the test that synced through.agents -> docs/agentswith 4 refusal tests (.agents,.agents/skills, a managed skill directory, and a later symlinked skill that must not leave an earlier one written). Newtest/skills-sync-docs.test.mjschecks that no sync surface namesdocs/agentsand that the procedure namesbehind_byand the sync dispatch.skills-sync-containment.shandshared-skills.md, 6 tests fail (not ok 1, 2, 8, 9, 10, 11,# fail 6)..memory/corrections.jsonl: 1 line, promoted to the 2 tests and the design doc.Revert test and review
node --test test/sync-skills-containment.test.mjs test/skills-sync-docs.test.mjsfailsnot ok 1, 2, 8, 9, 10, 11. Reversing the compare direction, or changing "do not add the label" to "you may add the label", makesskills-sync-docstest 2 fail.openai/gpt-6.1-sol(coderdeepseek/deepseek-flash). Initial review at9a1dbef: Ready, 2 low non-blocking findings (a rerun that finds no change leaves a stale PR as it is; the docs test did not pin the compare direction). Both fixed in9a3177e. Re-review 1 at9a3177e: Ready, Blocking: none.