Claude-skill-registry commands-frontmatter-adapter
Parse Claude command frontmatter and expose body/meta for Codex CLI.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/commands-frontmatter-adapter" ~/.claude/skills/majiayu000-claude-skill-registry-commands-frontmatter-adapter && rm -rf "$T"
manifest:
skills/data/commands-frontmatter-adapter/SKILL.mdsource content
Commands Frontmatter Adapter
Extract frontmatter and body from Claude-style command files so Codex CLI can consume the body as a prompt while still exposing metadata as JSON.
Usage
- By command name (from the scripts directory):
./adapter.py --command diary --pretty - By explicit file (from anywhere):
/abs/path/to/adapter.py --file /abs/path/to/src/.claude/commands/diary.md
Note: The script resolves
src/.claude/commands relative to the skill location, so symlinked global installs work without depending on the current working directory. Use --file if your commands live elsewhere.
Options
Output body only (paste into prompt)--body-only
Output parsed frontmatter as JSON--frontmatter-only
Output raw frontmatter block--raw-frontmatter
Pretty-print JSON--pretty
Behavior
- Treat the first
...---
block as frontmatter.--- - Try
; if PyYAML is missing or fails, fall back to a minimal parser (key/value and bullet lists).yaml.safe_load - JSON output structure:
: target file pathfile
: parsed metadata (dict or null)frontmatter
: raw textfrontmatter_raw
: body textbody
Known frontmatter keys (current commands)
: short summary shown in command picker.description
: usage hint forargument-hint
.$ARGUMENTS
: tool whitelist string (pass-through; no validation here).allowed-tools
The adapter performs parsing only; interpretation or enforcement of these keys is left to the caller (e.g., Codex CLI prompt wrappers).
Tips
- Prefer
when piping into Codex CLI prompts.--body-only - Manually respect metadata such as
as needed in your session.allowed-tools - If a file has no frontmatter, only the body is returned.