From factory-templates
Use when validating the quality of a Claude Code agent .md file. Checks YAML frontmatter completeness, tool restrictions, When-to-invoke examples, and output format documentation. Returns a 0-100 quality score.
How this skill is triggered — by the user, by Claude, or both
Slash command
/factory-templates:agent-quality-validatorThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
A quality assurance tool for Claude Code agent `.md` files. This skill analyzes agent definitions against established best practices and returns a structured score with actionable feedback.
A quality assurance tool for Claude Code agent .md files. This skill analyzes agent definitions against established best practices and returns a structured score with actionable feedback.
name, description, tools, model) are present and well-formed.["*"] or "All tools") that bypass the principle of least privilege.passed boolean (threshold: 80), a per-criterion breakdown, and a prioritised issues list.Provide one of the following:
| Input type | Details |
|---|---|
| File path | Absolute or relative path to an agent .md file |
| Content string | Raw Markdown string containing the agent definition |
The validator accepts both via AgentQualityValidator — pass a file path to validate_file() or a raw string to validate_content().
{
"score": 87, # int 0-100
"passed": True, # bool — True when score >= 80
"breakdown": {
"frontmatter_completeness": 28, # max 30
"description_quality": 20, # max 25
"when_to_invoke": 20, # max 20
"tool_restrictions": 15, # max 15
"output_format": 4, # max 10
},
"issues": [
"output_format: No output format or return description found in body."
]
}
| File | Purpose |
|---|---|
validator.py | Main implementation — AgentQualityValidator class |
from validator import AgentQualityValidator
v = AgentQualityValidator()
# From a file
result = v.validate_file("path/to/my-agent.md")
# From a string
result = v.validate_content(raw_markdown_string)
print(result["score"]) # e.g. 87
print(result["passed"]) # True / False
print(result["issues"]) # List of human-readable problems
| Criterion | Max Points | What is checked |
|---|---|---|
| Frontmatter completeness | 30 | name, description, tools, model fields all present and non-empty |
| Description quality | 25 | Contains action verbs; not just a noun phrase; reflects specialisation |
| When-to-invoke examples | 20 | Body contains a "when to invoke" section with at least one example |
| Tool restrictions | 15 | tools is not ["*"], "*", or "All tools"; points deducted for wildcard grants |
| Output format | 10 | Body documents expected output, return values, or response format |
Pass threshold: score >= 80
Before treating a validator score as authoritative:
.md extension and YAML frontmatter.md with SKILL.md format) — this validator is specific to agent files.Guides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.
npx claudepluginhub donalmoloney/factory-template