npx skills add ...
npx skills add microsoft/skills --skill wiki-agents-md
npx skills add microsoft/skills --skill wiki-agents-md
Generates AGENTS.md files for repository folders — coding agent context files with build commands, testing instructions, code style, project structure, and boundaries. Only generates where AGENTS.md is missing.
Generate high-quality AGENTS.md files for repository folders. Each file provides coding agents with project-specific context — build commands, testing instructions, code style, structure, and operational boundaries.
AGENTS.md complements README.md. README is for humans; AGENTS.md is for coding agents.
AGENTS.md in the current directory, then walk up the treeAGENTS.md that takes precedence over the root one.github/agents/*.agent.md — Those are agent persona definitions (who the agent is). AGENTS.md is project context (what the agent should know about this code)This is the single most important rule.
NEVER overwrite an existing AGENTS.md.
Before generating for ANY folder:
"AGENTS.md already exists at <path> — skipping"Identify which folders should have an AGENTS.md:
/)wiki/) — if generated by deep-wiki (has package.json with VitePress)tests/, src/, lib/, app/, api/packages/*/, apps/*/, services/*/package.jsonpyproject.tomlCargo.toml*.csproj / *.fsprojgo.modpom.xml / build.gradle.github/ — only if it contains workflows or actionsnode_modules/, .git/, dist/, build/, out/, target/vendor/, .venv/, venv/, __pycache__/Every good AGENTS.md covers these areas, tailored to what actually exists in the folder. Do not invent sections for things the project doesn't have.
Agents reference these constantly. Use exact commands with flags, not just tool names.
Read these sources to find real commands:
package.json → scripts sectionMakefile → targetspyproject.toml → [tool.poetry.scripts] or [project.scripts]Cargo.toml → standard cargo commands.github/workflows/*.yml, Jenkinsfile, .gitlab-ci.ymlInclude:
Include:
src/main.py, src/index.ts)One real code example beats three paragraphs of description.
Only include if the repo has evidence of conventions (e.g., commitlint config, PR templates, contributing guides).
Use a three-tier system:
Tailor boundaries to the project:
When generating an AGENTS.md for a specific folder:
If it exists, stop. Report and move to the next folder.
Identify:
Extract real commands and settings from:
package.json scriptsMakefile / Justfile targetspyproject.toml scripts and tool configsCargo.toml metadata.github/workflows/*.yml build/test stepsdocker-compose.yml service definitions.eslintrc, ruff.toml, rustfmt.toml)Read 3-5 source files to identify:
Use only the sections that apply. If the folder has no tests, omit the testing section. If there's no CI config, omit git workflow.
Before writing the file:
<your-project> or TODOOmit any section that doesn't apply. A 20-line AGENTS.md with real commands beats a 200-line one with generic filler.
/AGENTS.md)Covers the entire project:
tests/AGENTS.md)Covers that specific subfolder:
cd tests && pnpm test)wiki/AGENTS.md)ALWAYS check if wiki/AGENTS.md exists before generating — same only-if-missing guard as all other folders. If it exists, skip it.
Use this template (adapt to the actual project):
Fill in the real section names, technologies, and project-specific conventions.
Agents read the nearest AGENTS.md in the directory tree. Nested files take precedence, so they should contain folder-specific details, not global ones.
Whenever you generate an AGENTS.md in a folder, also generate a CLAUDE.md in the same folder — only if CLAUDE.md does not already exist.
The CLAUDE.md content is always exactly:
This ensures Claude Code (and similar tools that look for CLAUDE.md) are redirected to the authoritative AGENTS.md instructions.
Same guard applies: check if CLAUDE.md exists before writing. If it exists, skip it.
| Principle | Good | Bad |
|---|---|---|
| Specific | "React 18 with TypeScript, Vite, Tailwind CSS" | "React project" |
| Executable | pytest tests/ -v --tb=short | "run the tests" |
| Grounded | Show a real code snippet from the project | Describe the style in abstract terms |
| Real paths | src/api/routes/ | path/to/your/code/ |
| Honest | Omit testing section if no tests exist | Invent a testing section |
| Concise | 30-80 lines for most folders | 300+ lines of prose |
## Project Structure
src/
├── api/ # FastAPI route handlers
├── models/ # Pydantic data models
├── services/ # Business logic
└── utils/ # Shared utilities
tests/ # Mirrors src/ structure