Skip to content

Avoid duplicate skills from multi-host skill repos #145

Closed

Description

@hhh2210

Problem

Some skill repos package multiple host-specific skill trees in one source directory, for example:

  • .cursor/skills/...
  • .factory/skills/...
  • openclaw/skills/...
  • .agents/skills/...

When those nested SKILL.md files do not declare targets: frontmatter, discovery currently leaves Targets as nil. During sync, nil means "sync to every target", so a Cursor target can receive skills that were actually packaged for another host.

In practice, this makes the same logical skill appear multiple times in a target tool's skill picker. I hit this mostly with gstack-style repos that contain several host-specific skill trees.

Local Evidence

In my Cursor target, I saw multiple entries for the same gstack skills after sync. The root gstack skill and host-specific flattened skills could both be present, and Cursor recursively indexes nested SKILL.md files.

The rough local shape was:

~/.cursor/skills/gstack
~/.cursor/skills/gstack__.cursor__skills__gstack-setup-browser-cookies
~/.cursor/skills/gstack__.cursor__skills__...

This makes the skill picker noisy and hard to use.

Proposed Fix

PR #144 keeps this as a small bug fix: infer targets from known host-specific project skill paths during full discovery.

Examples:

  • .cursor/skills/<skill> -> cursor
  • .factory/skills/<skill> -> droid
  • openclaw/skills/<skill> -> openclaw
  • .skills/<skill> -> letta
  • .agents/skills/<skill> -> universal

Generic skills without host-specific paths still keep Targets == nil, so they continue syncing everywhere. DiscoverSourceSkillsLite intentionally keeps the previous behavior.

Validation

PR #144 includes unit and integration coverage. I ran:

go test ./internal/sync
go test ./internal/...
go build -o bin/skillshare ./cmd/skillshare
SKILLSHARE_TEST_BINARY=/Users/larry_1/Opensource/skillshare/bin/skillshare go test ./tests/integration -run TestSkillTargets

The PR also addresses the bot review feedback about non-*/skills/* project paths and repeated project-target map construction.

Activity

  1. added
    feature
    on Apr 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions