Skip to content

fix(skillignore): apply directory-only rules to a skill's own folder - #985

Merged
runkids merged 1 commit into
mainfrom
runkids/skillignore-dir-rules
Nov 23, 2026
Merged

runkids merged 1 commit into
mainfrom
runkids/skillignore-dir-rules

Conversation

@runkids

@runkids runkids commented Nov 23, 2026

Copy link
Copy Markdown
Owner

Type

  • Bug fix
  • Small improvement (docs, typo, minor refactor)
  • Feature proposal (proposals/ only — see CONTRIBUTING.md)
  • Approved feature or large change (the linked issue has the approved label)

Linked Issue

No issue. Found while reviewing #980.

What was wrong

The docs describe pattern/ in .skillignore as 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, check and install's preview treated the folder as a directory, so the rule applied.
  • sync, list, status, doctor and the dashboard matched the folder as a file, so a directory-only rule never applied to it.

With plain/ in the source's .skillignore:

$ skillshare sync -g      # links plain
$ skillshare diff -g
  Orphan    plain
$ skillshare list -g
  plain     local          # shown as enabled

A directory-only negation failed everywhere except install's preview. With build/ and !build/keep/, no discovery walk kept build/keep. The same happened inside tracked repos.

Fix

Skill discovery and the tracked-repo check (isSkillIgnored) now match the skill folder as a directory, as CanSkipDir, install and skillmove already did. After the change, sync leaves plain out and reports it as ignored, list shows it as disabled, and diff reports the targets in sync.

Upgrade effect: a skill whose own folder matches a rule ending in / stops syncing, and the next sync prunes 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_DirOnlyRulesMatchSkillFolder covers a root plain/ rule and a root build/ plus !build/keep/ rule. It checks the folder-skipping walk (diff, check), the full walk and its ignored list (sync), and the Disabled flag (list, dashboard, toggles).
  • TestDiscoverSourceSkills_IgnorePatterns covers the same rules in a tracked repo. It now checks both walks and gains a directory-only negation case.
  • Both fail on main and pass with the fix.

Checks

  • make check passes in the devcontainer.
  • End to end with the built binary in global mode: root plain/ and tracked-repo ignored/. sync, diff and list now agree.

Not in this PR

  • In the list TUI, 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 on main. This change makes them reachable with name/ rules too. The dashboard already answers 409 for this case.
  • Agents in a directory ignored by .agentignore are not listed at all, while a file rule lists them as disabled. Listing them changes uninstall --all and audit, so it needs its own change.

Checklist

  • I've read CONTRIBUTING.md, including its AI-assisted contributions section
  • I've reviewed every line of the diff and can explain it
  • Tests included and passing (make check) — for code changes
  • No unrelated changes in the diff
  • Scope is focused — one concern per PR

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.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T02:09:21.725741Z 090f398 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@runkids
runkids merged commit 3b46626 into main Nov 23, 2026
10 checks passed
@runkids
runkids deleted the runkids/skillignore-dir-rules branch November 23, 2026 03:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant