agentleFS
reaatechreaatech/agents-md-kit/AGENTS.md

agents-md-kit

AGENTS.md2 starsChanged 6 months agoMITView on GitHub

Linter, validator, and scaffolding tool for AGENTS.md and SKILL.md files

  • Reads credentials
  • Installs packages
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

The file

We split this AGENTS.md into the rules it gives an agent

7 rules. About 0 are common, 4 are distinctive, and 3 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.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every AGENTS.md file must follow this schema.

    line 104
  2. Very specific:

    Every SKILL.md file must follow this schema.

    line 157
  3. Very specific:

    Use environment variable references like ${API_KEY} instead of actual values

    line 405
  4. Very specific:

    Use placeholder values like user-123, emp456, john.doe@example.com

    line 411
  5. Distinctive:

    Every lint/validate operation is logged with:

    line 426
  6. Distinctive:

    Use both in CI/CD for comprehensive agent validation:

    line 486
  7. Distinctive:

    Before deploying agent instruction files to production:

    line 507

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md 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
AGENTS.md

agents-md-kit — Agent Development Guide

What this is

This document defines how to use agents-md-kit to create, validate, and maintain AGENTS.md and SKILL.md files — the "durable agent instruction artifacts" that define how AI agents behave, what skills they possess, and how they integrate into multi-agent systems.

Target audience: Engineers building AI agents who need to create standardized agent instruction files that follow community best practices and can be validated for correctness, completeness, and quality.


Architecture Overview

agents-md-kit is a pnpm monorepo of 9 independently versioned packages published under the @reaatech/agents-markdown-* scope, plus examples and end-to-end tests.

┌─────────────┐    ┌─────────────┐    ┌─────────────┐    ┌─────────────┐
│   Parser    │    │  Validator  │    │   Linter    │    │  Reporter   │
│  (remark)   │───▶│   (zod)     │───▶│  (rules)    │───▶│ (4 formats) │
└─────────────┘    └─────────────┘    └─────────────┘    └─────────────┘
       │                                                       │
       ▼                                                       ▼
┌─────────────┐                                        ┌─────────────┐
│    Core     │                                        │  Scaffold   │
│  (types +   │                                        │ (handlebars)│
│   schemas)  │                                        └─────────────┘
└─────────────┘                                               │
       │                                               ┌──────┴──────┐
       ▼                                               ▼             ▼
┌─────────────────────────────────────────────────────────────────────┐
│                        CLI          │        MCP Server             │
│                    (commander)       │    (@modelcontextprotocol)    │
└─────────────────────────────────────────────────────────────────────┘
                               │
                               ▼
┌─────────────────────────────────────────────────────────────────────┐
│                      Observability (pino + OTel)                     │
└─────────────────────────────────────────────────────────────────────┘

Key Packages

Packagenpm NamePurpose
core@reaatech/agents-markdownDomain types, Zod schemas, shared utilities
parser@reaatech/agents-markdown-parserMarkdown AST extraction with line number preservation
validator@reaatech/agents-markdown-validatorZod schema validation for AGENTS.md and SKILL.md
linter@reaatech/agents-markdown-linter18 built-in style, content, and best-practice rules
scaffold@reaatech/agents-markdown-scaffoldHandlebars template-based file generation
reporter@reaatech/agents-markdown-reporterConsole, JSON, HTML, and Markdown output formats
observability@reaatech/agents-markdown-observabilityPino structured logging + OpenTelemetry metrics
cli@reaatech/agents-markdown-cliCLI tool — agents-md-kit command
mcp-server@reaatech/agents-markdown-mcp-serverMCP server over Stdio and StreamableHTTP transports

Toolchain

ConcernTool
Buildtsup (dual CJS/ESM per package)
Orchestrationturbo (Turborepo)
Package managerpnpm (workspaces)
Lint + Formatbiome
Versioning + Releasechangesets + GitHub Actions
Type checktsc --noEmit -p tsconfig.typecheck.json
Testvitest (per-package, co-located)

Skill System

Skills represent the atomic capabilities of agents-md-kit. Each skill corresponds to a validation or generation capability.

Available Skills

Skill IDFileDescription
schema-validationskills/schema-validation/skill.mdZod schema validation for AGENTS.md/SKILL.md
lintingskills/linting/skill.mdStyle and structure linting rules
scaffoldingskills/scaffolding/skill.mdTemplate-based file generation
examplesskills/examples/skill.mdCurated example gallery
changelog-generationskills/changelog-generation/skill.mdGenerate changelogs with changesets
documentation-refreshskills/documentation-refresh/skill.mdSync docs with code changes
release-prepskills/release-prep/skill.mdOrchestrate changeset-based release workflow

AGENTS.md Schema

Every AGENTS.md file must follow this schema. The validator checks for required sections, proper structure, and content quality.

Required Frontmatter

---
agent_id: "my-agent"
display_name: "My Agent"
version: "1.0.0"
description: "Brief description of agent capabilities"
type: "mcp"  # mcp, orchestrator, classifier, router, evaluator
---

Required Sections

SectionHeading LevelDescription
Title#Agent name as the main heading
What this is##One-paragraph description of the agent
Architecture Overview##ASCII diagram and component table
Skill System##Table of skills with references to skills/*.md files
MCP Integration##MCP tools, protocol details, request/response formats
Security Considerations##PII handling, authentication, input validation
Observability##Logging, tracing, metrics
Checklist: Production Readiness##Pre-deployment checklist

Recommended Sections

SectionHeading LevelDescription
Agent Configuration##Environment variables and configuration
Error Handling##Known failure modes and recovery strategies
Testing##Testing approach and test structure
Deployment##Deployment instructions and infrastructure
References##Links to related documentation

Validation Rules

RuleSeverityDescription
Required sections presenterrorAll required sections must exist
Section orderingwarningSections should follow recommended order
Skill references validerrorReferenced skills/*.md files must exist
MCP tools documentedwarningMCP tools should have input/output schemas
Security mentions PIIwarningSecurity section should mention PII handling
Observability mentions loggingwarningObservability section should mention structured logging

SKILL.md Schema

Every SKILL.md file must follow this schema. Skills are the atomic unit of agent capability and must be well-documented.

Required Frontmatter

---
skill_id: "my-skill"
display_name: "My Skill"
version: "1.0.0"
description: "Brief description of skill capabilities"
category: "tool"  # tool, orchestration, evaluation, routing
---

Required Sections

SectionHeading LevelDescription
Title#Skill name as the main heading
Capability##One-sentence description of what this skill enables
MCP Tools##Table of tools with input schemas and outputs
Usage Examples##At least 2 examples (success and error cases)
Error Handling##Known failures and recovery strategies
Security Considerations##PII, permissions, audit logging

MCP Tools Table Format

### MCP Tools

| Tool | Input Schema | Output | Rate Limit |
|------|-------------|--------|------------|
| `tool_name` | `z.object({ param: z.string() })` | `{ result: string }` | 60 RPM |

Validation Rules

RuleSeverityDescription
Required sections presenterrorAll required sections must exist
MCP tools table validerrorTools table must have Tool, Input Schema, Output columns
Examples include error casewarningAt least one example should show error handling
Security mentions permissionswarningSecurity section should mention permission requirements

Using agents-md-kit

CLI Commands

# Install
npm install -g @reaatech/agents-markdown-cli

# Lint AGENTS.md and SKILL.md files
agents-md-kit lint ./agents/my-agent/AGENTS.md
agents-md-kit lint ./agents/my-agent/skills/

# Validate against schema (strict mode)
agents-md-kit validate ./agents/my-agent/AGENTS.md
agents-md-kit validate ./agents/my-agent/skills/echo/skill.md

# Scaffold new agent files
agents-md-kit scaffold --agent-type mcp --agent-id my-agent --display-name "My Agent" --output-dir ./my-agent/

# Auto-fix formatting issues
agents-md-kit format ./agents/my-agent/ --fix

# List and view examples
agents-md-kit examples
agents-md-kit examples show mcp-server

Library Usage

import { parseMarkdown } from "@reaatech/agents-markdown-parser";
import { validate } from "@reaatech/agents-markdown-validator";
import { runLintRules } from "@reaatech/agents-markdown-linter";
import { generateFiles } from "@reaatech/agents-markdown-scaffold";

const doc = await parseMarkdown(content, "./AGENTS.md");
const validationResult = validate(doc);
const lintResult = runLintRules(doc);

Exit Codes

CodeMeaning
0All checks passed (only info-level findings)
1Validation errors found
2Lint warnings found (with --fail-on warning)
3Execution error (file not found, parse error)

CI/CD Integration

# .github/workflows/agents-md-lint.yml
name: Agents.md Lint

on:
  pull_request:
    paths:
      - '**/AGENTS.md'
      - '**/skills/**/*.md'

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: pnpm/action-setup@v4

      - name: Install CLI
        run: npm install -g @reaatech/agents-markdown-cli

      - name: Lint agent files
        run: agents-md-kit lint ./agents/ --format json --output lint-results.json

      - name: Validate schemas
        run: agents-md-kit validate ./agents/ --strict

      - name: Upload results
        if: always()
        uses: actions/upload-artifact@v4
        with:
          name: lint-results
          path: lint-results.json

MCP Integration

The kit exposes MCP tools for agent integration via @reaatech/agents-markdown-mcp-server:

lint_agents_md Tool

{
  "name": "lint_agents_md",
  "arguments": {
    "filePath": "./agents/my-agent/AGENTS.md",
    "severity": "warning"
  }
}

validate_agents_md Tool

{
  "name": "validate_agents_md",
  "arguments": {
    "filePath": "./agents/my-agent/AGENTS.md",
    "strict": true
  }
}

validate_skill_md Tool

{
  "name": "validate_skill_md",
  "arguments": {
    "filePath": "./agents/my-agent/skills/echo/skill.md",
    "strict": true
  }
}

scaffold_agent Tool

{
  "name": "scaffold_agent",
  "arguments": {
    "agentId": "my-orchestrator",
    "displayName": "My Orchestrator",
    "agentType": "orchestrator",
    "outputDir": "./agents/my-orchestrator/",
    "skills": [
      { "skillId": "routing", "displayName": "Routing", "skillType": "orchestration" },
      { "skillId": "circuit-breaker", "displayName": "Circuit Breaker", "skillType": "orchestration" }
    ]
  }
}

get_examples Tool

{
  "name": "get_examples",
  "arguments": {
    "type": "mcp-server"
  }
}

Linting Rules

Style Rules

Rule IDSeverityDescriptionAuto-fix
heading-orderwarningHeading levels skippedYes
no-code-languagewarningCode block missing languageYes
trailing-whitespaceinfoTrailing whitespaceYes
line-too-longinfoLine exceeds 120 charsNo
table-formatwarningTable formatting inconsistentYes
list-formatwarningList markers inconsistentNo

Content Rules

Rule IDSeverityDescriptionAuto-fix
heading-missingerrorRequired section missingYes
empty-sectionwarningSection has no contentNo
placeholder-textwarningTODO/FIXME placeholdersNo
duplicate-sectionerrorDuplicate section titlesNo
broken-skill-referrorReferences non-existent skillNo
duplicate-skill-iderrorMultiple skills with same IDNo
section-orderingwarningSections should follow recommended orderNo
min-content-lengthwarningSections should have minimum contentNo

Best Practice Rules

Rule IDSeverityDescriptionAuto-fix
missing-pii-mentionwarningNo PII handling in securityNo
missing-confidenceerrorNo confidence_threshold in configNo
missing-observabilitywarningNo structured logging mentionedNo
incomplete-exampleswarningExamples missing error casesNo
missing-mcp-schemawarningMCP tools missing input schemasNo

Security Considerations

No Secrets in Markdown

  • Never include API keys, tokens, or secrets in AGENTS.md or SKILL.md files
  • Use environment variable references like ${API_KEY} instead of actual values
  • The linter will flag potential secrets

PII Handling

  • Never include real user data in examples
  • Use placeholder values like user-123, emp456, john.doe@example.com
  • The validator checks that security sections mention PII handling

Input Sanitization

  • Examples should demonstrate input validation
  • Security sections should document sanitization approaches
  • The linter checks for security best practices

Observability

Structured Logging

Every lint/validate operation is logged with:

{
  "timestamp": "2026-04-15T23:00:00Z",
  "service": "agents-md-kit",
  "operation": "lint",
  "file": "AGENTS.md",
  "errors": 0,
  "warnings": 2,
  "duration_ms": 45
}

OpenTelemetry Metrics

MetricTypeDescription
agents_md_kit.operations.totalCounterTotal operations by type
agents_md_kit.operations.duration_msHistogramOperation latency
agents_md_kit.validation.errorsCounterValidation errors found
agents_md_kit.linting.warningsCounterLint warnings found
agents_md_kit.files.processedCounterFiles processed
agents_md_kit.scaffold.generationsCounterScaffold operations

Integration with Multi-Agent Systems

Using with agent-mesh

Register agents-md-kit as an agent in agent-mesh:

# agents/agents-md-kit.yaml
agent_id: agents-md-kit
display_name: Agents.md Kit
description: >-
  Linter, validator, and scaffolding tool for AGENTS.md and SKILL.md files.
  Helps ensure agent instruction files follow best practices and community standards.
type: mcp
is_default: false
confidence_threshold: 0.9
examples:
  - "Validate my AGENTS.md file"
  - "Lint all skill files in my agent directory"
  - "Generate a new agent scaffold"
skills:
  - schema-validation
  - linting
  - scaffolding

Using with mcp-contract-kit

agents-md-kit complements mcp-contract-kit:

  • agents-md-kit — validates the documentation (AGENTS.md, SKILL.md)
  • mcp-contract-kit — validates the implementation (MCP server conformance)

Use both in CI/CD for comprehensive agent validation:

jobs:
  documentation:
    runs-on: ubuntu-latest
    steps:
      - name: Lint documentation
        run: npx @reaatech/agents-markdown-cli lint ./agents/

  implementation:
    runs-on: ubuntu-latest
    steps:
      - name: Validate MCP conformance
        run: npx mcp-contract-kit test http://localhost:8080

Checklist: Production Readiness

Before deploying agent instruction files to production:

  • AGENTS.md passes schema validation (no errors)
  • All SKILL.md files pass schema validation
  • Lint warnings addressed or documented as intentional
  • All referenced skill files exist
  • No secrets or sensitive data in markdown files
  • Security section documents PII handling
  • Observability section documents logging approach
  • Examples include both success and error cases
  • Agent configuration uses environment variables (no hardcoded values)
  • Production readiness checklist is complete and accurate

References

  • README.md — Quick start and per-package details
  • ARCHITECTURE.md — System design deep dive
  • DEV_PLAN.md — Development checklist and history
  • docs/SCHEMA_REFERENCE.md — Complete schema documentation
  • docs/LINT_RULES.md — Lint rules reference
  • examples/ — Curated example AGENTS.md and SKILL.md files
  • MCP Specification — https://modelcontextprotocol.io/
  • agent-mesh/AGENTS.md — Multi-agent orchestration patterns

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.