fix(sync): Adopt only directories that contain a SKILL.md - #194
Merged
Merged
Conversation
sync adopted every undeclared directory under the skills directory. A hidden directory such as .trash/ was written to agents.toml with a name the config schema rejects, so every later command, including doctor, failed with 'Invalid config'. Directories without a SKILL.md, such as Claude Code's synced/ after ~/.claude/skills/ is migrated, were adopted as skills. Adopt a directory only when its name is a valid skill name and it contains a SKILL.md. Pruning of stale managed skills is unchanged. If a directory adopted earlier loses its SKILL.md and its agents.toml entry, drop its in-place agents.lock entry too, so .agents/.gitignore stops hiding its files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@m-naoki-m is attempting to deploy a commit to the Sentry Team on Vercel. A member of the Team first needs to authorize it. |
Member
|
Thanks! |
This was referenced Sep 29, 2026
3 tasks
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.
syncadopts every undeclared directory under the skills directory, whether or not it is a skill. A hidden directory gets written toagents.tomlunder a name the config schema rejects, and from then on every command fails,doctorincluded:A directory without a
SKILL.md, such asnotes/, is adopted as a skill namednotes.I hit this with Claude Code. Global
initmigrates~/.claude/skills/into~/.agents/skills/, and Claude Code keeps its ownsynced/(skills synced from claude.ai, nested one level deeper under an account directory),.trash/, and.staging/there. Afterinit --agents claude,codex,opencode, the nextsyncwrote.staging,.trash, andsyncedinto~/.agents/agents.toml, andsync,install, anddoctorall exited with the error above.Fix
The adopt step now skips a directory unless its name passes the same check
managedSkillPathuses and it contains aSKILL.md. This also covers.dotagents-managed, so its special case is removed. Pruning of stale managed skills runs before the new check and is unchanged.If a directory that was adopted earlier loses its
SKILL.mdand itsagents.tomlentry, its in-placeagents.lockentry is dropped too. Otherwise the leftover lock entry would make.agents/.gitignorelist the directory as managed and hide its files from Git.specs/SPEC.mdnow says which directoriessyncadopts. The README, docs site, and bundled skill already describe adopting skills, which matches the new behavior.Verification
pnpm checkpasses on Node 20 and 26 (lib 295 tests, host 844). The CI build job steps (pnpm build, CLI--help, packing both packages,scripts/verify-pack.mjs) pass on Node 20, and the docs build passes on Node 22.sync.test.ts, both failing onmain:adopts only directories that are valid skillsplaces.trash/,synced/<bucket>/<skill>/, anotes/withoutSKILL.md, and a validreview/, and expects onlyreviewto be adopted.forgets an adopted skill whose directory no longer has a SKILL.mdexpects the stale lock entry to be removed and the directory to stay out of.agents/.gitignore.HOMEcontaining~/.claude/skills/{review,synced/<account>/pdf,.trash/old,.staging}:init,sync,install, anddoctorall succeed, and onlydotagentsandrevieware declared. The same run in thedotagents-qaDocker image passes, andpnpm qa:examplepasses there.pnpm qa:pluginsfails in the Docker image at the Copilot proof ("Copilot did not report enabled qa-tools from the live local marketplace"), onmainas well.Separately from this fix, Claude Code's claude.ai-synced skills end up visible to Codex after the global migration. That needs a design decision, so I opened #193 for it.