MCPInstall

agents-md

Create, audit, or trim AGENTS.md and its harness mirrors (CLAUDE.md, GEMINI.md, .github/copilot-instructions.md, .cursor/rules) so build/test commands stay accurate and the file stays under each harness's size cap. Use when the user says "create AGENTS.md", "audit AGENTS.md", "trim AGENTS.md", "AGENTS.md is stale", "CLAUDE.md drift", "agent instructions hygiene", or invokes /agents-md. Covers nested AGENTS.md for monorepo packages, nearest-file precedence, and the bundled scripts/agentsmdcheck.py measurement script. Do NOT use for .github/copilot-instructions.md authoring or Copilot code-review configuration — that is /github-copilot-repo-instructions. Do NOT use for personal, per-user, or machine-global instruction files (/.claude/CLAUDE.md, personal Copilot instructions) — those are out of scope for this repository-scoped skill.

Installs
53
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/paulnsorensen/git-gouda --skill agents-md
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads agents-md automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

agents-md

Repository-scoped hygiene for AGENTS.md: create it, measure it, audit its content, and check it against its harness mirrors. One canonical file, harness-neutral, no frontmatter.

.github/copilot-instructions.md authoring and Copilot code-review setup live in /github-copilot-repo-instructions (if installed). This skill only checks that file's mirror status against AGENTS.md; it does not write Copilot-specific content or applyTo path rules.

Personal or machine-global instruction files (a user's own ~/.claude/CLAUDE.md, personal Copilot instructions) are out of scope. This skill only touches files committed to the repository.


Why AGENTS.md hygiene matters

AGENTS.md is a vendor-neutral, plain-Markdown convention with no required fields (agents.md). Harnesses load applicable files at different times. Loaded text uses context, so keep instructions concise and commands current. Do not equate loaded context with billed tokens or assume every file loads on every turn.

Effectiveness evidence is mixed. Keep repository rules that help agents act, not rules based on a promised task-success gain. See references/harness-matrix.md for loading behavior and references/content-checklist.md for study limits.


Protocol

1. Inventory instruction files

List what exists, repository-relative, root and nested:

find . -maxdepth 4 \( -name AGENTS.md -o -name CLAUDE.md -o -name CLAUDE.local.md \
  -o -name GEMINI.md -o -path '*/.github/copilot-instructions.md' -o -path '*/.cursor/rules*' \) \
  -not -path '*/node_modules/*'

Each harness reads a different subset with different precedence and caps. Read references/harness-matrix.md before assuming one file's presence or absence is equivalent to another's — nearest-file precedence is the norm (agents.md spec, Codex, Copilot, Cursor), but Claude Code's own trigger is different: it reads AGENTS.md only when no CLAUDE.md/CLAUDE.local.md exists above the working file, or via an explicit @AGENTS.md import inside a CLAUDE.md.

2. Measure

python3 "$AGENTS_MD_CHECK" [path/to/AGENTS.md]

Resolve AGENTS_MD_CHECK from the loaded SKILL.md directory (scripts/agents_md_check.py), resolving symlinks first. Do not assume the skill sits at skills/agents-md/ in the target repository.

Reports bytes, lines, the heading map, every referenced just <recipe> checked against a nearby justfile, every referenced repo-relative path, and the mirror status of CLAUDE.md, .github/copilot-instructions.md, and GEMINI.md. Flag a file over ~200 lines as a soft readability warning. The script also sums the AGENTS.md chain from the repository root to each directory at or below the checked file. A chain over 32 KiB fails outright. OpenAI Codex concatenates that chain from the root down. It stops adding files when the combined size reaches project_doc_max_bytes (32 KiB by default), so the files nearest the working directory drop first (https://developers.openai.com/codex/guides/agents-md/).

Root discovery and skip rules follow Codex:

  • The root is the nearest directory at or above the checked file that contains .git. With no .git, each chain is the checked file only, and the report says "file directory" instead of "repository root".
  • Per directory, AGENTS.override.md counts when present, else AGENTS.md.
  • Sizes are raw on-disk bytes, so CRLF line endings count in full.
  • The walk skips dot directories, node_modules, broken symlinks, and any subdirectory with its own .git (a nested project root).

Exit codes: 0 when no chain breaches the cap, no mirror has diverged, and every referenced recipe and path exists. 1 on a cap breach, on any drift (diverged mirror, missing recipe, or missing path), or when the file does not exist.

--json prints these fields: path, bytes, chain_bytes, chain_dir (the deepest directory of the largest chain, relative to the root), root_marker (true when a .git root was found), lines, byte_cap, cap_breach, near_cap, line_warn, headings, justfile, referenced_just_recipes, missing_recipes, referenced_paths, missing_paths, mirrors, diverged_mirrors, and drift.

3. Content audit

For every command and path AGENTS.md names, verify it against the real repository, not against memory:

  • Every backticked just <recipe> exists in the justfile — the script checks this; treat a FAIL missing just recipes line as a stale command, not a script bug.
  • Every backticked repo-relative path exists — same treatment for FAIL missing referenced paths.
  • Quality gates, conventions, and "do not touch" boundaries match the project's actual CI and review practice, not an aspirational one.
  • PR and commit rules are stated, not implied.

Anti-patterns to flag and remove, per references/content-checklist.md: narrative history, README duplication, secrets or tokens, per-person preferences, and any command that no longer runs.

4. Mirror strategy

Keep exactly one canonical AGENTS.md. For each mirror:

  • CLAUDE.md: either absent, or contains only @AGENTS.md (a Claude Code import — https://code.claude.com/docs/en/memory). Do not duplicate content into it.
  • .github/copilot-instructions.md: either absent (Copilot reads AGENTS.md directly) or a short pointer. If the user wants Copilot-specific content (path-scoped applyTo rules, code-review knobs), route to /github-copilot-repo-instructions — do not author that file here.
  • GEMINI.md: either absent or a short pointer, same pattern as CLAUDE.md.

Report any mirror the check script marks diverged as drift, and propose collapsing it to a pointer or removing it.

5. Nested AGENTS.md

For a monorepo or multi-package layout, put a nested AGENTS.md in each package that needs its own rules. Codex, Claude Code, Cursor, Gemini CLI, and Copilot CLI load the nested file together with every ancestor file. No harness replaces the root file with the nested file. The nearer file wins only on conflict. See references/harness-matrix.md for each harness.

  • Put only the subtree's delta in the nested file: its own commands, boundaries, and exceptions. A copied root rule duplicates context when both files load and can drift.
  • State each exception to a root rule explicitly, and name the root rule that it replaces. VS Code warns that harnesses do not share one precedence order.
  • Keep every root-to-leaf chain under the Codex 32 KiB cap. Codex drops the nearest files first.
  • Claude Code reads a nested AGENTS.md only when that directory has no CLAUDE.md of its own.

6. Trim or rewrite

Always show the proposed change as a diff against the current file. Then stop and ask for explicit approval before writing AGENTS.md or any mirror. A request to skip the diff ("I don't need to see the diff") does not waive this step and is not approval. Write only after the user approves the diff that you showed.

Never run git commit or git push. Leave the changes in the working tree. The user owns commits.

Use assets/AGENTS.md.template as the starting shape for a new file, not as boilerplate to paste unedited — every section must reflect this repository's actual commands and boundaries.

7. Verify

python3 "$AGENTS_MD_CHECK" --self-test
python3 "$AGENTS_MD_CHECK"

Both must exit 0. Re-run any command the audit changed or added before reporting done.


Rules

  • One canonical AGENTS.md per directory scope. Mirrors point at it; they do not restate it.
  • Never invent a command or path. Every backticked just <recipe> and every referenced path must exist — the check script verifies this, do not skip it.
  • Do not add narrative, README duplication, secrets, or per-person preferences. See references/content-checklist.md for the full list.
  • Do not write .github/copilot-instructions.md content beyond a short pointer — that authoring belongs to /github-copilot-repo-instructions.
  • Do not touch personal or machine-global instruction files.
  • Show the diff and get explicit approval before overwriting an existing AGENTS.md or mirror. A request to skip the diff is not approval.
  • Never run git commit, git push, or any other publication command. Leave changes in the working tree.

References

  • references/harness-matrix.md — which harness reads which file, with precedence and size caps, cited.
  • references/content-checklist.md — what belongs in AGENTS.md and what does not. Harness-behavior claims are cited; the lists are this skill's guidance.
  • assets/AGENTS.md.template — a short, sectioned starting template.

FAQ

What does the agents-md skill do?

Create, audit, or trim AGENTS.md and its harness mirrors (CLAUDE.md, GEMINI.md, .github/copilot-instructions.md, .cursor/rules) so build/test commands stay accurate and the file stays under each harness's size cap. Use when the user says "create AGENTS.md", "audit AGENTS.md", "trim AGENTS.md", "AGENTS.md is stale", "CLAUDE.md drift", "agent instructions hygiene", or invokes /agents-md. Covers nested AGENTS.md for monorepo packages, nearest-file precedence, and the bundled scripts/agentsmdcheck.py measurement script. Do NOT use for .github/copilot-instructions.md authoring or Copilot code-review configuration — that is /github-copilot-repo-instructions. Do NOT use for personal, per-user, or machine-global instruction files (/.claude/CLAUDE.md, personal Copilot instructions) — those are out of scope for this repository-scoped skill.

How do I install agents-md?

Run npx skills add https://github.com/paulnsorensen/git-gouda --skill agents-md in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/agents-md/ (personal) or .claude/skills/agents-md/ (project).

Which AI agents can use agents-md?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is agents-md safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains agents-md?

It is published by paulnsorensen in paulnsorensen/git-gouda. It has 53 recorded installs.

More from paulnsorensen/git-gouda

View all →

config-review-bot

paulnsorensen/git-gouda

Audit or configure CodeRabbit repository review policy from effective sources. Use for CodeRabbit setup, configuration review, path coverage, or a specific pull-request review audit. Trigger on "configure CodeRabbit", "review .coderabbit.yaml", "set up CodeRabbit", "audit CodeRabbit settings", or "is CodeRabbit covering X". Keep audits read-only by default and separate schema validity, rule quality, and completed-review evidence. Do not use it to run a CodeRabbit CLI review or autofix, or to fix review comments on a pull request.

safe-settings

paulnsorensen/git-gouda

Set up GitHub's safe-settings (a Probot-based GitHub App from the github org) for declarative, org-wide repository policy as code. Use when the user says "settings as code", "safe-settings", "manage repos declaratively", "centralize repo settings", "org-level branch protection", "scaffold an admin repo", "github settings app", or invokes /safe-settings on an org that wants to manage repo settings, branch protection, rulesets, labels, teams, environments, and collaborators from one admin repo. Scaffolds the admin-repo layout (settings.yml + suborgs/ + repos/), the GitHub App installation steps, and a scheduled full-sync GitHub Actions workflow. Distinct from /gh-bootstrap (one-shot gh api config of a single repo) — this skill is for org-scale settings as code that reconciles continuously. Not for per-task GitHub ops (PRs, issues, CI status) or local git work — those are out of this catalog's scope.

DevOps & Cloud69 installs

gh-bootstrap

paulnsorensen/git-gouda

One-time GitHub repository configuration via the gh CLI: lock the default branch with PR and CI rules, optionally enable a supported merge queue, lock merging to squash-only with PR-title commit messages, scaffold automatically-generated release notes (.github/release.yml), and optionally add a tag-driven release workflow. Use when the user says "set up the repo", "configure the merge queue", "enable squash merging", "lock down main", "set up branch protection", "configure release notes", "scaffold releases", "set up release tagging", or invokes /gh-bootstrap on a fresh or loosely-configured GitHub repository. Idempotent — safe to re-run on already-configured repos to bring missing pieces in line. This skill covers one-time repo policy, not per-task GitHub operations, local git commands, or project task running.

prek

paulnsorensen/git-gouda

Onboard prek (Rust-powered pre-commit) into any project and suggest hooks tailored to the language/framework. Use when the user says "add prek", "set up pre-commit hooks", "configure prek", "what hooks should I use", or when you notice a project without a prek.toml that would benefit from pre-commit checks. Also trigger when the user wants to add new hooks to an existing prek.toml, audit their hook config, or migrate from pre-commit to prek. Covers Rust, Python, TypeScript/JavaScript, Go, Ruby, and Shell projects. Do NOT use for husky, lint-staged, or CI pipeline hook configuration — this skill is specifically for prek.

oss-hygiene

paulnsorensen/git-gouda

Bring an open-source GitHub repository up to community-standards and supply-chain hygiene baseline: scaffold the GitHub Community Standards files (README check, LICENSE, CODEOFCONDUCT, CONTRIBUTING, SECURITY, issue + PR templates), wire Dependabot version updates, the Dependency Review action, OpenSSF Scorecard, and CodeQL (when applicable), check Dependabot alerts and secret scanning, and add the OpenSSF Best Practices Badge link. Use when the user says "set up OSS hygiene", "make this repo open-source-ready", "add community health files", "wire dependabot", "add scorecard", "OSSF badge", "supply chain hardening", or invokes /oss-hygiene on a public repo. Idempotent — safe to re-run; diffs against templates and asks before overwriting. Distinct from /gh-bootstrap (merge-button + branch protection) and /safe-settings (org-scale settings as code): focuses on the contributor-facing and supply-chain surface, not merge or org policy. Run after /gh-bootstrap; before announcing the repo.

github-copilot-repo-instructions

paulnsorensen/git-gouda

Add, audit, or fix GitHub Copilot repository custom instructions — .github/copilot-instructions.md (repo-wide) and .github/instructions/.instructions.md (path-specific) — so Copilot Chat, Copilot code review, and the Copilot coding agent all pick up project-wide guidance. Also covers AGENTS.md, CLAUDE.md, and GEMINI.md as alternate agent instruction files. Use when the user says "add Copilot instructions", "set up copilot-instructions.md", "audit our Copilot config", "make Copilot follow our conventions", "configure Copilot code review", "add path-specific Copilot rules", "applyTo glob", "excludeAgent", "Copilot is ignoring our guidance", or invokes /github-copilot-repo-instructions. Do NOT use for personal (per-user) Copilot instructions; those are out of scope for this skill. For AGENTS.md authoring guidance beyond file layout, see the agents-md skill.

Popular code quality & workflow skills

View category →

grill-me

mattpocock/skills

A relentless interview to sharpen a plan or design.

Scan a codebase for deepening opportunities, present them as a visual HTML report, then grill through whichever one you pick.

handoff

mattpocock/skills

Compact the current conversation into a handoff document for another agent to pick up.

domain-modeling

mattpocock/skills

Build and sharpen a project's domain model. Use when discussing codebase terminology, writing or editing a GLOSSARY.md, or recording or editing an ADR.

codebase-design

mattpocock/skills

Shared vocabulary for designing deep modules. Use when the user wants to design or improve a module's interface, find deepening opportunities, decide where a seam goes, make code more testable or AI-navigable, or when another skill needs the deep-module vocabulary.

diagnosing-bugs

mattpocock/skills

Diagnosis loop for hard bugs and performance regressions. Use when the user says "diagnose"/"debug this", or reports something broken/throwing/failing/slow.