Skip to content

fix(skills-sync): write only to real .agents/skills directories; require a current sync PR head - #212

Merged
bketelsen merged 2 commits into
mainfrom
lucilla/skills-sync-agents-path
Nov 6, 2026
Merged

bketelsen merged 2 commits into
mainfrom
lucilla/skills-sync-agents-path

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

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.

  • The sync resolved an .agents symlink (scripts/lib/skills-sync-repo.sh, scripts/lib/skills-sync-containment.sh). In a consumer with .agents -> docs/agents, it wrote managed skills to docs/agents/skills/. Every consumer in .github/skills-sync.json now has a real .agents 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 any mkdir, rsync or marker write, and it stages the fixed path .agents/skills. The existing containment checks stay first and unchanged.
  • A stale sync PR merged green on its old base. chore: sync agent skills from frostyard/core chairlift#273 was cut before docs: adopt the repository baseline; fold the framework trees into AGENTS.md and docs/ chairlift#272 moved the skills from 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 made main red (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_by prints 0); 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: docs/design/skills-sync-operations.md (real directories only; each run rebuilds the branch) and the frostyard-onboard-repo pitfall. 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 touches scripts/lib/skills-sync-*.sh from .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/skills is a real directory, so the old computed path and the fixed path are the same. Authentication, push and PR steps are unchanged.
  • Effect on consumers: all 10 consumers have a real .agents directory at their default branch today (checked with gh 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

  • Cross-links unchanged and valid (design docs edited in place; no new doc)
  • No ADR change: the change implements ADR-0026's .agents/skills/<name>/ path
  • Conformance aliases (ADR-0029) untouched

Verification

  • make verify: 388 tests pass, exit 0 (includes node scripts/check-docs.mjs and the corrections check).
  • Guard: test/sync-skills-containment.test.mjs replaces the test that synced through .agents -> docs/agents with 4 refusal tests (.agents, .agents/skills, a managed skill directory, and a later symlinked skill that must not leave an earlier one written). New test/skills-sync-docs.test.mjs checks that no sync surface names docs/agents and that the procedure names behind_by and the sync dispatch.
  • Revert test: with the old skills-sync-containment.sh and shared-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

  • Revert test (scratch worktree from the PR head, fix files restored from the base, tests kept): node --test test/sync-skills-containment.test.mjs test/skills-sync-docs.test.mjs fails not ok 1, 2, 8, 9, 10, 11. Reversing the compare direction, or changing "do not add the label" to "you may add the label", makes skills-sync-docs test 2 fail.
  • Cross-review: openai/gpt-6.1-sol (coder deepseek/deepseek-flash). Initial review at 9a1dbef: 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 in 9a3177e. Re-review 1 at 9a3177e: Ready, Blocking: none.

…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).
@github-actions github-actions Bot added the risk:high Touches a path in .github/risk-paths.json label Nov 6, 2026
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 6, 2026
@bketelsen
bketelsen merged commit ed474fb into main Nov 6, 2026
5 checks passed
@bketelsen
bketelsen deleted the lucilla/skills-sync-agents-path branch November 6, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge risk:high Touches a path in .github/risk-paths.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants