agentleFS
reaatechreaatech/agents-md-kit/skills/schema-validation/skill.md

schema-validation

Skill2 starsChanged 6 months agoMITView on GitHub

Zod schema validation for AGENTS.md and SKILL.md files

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
  1. Distinctive:

    Never log full file content — only metadata (path, size, section names)

    line 118
  2. Distinctive:

    Don't include file content in trace spans

    line 120
  3. Distinctive:

    Read-only access to files (no write without explicit consent)

    line 124
  4. Distinctive:

    Don't follow symlinks outside the project directory

    line 126

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
skill.md

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

ToolInput SchemaOutputRate Limit
validate_agents_mdz.object({ filePath: z.string().optional(), content: z.string().optional(), strict: z.boolean().optional() }){ valid: boolean, errors: Error[], warnings: Warning[] }60 RPM
validate_skill_mdz.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

FailureCauseRecovery
File not foundPath doesn't existReturn error with suggestion to check path
Parse errorInvalid YAML frontmatterReturn error with line number and context
Invalid schemaZod validation failureReturn detailed field-level errors
Circular referenceSkill references itselfReturn error with dependency chain

Recovery Strategies

  • Missing files: Suggest using scaffold_agent to 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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.