Skip to content

Clarify or make additive --skill behavior when installing from existing skill bundles #1862

Description

@lirantal

Summary

When installing a subset of skills from the same skill-bundle dependency, apm install --skill ... appears to replace the previously configured skill subset instead of adding to it. This is surprising for an install command and makes the workflow for incrementally adding skills confusing.

Reproduction

Start with a user-scope install of one skill from a bundle:

apm install -g --target agent-skills lirantal/skills --skill gh-bulk-repo-edit

This installs the skill and writes a user-scope dependency entry similar to:

dependencies:
  apm:
    - git: lirantal/skills
      skills:
        - gh-bulk-repo-edit

Then try to add another skill from the same dependency:

apm install -g --target agent-skills lirantal/skills --skill gh-repo-init-context

The resulting ~/.apm/apm.yml replaces the previous subset:

dependencies:
  apm:
    - git: lirantal/skills
      skills:
        - gh-repo-init-context

APM then treats the previously installed skill as stale and attempts to clean it up.

Why this is confusing

From a user perspective, apm install <package> --skill <skill-name> reads like "install this additional skill from this package", especially when the package is already configured.

Instead, the current behavior is closer to "set the exact selected skill subset for this package to only these --skill values". That behavior is understandable once known, but it was not obvious from the CLI flow.

This was especially confusing in user scope with the agent-skills target because the first command successfully created:

~/.agents/skills/gh-bulk-repo-edit/

Then the second command updated ~/.apm/apm.yml to the new skill only and cleaned the old skill as stale.

Workaround

To keep both skills, the user must pass all desired skill selections every time:

apm install -g --target agent-skills lirantal/skills \
  --skill gh-bulk-repo-edit \
  --skill gh-repo-init-context

Or edit ~/.apm/apm.yml manually so the dependency has the full desired subset, then run:

apm install -g --target agent-skills

If the dependency is floating on a branch and the new skill exists only on a newer commit, the user may also need:

apm install -g --target agent-skills --update

Suggested friendlier behavior

I think one of these would be much easier to understand:

  1. Make repeated apm install <existing-package> --skill <new-skill> additive by default, merging the new skill into the existing skills: list.

  2. If replacement is intentional, print an explicit warning before changing the subset, for example:

    [!] Replacing selected skills for lirantal/skills:
        previous: gh-bulk-repo-edit
        new: gh-repo-init-context
        To keep both, pass both --skill flags or edit ~/.apm/apm.yml.
    
  3. Add explicit flags so intent is unambiguous:

    apm install ... --skill gh-repo-init-context          # additive
    apm install ... --only-skill gh-repo-init-context     # replacement / exact subset
    apm install ... --remove-skill gh-bulk-repo-edit      # removal

At minimum, the help text for --skill could say that it sets/replaces the package's selected skill subset.

Related observation

In the same flow, --refresh still installed from the cached resolved commit:

[+] lirantal/skills @8f088042 (cached)

The user had to reason separately about --update versus --refresh. That may be working as designed, but it compounded the confusion because the config listed two skills while only one appeared in ~/.agents/skills/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliCLI command surface, flags, help text (cross-cutting).area/docs-sitedocs/src/content (Starlight), README, doc generation.status/needs-designDirection approved, design discussion required before code.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).type/featureNew capability, new flag, new primitive.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions