From f5a260e85c15dcf45288fcc98dd7182c4c243669 Mon Sep 17 00:00:00 2001 From: Defame1297 Date: Thu, 15 Oct 2026 07:29:52 +0000 Subject: [PATCH] docs(kyberforge): research apm prompts primitive and prompt-file standards Add prompt-target-mapping and prompt-gotchas for the apm .prompt.md primitive from the published apm docs, correct the preserved-key set in prompt-primitive-schema, and add prompt-standards research covering Copilot/VS Code prompt files, Claude Code commands, Prompty, Dotprompt and MCP prompts. No vendor-neutral prompt-file standard was found. Refs: #149 Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_012CqgnwEGtmfsjcoG9QwByN --- .../docs/microsoft-apm/prompt-gotchas.md | 51 +++++++++++++++ .../microsoft-apm/prompt-primitive-schema.md | 4 ++ .../microsoft-apm/prompt-target-mapping.md | 63 +++++++++++++++++++ .../research/docs/microsoft-apm/sources.md | 35 +++++++++++ .../prompt-standards/claude-code-commands.md | 25 ++++++++ .../docs/prompt-standards/dotprompt.md | 21 +++++++ .../docs/prompt-standards/mcp-prompts.md | 21 +++++++ .../docs/prompt-standards/overview.md | 37 +++++++++++ .../research/docs/prompt-standards/prompty.md | 21 +++++++ .../research/docs/prompt-standards/sources.md | 43 +++++++++++++ .../vscode-copilot-prompt-files.md | 25 ++++++++ 11 files changed, 346 insertions(+) create mode 100644 plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-gotchas.md create mode 100644 plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-target-mapping.md create mode 100644 plugins/kyberforge/docs/research/docs/prompt-standards/claude-code-commands.md create mode 100644 plugins/kyberforge/docs/research/docs/prompt-standards/dotprompt.md create mode 100644 plugins/kyberforge/docs/research/docs/prompt-standards/mcp-prompts.md create mode 100644 plugins/kyberforge/docs/research/docs/prompt-standards/overview.md create mode 100644 plugins/kyberforge/docs/research/docs/prompt-standards/prompty.md create mode 100644 plugins/kyberforge/docs/research/docs/prompt-standards/sources.md create mode 100644 plugins/kyberforge/docs/research/docs/prompt-standards/vscode-copilot-prompt-files.md diff --git a/plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-gotchas.md b/plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-gotchas.md new file mode 100644 index 0000000..390e3d1 --- /dev/null +++ b/plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-gotchas.md @@ -0,0 +1,51 @@ +--- +topic: prompt-gotchas +source_keys: + - apm-docs-author-prompts + - apm-docs-llms-full + - apm-docs-producer-ramp + - apm-docs-cli-run + - apm-docs-cli-compile +--- + +## What this covers + +Constraints that surprise a prompt author, taken from the published apm docs. None of it was exercised against the installed binary. Items marked "doc conflict" have two statements in the docs that disagree and need an experiment before a skill asserts either. + +## Silent or quiet loss + +- Keys outside the preserved set are dropped on every command target except Copilot. The only signal is a diagnostic at install time; there is no failure and no flag to keep them. +- Input names must match `[A-Za-z][\w-]{0,63}`. A non-matching name is rejected with a warning and never reaches the command frontmatter, so that one argument silently disappears while the install succeeds. +- Codex receives nothing. A workflow that must reach Codex has to ship as a skill. +- A package whose `type:` does not cover prompts may deploy none. Doc conflict: the manifest field reference says `type` constrains what `.apm/` may contain, while the spec says it is advisory in v0.1 and consumers must ignore it. + +## Compile versus install + +`apm compile` ignores prompts. It handles instructions and root context files. Prompts are deployed by `apm install`, and parameter binding happens only in `apm run`. Consequences: a prompts-only package compiled for `claude` yields no output; `apm compile --validate` checks primitive frontmatter and structure without writing, but the docs do not say whether it inspects individual prompt files, and no prompt validation class was found in the code reading. Whether a plain `apm compile` fails on a package with no instructions is not addressed for prompts-only packages. Doc conflict: one passage says compile and run both compile prompts and another says prompts are never compiled. + +## Identity and collisions + +- The base filename is the command name on every target, so it must be valid and unique as a slash command and as a Copilot prompt filename at once. +- Two prompts with the same base name, one under `.apm/prompts/` and one at the package root, collide. The later writer wins on Copilot and the transform fails on Claude and Cursor. +- Root-level `*.prompt.md` discovery is documented both as supported for backward compatibility and as not discovered by install. Doc conflict; prefer `.apm/prompts/` and do not rely on either. +- A virtual package reference ending in `.prompt.md` is classified by extension only. +- Symlinked prompt files are rejected by `apm preview` and `apm run`, and plugin packing flags symlinks under the prompts directory. + +## Ownership, overwrite and cleanup + +No prompt-specific rule exists; only generic install rules were found. Untracked files already on disk are skipped with a warning unless `--force` is used. Files a package previously deployed and no longer produces are removed on the next install. Narrowing `targets:` removes only unchanged files apm owns, and files placed by hand inside a target directory remain. Uninstall deletes only files recorded in the lockfile `deployed_files` manifest. Local primitives override dependency primitives of the same name and type; the first declared dependency wins between dependencies. + +## Security scanning + +The install-time scan inspects every primitive for hidden Unicode and blocks critical findings unless forced. `apm compile` and `apm run` do not re-scan, so a hand-edited prompt needs `apm audit`. A proposed audit of deployed prompts decodes only documented prompt fields. + +## apm run specifics + +Parameters are interpolated into any `.prompt.md` the script references and are not exported as shell variables. A typo in a script name can fall through to discovery and then to a virtual-package install attempt. The docs do not say what happens when a `${input:...}` placeholder has no `--param`. The `apm run` command is marked experimental. The spec describes script substitution with `{key}` placeholders instead of `${input:name}`; this divergence is unresolved. + +## Documentation inconsistencies to keep out of the skill + +- Whether `apm init` scaffolds `.apm/prompts/`. +- Whether Copilot prompts deploy at user scope. +- The `$name` form used in one example versus `${input:name}` in the prompts page; the transformer rewrite explains it, but the example does not say so. +- `mode` and `mcp` appear in some example frontmatter but are not in the preserved set. diff --git a/plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-primitive-schema.md b/plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-primitive-schema.md index b5331bc..28947b4 100644 --- a/plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-primitive-schema.md +++ b/plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-primitive-schema.md @@ -3,8 +3,12 @@ topic: prompt-primitive-schema source_keys: - context7-microsoft-apm - apm-github-repo + - apm-docs-author-prompts + - apm-docs-llms-full --- +Per-target output, key survival and the doc inconsistencies are in `prompt-target-mapping.md` and `prompt-gotchas.md`. The published "Author a prompt" page lists five preserved keys: `description`, `input`, `allowed-tools`, `model`, `argument-hint`. Where the section below says four keys are preserved, read that as four plus `input`, which is consumed into `arguments:` on Claude. Both the page and the installed 0.28.0 source agree on this set. + ## File location, naming, and frontmatter `.apm/prompts/*.prompt.md` (also discovered at the package root). Filename minus the `.prompt.md` suffix becomes the prompt's identity — used verbatim as the Copilot filename and, after transformation, as the Claude command name. No required-extension ambiguity: it is genuinely `.prompt.md`, confirmed both in docs and in APM's own `PromptIntegrator.find_prompt_files` (`*.prompt.md`) and `CommandIntegrator.find_prompt_files` (same glob). diff --git a/plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-target-mapping.md b/plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-target-mapping.md new file mode 100644 index 0000000..888c8b0 --- /dev/null +++ b/plugins/kyberforge/docs/research/docs/microsoft-apm/prompt-target-mapping.md @@ -0,0 +1,63 @@ +--- +topic: prompt-target-mapping +source_keys: + - apm-docs-author-prompts + - apm-docs-llms-full + - apm-docs-producer-ramp + - apm-github-repo +--- + +## Scope and confidence + +This file maps one `.apm/prompts/.prompt.md` source to what each apm target receives. It combines the published apm docs (the "Author a prompt" page, the full docs dump and the producer guide) with the code-level reading already recorded in `prompt-primitive-schema.md`. Nothing here was verified by running apm 0.28.0; unlike the instructions research there are no install experiments behind it. Doc statements that contradict each other are listed in `prompt-gotchas.md` rather than resolved here. + +## Output per target + +| Target | Output path | Form | +|---|---|---| +| copilot | `.github/prompts/.prompt.md` | Verbatim copy, markdown links resolved | +| claude | `.claude/commands/.md` | Reconstructed slash command | +| cursor | `.cursor/commands/.md` | Shared command transformer (same as Claude) | +| opencode | `.opencode/commands/.md` | Shared command transformer | +| grok-build | `.grok/commands/.md` | Grok command | +| gemini | `.gemini/commands/.toml` | TOML command, `$ARGUMENTS` becomes `{{args}}` | +| windsurf | `.windsurf/workflows/.md` | Workflow file | +| copilot-app | row in the Copilot App workflows store | Experimental, only for workflow-shaped prompts | +| codex | none | No prompts or commands primitive | + +The published compatibility matrix labels Copilot "Native", the command-style targets "Compiled", and Codex, Kiro and Hermes "Unsupported". The published page lists seven deploying targets and Codex as the only explicit "none"; antigravity is described as compiled in the matrix, while the code reading found no commands primitive for it. Treat antigravity, kiro and any other target as unknown until tested. + +## Slot terminology + +The docs call the source primitive "prompts" and the per-target surface "commands". Claude and Cursor have no `prompts` slot in their target profile, so a package that ships only prompts and is compiled for `claude` produces zero output from `apm compile`. Prompts reach Claude only through `apm install`, which routes them into the commands slot. There is no `.apm/commands/` source directory; "command" is purely the compiled name for the same file. + +## Frontmatter survival by target + +Five keys are preserved by the cross-tool command transform: `description`, `input`, `allowed-tools`, `model`, `argument-hint`. The published pages list this set as five keys including `input`; the earlier research digest listed four and treated `input` as input to `arguments` only, which is a wording difference rather than a behavioural one. + +| Key | Copilot | Claude, Cursor | Other command targets | +|---|---|---|---| +| `description` | kept | kept | kept | +| `input` | kept as written | becomes `arguments:`, and `argument-hint` is derived if unset | per-target; not individually documented | +| `allowed-tools` | kept, but Copilot ignores it | honored | not documented | +| `model` | kept | honored | not documented | +| `argument-hint` | kept | kept, or derived from `input` | not documented | +| any other key (`author`, `mcp`, `parameters`) | kept | dropped with an install diagnostic | dropped with an install diagnostic | + +The Copilot copy is a byte copy, so every key survives even where the Copilot runtime ignores it. The VS Code prompt-file format uses `agent`, `tools` and `name` keys that apm does not list as preserved, so a prompt written for Copilot with those keys works on Copilot only. + +## Body placeholders + +The apm body syntax is `${input:name}`. The transformer rewrites it to the target's native form, for example `$name` on Claude. On Gemini the argument token is `{{args}}`. Copilot receives the text unchanged, and VS Code itself understands `${input:name}` and `${input:name:placeholder}`. + +## Workflow-shaped prompts + +Only the top-level keys `interval`, `schedule_hour` and `schedule_day` mark a prompt as a Copilot App workflow. The other workflow keys (`name`, `mode`, `model`, `reasoning_effort`) do not by themselves. A plain prompt pointed at `copilot-app` is a hard error, and workflow-shaped prompts are skipped by the command integrator, so they never appear as slash commands. + +## Invocation + +Copilot uses its prompt picker. Claude, Cursor, OpenCode and Gemini use `/` followed by arguments. Windsurf uses the workflows menu. Consumers can also bypass the picker through an `apm.yml` script and `apm run