| name | agent-check |
| description | Validate custom agent file format and structure |
| user-invocable | true |
Agent File Validator
Validate agent files in .claude/agents/ for correct format.
Validation Target
- With argument: validate specific file
- Without: validate all
.claude/agents/*.md
Required Frontmatter
---
name: agent-name
description: >
Use this agent when [conditions]. Examples:
<example>
Context: [situation]
user: "[request]"
assistant: "[response using this agent]"
</example>
color: cyan
model: sonnet
tools:
- Read
- Write
- Grep
skills:
- linked-skill
memory:
- user
- project
- local
mcpServers:
- server-name
hooks:
PreToolUse:
- matcher: Write
hooks:
- type: command
command: ./validate.sh
PostToolUse:
- matcher: Bash
hooks:
- type: command
command: ./log.sh
permissionMode: default
disallowedTools:
- NotebookEdit
---
Valid Tools
Read, Write, Edit, Bash, Grep, Glob, Task,
WebFetch, WebSearch, TodoWrite, NotebookEdit
Valid Colors
yellow, red, green, blue, magenta, cyan
Valid Models
inherit, haiku, sonnet, opus, best, sonnet[1m], opus[1m], opusplan
Validation Checklist
Required Fields
Optional Fields
Content Structure
Format Rules
Output Format
## Agent Validation Report
### Files Checked
| File | Status | Issues |
|------|--------|--------|
| code-reviewer.md | OK | None |
| my-agent.md | WARN | Missing color, model |
### Summary
- Total: [N]
- Valid: [N]
- Needs fixes: [N]
Auto-Fix
- Convert bracket array tools to YAML list format
- Convert string skills to YAML array
- Add missing
color field (default: cyan)
- Add missing
model field (default: inherit)
- Convert boolean forkContext to string
- Convert scalar memory to array format
- Remove invalid tools
- Add recommended sections