Skip to content
Back to skills

Commands Frontmatter Adapter

ASecurity

Parse Claude command frontmatter and expose body/meta for Codex CLI.

  • 666 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added February 8, 2026
tools

Works with

  • cli

Security analysis

A100/100

Scanned February 10, 2026

npx -y skills add majiayu000/claude-skill-registry --skill commands-frontmatter-adapter --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Commands Frontmatter Adapter?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Commands Frontmatter Adapter
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/majiayu000-commands-frontmatter-adapter/badge)](https://www.skillsdirectory.com/skills/majiayu000-commands-frontmatter-adapter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: commands-frontmatter-adapter
description: Parse Claude command frontmatter and expose body/meta for Codex CLI.
---

# 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

- `--body-only` Output body only (paste into prompt)
- `--frontmatter-only` Output parsed frontmatter as JSON
- `--raw-frontmatter` Output raw frontmatter block
- `--pretty` Pretty-print JSON

## Behavior

1. Treat the first `---` ... `---` block as frontmatter.
2. Try `yaml.safe_load`; if PyYAML is missing or fails, fall back to a minimal parser (key/value and bullet lists).
3. JSON output structure:
   - `file`: target file path
   - `frontmatter`: parsed metadata (dict or null)
   - `frontmatter_raw`: raw text
   - `body`: body text

## Known frontmatter keys (current commands)

- `description`: short summary shown in command picker.
- `argument-hint`: usage hint for `$ARGUMENTS`.
- `allowed-tools`: tool whitelist string (pass-through; no validation here).

The adapter performs parsing only; interpretation or enforcement of these keys is left to the caller (e.g., Codex CLI prompt wrappers).

## Tips

- Prefer `--body-only` when piping into Codex CLI prompts.
- Manually respect metadata such as `allowed-tools` as needed in your session.
- If a file has no frontmatter, only the body is returned.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.