Skip to content

apm install ignores root-level .apm/ primitives when project has external dependencies #714

@edenfunf

Description

@edenfunf

Description

Running apm install on a project that has both external APM dependencies in apm.yml and local rules in the root .apm/ directory only deploys the external packages' rules -- the root-level .apm/ is silently ignored.

Reproduction

my-project/
├── apm.yml                              # has external dep
└── .apm/
    └── instructions/
        └── my-rules.instructions.md    # never deployed
# apm.yml
name: my-project
version: 1.0.0
dependencies:
  apm:
    - some-org/some-package
apm install -t claude
# some-org/some-package rules deployed -> .claude/rules/  OK
# my-rules.instructions.md             -> NOT deployed

The same problem occurs even with no external deps at all -- apm install exits with "All dependencies are up to date" and deploys nothing.

Workaround (from Discussion #595)

Move rules into a sub-directory and add a stub apm.yml:

my-project/
├── apm.yml           # depends on ./agent
└── agent/
    ├── apm.yml       # required stub
    └── .apm/instructions/my-rules.instructions.md

This is unnecessary boilerplate and the expected behavior should work without it.

Root Cause

_install_apm_dependencies() has two early-return guards that check whether the resolved dependency list is empty. Both return before the target detection and integrator setup happen, so the project root's own .apm/ directory is never processed. The integration pipeline only ever runs against paths inside apm_modules/.

Expected Behavior

apm install should deploy primitives from the project root's own .apm/ directory alongside any external dependencies, without requiring a sub-package stub.

Refs: Discussion #595

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions