Creates individual AI-ready documentation files with proper structure, frontmatter, and validation. Use when writing or improving documentation that AI tools must process effectively. Triggers on "write documentation", "create docs", "document this", "make docs AI-ready", or "validate documentation".
From m42-meta-toolkitnpx claudepluginhub mission42-ai/m42-claude-plugins --plugin m42-meta-toolkitThis skill uses the workspace's default tool permissions.
references/ai-ready-single-file.mdreferences/api-doc-patterns.mdreferences/examples.mdreferences/frontmatter-schemas.mdreferences/quality-checklist.mdscripts/check_doc_quality.pyscripts/check_links.shscripts/create_from_template.pyscripts/lint_markdown.shscripts/list_templates.pytemplates/CHANGELOG.mdtemplates/README.mdtemplates/adr-template.mdtemplates/api-endpoint.mdtemplates/cli-command.mdtemplates/concept-explanation.mdtemplates/config-option.mdtemplates/error-reference.mdtemplates/faq.mdtemplates/generic-template.mdDesigns and optimizes AI agent action spaces, tool definitions, observation formats, error recovery, and context for higher task completion rates.
Enables AI agents to execute x402 payments with per-task budgets, spending controls, and non-custodial wallets via MCP tools. Use when agents pay for APIs, services, or other agents.
Compares coding agents like Claude Code and Aider on custom YAML-defined codebase tasks using git worktrees, measuring pass rate, cost, time, and consistency.
This skill provides comprehensive guidance for creating individual documentation files that AI tools can effectively process and understand. AI coding assistants process documentation as discrete text chunks through semantic similarity matching, requiring explicit context, consistent terminology, and self-contained sections.
This skill is for single-file documentation creation. For managing entire documentation repositories or multi-file documentation systems, use the maintaining-docs skill.
Before writing AI-ready documentation, fetch the latest official Claude Code documentation for up-to-date
patterns and requirements. Use WebFetch to retrieve these references:
CLAUDE.md as AI-ready documentation - https://code.claude.com/docs/en/memory.md
Covers CLAUDE.md structure, rules frontmatter, and how AI tools consume project-level documentation.
SKILL.md and README.md documentation requirements - https://code.claude.com/docs/en/plugins.md
Plugin documentation standards including SKILL.md structure, README conventions, and required metadata.
Technical reference patterns and schema documentation - https://code.claude.com/docs/en/plugins-reference.md
Schema specifications, API documentation patterns, and technical reference formatting standards.
MCP configuration documentation patterns - https://code.claude.com/docs/en/mcp.md
MCP server documentation patterns, configuration file formats, and integration documentation examples.
Output styles and formatting - https://code.claude.com/docs/en/output-styles.md
Output formatting options, markdown rendering behavior, and style guidelines for AI-generated content.
IMPORTANT: Always use WebFetch to retrieve these URLs for the most current documentation before creating
or reviewing documentation artifacts. Official docs may have changed since this skill was last updated.
Use this skill when:
The fastest way to create AI-ready documentation is to start with a template:
1. List available templates:
python scripts/list_templates.py
This shows all 17 templates organized by frequency (high/medium/one-time/special).
2. Create from template:
python scripts/create_from_template.py <template-name> <output-path>
Examples:
# API endpoint documentation
python scripts/create_from_template.py api-endpoint docs/api/get-users.md
# How-to guide
python scripts/create_from_template.py how-to-guide docs/guides/deploy-production.md
# Tutorial
python scripts/create_from_template.py tutorial docs/tutorials/first-oauth-app.md
# README
python scripts/create_from_template.py README README.md
3. Fill in placeholders and validate:
After creating from template:
[placeholders] with actual contentTemplates automatically include:
Follow this workflow when creating or improving documentation:
Every documentation file must start with YAML frontmatter enclosed in ---. The frontmatter provides essential
metadata for both human navigation and AI context.
Universal required fields:
title: Clear, descriptive title (60-70 chars max)description: Brief 1-2 sentence summary for SEO and AI contexttype: Document type (api-endpoint, guide, tutorial, reference, concept, troubleshooting)created: ISO 8601 date (YYYY-MM-DD)lastUpdated: ISO 8601 date (YYYY-MM-DD)Document type-specific fields:
Optional discovery fields for improved AI agent discoverability:
For guides, tutorials, troubleshooting, and concept documentation, add optional discovery fields:
when-to-read: User scenarios/contexts when this document is relevant (e.g., "implementing authentication", "debugging 401 errors")related-to: Explicit links to related documentationcode-references: Links to relevant source code filesThese fields help AI agents find relevant documentation through fuzzy/semantic search based on user intent. Use them when they provide clear value beyond the title and description. See the "Optional Discovery Fields" section in references/frontmatter-schemas.md for details.
For detailed frontmatter schemas: See references/frontmatter-schemas.md
AI tools split documentation into semantic chunks of 500-1000 tokens. Each section must be self-contained because chunking may separate related content.
See references/ai-ready-single-file.md for core AI-ready principles including:
Heading hierarchy rules:
Self-contained sections:
See references/ai-ready-single-file.md for complete structural rules and examples.
See references/examples.md for complete document examples.
Always use properly formatted code blocks with language tags. AI tools struggle when commands are embedded in sentences.
Good: Code in fenced blocks with language tags Bad: Commands inline in prose
See references/examples.md for complete before/after examples showing proper code formatting.
Key principles:
See references/ai-ready-single-file.md for detailed content patterns and anti-patterns.
See references/examples.md for complete before/after examples.
Use the validation scripts to check documentation:
Check document quality:
python scripts/check_doc_quality.py path/to/your-doc.md
Lint markdown:
bash scripts/lint_markdown.sh path/to/your-doc.md
Auto-fix linting issues:
npx markdownlint-cli --config .markdownlint.json --fix path/to/your-doc.md
Check for broken links:
bash scripts/check_links.sh path/to/your-doc.md
All scripts support multiple files and glob patterns. See scripts/ section below for details.
For frontmatter validation, use the maintaining-docs skill:
# Invoke maintaining-docs skill for comprehensive validation
Skill(command='maintaining-docs')
# Then use that skill's validation tools
Run all validators before considering documentation complete.
Self-contained sections:
Proper document length:
Examples over explanations:
Semantic proximity:
See references/quality-checklist.md for a comprehensive validation checklist.
Validation scripts:
check_doc_quality.py - Checks documentation quality metrics
lint_markdown.sh - Lints markdown with markdownlint-cli
.markdownlint.jsoncheck_links.sh - Checks for broken links in markdown files
.markdown-link-check.jsonTemplate management:
list_templates.py - Lists all available templates with descriptions
python scripts/list_templates.py
Output example:
📋 Available Documentation Templates
======================================================================
🔥 High-Frequency Templates
Use multiple times per project
• api-endpoint.md REST/GraphQL API endpoint documentation
• how-to-guide.md Task-oriented step-by-step guides
• cli-command.md Command-line interface reference
...
📖 Usage:
Create from template:
$ python scripts/create_from_template.py <template-name> <output-path>
Features:
create_from_template.py - Creates new documentation from template
python scripts/create_from_template.py <template-name> <output-path>
# Examples:
python scripts/create_from_template.py api-endpoint docs/api/get-users.md
python scripts/create_from_template.py tutorial docs/tutorials/oauth.md
python scripts/create_from_template.py README README.md
Features:
Complete workflow example:
# 1. List available templates
python scripts/list_templates.py
# 2. Create from template
python scripts/create_from_template.py api-endpoint docs/api/create-user.md
# 3. Edit the file (replace [placeholders])
# ... edit docs/api/create-user.md ...
# 4. Validate
python scripts/check_doc_quality.py docs/api/create-user.md
bash scripts/lint_markdown.sh docs/api/create-user.md
# 5. Auto-fix any linting issues
npx markdownlint-cli --config .markdownlint.json --fix docs/api/create-user.md
All scripts are executable and provide clear error/success output.
ai-ready-single-file.md - Core principles for AI-readable documentation
frontmatter-schemas.md - Frontmatter templates for common document types
examples.md - Complete before/after examples
api-doc-patterns.md - Standard structure for API endpoint documentation
quality-checklist.md - Comprehensive validation checklist
Refer to these files when creating documentation for detailed guidance and examples.
Ready-to-use templates for common documentation types. Each template includes proper frontmatter, structure, and placeholder content following AI-ready principles.
High-frequency templates (use multiple times per project):
api-endpoint.md - REST/GraphQL API endpoint documentationhow-to-guide.md - Task-oriented step-by-step guidestroubleshooting-entry.md - Problem-solution documentationcli-command.md - Command-line interface referenceconfig-option.md - Configuration option referenceMedium-frequency templates (several per project):
tutorial.md - Step-by-step learning tutorialconcept-explanation.md - Architecture and design conceptserror-reference.md - Error code documentationOne-time templates (project essentials):
getting-started.md - Quick start guideinstallation-guide.md - Installation instructionsSpecial documentation:
CHANGELOG.md - Version history and release notesREADME.md - Project overview and introductionadr-template.md - Architecture Decision Recordspersonas.md - User persona documentationfaq.md - Frequently Asked Questionsglossary.md - Terminology and definitionsFallback:
generic-template.md - Flexible template for any documentation typeUsage: Copy appropriate template, fill in placeholders, run validation scripts.
Example request 1: "Document this API endpoint for AI tools"
Response approach:
Example request 2: "Help me improve this documentation file"
Response approach:
Example request 3: "Create a tutorial for implementing OAuth"
Response approach:
For project-wide documentation management:
Use the maintaining-docs skill for:
Skill(command='maintaining-docs')
For writing agent prompts or instructions:
Use the crafting-agentic-prompts skill (not this skill) when documenting: