Describe the bug
sync_integration() in skill_integrator.py hard-codes skill directory
prefixes (e.g. ".opencode/skills/") when scanning managed files for
removal. User-scope deployments can produce roots with nested path separators
(e.g. ".config/opencode/skills/"), which do not match the hard-coded
prefixes. This means user-scope skill directories are not cleaned up during
uninstall/sync.
To Reproduce
apm install -g --target opencode (deploys to ~/.config/opencode/skills/)
apm uninstall -g <package> (sync_integration tries to remove orphaned skills)
- Hard-coded prefix
".opencode/skills/" does not match ".config/opencode/skills/"
- Orphaned skill directories remain under
~/.config/opencode/skills/
Expected behavior
sync_integration() should derive allowed skill prefixes from KNOWN_TARGETS
using target.effective_root(user_scope=...) (and deploy_root overrides)
instead of hard-coded strings.
Environment (please complete the following information):
- OS: All (code-level bug, not platform-specific)
- Python Version: 3.12
- APM Version: 0.8.9
- Affected file:
src/apm_cli/integration/skill_integrator.py
(sync_integration() method)
Logs
N/A -- no runtime error; orphaned directories silently remain.
Additional context
Pre-existing issue not introduced by #537, but surfaced during Copilot code
review. Affects any target where user_root_dir != root_dir (currently
Copilot and OpenCode).
Suggested approach: build the prefix set dynamically from
KNOWN_TARGETS.values() iterating over each target's effective_root()
for both scopes, similar to how get_integration_prefixes() works in
base_integrator.py.
Related: #537, #530
Describe the bug
sync_integration()inskill_integrator.pyhard-codes skill directoryprefixes (e.g.
".opencode/skills/") when scanning managed files forremoval. User-scope deployments can produce roots with nested path separators
(e.g.
".config/opencode/skills/"), which do not match the hard-codedprefixes. This means user-scope skill directories are not cleaned up during
uninstall/sync.
To Reproduce
apm install -g --target opencode(deploys to~/.config/opencode/skills/)apm uninstall -g <package>(sync_integration tries to remove orphaned skills)".opencode/skills/"does not match".config/opencode/skills/"~/.config/opencode/skills/Expected behavior
sync_integration()should derive allowed skill prefixes fromKNOWN_TARGETSusing
target.effective_root(user_scope=...)(anddeploy_rootoverrides)instead of hard-coded strings.
Environment (please complete the following information):
src/apm_cli/integration/skill_integrator.py(
sync_integration()method)Logs
N/A -- no runtime error; orphaned directories silently remain.
Additional context
Pre-existing issue not introduced by #537, but surfaced during Copilot code
review. Affects any target where
user_root_dir != root_dir(currentlyCopilot and OpenCode).
Suggested approach: build the prefix set dynamically from
KNOWN_TARGETS.values()iterating over each target'seffective_root()for both scopes, similar to how
get_integration_prefixes()works inbase_integrator.py.Related: #537, #530