schema-validation
Skill2 starsChanged 6 months agoMITView on GitHub
Zod schema validation for AGENTS.md and SKILL.md files
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- changelog-generationSkill
- documentation-refreshSkill
- examplesSkill
- lintingSkill
- release-prepSkill
- scaffoldingSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 118
Never log full file content — only metadata (path, size, section names)
- Distinctive: line 120
Don't include file content in trace spans
- Distinctive: line 124
Read-only access to files (no write without explicit consent)
- Distinctive: line 126
Don't follow symlinks outside the project directory
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 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
Schema Validation
Capability
Validates AGENTS.md and SKILL.md files against Zod schemas to ensure structural correctness, required sections, frontmatter completeness, and content quality.
MCP Tools
| Tool | Input Schema | Output | Rate Limit |
validate_agents_md | z.object({ filePath: z.string().optional(), content: z.string().optional(), strict: z.boolean().optional() }) | { valid: boolean, errors: Error[], warnings: Warning[] } | 60 RPM |
validate_skill_md | z.object({ filePath: z.string().optional(), content: z.string().optional(), strict: z.boolean().optional() }) | { valid: boolean, errors: Error[], warnings: Warning[] } | 60 RPM |
Usage Examples
Example 1: Validate an AGENTS.md file
- User intent: Validate that an AGENTS.md file conforms to the schema
- Tool call:
{ "name": "validate_agents_md", "arguments": { "filePath": "./agents/my-agent/AGENTS.md", "strict": true } } - Expected response:
{ "valid": true, "errors": [], "warnings": [ { "rule": "missing-pii-mention", "message": "Security section should mention PII handling", "line": 45, "suggestion": "Add a paragraph about PII handling in the Security Considerations section" } ] }
Example 2: Validate a SKILL.md file with errors
- User intent: Validate a skill file that has missing sections
- Tool call:
{ "name": "validate_skill_md", "arguments": { "filePath": "./agents/my-agent/skills/echo/skill.md", "strict": true } } - Expected response:
{ "valid": false, "errors": [ { "rule": "heading-missing", "message": "Required section 'Error Handling' not found", "line": null, "suggestion": "Add a '## Error Handling' section with known failure modes and recovery strategies" } ], "warnings": [] }
Example 3: Validate inline content (no file)
- User intent: Validate markdown content passed directly
- Tool call:
{ "name": "validate_agents_md", "arguments": { "content": "---\nagent_id: test\ndisplay_name: Test\nversion: 1.0.0\ndescription: test\n---\n\n# Test\n\n## What this is\n\n...", "strict": false } }
Error Handling
Known Failure Modes
| Failure | Cause | Recovery |
| File not found | Path doesn't exist | Return error with suggestion to check path |
| Parse error | Invalid YAML frontmatter | Return error with line number and context |
| Invalid schema | Zod validation failure | Return detailed field-level errors |
| Circular reference | Skill references itself | Return error with dependency chain |
Recovery Strategies
- Missing files: Suggest using
scaffold_agentto generate missing files - Parse errors: Show the problematic YAML snippet with line numbers
- Schema violations: List specific fields that failed validation with suggestions
- Cross-reference errors: List all broken references and suggest fixes
Security Considerations
PII Handling
- Never log full file content — only metadata (path, size, section names)
- Redact any potential PII in error messages
- Don't include file content in trace spans
Permissions
- Read-only access to files (no write without explicit consent)
- Respect file system permissions
- Don't follow symlinks outside the project directory
Audit Logging
- Log all validation operations with file paths and results
- Include request_id for tracing
- Track validation duration for performance monitoring
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.

