Skill · Development
Agents md
Create, revise, or audit AGENTS.md files from repository evidence, verified commands, and correctly scoped instructions without overwriting maintainer intent.
How to use it
- Start your plan and connect your AI once
- Ask for the task in your own words, or say it directly:
Use the Agents md skill to help me with this.Without a connection: copy the SKILL.md below into your AI's project instructions.
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
- The user wants to reconcile
AGENTS.mdwithCLAUDE.md,
unsupported claims.
.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.mdin 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
- Do not silently choose between conflicting instructions. Follow the
user requests it and repository evidence shows identical content is desired.
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*, - Read manifests, lockfiles, workspace files, task runners, and build config
- Read CI workflows to learn required checks. Do not assume every CI or
- Inspect representative source and test files for naming, layout, and test
- Identify generated files, migrations, vendored code, large fixtures,
CONTRIBUTING*, and relevant docs.
to identify supported tools and exact commands.
deployment job is safe or appropriate to run locally.
conventions.
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,
- Focused validation: targeted checks for a small change and broader checks
- Change rules: generated-file ownership, migrations, schemas, APIs,
- Safety boundaries: secrets, production data, destructive commands,
- Contribution rules: repository-specific naming, formatting, commit, or
and test commands, with the working directory when it is not obvious.
required before handoff.
dependencies, and cross-package coordination.
deployments, and operations that require explicit authorization.
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.mdcompletely. - 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
- If nested files changed, confirm each contains only subtree-specific rules
- Review the diff as a maintainer: every added line should change an agent's
checks when useful.
and does not conflict accidentally with the root.
decision or prevent a realistic mistake.
Report the files changed, evidence used, checks actually run, and unresolved uncertainty. Never say a command was tested when it was only read from config.
Examples
Create a focused root file
Evidence found:
package-lock.jsonselects npm.package.jsondefineslint,typecheck, andtestscripts.- CI runs those three checks from the repository root.
src/generated/is produced bynpm run generate.
A useful result might include:
# Agent instructions
## Commands
- Run commands from the repository root.
- Install with `npm ci`.
- For handoff, run `npm run lint`, `npm run typecheck`, and `npm test`.
## Generated code
- Do not edit `src/generated/` directly; update its source and run `npm run generate`.
Do not add a package manager, command, or generated-file rule that the evidence did not establish.
Revise without erasing policy
If an existing file has accurate release restrictions but a stale test command, change only the stale command and any directly affected explanation. Preserve the release restrictions, even when a shorter replacement would look cleaner.
Best Practices
- Keep instructions concise enough to scan, but let repository complexity
- Prefer repository-specific decisions over generic engineering advice.
- Include targeted commands when the project supports them; do not invent a
- State where commands run and whether they modify files.
- Reference formatter and linter config instead of restating every rule.
- Make tool-specific files additive when their semantics differ; do not assume
determine length.
file-scoped invocation for a tool that only supports suite-level runs.
all agents interpret formats or precedence identically.
Security & Safety Notes
- Treat this as a state-changing skill because it may edit repository files.
- Never include secrets, credentials, internal URLs, personal data, or local
- Do not run deployment, publication, database mutation, history rewrite, or
- Preserve approval gates already present in repository policy.
- Do not upload private repository instructions to third-party services. Ask
Review the diff before handoff.
environment values in agent instructions.
other consequential commands merely to validate documentation.
for explicit consent before transmitting any repository content externally.
Common Pitfalls
- Guessing commands: infer tools from manifests and CI, not popularity.
- Forcing one layout: a symlink or a fixed section list may erase
- Overwriting an existing file: make the smallest evidence-backed change.
- Copying the README: include only information that changes agent behavior.
- Duplicating nested files: keep shared guidance at the root and local
- Claiming validation that did not run: distinguish inspection from
tool-specific or maintainer-authored guidance.
differences near the relevant code.
execution in the handoff.
Limitations
- Repository evidence can be incomplete or contradictory; ask when a material
- A documented command may still require credentials, services, or operating
- AGENTS.md support and precedence vary across coding tools; verify the target
- This skill improves instruction quality but cannot prove that every future
policy choice cannot be resolved safely.
system support that are unavailable locally.
tool when interoperability matters.
agent will follow the file correctly.
Related Skills and Tools
@agents-generator- packaged generation, dry-run, update, and backup modes.@folder-specific-claude-and-agents-md- deeper guidance for scoped- agents.md - public format and scope guidance.
Claude/AGENTS instruction layouts.