fix(kyberforge): correct prompt-author claims found in clean-context review

Three clean-context reviewers checked the skill against apm 0.28.0. Fix what
they showed to be wrong: a failed hidden-character install still writes the
Copilot and Gemini outputs and withholds only the Claude command; a multi-key
input item turns each key into an argument. Add the symptom row, use "prompt
file" for the source concept, name the Claude slash-commands source for the
forge discriminator, drop an ambiguous Step 3 pointer and a "trim" heading
with no trim guidance, and tighten two bats assertions. CONTEXT.md now says
"a single-file command that is not a SKILL.md".

Refs #149

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN
This commit is contained in:
Defame1297andClaude Sonnet 5.5 committed 2026-10-15 16:16:27 +00:00
1 parent e9df1ca0da
commit 8381c9f395
13 files changed
+40 -27

No files matched your search

+1 -1
View File
@@ -48,7 +48,7 @@ _Avoid_: agent hygiene
A reusable capability defined as a `SKILL.md` file following the
[Agent Skills open standard](https://agentskills.io), authored at
`plugins/<plugin>/.apm/skills/<skill>/SKILL.md`. It is loaded by description-matching, or typed by
hand when declared a **Hand-invoked skill**. A slash command that is not a `SKILL.md` is a
hand when declared a **Hand-invoked skill**. A single-file command that is not a `SKILL.md` is a
**Prompt file**.
_Avoid_: command, prompt, macro
@@ -5,6 +5,7 @@ source_keys:
- claude-code-memory-docs
- apm-docs-author-prompts
- apm-cli-0-28-0-prompt-experiments
- claude-code-slash-commands
---
# Routing a skill, agent, instructions file or prompt file to its author skill
@@ -36,7 +36,15 @@
- **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 and that a Claude-only command gains nothing from a prompt file over a skill.
- **Description:** The installed apm-cli 0.28.0 exercised in throwaway packages. Grounds the same table: which targets receive a prompt file.
- **Contributing files:** references/author-routes.md
- **Status:** `extracted`
## claude-code-slash-commands
- **URL:** https://code.claude.com/docs/en/slash-commands
- **Research doc:** plugins/kyberforge/docs/research/docs/prompt-standards/sources.md (digest: plugins/kyberforge/docs/research/docs/prompt-standards/claude-code-commands.md)
- **Description:** Claude Code custom-commands documentation. Grounds the third row of the "Prompt file or hand-invoked skill?" table in `references/author-routes.md`: custom commands are merged into skills, still work, and the docs recommend skills for new work.
- **Contributing files:** references/author-routes.md
- **Status:** `extracted`
@@ -7,9 +7,9 @@ source_keys:
Reached from `SKILL.md` Step 3 after a route has finished. A skill route always lands here:
`skill-author` moves only a skill's own `metadata.version`, which is not the package manifest's
number, so the package version is still behind when it reports done. `agent-author`, `instructions-author` and `prompt-author` bump the
resolved package's `apm.yml` themselves (`agent-author` at plugin/APM scope), and `apm-workflow`'s configure flow
carries the same policy — read those routes' output before acting here, because a second bump for
number, so the package version is still behind when it reports done. `agent-author`,
`instructions-author` and `prompt-author` bump the resolved package's `apm.yml` themselves
(`agent-author` at plugin/APM scope), and `apm-workflow`'s configure flow carries the same policy — read those routes' output before acting here, because a second bump for
one change is wrong.
## Find the owning package
@@ -20,7 +20,7 @@ metadata:
## Gotchas
- `apm compile` never reads prompt files, and `--validate` ignores them even when malformed. A prompt is verified only by a throwaway `apm install`.
- `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.
- `input:` descriptions are discarded: only the names survive, as `arguments:`. Duplicate names are not caught.
@@ -32,7 +32,7 @@ metadata:
| A file exists, at least one improvement signal present | Improve | `references/improve.md` |
| A file exists, no signals | Stop and ask | — |
Signals: grill output, audit findings, inline feedback, a session describing a command that is missing, argument-less or lost a field after install. With none, ask whether the user meant to create a new file or has feedback to apply.
Signals: grill output, audit findings, inline feedback, a session describing a command that is missing, argument-less or lost a field after install. With none, ask whether this is a new file or feedback to apply.
Read only the reference for the resolved flow.
@@ -41,7 +41,7 @@ Read only the reference for the resolved flow.
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 command name, and apm skips a hand-written file of the same name unless `--force` is passed. Check for a collision before choosing it.
- **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.
- **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`.
@@ -22,7 +22,7 @@ Reached from `SKILL.md` Step 2. A prompt file is a single instruction a user fir
## Not a prompt file?
Stop and tell the user when the content is any of these, and do not bend it into a prompt:
Stop and tell the user when the content is any of these, and do not bend it into a prompt file:
- A multi-step procedure that needs `references/` or `scripts/`, or that other skills or the model must be able to call: a skill. Which kind is forge's call.
- A rule that should apply without being typed: an instructions file.
@@ -6,19 +6,19 @@ source_keys:
# Creating a new prompt file
Return to `SKILL.md` Step 3 once Step 3 below is done.
Return to `SKILL.md` Step 3 once the file is filled in (Step 3 below).
## Before touching the filesystem
Confirm, and ask the user for anything missing:
- [ ] What the command does, in one sentence. Two jobs are two files.
- [ ] What the prompt file does, in one sentence. Two jobs are two files.
- [ ] Which arguments it takes, by name, or that it takes none.
- [ ] A kebab-case stem. It becomes the command name.
## Step 1 — Check the stem
apm skips a hand-written file at `.claude/commands/<stem>.md`, `.github/prompts/<stem>.prompt.md`, `.cursor/commands/<stem>.md` and `.gemini/commands/<stem>.toml` ("not managed by APM") and installs everything else. `--force` overwrites it. List those paths in the consuming project and choose another stem on any hit.
apm skips a hand-written file at a deployed path ("not managed by APM") and installs everything else. `--force` overwrites it. For each target in `targets:`, list its path from `references/target-mapping.md` in the consuming project and choose another stem on any hit.
## Step 2 — Scaffold
@@ -10,7 +10,7 @@ Return to `SKILL.md` Step 3 once the edits are made.
## Step 1 — Read the file and the signals
Read the file whole. Signals are grill output, audit findings, inline feedback, or a session describing a command that is missing, lost a field or ignores its arguments. Apply what the signals name and nothing else.
Read the file whole. Apply the signals that triggered this flow (`SKILL.md` Step 1) and nothing else.
## Step 2 — Diagnose by symptom
@@ -19,16 +19,17 @@ Read the file whole. Signals are grill output, audit findings, inline feedback,
| 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 |
| An argument is missing from `arguments:` | The name failed `[A-Za-z][\w-]{0,63}` and install warned `input: rejected` | Rename it |
| 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 |
| 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; `--force` does not deploy it either | Remove the hidden characters |
| 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 |
Cases not in the table: read `references/target-mapping.md`.
## Step 3 — Split or trim
## Step 3 — Split
A prompt doing two jobs becomes two files. Do the split only when a signal names it.
A prompt file doing two jobs becomes two files. Do the split only when a signal names it.
@@ -14,7 +14,7 @@ Verified against apm 0.28.0. Reached from `SKILL.md` Step 2 when a field, a plac
`.apm/prompts/<name>.prompt.md`, flat. A root-level `<name>.prompt.md` is also discovered, but `.apm/prompts/` is canonical.
- Discovery is non-recursive and case-sensitive. A file in a subdirectory, `X.PROMPT.md` or a bare `x.md` is ignored with exit 0.
- The stem is the prompt's name and the command name. There is no `name` field. Odd names (uppercase, underscores, dots, spaces) deploy unvalidated, so use kebab-case.
- The stem is the prompt file's name and, once deployed, the command name. There is no `name` field. Odd names (uppercase, underscores, dots, spaces) deploy unvalidated, so use kebab-case.
- `apm init` creates only `apm.yml`; create `.apm/prompts/` yourself.
- The manifest `type:` is validated (`instructions`, `skill`, `hybrid`, `prompts`) but never constrains what deploys.
- Do not give a root file and a `.apm/prompts/` file the same stem. The root one wins and the other is skipped with a misleading "not managed by APM".
@@ -26,14 +26,14 @@ No closed schema; apm passes or drops keys per target.
| Key | Purpose |
|---|---|
| `description` | Shown in pickers; kept everywhere |
| `input` | Argument names, a list of strings. Becomes `arguments:` on the Claude family. Object and map forms are accepted, but their descriptions are discarded |
| `input` | Argument names, a list of strings. Becomes `arguments:` on the Claude family. A list item `{name: description}` is accepted, but the description is discarded. An item with several keys, such as `name:` plus `description:`, makes each key an argument, so do not write one |
| `allowed-tools` (alias `allowedTools`) | Tool allowlist. Copilot ignores it |
| `model` | Model override |
| `argument-hint` (alias `argumentHint`) | Hint text; synthesised as `<a> <b>` from `input` when omitted |
Input names must match `[A-Za-z][\w-]{0,63}`. An invalid name is dropped with a warning and the install still succeeds; duplicates are neither removed nor warned about.
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 as a scheduled workflow that the command integrator skips. Do not use them in a plain prompt. 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 `agent`, `tools` and `name` survive on Copilot only.
## Body placeholders
@@ -50,8 +50,8 @@ 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 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. Tag characters and bidi overrides are critical: install exits 1 and deploys nothing, even with `--force`, which still exits 0.
- 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.
## Packing
@@ -63,6 +63,7 @@ make_package() {
@test "creates <name>.prompt.md under .apm/prompts/, which apm init does not create" {
make_package
assert [ ! -d "$ROOT/.apm" ]
run bash "$SCRIPT" my-prompt "$ROOT"
assert_success
assert [ -f "$ROOT/.apm/prompts/my-prompt.prompt.md" ]
@@ -155,6 +156,8 @@ make_package() {
assert_success
run grep -E '^input:' "$file"
assert_success
run grep -c '^ - ' "$file"
assert_output "1"
run grep -F '${input:target}' "$file"
assert_success
}
@@ -37,7 +37,7 @@ Constraints that surprise a prompt author. Items are marked **observed** when th
- **Observed:** on the Claude family (claude, cursor, opencode, windsurf, grok-build) unsupported keys are dropped with exit 0 and a warning of the form "frontmatter keys not supported for claude commands and were dropped: agent, author, mcp, mode, parameters, tools. Supported keys: allowed-tools, argument-hint, description, input, model". Unknown keys such as `inputs` are dropped the same way. Copilot keeps everything.
- **Observed, disagrees with the docs:** Gemini drops everything except `description` with **no** diagnostic.
- **Observed:** codex, kiro, antigravity and agent-skills deploy nothing, exit 0, with no warning.
- **Observed:** the `input` descriptions in the object and map forms are discarded; only names survive, as `arguments:`.
- **Observed:** a single-key `{name: description}` list item loses its description and only the name survives, as `arguments:`. A multi-key item such as `name:` plus `description:` turns every key into an argument (`arguments: [name, description]`). Found by a clean-context review of `prompt-author`.
- **Observed:** invalid input names (`bad name!`, `9lead`) are rejected with a warning and the install succeeds. Duplicate names are neither removed nor warned about, giving `arguments: [dup, dup]`.
- **Observed:** declaring `input:` and also writing a literal `$ARGUMENTS` or `$0` in the body gives both `arguments:` and the literal text, with no conflict diagnostic.
@@ -56,8 +56,8 @@ Constraints that surprise a prompt author. Items are marked **observed** when th
## Security scanning
- **Observed:** zero-width space, BOM and NBSP in a prompt are warnings and the file deploys. Tag characters and bidi overrides are critical: the install exits 1, apm.yml is restored and nothing deploys.
- **Observed, disagrees with the docs:** `--force` makes the exit code 0 and prints "Deployed with --force despite critical hidden characters", yet the prompt is still not deployed.
- **Observed:** zero-width space, BOM and NBSP in a prompt are warnings and the file deploys. Tag characters and bidi overrides are critical: the install exits 1 and apm.yml is restored; the Claude-family command is withheld, but the Copilot and Gemini outputs may still be written.
- **Observed, disagrees with the docs:** `--force` makes the exit code 0 and prints "Deployed with --force despite critical hidden characters", yet the Claude-family command is still not deployed. Re-tested later: even without `--force`, a plain install that exits 1 on a tag character still wrote the Copilot byte copy and the Gemini TOML; only the Claude file was withheld.
- **Observed:** `apm audit` scans deployed command files, exits 2 on the zero-width warning, and a hand-appended critical character produces a critical finding plus drift. `apm audit --ci` reports `hash-drift`.
## Packing
@@ -34,7 +34,7 @@ The docs call the source primitive "prompts" and the per-target surface "command
## Claude-family output
For a source with `description`, `input` (`simple`, `named: The named one`, `other`), `allowed-tools`, `model`, `argument-hint` and extra keys, the Claude command file contains only `allowed-tools`, `argument-hint`, `arguments`, `description` and `model`, keys sorted alphabetically, with no trailing newline. `input` is consumed into `arguments:` as names only (object and map forms lose their descriptions), and `argument-hint` is synthesised as `<a> <b>` when absent or kept when given. `argumentHint` and `allowedTools` are accepted as aliases. The five keys visible in the output are therefore `description`, `allowed-tools`, `model`, `argument-hint` and `arguments`, while the five keys an author may write and expect to survive are `description`, `input`, `allowed-tools`, `model` and `argument-hint`.
For a source with `description`, `input` (`simple`, `named: The named one`, `other`), `allowed-tools`, `model`, `argument-hint` and extra keys, the Claude command file contains only `allowed-tools`, `argument-hint`, `arguments`, `description` and `model`, keys sorted alphabetically, with no trailing newline. `input` is consumed into `arguments:` as names only (a single-key `{name: description}` item loses its description; a multi-key item turns every key into an argument), and `argument-hint` is synthesised as `<a> <b>` when absent or kept when given. `argumentHint` and `allowedTools` are accepted as aliases. The five keys visible in the output are therefore `description`, `allowed-tools`, `model`, `argument-hint` and `arguments`, while the five keys an author may write and expect to survive are `description`, `input`, `allowed-tools`, `model` and `argument-hint`.
## Frontmatter survival by target