
agent-rules
Skill that generates and maintains AGENTS.md and copilot rule files from existing project files.
- GitHub stars
- 92
What it does
- Adds the
agent-rulesskill, triggered by requests to create or update AGENTS.md, copilot-instructions.md, or other agent rule files - Generates thin root files of about 30 lines plus scoped files for detected subsystems like backend/, frontend/, internal/, and cmd/
- Auto-extracts commands from Makefile, package.json, composer.json, and go.mod, with templates for Go, PHP, TypeScript, and Python
- Supports idempotent updates that refresh content while preserving existing structure and marking files as agent-maintained
Generate and maintain AGENTS.md, copilot-instructions.md, and other agent rule files. Extracts CI rules, architecture boundaries, ADRs, and GitHub rulesets. Supports Go, PHP, TYPO3, Symfony, Python, TypeScript, and skill repos.
Add marketplace
/plugin marketplace add netresearch/claude-code-marketplaceRun it inside Claude Code once, then install the plugin below.
Install
/plugin install agent-rules@netresearch-claude-code-marketplaceRun it inside Claude Code after adding the marketplace.
Files
Discovered from sourceAGENTS.md Generator Skill
Generate and maintain AGENTS.md files following the agents.md convention. AGENTS.md is FOR AGENTS, not humans.
When to Use
- Creating or updating AGENTS.md for new/existing projects
- Scaffolding a new repository — ship AGENTS.md with the initial commits; retrofitting later needs full re-verification
- Standardizing agent documentation across repositories
- Checking AGENTS.md freshness after code changes
- Onboarding AI agents to an unfamiliar codebase
Scripts
Call every script by its full path: bash ${CLAUDE_SKILL_DIR}/scripts/<name> PATH. Calling one relative to the working directory is not covered by the frontmatter rule and raises a permission prompt per call.
| Script | Purpose |
|---|---|
generate-agents.sh PATH | Generate AGENTS.md files |
validate-structure.sh PATH | Validate structure compliance |
check-freshness.sh PATH | Check if files are outdated |
verify-content.sh PATH | Verify documented files/commands match codebase |
verify-commands.sh PATH | Verify documented commands execute |
score-agents.sh PATH | Grade AGENTS.md quality, worst-first |
detect-project.sh PATH | Detect language, version, build tools |
detect-scopes.sh PATH | Identify directories needing scoped files |
extract-commands.sh PATH | Extract commands from build configs |
extract-ci-rules.sh PATH | Extract CI quality gates and version matrix |
extract-architecture-rules.sh PATH | Extract module boundaries |
extract-adrs.sh PATH | Extract architectural decision records |
extract-github-rulesets.sh PATH | Extract GitHub rulesets and merge rules |
See references/scripts-guide.md for full options.
Workflow
- Detect:
detect-project.sh+detect-scopes.sh— stacks and subsystems - Extract:
extract-commands.sh,extract-ci-rules.sh— gather facts - Generate:
generate-agents.sh --style=thin(default) or--verbose - Verify:
verify-content.sh+verify-commands.sh-- MANDATORY before done. Replace the generated**Changelog:**TODO: name the file, its format and which PR writes the entry, read from the last merged PRs (AG-32, AG-33) - Line cap: before committing any root AGENTS.md edit,
wc -l AGENTS.mdmust be under 150 (harnessAH-02); run the repo'sverify-harness.shwhere it exists -- CI's harness check fails otherwise
--update preserves curated content outside <!-- GENERATED --> markers.
Core Principles
- Structured over Prose -- tables parse faster than paragraphs
- Never Fabricate -- only document what exists; verify every command and path
- Pointer Principle -- point to files, don't duplicate content
- Auto Symlinks -- CLAUDE.md/GEMINI.md by default (
ai-tool-compatibility.md)
References
| File | Contents |
|---|---|
verification-guide.md | Verification steps, anti-bloat, preservation check |
fleet-sync-sweep.md | Fleet-wide AGENTS.md sweeps |
scripts-guide.md | Script options, validation checklist |
quality-rubric.md | Grading rubric |
ai-tool-compatibility.md | 16-agent compatibility matrix |
output-structure.md | Root/scoped sections |
git-hooks-setup.md | Hook framework setup |
examples/ | Complete examples |
ai-contribution-guidelines.md | "3 Cs" AI-contribution framework |
directory-coverage.md | Scoped-file coverage rationale |
feedback-memory-schema.md | Approved-learning file format |
Templates
Root: assets/root-thin.md (default) or root-verbose.md. Scoped: assets/scoped/, one per stack (Go/PHP/Python/TYPO3/Symfony/Oro/CLI/TS/skill-repo).
Supported Projects
Go, PHP (Composer/Laravel/Symfony/TYPO3/Oro), TypeScript (React/Next/Vue/Node), Python (pip/poetry/ruff/mypy), skill repos, hybrid.
See Also
agent-harness-skill— agent-readiness harness (CI enforcement).skill-repo-skill— skill-repo structure (plugin.json, licensing, releases).
Readme
AGENTS.md Generator Skill
Netresearch AI skill for generating and maintaining AGENTS.md files following the agents.md specification.
What is AGENTS.md? A context file written for AI coding agents, not humans. Human readability is a side effect, not a goal. Adopted by 60,000+ open-source projects. See the official specification and best practices from 2,500+ repositories.
Standards Compliance
This skill implements two complementary standards:
-
agents.md - The file format this skill generates. A simple Markdown convention for guiding AI coding agents, supported by Claude Code, GitHub Copilot, Cursor, and 60,000+ open-source projects.
-
Agent Skills - How this skill is packaged and distributed. A portable format for procedural knowledge that works across AI agents.
Supported Platforms:
- ✅ Claude Code (Anthropic)
- ✅ Cursor
- ✅ GitHub Copilot
- ✅ Other skills-compatible AI agents
Features
- Thin Root Files - ~30 lines with precedence rules and global defaults
- Scoped Files - Automatic subsystem detection (backend/, frontend/, internal/, cmd/)
- Auto-Extraction - Commands from Makefile, package.json, composer.json, go.mod
- Multi-Language - Templates for Go, PHP, TypeScript, Python, and hybrid projects
- Idempotent Updates - Preserve existing structure while refreshing content
- Managed Headers - Mark files as agent-maintained with timestamps
Installation
Marketplace (Recommended)
Add the Netresearch marketplace once, then browse and install skills:
# Claude Code
/plugin marketplace add netresearch/claude-code-marketplace
/plugin install agent-rules@netresearch-claude-code-marketplace
Without a marketplace
Since Claude Code 2.1.157 a plugin directory under your personal skills directory loads on its own:
mkdir -p ~/.claude/skills
git clone https://github.com/netresearch/agent-rules-skill.git \
~/.claude/skills/agent-rules
It loads as agent-rules@skills-dir on the next session. Update with git -C ~/.claude/skills/agent-rules pull and start a new session; remove it by deleting the directory. This route has no claude plugin update.
npx (skills.sh)
Install with any Agent Skills-compatible agent:
npx skills add https://github.com/netresearch/agent-rules-skill --skill agent-rules
Download Release
Download the latest release and extract to your agent's skills directory.
Git Clone
git clone https://github.com/netresearch/agent-rules-skill.git
Composer (PHP Projects)
composer require netresearch/agent-rules-skill
Requires netresearch/composer-agent-skill-plugin.
npm (Node Projects)
npm install --save-dev \
@netresearch/agent-skill-coordinator \
github:netresearch/agent-rules-skill
Requires @netresearch/agent-skill-coordinator, which discovers the skill in node_modules and registers it in AGENTS.md via a postinstall hook. For pnpm, also allowlist the coordinator's postinstall:
{
"pnpm": {
"onlyBuiltDependencies": ["@netresearch/agent-skill-coordinator"]
}
}
Usage
The skill triggers on keywords like:
- "AGENTS.md", "agents file"
- "agent documentation", "AI onboarding"
- "project context for AI"
Example Prompts
"Generate AGENTS.md for this project"
"Update the agents documentation"
"Create scoped AGENTS.md files for each subsystem"
"Validate AGENTS.md structure"
Supported Projects
| Type | Detection | Features |
|---|---|---|
| Go | go.mod | Version extraction, CLI tool detection |
| PHP | composer.json | TYPO3/Laravel/Symfony detection |
| TypeScript | package.json | React/Next.js/Vue/Express detection |
| Python | pyproject.toml | Poetry/Ruff/Django/Flask detection |
| Hybrid | Multiple markers | Auto-creates scoped files per stack |
Structure
agents/
├── SKILL.md # AI instructions
├── README.md # This file
├── LICENSE-MIT # Code license (MIT)
├── LICENSE-CC-BY-SA-4.0 # Content license (CC-BY-SA-4.0)
├── composer.json # PHP distribution
├── references/ # Convention documentation
├── scripts/ # Generator scripts
│ ├── generate-agents.sh
│ ├── validate-structure.sh
│ └── detect-scopes.sh
└── templates/ # Language-specific templates
├── go/
├── php/
├── typescript/
└── python/
Contributing
Contributions welcome! Please submit PRs for:
- Additional language templates
- Detection signal improvements
- Script enhancements
- Documentation updates
Governance and policies
This repository follows the organisation-wide policies of netresearch:
- Governance: roles, how changes are decided and disputes resolved, and who controls access to sensitive resources.
- Roadmap: the maintenance work planned and excluded for the coming year.
- Handling of dependency and code analysis findings: which vulnerability, licence and static-analysis findings block a change, the deadlines for the others, and how exceptions are recorded.
- Secret management: where CI secrets are stored, who can access them, and when they are rotated.
- Access roster: the accounts with admin, maintain and write access to this repository.
Checks that run on every pull request to main (.github/workflows/security.yml):
- Dependency review: fails on a known vulnerability of severity high or critical in a dependency the pull request adds or changes.
- Composer Audit: fails on a known vulnerability in a Composer dependency.
- Opengrep: static security analysis of the repository's code; which findings fail the check is set by the organisation's static analysis rule.
- Betterleaks: fails on a committed secret.
- zizmor: static analysis of the GitHub Actions workflows; findings go to code scanning and do not fail the check.
What you can and cannot expect from this repository in terms of security, with its threat model: docs/SECURITY-ASSURANCE.md.
License
This project uses split licensing:
- Code (scripts, workflows, configs): MIT
- Content (skill definitions, documentation, references): CC-BY-SA-4.0
See the individual license files for full terms.
Credits
Developed and maintained by Netresearch DTT GmbH.
Made with ❤️ for Open Source by Netresearch
Details
- Marketplace
- netresearch/claude-code-marketplace
- Source
- netresearch/agent-rules-skill
- Category
- Development
- Listed since
- Apr 7, 2026
More from netresearch/claude-code-marketplace
All 41- automated-assessment
- cli-tools
- concourse-ci
- context7
- data-tools
- docker-development
- enterprise-readiness
- file-search
- formal-model-checking
- german-technical-writing
- git-workflow
- github-project
- github-release
- go-development
- jira-integration
- jujutsu-workflow
- markdown-to-pdf
- matrix-communication
- netresearch-branding
- orocommerce
- peer-qa-review
- php-modernization
- php-structured-edit
- retro
Similar to agent-rules
More Agent Workflow & Planning
agents-mdSkillcallicrate/skills1.4K installsScoped AGENTS.md authoring skill that turns verified repo evidence into concise, path-scoped guidance for coding agents.
cli-toolsPluginnetresearch/claude-code-marketplace92 starsAutomatic CLI tool management for coding agents. Detects missing tools from 'command not found' errors and installs via optimal package managers. 100+ tool cata
create-agentsmdSkillgithub/awesome-copilot13.3K installsGuided prompt for generating a repository-root AGENTS.md that gives coding agents setup, testing, style, and PR context.
skill-curatorPluginagent-sh/agentsys1K starsCanonical guidance for writing, reviewing, and maintaining production-grade SKILL.md files across agent tools
agent-harnessPluginnetresearch/claude-code-marketplace92 starsUse when making a repo agent-ready, verifying harness consistency, checking for documentation drift, bootstrapping harness infrastructure (AGENTS.md as index, d
customaize-agentPluginNeoLabHQ/context-engineering-kit1.8K starsCommands and skills for writing and refining commands, hooks, skills for Claude Code, includes Anthropic Best Practices and Agent Persuasion Principles that can