Skip to content

[BUG] apm compile -t <target> generates outputs for ALL targets, ignoring the -t flag #1074

@ic4-y

Description

@ic4-y

Bug Description

apm compile -t <target> generates output files for ALL supported targets regardless of what is passed to -t. The flag only controls which harness directories get skills deployed to during apm install, not what compile outputs.

Environment

  • APM version: 0.11.0
  • OS: Linux (NixOS)

Steps to Reproduce

mkdir -p /tmp/apm-compile-bug/.apm/instructions
cd /tmp/apm-compile-bug

cat > apm.yml << 'EOF'
name: test-bug
version: 1.0.0
type: hybrid
target: opencode
EOF

cat > .apm/instructions/test.instructions.md << 'EOF'
---
description: Test instruction
applyTo: "*.md"
---

Test content.
EOF

# Compile with opencode target only
apm compile -t opencode

Expected Behavior

apm compile -t opencode should only generate AGENTS.md (which is what opencode reads). It should not generate CLAUDE.md, GEMINI.md, or any other target-specific output.

Actual Behavior

$ apm compile -t opencode
[*] Starting context compilation...
[i] Compiling for AGENTS.md + CLAUDE.md + GEMINI.md + .github/ + .claude/ +
.cursor/ + .opencode/ + .codex/ + .gemini/ + .agents/ - explicit --target flag

Running ls after the command shows both AGENTS.md and CLAUDE.md (and likely more if the project had matching target files). The -t opencode flag had no effect on which files were generated.

Additional Context

  • The -t flag description in --help says Target platform: copilot (AGENTS.md), claude (CLAUDE.md), cursor, opencode, or all. — implying it controls compile output, but it does not.
  • This produces unwanted files (e.g., a CLAUDE.md in a repo that only uses opencode) that must then be .gitignore\d or manually cleaned.
  • Verified on 0.11.0 with a clean Python environment (no PYTHONPATH pollution).

Suspected Location

The compile command likely ignores the -t/--target parameter and always compiles for all registered targets. The flag is only respected by apm install for harness directory deployment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions