feat: support project-local .apm/ content during apm install#644
Merged
sergio-sisternes-epam merged 2 commits intomicrosoft:mainfrom Apr 10, 2026
Conversation
…ft#626) apm install now automatically discovers and deploys primitives (skills, instructions, agents, prompts, hooks, commands) from the project's own .apm/ directory to target directories (.github/, .claude/, .cursor/, .opencode/) alongside dependency content. Local content takes priority over dependencies on collision. Key changes: - Add _has_local_apm_content() to detect local .apm/ primitives - Add _integrate_local_content() to deploy local content via the existing _integrate_package_primitives() pipeline - Add local_deployed_files section to LockFile for stale file cleanup - Wire local integration into install() after dependency integration - Skip local integration for --global, --only=mcp, and dry-run - Root SKILL.md excluded (describes the project, not a deployable skill) Includes 20 unit tests and documentation updates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class support for integrating a project's own .apm/ primitives during apm install, aligning local project configuration with dependency-driven installation and improving collision precedence.
Changes:
- Integrate project-local
.apm/primitives after dependency integration so local content wins on collisions, and track deployed local files for cleanup. - Extend the lockfile schema with
local_deployed_filesand update semantic equivalence/YAML serialization accordingly. - Add unit tests and update docs/changelog to reflect the new
apm installbehavior.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/apm_cli/commands/install.py |
Detects and integrates local .apm/ content via the existing primitive integration pipeline; attempts stale cleanup and persists local_deployed_files. |
src/apm_cli/deps/lockfile.py |
Adds local_deployed_files to the lockfile schema + YAML (de)serialization and semantic equivalence checks. |
tests/unit/test_local_content_install.py |
New unit tests covering detection, integration plumbing, and lockfile serialization/semantics. |
packages/apm-guide/.apm/skills/apm-usage/workflow.md |
Documents that apm install deploys local .apm/ content and local wins on collision. |
docs/src/content/docs/reference/manifest-schema.md |
Updates cross-reference anchor to the updated apm install section. |
docs/src/content/docs/reference/cli-commands.md |
Updates apm install reference to include local .apm/ deployment behavior and exceptions. |
docs/src/content/docs/guides/skills.md |
Documents local .apm/skills promotion behavior and root SKILL.md exception. |
docs/src/content/docs/guides/pack-distribute.md |
Updates CLI reference anchor for apm install --dev. |
docs/src/content/docs/guides/dependencies.md |
Notes local .apm/ deployment as part of apm install. |
docs/src/content/docs/getting-started/quick-start.md |
Mentions local .apm/ content being deployed alongside dependencies. |
CHANGELOG.md |
Adds an Unreleased entry describing the new apm install behavior. |
- Gate local integration on old_local_deployed too (cleanup when .apm/ removed)
- Track error_count delta instead of object identity for error detection
- Retain failed-delete paths in local_deployed_files for retry
- Log stale file deletion failures
- Use rglob('*') with is_file() check in _has_local_apm_content()
- CHANGELOG references both issue and PR (microsoft#626, microsoft#644)
- Add test for subdirectory-only (no files) false positive
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
SebastienDegodez
approved these changes
Apr 10, 2026
danielmeppiel
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #626
Summary
apm installnow automatically discovers and deploys primitives from the project's own.apm/directory to target directories (.github/,.claude/,.cursor/,.opencode/) alongside dependency content. Local content takes priority over dependencies on collision.Motivation
Users expect
.apm/to be the single canonical location for all AI primitives in a project. Before this change, only content from installed dependency packages was deployed — the project's own.apm/content was ignored unless manually installed as a local path dependency. This was confusing and required workarounds.What changed
src/apm_cli/commands/install.py(+228 lines)_has_local_apm_content()— detects primitives in.apm/(skills, instructions, agents, prompts, hooks, commands, chatmodes)_integrate_local_content()— deploys local content via the existing_integrate_package_primitives()pipeline using a syntheticPackageInfoinstall()after dependency integrationsrc/apm_cli/deps/lockfile.py(+6 lines)local_deployed_files: List[str]field for stale file cleanup across installstests/unit/test_local_content_install.py(20 new tests)7 documentation files updated (CLI reference, guides, quick-start, workflow skill, cross-reference anchors)
Design decisions
install()level (not inside_install_apm_dependencies()) so zero-dep projects workPackageType.APM_PACKAGEfor synthetic PackageInfo to prevent rootSKILL.mdfrom being deployed as a skilllocal_deployed_fileslockfile section instead of a fake dependency entry — avoids polluting dep-specific logic--global,--only=mcp, and--dry-runTesting