Describe the bug
When using apm compile --targets with a comma-delimited list that spans multiple compiler families (e.g., claude,codex), the compile command incorrectly generates GEMINI.md even though Gemini was not included in the target list. This happens because _resolve_compile_target() in src/apm_cli/commands/compile/cli.py collapses any multi-family combination into "all", and "all" unconditionally triggers generation of all output files including GEMINI.md.
To Reproduce
- Run
apm compile --targets claude,codex
- Observe that
GEMINI.md is generated in the output
- The same occurs with any cross-family combination that does not include
gemini, e.g., --targets claude,cursor
Expected behavior
Only CLAUDE.md and AGENTS.md should be generated when --targets claude,codex is specified. GEMINI.md should only be generated when the target list explicitly includes gemini, or when --targets all is used.
Environment (please complete the following information):
- OS: macOS 26.4.1
- Python Version: 3.14.4
- APM Version: 0.10.0
Logs
N/A
Additional context
The root cause is in _resolve_compile_target() (src/apm_cli/commands/compile/cli.py, lines 166–198). When the target is a list, it groups targets into three families (has_agents_family, has_claude, has_gemini) and counts distinct families. If distinct >= 2, it returns "all". Downstream, should_compile_gemini_md() (src/apm_cli/core/target_detection.py, line 162) returns True for "all", so GEMINI.md is always generated.
The issue is that "all" is overloaded — it means both "the user explicitly requested all targets" and "the user requested targets from more than one compiler family." There is no way to represent "claude + agents-family but not gemini" in the current scheme.
Describe the bug
When using
apm compile --targetswith a comma-delimited list that spans multiple compiler families (e.g.,claude,codex), the compile command incorrectly generatesGEMINI.mdeven though Gemini was not included in the target list. This happens because_resolve_compile_target()insrc/apm_cli/commands/compile/cli.pycollapses any multi-family combination into"all", and"all"unconditionally triggers generation of all output files includingGEMINI.md.To Reproduce
apm compile --targets claude,codexGEMINI.mdis generated in the outputgemini, e.g.,--targets claude,cursorExpected behavior
Only
CLAUDE.mdandAGENTS.mdshould be generated when--targets claude,codexis specified.GEMINI.mdshould only be generated when the target list explicitly includesgemini, or when--targets allis used.Environment (please complete the following information):
Logs
N/A
Additional context
The root cause is in
_resolve_compile_target()(src/apm_cli/commands/compile/cli.py, lines 166–198). When the target is a list, it groups targets into three families (has_agents_family,has_claude,has_gemini) and counts distinct families. Ifdistinct >= 2, it returns"all". Downstream,should_compile_gemini_md()(src/apm_cli/core/target_detection.py, line 162) returnsTruefor"all", soGEMINI.mdis always generated.The issue is that
"all"is overloaded — it means both "the user explicitly requested all targets" and "the user requested targets from more than one compiler family." There is no way to represent "claude + agents-family but not gemini" in the current scheme.