Get the FREE Ultimate OpenClaw Setup Guide →

agent-rules

npx machina-cli add skill netresearch/agent-rules-skill/agent-rules --openclaw
Files (1)
SKILL.md
3.8 KB

AGENTS.md Generator Skill

Overview

Generate and maintain AGENTS.md files following the agents.md convention. AGENTS.md is FOR AGENTS, not humans.

When to Use

  • Creating a new project and establishing baseline AGENTS.md
  • Standardizing existing projects with consistent agent documentation
  • Ensuring multi-repo consistency across repositories
  • Checking if AGENTS.md files are current with recent code changes
  • Onboarding AI agents to an unfamiliar codebase

Quick Reference

ScriptPurpose
scripts/generate-agents.sh PATHGenerate AGENTS.md files
scripts/validate-structure.sh PATHValidate structure compliance
scripts/check-freshness.sh PATHCheck if files are outdated vs git commits
scripts/verify-content.sh PATHVerify documented files/commands match codebase
scripts/verify-commands.sh PATHVerify documented commands execute
scripts/detect-project.sh PATHDetect language, version, build tools
scripts/detect-scopes.sh PATHIdentify directories needing scoped files
scripts/extract-commands.sh PATHExtract commands from build configs

See references/scripts-guide.md for full options and validation checklist.

Core Principles

  • Structured over Prose -- tables and maps parse faster than paragraphs
  • Verified Commands -- commands that don't work waste 500+ tokens debugging
  • Pointer Principle -- point to files, don't duplicate content
  • Golden Samples -- one example file beats pages of explanation
  • Audit Before Generating -- discover existing docs and pain points before running scripts

Language Choice

Default to English. Exception: match your code's naming language to prevent agents mixing languages.

Prerequisites

RequirementVersionNotes
Bash4.3+Nameref variables (local -n). macOS: brew install bash
jq1.5+JSON processing
git2.0+For git history analysis

References

Detailed documentation in references/:

FileContents
verification-guide.mdVerification steps, name matching, command verification, design principles
scripts-guide.mdScript options, post-generation validation checklist
ai-tool-compatibility.mdClaude Code shim, Codex stacking, Copilot integration
output-structure.mdRoot/scoped sections, auto-generate vs manual curation
analysis.mdAnalysis of 21 real-world AGENTS.md files
directory-coverage.mdCoverage guidance for PHP/TYPO3, Go, TypeScript
examples/Complete examples (coding-agent-cli, ldap-selfservice, simple-ldap-go, t3x-rte-ckeditor-image)

Asset Templates

Root templates in assets/: root-thin.md (~30 lines, default), root-verbose.md (~100 lines).

Scoped templates in assets/scoped/: backend-go.md, backend-php.md, typo3.md, oro.md, cli.md, frontend-typescript.md.

Supported Project Types

LanguageProject Types
GoLibraries, web apps (Fiber/Echo/Gin), CLI (Cobra/urfave)
PHPComposer packages, Laravel/Symfony
PHP/TYPO3TYPO3 extensions (auto-detected via ext_emconf.php)
PHP/OroOroCommerce, OroPlatform, OroCRM bundles
TypeScriptReact, Next.js, Vue, Node.js
Pythonpip, poetry, Django, Flask, FastAPI
HybridMulti-language projects (auto-creates scoped files per stack)

Source

git clone https://github.com/netresearch/agent-rules-skill/blob/main/skills/agent-rules/SKILL.mdView on GitHub

Overview

Generates and maintains AGENTS.md files following the agents.md convention. AGENTS.md is intended for AI agents, not humans, helping standardize agent documentation across repositories.

How This Skill Works

It generates AGENTS.md using the project’s scripts and templates, aligning with the agents.md convention. It then validates structure, freshness, and content through dedicated scripts to ensure commands and entries reflect the codebase.

When to Use It

  • Creating a new project and establishing baseline AGENTS.md
  • Standardizing existing projects with consistent agent documentation
  • Ensuring multi-repo consistency across repositories
  • Checking if AGENTS.md files are current with recent code changes
  • Onboarding AI agents to an unfamiliar codebase

Quick Start

  1. Step 1: Run scripts/generate-agents.sh PATH to generate AGENTS.md from a baseline
  2. Step 2: Run scripts/validate-structure.sh PATH to ensure structural conformance
  3. Step 3: Run scripts/check-freshness.sh PATH and scripts/verify-content.sh PATH to confirm freshness and accuracy

Best Practices

  • Structured over Prose - tables and maps parse faster than paragraphs
  • Verified Commands - commands that don’t work waste tokens debugging
  • Pointer Principle - point to files, don’t duplicate content
  • Golden Samples - one example file beats pages of explanation
  • Audit Before Generating - discover existing docs and pain points before running scripts

Example Use Cases

  • Create a baseline AGENTS.md for a new Go service
  • Standardize AGENTS.md across a multi-repo microservices project
  • Onboard AI agents to an unfamiliar repository
  • Validate AGENTS.md freshness after a major code change
  • Migrate legacy AGENTS.md to the latest agents.md convention

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers