Repository navigation
fix(skillignore): apply directory-only rules to a skill's own folder - #985
Merged
Merged
Conversation
The docs describe "name/" in .skillignore as a directory-only rule, and a skill is a directory. diff, check and install's preview matched the skill folder as a directory, but sync, list, status, doctor and the dashboard matched it as a file, so a directory-only rule never applied to it. With "plain/", sync linked plain while diff reported it as an orphan, and a negation such as "!build/keep/" re-enabled nothing. Match the folder as a directory in discovery and in the tracked-repo check, as CanSkipDir, install and skillmove already do. A skill whose folder matches a "name/" rule now stops syncing, and the next sync prunes it from targets.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
6 of 9 tasks
6 of 9 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.
Type
proposals/only — see CONTRIBUTING.md)approvedlabel)Linked Issue
No issue. Found while reviewing #980.
What was wrong
The docs describe
pattern/in.skillignoreas a directory-only rule, and a skill is a directory. Commands still disagreed about whether such a rule matched a skill's own folder:diff,checkand install's preview treated the folder as a directory, so the rule applied.sync,list,status,doctorand the dashboard matched the folder as a file, so a directory-only rule never applied to it.With
plain/in the source's.skillignore:A directory-only negation failed everywhere except install's preview. With
build/and!build/keep/, no discovery walk keptbuild/keep. The same happened inside tracked repos.Fix
Skill discovery and the tracked-repo check (
isSkillIgnored) now match the skill folder as a directory, asCanSkipDir, install andskillmovealready did. After the change,syncleavesplainout and reports it as ignored,listshows it as disabled, anddiffreports the targets in sync.Upgrade effect: a skill whose own folder matches a rule ending in
/stops syncing, and the nextsyncprunes it from targets. Pruning removes only the links or copies skillshare manages. The source folder is kept. A directory-only negation such as!build/keep/now re-enables the skill.Tests
TestDiscoverSourceSkills_DirOnlyRulesMatchSkillFoldercovers a rootplain/rule and a rootbuild/plus!build/keep/rule. It checks the folder-skipping walk (diff,check), the full walk and its ignored list (sync), and theDisabledflag (list, dashboard, toggles).TestDiscoverSourceSkills_IgnorePatternscovers the same rules in a tracked repo. It now checks both walks and gains a directory-only negation case.mainand pass with the fix.Checks
make checkpasses in the devcontainer.plain/and tracked-repoignored/.sync,diffandlistnow agree.Not in this PR
listTUI, enabling a skill disabled by a glob or directory rule flips the row to enabled although the rule still matches (cmd/skillshare/list_tui.go). In the same case,skillshare enable <name>prints "not disabled". Both already happen with glob rules onmain. This change makes them reachable withname/rules too. The dashboard already answers 409 for this case..agentignoreare not listed at all, while a file rule lists them as disabled. Listing them changesuninstall --allandaudit, so it needs its own change.Checklist
make check) — for code changes