Platform reference
Strip rules, the processing pipeline, and the frontmatter each platform accepts.
Strip rules
The strip rules are loaded from src/apmw/data/agent-strip-fields.json, the only source of truth:
json
{
"opencode": ["tools", "user-invocable", "agents", "metadata"],
"copilot": ["mode", "steps", "color", "permission", "task", "metadata"],
"claude": ["mode", "steps", "color", "tools", "permission", "user-invocable", "agents", "model", "metadata"],
"cursor": ["mode", "steps", "color", "permission", "metadata"],
"codex": ["mode", "steps", "color", "permission", "metadata"]
}metadata appears in every platform's list — it is always stripped after extraction.
Processing pipeline
For each *.md file in the target agent directory, apmw runs:
- Extract — find
metadata.<platform>and de-indent its content lines. - Strip — remove fields in the platform's strip list (including
metadata). - Inject — if step 1 produced lines: strip any conflicting top-level fields, then append the extracted lines. Metadata wins. Missing
tools(Claude Code) orpermission(OpenCode) are derived from the Copilottools:list, see Authoring multi-target agents. - Rewrite — write the file only if the frontmatter changed.
OpenCode permission: reference
yaml
permission:
read: allow # file read
edit: deny # file write/edit
glob: allow # file glob search
grep: allow # content search
bash:
"*": deny # deny all shell commands by default
"git *": allow # allow specific patterns
"gh *": allow
task: allow # spawn sub-agents
skill: allow # load skills
webfetch: allow # HTTP fetch
question: allow # interactive promptsClaude Code tools: reference
yaml
tools:
- Bash # shell commands
- Read # read files
- Write # create/overwrite files
- Edit # patch existing files
- Glob # file pattern search
- Grep # content search
- WebFetch # HTTP fetch
- Task # spawn sub-agents
- TodoWrite # task list management