Skip to content

[BUG] apm install -g --target opencode installs skills to ~/.opencode/ instead of ~/.config/opencode/ #530

@tr4l

Description

@tr4l

Describe the bug

When running apm install -g --target opencode, skills are silently deployed to ~/.opencode/skills/<skill>/ instead of the correct user-scope path ~/.config/opencode/skills/<skill>/. No error or warning is raised.

This is caused by two related issues in skill_integrator.py:

  1. Wrong root dir used_integrate_native_skill (line 717) uses target.root_dir (.opencode) directly instead of calling target.effective_root(user_scope=True) (.config/opencode). The user_scope flag is never propagated into the skill integrator.
  2. auto_create guard missing — All other integrators (agent, command, instruction, prompt) skip deployment when target.auto_create=False and the target dir doesn't already exist. skill_integrator.py has no such guard, so it unconditionally creates ~/.opencode/skills/ from scratch via mkdir(parents=True).

To Reproduce

  1. apm install -g --target opencode <some-skill-package>
  2. Observe ~/.opencode/skills/<skill>/ is created
  3. ~/.config/opencode/skills/ is never touched

Expected behavior

Skill installed to ~/.config/opencode/skills/<skill>/. If ~/.config/opencode/ doesn't exist and auto_create=False, skip with a warning (consistent with other integrators).

Relevant code

  • src/apm_cli/integration/skill_integrator.py:717target.root_dir should be target.effective_root(user_scope=<flag>)
  • src/apm_cli/integration/skill_integrator.py:728mkdir called unconditionally, no auto_create guard
  • src/apm_cli/integration/targets.py:99-107effective_root() exists and handles this correctly, just not called
  • Compare with agent_integrator.py:115, command_integrator.py:135 for the correct auto_create pattern

Environment

  • OS: WSL (Linux)
  • Python Version: 3.12.3
  • APM Version: 0.8.9

Logs

No error output — failure is silent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedDeprecated: use status/accepted. Kept for issue history; will be removed in milestone 0.10.0.bugDeprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions