Bug: -s/--skill flag installs all agents from repo
Summary
Using -s/--skill to select a specific skill also installs all agents from the repo. The -a/--agent flag does not have the inverse problem because it implicitly sets opts.Kind = "agent", but -s/--skill does not set opts.Kind = "skill".
Steps to reproduce
- Have a repo with both skills and agents (e.g. 3 skills, 2 agents)
- Install a specific skill:
skillshare install [email protected]:Acme/skills -s example-pr-description
- Both agents are installed alongside the selected skill
Expected behaviour
Only the specified skill should be installed. Agents should only be installed when explicitly requested via -a or --all.
Workaround
Adding --kind skill suppresses agent installation:
skillshare install [email protected]:Acme/skills -s example-pr-description --kind skill
Root cause
In cmd/skillshare/install.go, the -a/--agent flag handler sets opts.Kind = "agent" (line 116), but the -s/--skill flag handler does not set opts.Kind = "skill".
In cmd/skillshare/install_handlers.go, installDiscoveredAgents() (line 1111) only skips agent installation when opts.Kind == "skill" (line 1115). Since -s never sets this, agents are always installed from mixed repos.
Suggested fix
Either:
- Set
opts.Kind = "skill"when-s/--skillis used (matching the-a/--agentbehaviour) - Or add a check in
installDiscoveredAgents()forlen(opts.SkillNames) > 0
Environment
skillshare version: 0.20.2
OS: Windows
Fixed in v0.20.3 — thanks for the precise root-cause analysis, that made this an easy fix. 🙏
-s/--skill now scopes the install correctly:
-s <names>installs only the named skills — no agents-s <names> -a <names>installs the named skills and the named agents--all/--yesstill install everything
As a bonus, an unknown -a name now fails the whole command up front (before any skill is installed), so automation never sees a half-completed install.
You no longer need the --kind skill workaround. Let me know if anything still looks off!