create-agents-md
Use when the user asks to create AGENTS.md, generate agent instructions for a repository, set up CLAUDE.md, or wants to document project conventions for coding agents. Also use when user says "create agents md", "setup agent docs", or "initialize repo for agents".
What this skill does
# Create AGENTS.md
Generate an AGENTS.md file that gives coding agents the non-obvious context they need to work effectively in a repository. Also creates a CLAUDE.md containing only `@AGENTS.md`.
**Core principle:** Write what is HARD for agents to find, not what's obvious. Agents already know how to use git, write code, and run standard tools.
## Workflow
```dot
digraph create_agents_md {
"Inspect repo" [shape=box];
"Present findings" [shape=box];
"User confirms/adds" [shape=diamond];
"Generate AGENTS.md" [shape=box];
"Show diff to user" [shape=box];
"User approves?" [shape=diamond];
"Write files" [shape=doublecircle];
"Inspect repo" -> "Present findings";
"Present findings" -> "User confirms/adds";
"User confirms/adds" -> "Generate AGENTS.md" [label="yes"];
"User confirms/adds" -> "Present findings" [label="needs changes"];
"Generate AGENTS.md" -> "Show diff to user";
"Show diff to user" -> "User approves?";
"User approves?" -> "Write files" [label="yes"];
"User approves?" -> "Generate AGENTS.md" [label="revise"];
}
```
## Step 1: Inspect the Repository
Run these inspections in parallel:
**Project identity and stack:**
- Read README.md for project description and context
- Read primary config: package.json, composer.json, Cargo.toml, go.mod, pyproject.toml, Gemfile, etc.
- Check for monorepo indicators: workspaces, lerna.json, nx.json, turbo.json, pnpm-workspace.yaml
- Note language versions: .nvmrc, .node-version, .tool-versions, .python-version, rust-toolchain.toml
**Directory structure:**
- `ls` the root directory
- Identify the top-level layout pattern (src/, lib/, packages/, apps/, etc.)
- For monorepos, list the packages/workspaces
**Build, lint, and test commands:**
- Read Makefile, package.json `scripts`, Taskfile.yml, justfile, composer.json `scripts`
- Read CI config: .github/workflows/*.yml, .circleci/config.yml, Jenkinsfile
- Identify: build command, lint command, test command (unit + integration), dev server command
- Note any required environment setup (Docker, .env files, database)
**Conventions:**
- `git log --oneline -20` for commit message style
- `git branch -a | head -20` for branch naming patterns
- Check for: .eslintrc*, .prettierrc*, phpcs.xml, .editorconfig, biome.json
- Check for: CONTRIBUTING.md, .github/PULL_REQUEST_TEMPLATE.md
- Check for existing: CLAUDE.md, AGENTS.md, .cursorrules, .github/copilot-instructions.md
**Architecture signals:**
- Read entry points (index.ts, main.go, app.py, etc.)
- Look for architecture docs in docs/ or ARCHITECTURE.md
- Identify patterns: MVC, hexagonal, event-driven, microservices, plugin-based
**Pitfall signals:**
- Check for generated files that should not be edited (look for "DO NOT EDIT" patterns)
- Check for vendored dependencies (vendor/, third_party/)
- Look at .gitignore for clues about generated artifacts
- Note any unusual build steps or prerequisites
## Step 2: Present Findings to User
Before generating, present a summary:
```
## Repo Inspection Results
**Project:** [name] - [one-line description]
**Stack:** [language] [version], [framework], [key deps]
**Structure:** [monorepo/standard] - [brief layout]
**Commands found:**
- Build: `[command]`
- Test: `[command]`
- Lint: `[command]`
**Conventions observed:**
- Commits: [style from git log]
- Branches: [pattern from git branch]
**Architecture:** [brief pattern]
**Things I couldn't determine:**
- [list unknowns]
Anything to add or correct before I generate AGENTS.md?
```
Use AskUserQuestion to confirm and gather any missing context the user wants included (common pitfalls, team conventions, architectural decisions).
## Step 3: Generate AGENTS.md
Use only sections that apply. Skip empty sections. Keep total under 500 lines.
### Template
```markdown
# [Project Name]
[One-line description of what this project is.]
## Tech Stack
- [Language] [version] — [framework/runtime]
- [Key dependency]: [what it's used for, if non-obvious]
- [Build tool]: [version if it matters]
## Directory Structure
[Only include non-obvious layout. Skip if it's a standard framework structure.]
```
[brief tree of important top-level dirs with one-line descriptions]
```
## Commands
### Build
```sh
[exact command]
```
### Test
```sh
[unit test command]
[integration test command, if different]
```
[Note: any prerequisites like running database, Docker, etc.]
### Lint
```sh
[lint command]
[autofix command if available]
```
### Dev
```sh
[dev server command]
```
[Note: ports, URLs, required env vars]
## Conventions
- **Commits:** [observed style, e.g., "Conventional Commits: type(scope): description"]
- **Branches:** [pattern, e.g., "feature/TICKET-123-short-description"]
- **PRs:** [any conventions — template, review requirements, CI checks]
- **Tests:** [when to write tests, what kind, coverage expectations]
- **Code style:** [enforced by linter — just mention the tool, don't repeat its rules]
## Architecture
[High-level decisions that deviate from defaults or that an agent might "fix" incorrectly.]
[Examples: "State management uses X instead of Y because...", "We use a custom router because...", "The plugin system uses dynamic imports intentionally — do not convert to static."]
## Common Pitfalls
- [Thing agents/developers commonly get wrong]
- [Files or patterns that MUST NOT be modified]
- [Non-obvious prerequisites or gotchas]
- [Environment-specific issues]
```
### Writing Quality Rules
- **Be explicit with commands** — copy-pasteable, not "run the test suite"
- **Use MUST/CRITICAL** for rules that cause real breakage if violated
- **Use "prefer" or "should"** for nice-to-haves
- **Don't restate what agents know** — no need to explain how git works, how to read JSON, etc.
- **Don't list every CLI flag** — basic usage and when to use each command is enough
- **Keep descriptions proportional** — 2 lines for simple sections, more for complex ones
## Step 4: Create CLAUDE.md
Generate a CLAUDE.md containing only:
```
@AGENTS.md
```
This keeps a single source of truth in AGENTS.md while ensuring Claude Code reads it.
## Step 5: Show Diffs and Get Approval
CRITICAL: Always show the full generated content as diffs before writing any files.
- If AGENTS.md already exists, show a diff against the existing file
- If CLAUDE.md already exists, warn the user and show what will change
- Ask for explicit approval before writing
- NEVER overwrite existing files without confirmation
## Common Mistakes
| Mistake | Fix |
|---------|-----|
| Including obvious info ("use git to commit") | Only write what's hard to discover |
| Letting the agent auto-generate everything | User must review — agents miss non-obvious context |
| Splitting into many sub-files too early | Keep one root file until it exceeds ~500 lines |
| Writing rules the linter already enforces | Reference the linter, don't duplicate its rules |
| Being vague about commands ("run tests") | Give exact copy-pasteable commands |
| Missing the Common Pitfalls section | This section prevents the most mistakes — always include it |
| Using symlinks for CLAUDE.md | Use `@AGENTS.md` content instead — symlinks break on Windows/sync |
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.