Generate and maintain AGENTS.md files following the public agents.md convention. Use when creating documentation for AI agent workflows, onboarding guides, or standardizing agent interaction patterns across projects. By Netresearch.
Inherits all available tools
Additional assets for this skill
This skill inherits all available tools. When active, it can use any tool Claude has access to.
LICENSEREADME.mdSTATUS.mdclaudedocs/refactoring-summary.mdcomposer.jsonreferences/analysis.mdreferences/examples/coding-agent-cli/AGENTS.mdreferences/examples/coding-agent-cli/scripts-AGENTS.mdreferences/examples/ldap-selfservice/AGENTS.mdreferences/examples/ldap-selfservice/internal-AGENTS.mdreferences/examples/ldap-selfservice/internal-web-AGENTS.mdreferences/examples/simple-ldap-go/AGENTS.mdreferences/examples/simple-ldap-go/examples-AGENTS.mdreferences/examples/t3x-rte-ckeditor-image/AGENTS.mdreferences/examples/t3x-rte-ckeditor-image/Classes-AGENTS.mdscripts/detect-project.shscripts/detect-scopes.shscripts/extract-commands.shscripts/generate-agents.shscripts/lib/template.shGenerate and maintain AGENTS.md files following the public agents.md convention.
Creates hierarchical AGENTS.md documentation for software projects:
Based on analysis of 21 real AGENTS.md files across Netresearch projects.
# Basic generation (thin root + auto-detected scopes)
/tmp/agents-skill/scripts/generate-agents.sh .
# Dry-run to preview what will be created
/tmp/agents-skill/scripts/generate-agents.sh . --dry-run
# Verbose output with detection details
/tmp/agents-skill/scripts/generate-agents.sh . --verbose
# Thin root (default, ~30 lines, simple-ldap-go style)
/tmp/agents-skill/scripts/generate-agents.sh . --style=thin
# Verbose root (~100-200 lines, ldap-selfservice style)
/tmp/agents-skill/scripts/generate-agents.sh . --style=verbose
# Update timestamps and refresh auto-extracted content
/tmp/agents-skill/scripts/generate-agents.sh . --update
# Force regeneration (overwrites existing, keeps structure)
/tmp/agents-skill/scripts/generate-agents.sh . --force
# Validate existing AGENTS.md structure
/tmp/agents-skill/scripts/validate-structure.sh .
# Check for missing scoped files
/tmp/agents-skill/scripts/detect-scopes.sh .
| Signal | Detection |
|---|---|
go.mod | Go project, extracts version |
composer.json | PHP project, detects TYPO3/Laravel |
package.json | Node.js project, detects framework |
pyproject.toml | Python project, detects poetry/ruff |
Makefile | Extracts targets with ## comments |
.github/workflows/ | Extracts CI checks |
docker-compose.yml | Docker-first setup |
~30 lines following simple-ldap-go pattern:
<!-- Managed by agent: keep sections & order; edit content, not structure. Last updated: YYYY-MM-DD -->
# AGENTS.md (root)
**Precedence:** The **closest AGENTS.md** to changed files wins. Root holds global defaults only.
## Global rules
- Keep PRs small (~≤300 net LOC)
- Conventional Commits: type(scope): subject
- Ask before: heavy deps, full e2e, repo rewrites
- Never commit secrets or PII
## Minimal pre-commit checks
- Typecheck: [auto-detected from build tools]
- Lint: [auto-detected from linters]
- Format: [auto-detected from formatters]
- Tests: [auto-detected from test runners]
## Index of scoped AGENTS.md
- `./backend/AGENTS.md` — Backend services
- `./frontend/AGENTS.md` — Frontend application
## When instructions conflict
Nearest AGENTS.md wins. User prompts override files.
Each scoped file follows this structure:
All generated files include:
<!-- Managed by agent: keep sections & order; edit content, not structure. Last updated: 2025-10-18 -->
This marks files as agent-maintained and provides update tracking.
$ /tmp/agents-skill/scripts/detect-project.sh .
{
"type": "go-web-app",
"language": "go",
"version": "1.24",
"build_tool": "make",
"has_docker": true,
"quality_tools": ["golangci-lint", "gofmt"],
"test_framework": "testing",
"ci": "github-actions"
}
Automatically creates scoped AGENTS.md for directories with ≥5 source files:
$ /tmp/agents-skill/scripts/detect-scopes.sh .
{
"scopes": [
{"path": "internal", "type": "backend-go", "files": 15},
{"path": "cmd", "type": "cli", "files": 3},
{"path": "examples", "type": "examples", "files": 8}
]
}
Extracts actual commands from build tools:
$ /tmp/agents-skill/scripts/extract-commands.sh .
{
"typecheck": "go build -v ./...",
"lint": "golangci-lint run ./...",
"format": "gofmt -w .",
"test": "go test -v -race -short ./...",
"build": "go build -o bin/app ./cmd/app"
}
Real-world examples from Netresearch projects in references/examples/:
Perfect thin root (26 lines):
Go backend + TypeScript frontend:
internal/AGENTS.md (Go)internal/web/AGENTS.md (TypeScript + Tailwind)Composer-based with Make targets:
Classes/AGENTS.md (PHP backend)Documentation/AGENTS.md (RST docs)Tests/AGENTS.md (PHPUnit tests)Script-heavy toolset:
scripts/AGENTS.mdCopy templates to project and modify:
cp /tmp/agents-skill/templates/root-thin.md ./.agents-templates/root.md
# Edit ./.agents-templates/root.md
/tmp/agents-skill/scripts/generate-agents.sh . --template-dir=./.agents-templates
Templates support placeholders:
{{PROJECT_NAME}} - From package.json/composer.json/go.mod{{PROJECT_TYPE}} - Auto-detected type{{LANGUAGE}} - Primary language{{BUILD_COMMANDS}} - Extracted commands{{QUALITY_TOOLS}} - Detected linters/formatters{{TIMESTAMP}} - Current date (YYYY-MM-DD)Safe to run multiple times:
# Check structure compliance
/tmp/agents-skill/scripts/validate-structure.sh .
# Validates:
# ✅ Root is thin (≤50 lines or has index)
# ✅ All scoped files have 9 sections
# ✅ Managed headers present
# ✅ Precedence statement in root
# ✅ Links from root to scoped files work
# ✅ No duplicate content between root and scoped
Add to claude-code-marketplace:
{
"name": "agents",
"description": "Generate AGENTS.md files following public convention",
"version": "1.0.0",
"source": "./skills/agents"
}
# Clone skill
git clone https://github.com/netresearch/agents-skill.git /tmp/agents-skill
# Generate for current project
/tmp/agents-skill/scripts/generate-agents.sh .
When creating root AGENTS.md files, keep them thin (~30 lines):
When determining scope boundaries, create scoped files for:
backend/, frontend/, api/internal/, pkg/ (Go projects)cmd/, cli/scripts/docs/, examples/tests/, testutil/When extracting commands, automate extraction from:
## comments# Check what was detected
/tmp/agents-skill/scripts/extract-commands.sh . --verbose
# Fallback: Specify commands manually
/tmp/agents-skill/scripts/generate-agents.sh . --commands='{"lint":"make lint","test":"make test"}'
# Override auto-detection
/tmp/agents-skill/scripts/generate-agents.sh . --type=go-library
# Supported types:
# go-library, go-web-app, go-cli
# php-library, php-typo3, php-laravel
# typescript-react, typescript-node
# python-library, python-cli
# hybrid
# Check scope detection
/tmp/agents-skill/scripts/detect-scopes.sh .
# Manually specify scopes
/tmp/agents-skill/scripts/generate-agents.sh . --scopes=internal,cmd,examples
Improvements welcome! Common additions:
GPL-2.0-or-later (matching other Netresearch skills)
references/analysis.md - Analysis of 21 real AGENTS.md filesreferences/prompt.md - Original generation prompt/rulereferences/examples/ - Real-world AGENTS.md filesreferences/best-practices.md - Writing guide