validate-generated-artifact
Skill8 starsChanged 7 months agoApache-2.0View on GitHub
Output lines are prefixed with ERROR:, WARNING:, or informational text. Exit code 1 = at least one ERROR. Errors block writing. Warnings count toward the threshold (>3 warnings in skills, >4 in subagents triggers NEEDS REVISION). The name: in frontmatter must match the parent directory name exactly and be kebab-case: The counter uses grep -c (counts lines, not occurrences). Spread file references across at least 3 separate lines: Recognized formats: backtick-wrapped names ( file.sh ) and directory prefixes (lib/, tests/,…
In this repository22 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- .github/workflows/CLAUDE.mdCLAUDE.md
- lib/CLAUDE.mdCLAUDE.md
- prompts/CLAUDE.mdCLAUDE.md
- schemas/CLAUDE.mdCLAUDE.md
- scripts/CLAUDE.mdCLAUDE.md
- tests/CLAUDE.mdCLAUDE.md
- add-bats-testSkill
- add-edge-testSkill
- add-gather-agentSkill
- add-integration-testSkill
- add-synthesis-fixtureSkill
- audit-prompt-schema-syncSkill
- bundle-and-verifySkill
- check-ci-locallySkill
- debug-agent-failureSkill
- fixture-syncSkill
- pre-pr-checklistSkill
- rebuild-test-imageSkill
- release-ultrainitSkill
- run-testsSkill
- tune-synthesis-contextSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 90
Add a ## Verify section with concrete commands:
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Before You Start
scripts/validate-skill.sh— skill validator (checks frontmatter, file refs, descriptions)scripts/validate-subagent.sh— subagent validatortests/fixtures/skills/valid-skill/SKILL.md— canonical passing skill exampletests/fixtures/subagents/valid-subagent.md— canonical passing subagent example
Running the Validators
Skill validation
# Skills must be inside a named subdirectory — validator derives name from parent dir
mkdir -p .claude/skills/<skill-name>
cat > .claude/skills/<skill-name>/SKILL.md << 'EOF'
...
EOF
bash scripts/validate-skill.sh .claude/skills/<skill-name>/SKILL.mdSubagent validation
bash scripts/validate-subagent.sh .claude/agents/<agent-name>.mdInterpreting Output
Output lines are prefixed with ERROR:, WARNING:, or informational text. Exit code 1 = at least one ERROR.
ERROR: frontmatter: name field missing
ERROR: body: fewer than 3 codebase-specific file references found (got 1)
WARNING: description: fewer than 3 trigger phrases detected
VERDICT: FAILErrors block writing. Warnings count toward the threshold (>3 warnings in skills, >4 in subagents triggers NEEDS REVISION).
Fixing Common Errors
"name field missing" or "kebab-case violation"
The name: in frontmatter must match the parent directory name exactly and be kebab-case:
---
name: my-skill-name # must match: .claude/skills/my-skill-name/SKILL.md"fewer than 3 codebase-specific file references"
The counter uses grep -c (counts lines, not occurrences). Spread file references across at least 3 separate lines:
# Wrong — all on one line (counts as 1)
See `lib/agent.sh`, `lib/gather.sh`, `lib/synthesize.sh`
# Correct — separate lines (counts as 3)
- `lib/agent.sh` handles agent spawning
- `lib/gather.sh` wires agents into phases
- `lib/synthesize.sh` builds the synthesis contextRecognized formats: backtick-wrapped names (`file.sh`) and directory prefixes (lib/, tests/, schemas/, prompts/, scripts/).
"description contains angle brackets"
Angle brackets break YAML parsing. Replace:
Use for <adding endpoints>→Use for adding endpoints(e.g., <name>)→(e.g., my-name)
"generic phrase detected"
Banned phrases: "best practice", "clean code", "SOLID principles", "maintainable", "readable", "scalable", "well-structured", "production-ready", "industry standard". Remove them without replacement — just describe what the skill actually does.
"no verification section"
Add a ## Verify section with concrete commands:
## Verify
```bash
make test-unit
bash -n lib/gather.sh
### "description exceeds 1024 characters"
The validator collapses the description to a single space-joined string before counting. Multi-line YAML folded scalars (`>`) are joined. Trim the description to under 1024 characters in the collapsed form.
## Verify
```bash
bash scripts/validate-skill.sh .claude/skills/<name>/SKILL.md
echo "Exit: $?"Exit 0 with VERDICT: PASS means it will be accepted by lib/validate.sh.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

