Filter non-skill dirs from Claude Code sync - #12
Merged
Conversation
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.
Problem
The
agent-skillsexternal mirrors upstreamskills/verbatim. Upstream nowkeeps non-skill dirs there alongside real skills:
cancer-predisposition-variant-analyst/-- a git submodule; tarball archivescarry it as an empty placeholder (no
SKILL.md, and never will via tarball).alternatives/,hooks/,pg-essays/,scribe/,shared/,suites/,workflows/-- support packages, hook scripts, CI config. NoSKILL.md.run_after_sync-skills.shsymlinked every top-level dir into~/.claude/skills/,so these surface in Claude Code as description-less junk skill entries. Raxol is
unaffected (it scans
**/SKILL.md).Fix
Filter at the sync layer instead of enumerating excludes. An include-glob can't
distinguish a skill from a support dir -- both live at
skills/<name>/; the onlydifference is a sibling
SKILL.md, which no glob can test. So the guard belongswhere the Claude Code skill set is actually selected.
run_after_sync-skills.sh.tmpl: addis_skill_dir()(SKILL.mdpresent);route both the create loop and the stale-link pruner through it. Skips
non-skill dirs (current and future) and prunes links whose target lost its
SKILL.md..chezmoiexternal.toml: keep it a faithful upstream mirror; note the filter.Manual testing
shellcheck -x run_after_sync-skills.sh.tmpl-- cleandirs excluded; 0 broken links; 0 real skills dropped (60->59 delta is the
expected
virtuals-protocol-acpname-clash across both roots)chezmoi apply --refresh-externals-- non-skill dirs stay unlinked