Repository navigation
Description
What happens
A target's include / exclude patterns are matched only against the path-joined internal name
(frontend__dev). The name that the target directory actually shows, and the name skillshare list
prints (dev), matches nothing.
Worse than a no-op: because the previously synced skills no longer resolve, the same sync prunes
them. There is no diagnostic naming the mismatch, and trash stays empty.
Reproduction
Verified on main @ d5d7fc47 (v0.23.4), Go 1.26.0, Linux, isolated SKILLSHARE_CONFIG sandbox.
Two source skills, standard naming, one merge-mode target:
<source>/frontend/dev/SKILL.md # name: dev
<source>/_repos/demo/lark-sheets/SKILL.md # name: lark-sheets (tracked-repo dir)
source: <source>
target_naming: standard
targets:
t1:
path: <target>
mode: mergeStep 1 — patterns written in the internal vocabulary:
include: [frontend__dev, _repos__demo__lark-sheets]$ skillshare sync -g
✓ Discovered 2 skills
t1: merged (2 linked, 0 local, 0 updated, 0 pruned)
$ ls <target>
dev
lark-sheets
The links land under the bare names. skillshare list agrees:
Installed skills
_repos/demo/
→ lark-sheets tracked: _repos
frontend/
→ dev local
Step 2 — the same two skills, addressed by the name the target shows and the name list printed:
include: [dev, lark-sheets]$ skillshare sync -g
✓ Discovered 2 skills
t1: merged (0 linked, 0 local, 0 updated, 2 pruned)
→ include: dev, lark-sheets
Sync complete: 1 targets, 0 linked, 0 local, 0 updated, 2 pruned (0.0s)
$ ls <target>
(empty)
$ skillshare trash list
→ Trash is empty
Nothing warns that dev and lark-sheets matched zero skills; the → include: line just echoes the
filters. skillshare target t1 --add-include dev is accepted the same way.
Why it is easy to hit
Every other surface the user reads — the target directory, list, diff, the N linked counts — speaks
the target-visible name. Only the filter vocabulary is different, and it is the one place that fails
silently.
Filtering agents already normalizes for intuition (FilterAgents strips the .md suffix so users
can write tutor instead of tutor.md); skills have no equivalent accommodation
(internal/sync/filter.go:31-45).
Root cause
FilterSkillsmatchesfilepath.Match(pattern, skill.FlatName)—internal/sync/filter.go:14-28,
:112-120.FlatNameis the source-relative path with/replaced by__—internal/utils/strings.go:25-39,
assigned ininternal/sync/discover_walk.go:307.- Naming is applied after filtering:
ResolveTargetSkillsForTargetcallsFilterSkillsfirst
(internal/sync/target_naming.go:34) and only then picks the target-visible name (:71-75). So a
pattern written in post-naming vocabulary is evaluated against pre-naming vocabulary and can never
match. - Prune resolves through the same function (
internal/sync/sync.go:750-795), which is why the mismatch
removes existing entries instead of merely failing to create them.
The CLI already has the missing diagnostic elsewhere: update and uninstall warn
%s: no skills match pattern (cmd/skillshare/update.go:283, cmd/skillshare/uninstall_handlers.go:254),
and audit errors no skills matched the given names/groups (cmd/skillshare/audit.go:735). The sync
path is the one place it is absent — and the one place where the consequence is destructive.
Proposal
- Minimum: in the sync path, warn per target for every
includepattern that matches zero
discovered skills, reusing the existing wording and, ideally, suggesting the closest internal name.
This turns a silent2 prunedinto an actionable line. Small, focused, with a regression test — I
can send it. - Fuller: when the effective naming is
standard, also accept the target-visible name (and the
SKILL.mdname for repo skills) ininclude/exclude, keeping today's flat patterns working.
This changes resolution semantics, so it probably wants the proposal template — happy to draft it if
you want it.
Notes
- Not a regression of merge-mode prune deletes live links into the source that skillshare never created #314: the pruned links were created by skillshare and are in the manifest, so
provenance pruning behaved as designed. Separate concern. website/docs/reference/targets/configuration.md("Matching is against target flat names (for example
team__frontend__ui)") is worth re-wording either way: undertarget_naming: standardthe target's
names are not flat, so the sentence and the observable behaviour read as contradictory.
Activity
fix(sync): show unmatched include warnings in every sync view (#328)
fix(sync): report include patterns that match no skill (runkids#326)