Skip to content

Skill sets: bind project skills to their repository #386

Closed

Description

@7schmiede

Problem

ADR-0074 installs a pool's skill sets into the agents' user skill folders (~/.claude/skills, ~/.agents/skills, ...). That is right for generic skills. A set that also carries project skills (ADR-0074, Context: "generic ones for every repository, and ones for a project") puts those into every session on the machine, in every repository.

Project skills tend to have generic triggers ("new page", "new grid", "add a button") and very specific content (one codebase's libraries, paths, conventions). An agent working in another repository sees the description, picks the skill and scaffolds code against libraries that do not exist there. The descriptions also cost context in every session of every project.

What we do today as a stopgap, in the source of the set:

  • the description starts with "Only in the repository <owner>/<name>" and ends with "do not use in other repositories";
  • the skill's first step checks git remote get-url origin and stops elsewhere.

That works, but it relies on the model reading the description, and the descriptions still load everywhere.

Proposal

Let a skill (or a set) say which repositories it belongs to, and let devstack keep it out of the others.

  1. Contract: metadata.repos in the frontmatter, next to group/tags (ADR-0077), e.g. repos: [acme/shop], matched against the origin of the working tree. Optionally the same as a field of the set (devstack pool skills add ... --repos acme/shop). Additive: an older hub ignores it and installs as today.
  2. Delivery: the open question, because ADR-0071 keeps devstack out of repository files. Options:
    • a) The hub keeps scoped skills out of the user folders. devstack mcp, which already runs per stack, offers them in a stack whose origin matches, e.g. as MCP prompts/resources. ADR-0074 rejected MCP as the general channel, but for scoped skills it is the one place that knows the repository.
    • b) The hub installs them, but into a per-project location of the agent outside the repository, where the agent has one. Claude Code could get a plugin from a hub-managed local marketplace, enabled per project. That needs an enabledPlugins entry in the project's local settings, which is a file in the repository, though an untracked one.
    • c) The hub keeps installing into the user folders but rewrites the description from metadata.repos ("Only in acme/shop ...") and adds the origin check. That is cheap and harness-independent, but the context cost stays.
  3. Several folders per set, each with its own members. Today a set has one path and one to. A team that keeps its generic skills and its project skills in one source (e.g. skills/ and projects/acme-shop/skills/) has to register a set per folder to give the project folder only to the people working on that project. Instead a set could list several folders, each with its own to (*, member ids, tags):
    devstack pool skills add team --github org/team-skills \
      --path skills --to '*' \
      --path projects/acme-shop/skills --to tag:acme
    
    Who gets which skill is then still the pool's allocation (ADR-0074, trust), just per folder instead of per set; metadata.group (ADR-0077) stays display and switching only. Together with metadata.repos (point 1) this scopes a project skill twice: to the people who work on the project, and on their machines to the repository.
  4. Dashboard: the Skills page shows the repositories a skill is bound to and where it is active.

My preference is a) where the agent speaks MCP, with c) as the fallback. A review card should come first (ADR-0070).

Acceptance

  • A skill with metadata.repos is not offered to an agent working in a repository that does not match.
  • In a matching repository and its worktrees/lanes it is available as before.
  • Skills without metadata.repos behave exactly as today.
  • A set with several folders hands each folder only to the members given for it; a set with one path/to behaves exactly as today.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions