writing-agents-md
Use when the user asks to create, review, audit, migrate, or update an AGENTS.md file for a repository, package, subproject, or monorepo. This skill writes agent-facing repository guidance grounded in project evidence, including setup, build/test commands, code style, testing, security, PR rules, nested AGENTS.md scope, and instruction precedence.
What this skill does
# Writing AGENTS.md Create, review, or revise `AGENTS.md`: a standard Markdown "README for agents" that gives coding agents the project-specific context they need without cluttering the human README. ## Grounding workflow Before writing, inspect the repository instead of guessing: - Read existing guidance: `README.md`, `CONTRIBUTING.md`, current `AGENTS.md`, package-level docs, `.github/workflows/*`, config files, and obvious build manifests (`package.json`, `pyproject.toml`, `Cargo.toml`, `go.mod`, `justfile`, `Makefile`, etc.). - Check the tree for monorepos, generated directories, vendored code, large data, or subprojects that may need scoped instructions. - Verify commands from scripts, task files, Make/Just recipes, or CI definitions. Do not invent commands from ecosystem habits. - If sources conflict, prefer executable config and CI over prose; preserve uncertainty as a short note or ask one focused question rather than silently choosing. - If updating an existing `AGENTS.md`, preserve correct project-specific rules and remove stale or unverifiable claims. - Prefer repository evidence over generic best practices. Label uncertainty briefly or omit it rather than inventing commands. ## Review mode When asked to review an existing `AGENTS.md` instead of drafting one: - Check it against repository evidence and the principles below. - Report concrete findings with severity, affected section/path, evidence, and a suggested replacement. - Prioritize incorrect commands, stale paths, missing scoped guidance, unsafe instructions, and conflicts with closer `AGENTS.md` files or explicit user directions. - Use this concise review shape when not directly editing: `Findings`, `Suggested edits`, `Verified evidence`, `Open questions`. - If edits are requested or clearly beneficial, make a bounded revision and then verify that all listed commands/paths remain grounded. ## AGENTS.md principles - `AGENTS.md` is plain Markdown; do not add YAML frontmatter or required-field scaffolding to the generated file. - Default to a root-level `AGENTS.md`; add package-level files only when scoped instructions differ or the user asks for a specific subproject. - Keep it agent-focused: include details a coding agent needs to work safely and verify changes, not product marketing or broad README content. - Treat it as living documentation. Make rules actionable, testable, and easy to update. - User prompts override repository instructions. When multiple `AGENTS.md` files apply, the closest file to the edited path takes precedence. - For large monorepos, prefer nested `AGENTS.md` files in packages/subprojects instead of one overloaded root file. Root files should describe global rules and point to scoped files. - Avoid copying broad human-facing README content, long install walkthroughs, unverifiable "best practices", personal preferences, or rules that merely restate tool defaults. ## File requirements - Name the file exactly `AGENTS.md`; when the user specifies a package or subdirectory, place it in that scope. - Use a clear title; `# Repository Guidelines` is a good default unless the repo already uses another title. - Keep it concise: usually 200–500 words for a root file. Go longer only when the repository genuinely needs more operational detail. - Use direct imperative bullets with concrete examples: commands, paths, naming patterns, and verification gates. - Do not duplicate README installation walkthroughs unless agents specifically need those commands to run checks. - Do not include secrets, credentials, private URLs, speculative claims, or instructions that encourage bypassing security checks. - For review responses, prefer findings first; for file creation/update responses, summarize changed paths and verification. ## Recommended content Choose sections that match the repository; omit empty or irrelevant sections. The core coverage from agents.md is: project overview, build and test commands, code style guidelines, testing instructions, security considerations, and extra teammate-like instructions such as commit/PR rules, deployment gotchas, large datasets, or migration steps. ### Project structure and scope - Summarize key directories and what agents should edit or avoid. - Mention generated/vendor/build artifacts that should not be hand-edited. - In monorepos, state how to locate the relevant package and whether package-level `AGENTS.md` files override root guidance. - Example split: root `AGENTS.md` owns repo-wide safety rules and CI gates; `packages/api/AGENTS.md` owns API migrations and schema tests; `packages/web/AGENTS.md` owns UI screenshots and browser checks. ### Build, test, and development commands - List the smallest reliable commands for setup, local development, formatting, linting, typechecking, tests, and full CI-equivalent verification. - Include targeted variants when useful, e.g. package filters or single-test patterns. - State required working directory if commands must run from repo root or a package directory. - Prefer commands proven by `package.json` scripts, `just --list`, `make help`, lockfiles, or CI jobs; if a command cannot be confirmed, leave it out or mark it as an example. ### Code style and conventions - Capture formatting tools, language versions, strictness settings, naming patterns, architectural boundaries, and dependency rules. - Prefer enforceable rules over taste statements. ### Testing and verification - Explain where tests live, naming conventions, fixture practices, coverage expectations, and which checks agents should run after specific change types. - Include relevant programmatic checks because agents may attempt listed commands and fix failures before finishing. - Encourage adding or updating tests with behavior changes when that is true for the repo. ### Security, configuration, and data - Call out secret handling, environment files, migrations, external services, large datasets, deployment steps, and destructive commands. - Tell agents how to use safe examples (`.env.example`, local mocks, dry-run flags) when available. ### Commit and PR guidance - Derive commit style from recent history if requested or relevant. - Include PR expectations such as linked issues, screenshots for UI changes, migration notes, and verification summaries. ## Migration and compatibility notes - If the repo has older agent instruction files, migrate by renaming to `AGENTS.md`; optionally leave a symlink for tools that still expect the old name, e.g. `mv AGENT.md AGENTS.md && ln -s AGENTS.md AGENT.md`. - For tools that need explicit configuration, add minimal setup notes only when the repo uses them (for example Aider `read: AGENTS.md` or Gemini CLI `context.fileName`). ## Final checks Before finishing: - Verify every listed command/path exists or is clearly marked as an example. - Ensure rules do not conflict with nearer scoped instructions or explicit user requirements. - Check that review output uses the requested findings format when applicable. - Keep one clear purpose per section; remove filler and generic advice. - If you edited the file, summarize affected path(s), evidence used, and verification performed.
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.