Is your feature request related to a problem? Please describe.
apm install and apm compile write two kinds of files:
- Dependencies under
apm_modules/. apm init already adds this to .gitignore (with a # APM dependencies comment), which is the right default.
- Deployed primitives at the fixed paths consuming agents read:
AGENTS.md, CLAUDE.md, .claude/, .cursor/, .github/instructions/, .agents/. These are equally derived from .apm/ and apm.yml, but they currently get no .gitignore treatment.
That asymmetry makes the contributor experience fail in the wrong direction:
- New contributors see the generated files in
git status and commit them, snapshotting whatever skill versions were installed at that moment.
- Reviewers can't tell whether a
CLAUDE.md diff was hand-authored or compiled.
- Migrating from a hand-authored
CLAUDE.md to APM-generated has no safe path: apm compile silently overwrites the committed file, and adding CLAUDE.md to .gitignore after the fact does not help — git ignores .gitignore rules for already-tracked files.
Describe the solution you'd like
Three coordinated changes:
-
apm init extends the .gitignore block it already writes to cover deployed-primitive paths in addition to apm_modules/, and wraps the whole block in # >>> apm-managed >>> / # <<< apm-managed <<< markers so future apm versions can refresh the contents in place without disturbing unrelated rules.
-
apm add-vcsignore — standalone, idempotent command that writes or refreshes the same block. For repositories that adopt apm after apm init has already run, and for CI to self-heal drift. Name is VCS-neutral on purpose; auto-detection makes the git case zero-friction (see VCS portability note below).
-
apm compile refuses to overwrite tracked, non-ignored files, aborting with an actionable error that points at apm add-vcsignore and git rm --cached. This is the load-bearing piece — without it, (1) and (2) only protect future contributors; existing committed files keep getting overwritten without warning.
Sample .gitignore block, full error-message wording, edge cases, and open questions in the next comment.
Describe alternatives you've considered
- Documentation only — add a "remember to update
.gitignore" paragraph to the apm README.
Cheap, but doesn't help projects migrating from a hand-authored CLAUDE.md, doesn't catch existing drift in contributor checkouts, and doesn't resolve reviewer confusion about generated vs. hand-authored diffs.
- Pre-commit hook shipped by
apm install — refuse commits that contain generated paths.
Heavy for the problem; collides with existing user-managed pre-commit setups (husky, pre-commit, lefthook).
- Compile to alternate paths (subdirectory or suffix, e.g.
.apm/dist/CLAUDE.md) — sidesteps .gitignore entirely.
Doesn't work: consuming agents (Claude Code, Cursor, Copilot) read fixed paths (CLAUDE.md, .cursor/rules/); APM can't redirect them. Compile-time warning without enforcement — print a notice and proceed with the overwrite anyway. Adds noise without removing the failure mode; users habituate to the warning and the committed CLAUDE.md keeps drifting.
Sample .gitignore block, full error-message wording, edge cases, VCS portability notes, and open questions in the next comment.
Is your feature request related to a problem? Please describe.
apm installandapm compilewrite two kinds of files:apm_modules/.apm initalready adds this to.gitignore(with a# APM dependenciescomment), which is the right default.AGENTS.md,CLAUDE.md,.claude/,.cursor/,.github/instructions/,.agents/. These are equally derived from.apm/andapm.yml, but they currently get no.gitignoretreatment.That asymmetry makes the contributor experience fail in the wrong direction:
git statusand commit them, snapshotting whatever skill versions were installed at that moment.CLAUDE.mddiff was hand-authored or compiled.CLAUDE.mdto APM-generated has no safe path:apm compilesilently overwrites the committed file, and addingCLAUDE.mdto.gitignoreafter the fact does not help — git ignores.gitignorerules for already-tracked files.Describe the solution you'd like
Three coordinated changes:
apm initextends the.gitignoreblock it already writes to cover deployed-primitive paths in addition toapm_modules/, and wraps the whole block in# >>> apm-managed >>>/# <<< apm-managed <<<markers so future apm versions can refresh the contents in place without disturbing unrelated rules.apm add-vcsignore— standalone, idempotent command that writes or refreshes the same block. For repositories that adopt apm afterapm inithas already run, and for CI to self-heal drift. Name is VCS-neutral on purpose; auto-detection makes the git case zero-friction (see VCS portability note below).apm compilerefuses to overwrite tracked, non-ignored files, aborting with an actionable error that points atapm add-vcsignoreandgit rm --cached. This is the load-bearing piece — without it, (1) and (2) only protect future contributors; existing committed files keep getting overwritten without warning.Sample
.gitignoreblock, full error-message wording, edge cases, and open questions in the next comment.Describe alternatives you've considered
.gitignore" paragraph to the apm README.Cheap, but doesn't help projects migrating from a hand-authored
CLAUDE.md, doesn't catch existing drift in contributor checkouts, and doesn't resolve reviewer confusion about generated vs. hand-authored diffs.apm install— refuse commits that contain generated paths.Heavy for the problem; collides with existing user-managed pre-commit setups (husky, pre-commit, lefthook).
.apm/dist/CLAUDE.md) — sidesteps.gitignoreentirely.Doesn't work: consuming agents (Claude Code, Cursor, Copilot) read fixed paths (
CLAUDE.md,.cursor/rules/); APM can't redirect them. Compile-time warning without enforcement — print a notice and proceed with the overwrite anyway. Adds noise without removing the failure mode; users habituate to the warning and the committedCLAUDE.mdkeeps drifting.Sample
.gitignoreblock, full error-message wording, edge cases, VCS portability notes, and open questions in the next comment.