Describe the bug
When a git dependency declares skills inside category subdirectories (e.g. mattpocock/skills organizes skills under skills/productivity/ and skills/engineering/), installing with the subdirectory-prefixed skill name succeeds, but the subsequent apm pack fails. It errors that the skills recorded in apm.lock.yaml (skill_subset: productivity/grill-me, productivity/grilling) were not found among the package's installed files.
This happens because apm_modules/<pkg>/.apm/skills/ stores the installed skill files in a flattened layout that drops the subdirectory prefix, so it no longer matches the skill_subset path recorded in the lockfile. Installing the same skills without the subdirectory prefix works as expected.
To Reproduce
Steps to reproduce the behavior:
- Add a git dependency whose skills live under category subfolders, using the subdir-prefixed names:
apm install mattpocock/skills#bc4cf90 --skill productivity/grill-me --skill productivity/grilling
- This generates an apm.yml with:
dependencies:
apm:
- git: mattpocock/skills
ref: bc4cf90
skills:
- productivity/grill-me
- productivity/grilling
- Run:
- See error:
Error: Cannot pack dependency mattpocock/skills: the skills recorded in apm.lock.yaml (skill_subset: productivity/grill-me, productivity/grilling) were not found among its installed files.
Run 'apm install' to re-deploy the expected skills, then pack again.
Expected behavior
apm pack should succeed when skills are declared and installed with subdirectory prefixes, correctly matching them against the installed files under apm_modules/<pkg>/.apm/skills/. Alternatively, if subdirectory prefixes aren't meant to be supported, apm install should reject or normalize them at install time rather than allowing a lockfile state that later breaks apm pack.
Environment (please complete the following information):
- OS: MacOS
- Python Version: 3.14.6
- APM Version: 0.24.0
Additional context
If I don't add the sub-dir prefix while installing the skills, i.e.,
apm install mattpocock/skills#bc4cf90 --skill grill-me --skill grilling
all works as expected.
I'm not sure where the root cause and bug lies:
apm may need to support skill installation with subdir prefixes end-to-end.
- The
mattpocock/skills repo's subdirectory layout may not be a supported/expected structure. In that case, I can report this in that repo.
- Even when a skill author uses subdirectories, apm may always expect the subdir prefix to be omitted at install time — meaning this could be user/documentation error rather than a bug, needing clarification.
One possible reason I can think of, and what I observed is that,
after running apm install, apm_modules directory is populated with the package files.
APM adds internal .apm directory for it in apm_modules/mattpocock/skills.
But skills kept in apm_modules/mattpocock/skills/.apm/skills path don't follow the subdir structure from the original source.
Click to expand and see the screenshot.
Maybe due to this mismatch, apm pack is not able to recognize the subdir prefix? 🤔 🤷🏻♂️
This is just a guess at the moment.
Describe the bug
When a git dependency declares skills inside category subdirectories (e.g.
mattpocock/skillsorganizes skills underskills/productivity/andskills/engineering/), installing with the subdirectory-prefixed skill name succeeds, but the subsequentapm packfails. It errors that the skills recorded inapm.lock.yaml(skill_subset: productivity/grill-me, productivity/grilling) were not found among the package's installed files.This happens because
apm_modules/<pkg>/.apm/skills/stores the installed skill files in a flattened layout that drops the subdirectory prefix, so it no longer matches theskill_subsetpath recorded in the lockfile. Installing the same skills without the subdirectory prefix works as expected.To Reproduce
Steps to reproduce the behavior:
Expected behavior
apm packshould succeed when skills are declared and installed with subdirectory prefixes, correctly matching them against the installed files underapm_modules/<pkg>/.apm/skills/. Alternatively, if subdirectory prefixes aren't meant to be supported,apm installshould reject or normalize them at install time rather than allowing a lockfile state that later breaksapm pack.Environment (please complete the following information):
Additional context
If I don't add the sub-dir prefix while installing the skills, i.e.,
all works as expected.
I'm not sure where the root cause and bug lies:
apmmay need to support skill installation with subdir prefixes end-to-end.mattpocock/skillsrepo's subdirectory layout may not be a supported/expected structure. In that case, I can report this in that repo.One possible reason I can think of, and what I observed is that,
after running
apm install,apm_modulesdirectory is populated with the package files.APM adds internal
.apmdirectory for it inapm_modules/mattpocock/skills.But skills kept in
apm_modules/mattpocock/skills/.apm/skillspath don't follow the subdir structure from the original source.Click to expand and see the screenshot.
Maybe due to this mismatch,
apm packis not able to recognize the subdir prefix? 🤔 🤷🏻♂️This is just a guess at the moment.