Skip to content

Commit ba7bade

Browse files
konsta95claude
andcommitted
plugin-dev: take the agent frontmatter verdict from claude plugin validate
validate-agent.sh no longer decides parse-ability with an awk classifier of its own. The file is copied into a throwaway plugin and run through `claude plugin validate --json` (plain-report fallback for Claude Code older than 2.1.259; exit 2 "not verified" when no claude can run), so the verdict is the loader's own parser, Bun YAML plus Claude Code's quoting/tab retry, and the product's message is what the user reads. The script keeps what the product does not check: an empty, null, numeric or boolean description (dropped by the project loader; placeholder or digits for a plugin agent), and the style checks, which now run on the text the plugin loader hands the model: block scalars with their chomping, plain and quoted scalars folded, double-quoted escapes decoded, then trimmed. CRLF and BOM files are read the way the loader reads them instead of being rejected at the first line. `validate-agent.sh --description <file>` prints that text. validate-agent.test.sh asserts against the product: 44 description shapes go through `claude plugin validate` once and the script's verdict must equal the product's plus the stated policy (44/44); the extracted text must equal the runtime's on 27 shapes observed in the agent listing of Claude Code 2.1.266 or replayed through Bun 1.4.1 (27/27). Pointed at PR anthropics#89404's script the corpus check fails on 19 shapes, at the previous version of this script on 20. The suite passes under gawk, mawk and busybox awk. Co-Authored-By: Claude Fable 5.1 <[email protected]>
1 parent e830ff6 commit ba7bade

3 files changed

Lines changed: 815 additions & 257 deletions

File tree

‎plugins/plugin-dev/skills/agent-development/SKILL.md‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,13 @@ Working examples in `examples/`:
405405

406406
Development tools in `scripts/`:
407407

408-
- **`validate-agent.sh`** - Validate agent file structure
408+
- **`validate-agent.sh`** - Validate an agent file. The frontmatter verdict comes from
409+
`claude plugin validate`, the product's own parser, so a shape that fails there is
410+
reported with the product's message; the script adds the required-field checks the
411+
product does not make (an empty, null or numeric description) and the style checks
412+
(`<example>` blocks, the trigger phrase, lengths) on the text the model will see.
413+
`validate-agent.sh --description agents/name.md` prints that text. Exit 2 means the
414+
frontmatter was not verified because no `claude` was found (set `CLAUDE_BIN`).
409415
- **`test-agent-trigger.sh`** - Test if agent triggers correctly
410416

411417
## Implementation Workflow

0 commit comments

Comments
 (0)