Skip to content

[FEATURE] Compile "prompts" primitive to Codex's native ~/.codex/prompts/ format (mirroring how "agents" already targets .codex/agents/*.toml) #2056

Description

@Ives7

Is your feature request related to a problem? Please describe.

The prompts primitive (.apm/prompts/*.prompt.md) compiles to Claude (.claude/commands/<name>.md), Copilot (.github/prompts/<name>.prompt.md), Cursor (.cursor/commands/<name>.md), Gemini (.gemini/commands/<name>.toml), and Windsurf (.windsurf/workflows/<name>.md) — but explicitly emits nothing for Codex. The docs confirm this is intentional today: "Codex receives nothing. Do not assume a prompt is universal," with the suggested workaround being to ship the functionality as a skill instead.

This is inconsistent with the agents primitive (.apm/agents/*.agent.md), which does compile to Codex correctly today: .codex/agents/<name>.toml, with the markdown body mapped to the developer_instructions field (per the "What compiles where" table in the instructions-and-agents docs). So apm already has precedent for faithfully materializing a primitive into a Codex-native format — it just hasn't been done for prompts yet.

Note this is a different ask from #1781, which was declined. #1781 proposed generating a skill from each prompt entry on Codex — i.e., translating one primitive type into another, which the maintainer correctly identified as a semantic-translation shim outside apm's install-and-integrity scope ("materializing the primitive faithfully is ours" vs. translating between primitive types). This issue instead asks apm to materialize the same prompt primitive onto Codex's own native prompts mechanism, not convert it into a different primitive — the same category of work already being done for agents -> .codex/agents/*.toml.

Concretely, Codex CLI already has its own native custom-prompts mechanism: files under ~/.codex/prompts/*.md, where the filename becomes the invocable command name (e.g. /prompt-name). So Codex can support project-authored custom commands in principle — it's specifically apm's prompts compiler that doesn't target it yet.

Without this, any apm package that ships a prompt is unusable as a slash-command on Codex, and a developer who wants that command available in Codex has to hand-author and hand-maintain a separate file under ~/.codex/prompts/ outside of apm's install/lock/verify lifecycle, per machine, instead of getting it compiled and kept in sync automatically the way Claude/Copilot/Cursor/Gemini/Windsurf users already do.

Describe the solution you'd like

Extend the prompts compiler to also emit to Codex's native prompts format when Codex is a target, mirroring the existing agents -> .codex/agents/<name>.toml mapping:

  • Output: <name>.md (body content, since Codex's native prompt files are plain markdown, not TOML)
  • Location: Codex's native prompts directory (~/.codex/prompts/)

One open question worth surfacing: Codex's native prompts directory is user-global (~/.codex/prompts/), unlike apm's other prompt targets which are all project-local (.claude/commands/, .cursor/commands/, etc.). If apm's install model assumes all materialized output lives inside the project tree, targeting a user-global path may need either (a) a documented exception for this target, or (b) treating it as out of scope for apm install and only relevant to apm install -g. Flagging this rather than assuming it's a simple addition.

Describe alternatives you've considered

  • Keep the current behavior (Codex gets nothing for prompts, author ships a skill instead). Works, but means prompt-based packages are simply unreachable as slash-commands on Codex, and there's no compiled/shared path — every developer maintains their own ~/.codex/prompts/ file by hand.
  • Generate a skill from prompt entries on Codex ([FEATURE] Generate a skill for prompt entries when targeting Codex #1781) — already proposed and declined as an out-of-scope semantic translation between primitive types.

Additional context

This was noticed while comparing how the agents and prompts primitives each target Codex — agents has full, correct Codex support today (verified empirically via apm install), while prompts has none, despite Codex having its own equivalent native mechanism that would make this a faithful materialization rather than a translation shim.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/docs-sitedocs/src/content (Starlight), README, doc generation.area/multi-targetMulti-target deploy spec, target directory creation, agent surface routing.area/package-authoringapm pack/unpack, plugin authoring, vendoring guidance, bundle format.status/needs-designDirection approved, design discussion required before code.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).theme/portabilityOne manifest, every target. Multi-target deploy, marketplace, packaging, install.type/featureNew capability, new flag, new primitive.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions