fix(kyberforge): bring prompt-author level with apm 0.39.3

apm 0.39 keeps Claude Code command keys such as disable-model-invocation
on the claude target and still drops them on cursor, opencode, windsurf
and grok-build. It withholds hooks, names dropped keys only under
--verbose, deploys a body-only prompt to Kiro, fails install on a
hand-edited deployed command, and writes nothing when a prompt carries a
critical hidden character.

Update the Gotchas, the frontmatter contract, the compatibility line, the
template and every reference. Re-cite forge's prompt-routing table on the
0.39.3 run. Bump prompt-author to 0.1.1 and forge to 1.0.6.

Refs: #273

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
Defame1297andClaude Opus 5.5 committed 2026-12-02 11:59:17 +00:00
1 parent 598f88b536
commit 5f9c805522
11 files changed
+74 -33

No files matched your search

@@ -6,7 +6,7 @@ description: >
skill -> `skill-author`. Not a named agent -> `agent-author`. Not a named
plugin -> `apm-workflow`.
metadata:
version: "1.0.5"
version: "1.0.6"
category: factory
source_keys:
- claude-code-subagents-docs
@@ -4,7 +4,7 @@ source_keys:
- context7-websites-code-claude
- claude-code-memory-docs
- apm-docs-author-prompts
- apm-cli-0-28-0-prompt-experiments
- apm-cli-0-39-3-experiments
- claude-code-slash-commands
---
@@ -32,11 +32,11 @@
- **Contributing files:** references/author-routes.md
- **Status:** `extracted`
## apm-cli-0-28-0-prompt-experiments
## apm-cli-0-39-3-experiments
- **URL:** https://pypi.org/project/apm-cli/0.28.0/
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-target-mapping.md)
- **Description:** The installed apm-cli 0.28.0 exercised in throwaway packages. Grounds the same table: which targets receive a prompt file.
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-gotchas.md)
- **Description:** The repo-pinned apm-cli 0.39.3 run in throwaway packages (holocron#273), re-running the 0.28.0 prompt experiments. Grounds the same table: Copilot, Cursor, Gemini and OpenCode each receive a prompt file as a command. Kiro now receives the body only, and Codex and Antigravity still receive nothing.
- **Contributing files:** references/author-routes.md
- **Status:** `extracted`
@@ -5,23 +5,24 @@ description: >
(`.apm/prompts/*.prompt.md`). Not read-only review -> `factory-audit`.
Not skills -> `skill-author`. Not agents -> `agent-author`. Not
instructions -> `instructions-author`.
compatibility: Requires the apm CLI; behaviour verified against apm 0.28.0.
compatibility: Requires the apm CLI, 0.39.2 or later; behaviour verified against apm 0.39.3.
allowed-tools: Bash Read Write Edit
metadata:
version: "0.1.0"
version: "0.1.1"
category: factory
source_keys:
- apm-docs-author-prompts
- apm-docs-llms-full
- apm-docs-producer-ramp
- apm-github-repo
- apm-cli-0-28-0-prompt-experiments
- apm-cli-0-39-3-experiments
- apm-v0-39-3-source
---
## Gotchas
- `apm compile` never reads prompt files, and `--validate` ignores them even when malformed. A prompt file is verified only by a throwaway `apm install`.
- Unsupported frontmatter keys are dropped, loudly on the Claude family and silently on Gemini, which keeps only `description`. Codex, Kiro and Antigravity deploy nothing and print nothing.
- Unsupported frontmatter keys are dropped without a word: the Claude family names them only under `apm install --verbose`, Gemini keeps only `description`, and Kiro keeps no frontmatter. Codex and Antigravity deploy nothing and print nothing.
- `input:` descriptions are discarded: only the names survive, as `arguments:`. Duplicate names are not caught.
## Step 1 — Dispatch
@@ -42,7 +43,7 @@ Gates on every file, whichever flow wrote it:
- **Source.** A single file named `<stem>.prompt.md` in `.apm/prompts/`, flat. Anything nested, uppercase or named plain `.md` is silently ignored.
- **Stem.** Kebab-case. It becomes the deployed command name, and apm skips a hand-written file of the same name unless `--force` is passed. Check for a collision before choosing it.
- **Frontmatter.** `description`, plus `input`, `allowed-tools`, `model` or `argument-hint` only when needed. No other keys: they are dropped, and `source_keys` would warn on every install.
- **Frontmatter.** `description`, plus `input`, `allowed-tools`, `model` or `argument-hint` only when needed. A Claude Code command key such as `disable-model-invocation` survives on the `claude` target only, from apm 0.39.0, and is dropped on every other target; add one only when the command needs it on Claude. Never `hooks`: apm withholds it. No other keys, `source_keys` included: they are dropped.
- **Arguments.** Declare `input:` names and use `${input:name}` in the body, or use a literal `$ARGUMENTS`, never both.
- **Body.** Written as an instruction to the model, self-contained, and clear about what it produces. If unsure the content is a prompt file rather than a skill, a rule or something to enforce, read `references/content.md`.
@@ -11,6 +11,8 @@ input:
# allowed-tools: Bash(git status:*) Read
# model: FILL IN
# argument-hint: "<target>" # synthesised from input: when omitted
# Claude only (apm 0.39+), dropped on every other target:
# disable-model-invocation: true
---
FILL IN: an instruction to the model, written so it works with nothing else loaded.
@@ -1,7 +1,7 @@
---
source_keys:
- apm-docs-author-prompts
- apm-cli-0-28-0-prompt-experiments
- apm-cli-0-39-3-experiments
---
# Creating a new prompt file
@@ -1,7 +1,7 @@
---
source_keys:
- apm-docs-author-prompts
- apm-cli-0-28-0-prompt-experiments
- apm-cli-0-39-3-experiments
---
# Improving an existing prompt file
@@ -18,15 +18,20 @@ Read the file whole. Apply the signals that triggered this flow (`SKILL.md` Step
|---|---|---|
| The command does not exist after install | The file is nested, uppercase (`.PROMPT.md`) or a bare `.md`, so discovery ignored it | Move it flat into `.apm/prompts/` and name it `<stem>.prompt.md` |
| The command is missing and install warned "malformed or over-budget YAML frontmatter" | Broken frontmatter, so Claude and Gemini skipped the file | Repair the YAML |
| Install warned "frontmatter keys not supported … dropped" | The file carries keys the Claude family does not keep | Remove them, or accept that only Copilot keeps them |
| `apm install --verbose` reported "frontmatter keys not supported … dropped" | The file carries keys that target does not keep | Remove them, or accept that only Copilot keeps them |
| `disable-model-invocation` or another Claude Code command key is missing from `.claude/commands/` | The apm that installed it is older than 0.39, which dropped those keys | Install with apm 0.39.2 or later |
| A Claude Code command key is missing from the Cursor or OpenCode command | Only the `claude` target keeps those keys | State it to the user; it is apm behaviour |
| Install warned "frontmatter hooks withheld" | The file sets `hooks`, which apm does not deploy on commands | Remove it, or move the hook into a hook package |
| An argument is missing from `arguments:` | The name failed `[A-Za-z][A-Za-z0-9_-]{0,63}` and install warned `input: rejected` | Rename it |
| An argument appears twice | Duplicate names are not caught | Remove the duplicate |
| `arguments:` lists `name` and `description` | An `input:` item had `name:` and `description:` keys, and each key became an argument | Use plain names, or one `{name: description}` pair per item |
| The body shows `$ARGUMENTS` or `$0` next to named arguments | `input:` and a literal placeholder were both written | Use one style |
| The Gemini command ignores `model` or `allowed-tools` | Gemini keeps only `description` and the body, silently | State it to the user; it is apm behaviour |
| Nothing deployed for Codex, Kiro or Antigravity | Those targets have no prompt surface | State it to the user |
| Nothing deployed for Codex or Antigravity | Those targets have no prompt surface | State it to the user |
| The Kiro prompt has no frontmatter | Kiro's prompt surface keeps the body only | State it to the user |
| Install exited 1 with "Kept … modified since APM deployed it" | A deployed command was edited by hand | Move it aside, or export the edit with `apm export-patch`, then reinstall |
| A hand-written command was not replaced | apm skips unmanaged files | Rename the stem, or use `apm install --force` knowingly |
| Install failed with exit 1 and a security error | Tag characters or a bidi override in the file; the Claude-family command is withheld even with `--force`, while the Copilot copy and Gemini TOML may still be written | Remove the hidden characters |
| Install failed with exit 1 and a security error | Tag characters or a bidi override in the file. Nothing is written; with `--force` the Copilot copy and Gemini TOML are, but the Claude-family command is still withheld | Remove the hidden characters |
Cases not in the table: read `references/target-mapping.md`.
@@ -2,12 +2,14 @@
source_keys:
- apm-docs-author-prompts
- apm-github-repo
- apm-v0-39-3-source
- apm-cli-0-39-3-experiments
- apm-cli-0-28-0-prompt-experiments
---
# The prompt source file
Verified against apm 0.28.0. Reached from `SKILL.md` Step 2 when a field, a placeholder or the file's location is in question.
Verified against apm 0.39.3, except the root-file and odd-name rules under "Location and name", last run on 0.28.0. Reached from `SKILL.md` Step 2 when a field, a placeholder or the file's location is in question.
## Location and name
@@ -31,9 +33,16 @@ No closed schema; apm passes or drops keys per target.
| `model` | Model override |
| `argument-hint` (alias `argumentHint`) | Hint text; synthesised as `<a> <b>` from `input` when omitted |
### Claude Code command keys
From apm 0.39.0 the `claude` target keeps Claude Code's own command keys: `when_to_use`, `disable-model-invocation`, `user-invocable`, `disallowed-tools`, `effort`, `context`, `agent`, `background` and `shell`. Every other target that gets a command file (cursor, opencode, windsurf, grok-build) drops them, and Gemini and Kiro drop them with the rest. apm 0.28.0 dropped them on Claude too, so a command relying on one needs apm 0.39.2 or later wherever it is installed.
- An authored `arguments:` is kept on Claude only when the file has no `input:` key at all.
- `hooks` is withheld: the command deploys without it, and install warns `frontmatter hooks withheld`.
Input names must match `[A-Za-z][A-Za-z0-9_-]{0,63}`. An invalid name is dropped with a warning and the install still succeeds; duplicates are neither removed nor warned about.
The Copilot App workflow keys `interval`, `schedule_hour` and `schedule_day` mark a prompt file as a scheduled workflow that the command integrator skips. Do not use them in a plain prompt file. The VS Code keys `agent`, `tools` and `name` survive on Copilot only.
The Copilot App workflow keys `interval`, `schedule_hour` and `schedule_day` mark a prompt file as a scheduled workflow that the command integrator skips. Do not use them in a plain prompt file. The VS Code keys `tools` and `name` survive on Copilot only. `agent` also survives on Claude, as a Claude Code command key with its own meaning there.
## Body placeholders
@@ -4,6 +4,8 @@ source_keys:
- apm-docs-llms-full
- apm-docs-producer-ramp
- apm-github-repo
- apm-v0-39-3-source
- apm-cli-0-39-3-experiments
- apm-cli-0-28-0-prompt-experiments
---
@@ -41,10 +43,26 @@ source_keys:
- **Contributing files:** SKILL.md, references/schema.md
- **Status:** `extracted`
## apm-v0-39-3-source
- **URL:** https://github.com/microsoft/apm/tree/v0.39.3/src/apm_cli
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-primitive-schema.md)
- **Description:** apm source at tag v0.39.3: the Claude-native command keys kept only on the `claude` target (`_CLAUDE_NATIVE_COMMAND_KEYS`), the `arguments` rule, and `hooks` being withheld.
- **Contributing files:** SKILL.md, references/schema.md, references/target-mapping.md
- **Status:** `extracted`
## apm-cli-0-39-3-experiments
- **URL:** https://pypi.org/project/apm-cli/0.39.3/
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-gotchas.md)
- **Description:** The repo-pinned apm-cli 0.39.3 run in throwaway packages (holocron#273): Claude-native keys on claude versus cursor and opencode, the `--verbose` dropped-keys line, `hooks` withheld, per-target output including Kiro, malformed YAML, input names, collisions, hand-edited deployed files, hidden-character scanning, and compile ignoring prompts.
- **Contributing files:** SKILL.md, references/create.md, references/improve.md, references/schema.md, references/target-mapping.md, references/verify.md
- **Status:** `extracted`
## apm-cli-0-28-0-prompt-experiments
- **URL:** https://pypi.org/project/apm-cli/0.28.0/
- **Research doc:** plugins/kyberforge/docs/research/docs/microsoft-apm/sources.md (digest: plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-gotchas.md)
- **Description:** The installed apm-cli 0.28.0 exercised in throwaway packages: discovery, manifest type, compile on prompts-only packages, per-target output and warnings, input-name and YAML edge cases, collisions, cleanup, hidden-Unicode scanning and packing.
- **Contributing files:** SKILL.md, references/create.md, references/improve.md, references/schema.md, references/target-mapping.md, references/verify.md
- **Description:** The installed apm-cli 0.28.0 exercised in throwaway packages. Superseded by `apm-cli-0-39-3-experiments` wherever both were run; still the only source for root-level discovery, odd filenames, user-scope paths, packing, and BOM, NBSP and bidi scanning.
- **Contributing files:** references/schema.md, references/target-mapping.md
- **Status:** `extracted`
@@ -2,12 +2,14 @@
source_keys:
- apm-docs-author-prompts
- apm-docs-llms-full
- apm-cli-0-39-3-experiments
- apm-v0-39-3-source
- apm-cli-0-28-0-prompt-experiments
---
# What each target receives
Verified against apm 0.28.0 in throwaway installs; runtime behaviour in the receiving tools was not tested. Reached from `SKILL.md` Step 2. Source syntax is in `references/schema.md`.
Verified against apm 0.39.3 in throwaway installs, except the user-scope paths and packing, last run on 0.28.0. Runtime behaviour in the receiving tools was not tested. Reached from `SKILL.md` Step 2. Source syntax is in `references/schema.md`.
## Install is the only path
@@ -20,7 +22,8 @@ Verified against apm 0.28.0 in throwaway installs; runtime behaviour in the rece
| cursor, opencode, grok-build | `.cursor/commands/`, `.opencode/commands/`, `.grok/commands/` `<n>.md` | Same transform as claude |
| windsurf | `.windsurf/workflows/<n>.md` | Same transform |
| gemini | `.gemini/commands/<n>.toml` | `description` and `prompt` only, silently |
| codex, kiro, antigravity, agent-skills | none | Exit 0, no warning |
| kiro | `.kiro/prompts/<n>.md` | Body only; every frontmatter key stripped, with a warning naming them |
| codex, antigravity, agent-skills | none | Exit 0, no warning |
At user scope (`apm install -g`) claude, gemini and cursor deploy to their home commands directories and Copilot to `~/.copilot/prompts/`. The experimental targets (hermes, openclaw, copilot-cowork, grok-cloud, copilot-app) need a flag and are untested.
@@ -33,9 +36,11 @@ At user scope (`apm install -g`) claude, gemini and cursor deploy to their home
| `allowed-tools` | kept (ignored by Copilot) | kept | dropped silently |
| `model` | kept | kept | dropped silently |
| `argument-hint` | kept | kept or synthesised | dropped silently |
| any other key | kept | dropped, with a warning naming the keys | dropped silently |
| Claude Code command keys (`disable-model-invocation` and the rest, `references/schema.md`) | kept | kept on `claude` only; dropped on cursor, opencode, windsurf and grok-build | dropped silently |
| `hooks` | kept | withheld on `claude`, with a warning; dropped elsewhere | dropped silently |
| any other key | kept | dropped; named only under `apm install --verbose` | dropped silently |
The Claude command file holds only `allowed-tools`, `argument-hint`, `arguments`, `description` and `model`, sorted, with no trailing newline.
The Claude command file holds the shared keys (`allowed-tools`, `argument-hint`, `arguments`, `description`, `model`) plus any Claude Code command keys, sorted. Cursor's and the other Claude-family files hold the shared keys only.
## Body placeholders by target
@@ -49,13 +54,14 @@ Claude Code natively supports `$ARGUMENTS`, zero-based `$N` and named `$name` fr
## Ownership and cleanup
- A hand-written file at a deployed path is skipped ("not managed by APM", exit 0); `--force` overwrites. Editing a deployed file and reinstalling silently overwrites it.
- Removing a prompt file from the package and reinstalling deletes the deployed files. A hand-edited one is kept with a "delete manually" message.
- Zero-width characters, BOM and NBSP warn and the file deploys to every target. Tag characters and bidi overrides are critical: install exits 1 and the Claude-family command is withheld, but the Copilot byte copy and Gemini TOML may still be written. `--force` makes the exit code 0 and changes nothing else.
- A hand-written file at a deployed path is skipped ("not managed by APM", exit 0); `--force` overwrites.
- A deployed file edited by hand blocks the next install that would change it: install exits 1 with "Kept ... it was modified since APM deployed it" and commits nothing. Move the file aside, or export the edit with `apm export-patch`.
- Removing a prompt file from the package and reinstalling deletes the deployed files. A hand-edited one is kept, with a warning.
- A zero-width space warns and the file deploys to every target. A tag character is critical: install exits 1 and writes nothing on any target. `--force` exits 0 and writes the Copilot copy and Gemini TOML, but still withholds the Claude-family command. BOM, NBSP and bidi overrides were last tested on 0.28.0, as warning, warning and critical.
## Packing
`apm pack --format plugin` copies `.apm/prompts/x.prompt.md` to `commands/x.md` unchanged and skips root-level prompts. Installing that bundle copies files verbatim, so `input:` survives untransformed and Copilot receives `.github/commands/`.
Last run on 0.28.0. `apm pack --format plugin` copies `.apm/prompts/x.prompt.md` to `commands/x.md` unchanged and skips root-level prompts. Installing that bundle copies files verbatim, so `input:` survives untransformed and Copilot receives `.github/commands/`.
## Unverified
@@ -1,11 +1,11 @@
---
source_keys:
- apm-cli-0-28-0-prompt-experiments
- apm-cli-0-39-3-experiments
---
# Verifying a file in a throwaway package
Reached from `SKILL.md` Step 3. `apm compile` and `apm compile --validate` never read prompts, so they verify nothing. Install is the only check. Run it outside the repo: `apm install` writes `apm_modules/`, `apm.lock.yaml` and a commands directory.
Reached from `SKILL.md` Step 3. `apm compile` and `apm compile --validate` never read prompts, so they verify nothing. Install is the only check. Run it outside the repo: `apm install` writes `apm_modules/`, `apm.lock.yaml` and a commands directory. In a repo that pins apm with uv, spell each `apm` below as `uv run --project <repo root> --frozen apm`, so the check runs the repo's apm and not the one on `PATH`.
1. Deploy the prompt where nothing else can be overwritten:
@@ -14,12 +14,12 @@ Reached from `SKILL.md` Step 3. `apm compile` and `apm compile --validate` never
printf 'name: scratch\nversion: 0.1.0\ntype: prompts\ntargets:\n - claude\n' > "$d/apm.yml"
mkdir -p "$d/.apm/prompts" "$d/.claude"
cp <package-root>/.apm/prompts/<name>.prompt.md "$d/.apm/prompts/"
(cd "$d" && apm install && cat .claude/commands/<name>.md)
(cd "$d" && apm install --verbose && cat .claude/commands/<name>.md)
```
2. Read every warning install prints. A line starting "frontmatter keys not supported … dropped" lists keys that did not survive; "input: rejected" names an invalid argument; "Skipped command … malformed" means the file did not parse and no command exists.
2. Read every warning and info line install prints. `--verbose` is what makes apm name dropped keys: a line "frontmatter keys not supported … dropped" lists keys that did not survive, and "frontmatter hooks withheld" means `hooks` was removed; "input: rejected" names an invalid argument; "Skipped command … malformed" means the file did not parse and no command exists.
3. The deployed file must contain `description` and, if `input:` was written, an `arguments:` list matching it. Body placeholders should read `$name`, not `${input:name}`. A missing file means the install skipped it.
3. The deployed file must contain `description`, every Claude Code command key the source set, such as `disable-model-invocation`, and, if `input:` was written, an `arguments:` list matching it. A missing command key means the apm that ran is older than 0.39. Body placeholders should read `$name`, not `${input:name}`. A missing file means the install skipped it.
4. For another target, add it to `targets:` and `cat` its deployed path from `references/target-mapping.md`. Gemini prints no warning for what it drops, so read its `.toml`.