Maintain AGENTS.md from repository evidence
Overview
Create or improve agent instructions that help a coding agent change the
repository correctly without rediscovering its workflow. Base every
repository-specific command, path, and rule on evidence in the current
checkout.
Prefer a focused diff over a wholesale rewrite. There is no universal line
limit, required section list, symlink layout, or commit-attribution policy;
follow the repository's own needs and maintainer intent.
When to Use
- The user asks to create, update, shorten, or audit
AGENTS.md.
- A monorepo needs root instructions plus narrower package-level overrides.
- Existing agent instructions contain stale commands, duplicated policy, or
unsupported claims.
- The user wants to reconcile
AGENTS.md with CLAUDE.md,
.github/copilot-instructions.md, or other repository instruction files.
Use @agents-generator instead when the task specifically calls for its
packaged generation modes, assets, or backup workflow. Use this skill when a
maintainer-readable, evidence-first edit is the primary goal.
How It Works
1. Preserve existing intent
Before writing, read every instruction file that applies to the target path,
including existing AGENTS.md files and relevant tool-specific files such as
CLAUDE.md, GEMINI.md, .github/copilot-instructions.md, and
.github/instructions/*.instructions.md.
- Improve an existing
AGENTS.md in place when possible.
- Preserve accurate maintainer-authored rules and repository-specific policy.
- Do not replace another tool's instruction file with a symlink unless the
user requests it and repository evidence shows identical content is desired.
- Do not silently choose between conflicting instructions. Follow the
higher-priority applicable rule, or ask when the intended policy cannot be
established from the repository.
2. Build a bounded evidence map
Inspect only enough of the repository to establish how work is actually done:
- Read the project overview and contribution guidance, such as
README*,
CONTRIBUTING*, and relevant docs.
- Read manifests, lockfiles, workspace files, task runners, and build config
to identify supported tools and exact commands.
- Read CI workflows to learn required checks. Do not assume every CI or
deployment job is safe or appropriate to run locally.
- Inspect representative source and test files for naming, layout, and test
conventions.
- Identify generated files, migrations, vendored code, large fixtures,
secrets boundaries, and production-only operations.
Prefer rg --files and rg for discovery when available. Track the source of
each non-obvious command or rule so unsupported claims do not enter the final
file.
3. Choose the instruction scope
Use the root AGENTS.md for repository-wide guidance. Add or revise a nested
AGENTS.md only when a subtree has materially different commands,
architecture, conventions, or safety boundaries.
Keep shared rules at the root and only differences in nested files. For tools
that implement the public AGENTS.md convention, the nearest file in the
directory tree controls the working subtree. Do not copy the full root file
into every package.
4. Write high-signal guidance
Choose headings that fit the repository instead of forcing a fixed template.
Include the following only when supported by evidence:
- Repository map: the few directories and boundaries an agent must know.
- Setup and commands: exact install, development, build, lint, type-check,
and test commands, with the working directory when it is not obvious.
- Focused validation: targeted checks for a small change and broader checks
required before handoff.
- Change rules: generated-file ownership, migrations, schemas, APIs,
dependencies, and cross-package coordination.
- Safety boundaries: secrets, production data, destructive commands,
deployments, and operations that require explicit authorization.
- Contribution rules: repository-specific naming, formatting, commit, or
pull-request requirements that affect implementation or handoff.
Write direct, testable statements. Prefer:
- From the repository root, run `npm test -- path/to/file.test.ts` for a focused test.
over:
- Make sure tests pass and follow best practices.
Link to maintained documentation instead of copying it. Distinguish required
checks from optional, slow, privileged, or deployment-only checks.
5. Validate before handoff
- Re-read each changed
AGENTS.md completely.
- Remove contradictions, duplicate rules, placeholders, and stale claims.
- Confirm every mentioned file and directory exists.
- Cross-check commands against manifests or CI, and run safe, proportionate
checks when useful.
- If nested files changed, confirm each contains only subtree-specific rules
and does not conflict accidentally with the root.
- Review the diff as a maintainer: every adde
1---2name: agents-md3description: Create, revise, or audit AGENTS.md files from repository evidence, verified commands, and correctly scoped instructions without overwriting maintainer intent. 4category: AI & Agents5source: antigravity6tags: [markdown, api, claude, ai, agent, workflow, template, document, security, cro]7url: https://github.com/sickn33/antigravity-awesome-skills/tree/main/skills/agents-md8metadata:9 source: https://skillmd.com/skills/sickn33/agents-md10---111213# Maintain AGENTS.md from repository evidence1415## Overview1617Create or improve agent instructions that help a coding agent change the18repository correctly without rediscovering its workflow. Base every19repository-specific command, path, and rule on evidence in the current20checkout.2122Prefer a focused diff over a wholesale rewrite. There is no universal line23limit, required section list, symlink layout, or commit-attribution policy;24follow the repository's own needs and maintainer intent.2526## When to Use2728- The user asks to create, update, shorten, or audit `AGENTS.md`.29- A monorepo needs root instructions plus narrower package-level overrides.30- Existing agent instructions contain stale commands, duplicated policy, or31 unsupported claims.32- The user wants to reconcile `AGENTS.md` with `CLAUDE.md`,33 `.github/copilot-instructions.md`, or other repository instruction files.3435Use `@agents-generator` instead when the task specifically calls for its36packaged generation modes, assets, or backup workflow. Use this skill when a37maintainer-readable, evidence-first edit is the primary goal.3839## How It Works4041### 1. Preserve existing intent4243Before writing, read every instruction file that applies to the target path,44including existing `AGENTS.md` files and relevant tool-specific files such as45`CLAUDE.md`, `GEMINI.md`, `.github/copilot-instructions.md`, and46`.github/instructions/*.instructions.md`.4748- Improve an existing `AGENTS.md` in place when possible.49- Preserve accurate maintainer-authored rules and repository-specific policy.50- Do not replace another tool's instruction file with a symlink unless the51 user requests it and repository evidence shows identical content is desired.52- Do not silently choose between conflicting instructions. Follow the53 higher-priority applicable rule, or ask when the intended policy cannot be54 established from the repository.5556### 2. Build a bounded evidence map5758Inspect only enough of the repository to establish how work is actually done:59601. Read the project overview and contribution guidance, such as `README*`,61 `CONTRIBUTING*`, and relevant docs.622. Read manifests, lockfiles, workspace files, task runners, and build config63 to identify supported tools and exact commands.643. Read CI workflows to learn required checks. Do not assume every CI or65 deployment job is safe or appropriate to run locally.664. Inspect representative source and test files for naming, layout, and test67 conventions.685. Identify generated files, migrations, vendored code, large fixtures,69 secrets boundaries, and production-only operations.7071Prefer `rg --files` and `rg` for discovery when available. Track the source of72each non-obvious command or rule so unsupported claims do not enter the final73file.7475### 3. Choose the instruction scope7677Use the root `AGENTS.md` for repository-wide guidance. Add or revise a nested78`AGENTS.md` only when a subtree has materially different commands,79architecture, conventions, or safety boundaries.8081Keep shared rules at the root and only differences in nested files. For tools82that implement the public AGENTS.md convention, the nearest file in the83directory tree controls the working subtree. Do not copy the full root file84into every package.8586### 4. Write high-signal guidance8788Choose headings that fit the repository instead of forcing a fixed template.89Include the following only when supported by evidence:9091- **Repository map:** the few directories and boundaries an agent must know.92- **Setup and commands:** exact install, development, build, lint, type-check,93 and test commands, with the working directory when it is not obvious.94- **Focused validation:** targeted checks for a small change and broader checks95 required before handoff.96- **Change rules:** generated-file ownership, migrations, schemas, APIs,97 dependencies, and cross-package coordination.98- **Safety boundaries:** secrets, production data, destructive commands,99 deployments, and operations that require explicit authorization.100- **Contribution rules:** repository-specific naming, formatting, commit, or101 pull-request requirements that affect implementation or handoff.102103Write direct, testable statements. Prefer:104105```markdown106- From the repository root, run `npm test -- path/to/file.test.ts` for a focused test.107```108109over:110111```markdown112- Make sure tests pass and follow best practices.113```114115Link to maintained documentation instead of copying it. Distinguish required116checks from optional, slow, privileged, or deployment-only checks.117118### 5. Validate before handoff1191201. Re-read each changed `AGENTS.md` completely.1212. Remove contradictions, duplicate rules, placeholders, and stale claims.1223. Confirm every mentioned file and directory exists.1234. Cross-check commands against manifests or CI, and run safe, proportionate124 checks when useful.1255. If nested files changed, confirm each contains only subtree-specific rules126 and does not conflict accidentally with the root.1276. Review the diff as a maintainer: every adde