Agents md writer
Create or improve AGENTS.md, CLAUDE.md, or any "AI agent context file" that orients coding agents (Claude Code, Codex, Cursor, Zed, etc.) to a specific project. Use this skill whenever the user asks to write, create, or improve AGENTS.md / CLAUDE.md / .cursor/rules.md / GEMINI.md / project guidelines for AI, even when they don't explicitly name the file — phrases like "エージェント向けガイドを作って", "プロジェクトのコンテキストファイル", "AIに読ませる説明書", "make a context file for Claude" all qualify. Apply it before writing the first line so the file follows the WHY/WHAT/HOW structure and stays under ~300 lines.From its SKILL.md
npx -y skills add Trippy3/MySkills --skill agents-md-writerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
11.7 KB, as published. Nobody here has run it
AGENTS.md Writer
This skill captures how to write a high-quality AGENTS.md (or its siblings:
CLAUDE.md, .cursor/rules.md, GEMINI.md, etc.) for a specific repository.
The aim is a hand-crafted document that lets any coding agent get oriented
in under 5 minutes and avoid the project's well-known pitfalls — not a
generic boilerplate.
When this skill applies
Activate whenever the user asks for any of:
- AGENTS.md / CLAUDE.md / GEMINI.md / .cursor/rules / Cline rules / aider conventions
- "AI agent向けの説明書 / ガイド / コンテキストファイル"
- "プロジェクトのルールを AI に読ませる"
- Improving / shortening / restructuring an existing such file
- "Make Claude understand this codebase"
Even if the user only describes the intent without naming a file ("I want Claude to stop suggesting React for this Vanilla TS project"), this skill applies — the right output is usually a fresh or improved AGENTS.md.
Core principles (do not skip)
These are the load-bearing ideas. The rest of the skill is a workflow that operationalizes them.
1. Define WHY / WHAT / HOW
Every agent context file must answer three questions, in roughly this order:
- WHY — why does this project exist, and what design premises must not be casually overturned? (e.g. "no DB on purpose", "Vanilla TS, no React", "in-memory only", "LWW model").
- WHAT — the high-level structure: directory layout, top-level domain types, where the entry points are.
- HOW — how to run the thing, how to verify a change, what command must pass before commit.
If a section doesn't map to one of these three, ask whether it really earns its place.
2. Stay short — aim for under ~300 lines
Long files dilute attention. Most projects can be covered well in 100–250 lines. If you're heading past 300, that's a yellow flag — push detail down into linked files.
3. Progressive disclosure
The agent context file is the index, not the encyclopedia. Anything
deeper (full architecture, migration runbooks, threat models, SLOs) belongs
in docs/ (or README.md, or ADRs/) and is linked from this file.
A good test: every paragraph should answer the question "what would an agent get wrong if this weren't here?" — if the answer is nothing, cut it.
4. Don't replicate what tooling already enforces
Linters, formatters, type checkers, pre-commit hooks, and CI already enforce
themselves. Writing "use 2-space indentation" or "run prettier" wastes both
context budget and the agent's attention. Mention tooling only if its
existence or invocation is non-obvious (e.g. "we use pnpm exec tsc --noEmit for type checks, not tsc directly").
5. Write it by hand
Auto-generators (/init, scaffolders) produce generic, low-signal text that
agents skim past. The value of this file comes from the specific,
non-obvious, hard-won knowledge about this project. That's only available
to a human (or to an agent that has just spent serious time in the
codebase). Treat it like an onboarding doc for a new hire who is sharp but
has never seen the code.
Workflow
Follow these steps in order. The first two are research — don't start drafting until they're done, or the file will end up generic.
Step 1: Read the project
Read, in this order, whichever exist:
README.md(and anydocs/README.mdit points to)package.json/pyproject.toml/go.mod/ equivalent — note name, scripts, dependencies- The entry point file(s) —
server.ts,main.py,cmd/.../main.go, etc. - The shared types / schema file if there is one — often the cleanest summary of the domain
.github/workflows/orMakefileto learn the canonical build/test commands
Note the project's language, framework choices, and what is conspicuously absent (no DB? no auth? no framework?). The absences are usually the WHY content.
Step 2: Extract the non-obvious
Open a scratch list of things an agent would get wrong without being told. Look for:
- Inverted defaults — does this project deliberately not use a tool that everyone reaches for? (no React, no ORM, no DB, no tests, no microservices)
- Schema versions / wire formats — anything where changing a number silently breaks compatibility
- Sanitization / security boundaries — where does untrusted data enter, what gets sanitized where
- In-memory state, singletons, side effects — anything that won't survive a restart and is intentional
- Identity invariants — "never regenerate this ID", "this map is keyed by X and the order matters"
- Past mistakes — if the user has been correcting the agent during the session, those corrections almost always belong in the file
- Dead-end suggestions — known refactors / features that have been considered and rejected, with reasons
If you've been working with the user on this project across earlier turns, mine that conversation: every time the user said "no, don't do X" or "we do this because…" is a candidate.
Step 3: Confirm the verification commands
Run, or have the user confirm, the actual commands needed to verify a change. Don't guess. The HOW section is worse than useless if the commands don't actually pass.
Typical set:
- type / compile check
- build
- unit test / integration test
- lint (only if non-standard)
Note which is required before commit and which is nice-to-have.
Step 4: Draft, with this structure
Use this skeleton. Reorder if the project demands it, but every section
should pull its weight. Match the language of the project's existing docs
(if docs/README.md is in Japanese, write AGENTS.md in Japanese; if
English, English).
# AGENTS.md
[1–3 sentence preamble: who this file is for and where to find more.]
[Pointer: "詳細は docs/README.md / docs/ARCHITECTURE.md を参照"]
---
## WHY — このプロジェクトは何のために存在するか
[1 paragraph mission.]
[Bulleted list of design premises that must not be overturned without
human approval. Each item one line, sharp. Examples:
- 永続化なし (in-memory only)
- 認証なし (tunnel-side が責務)
- Vanilla TS、フレームワーク不使用]
[Sentence: "this premise を覆す変更は事前に確認"]
---
## WHAT — リポジトリの構造
[Tree of the top 1–2 levels of files that matter.
Annotate each with one short comment.]
[2–4 lines naming the core domain types and where they live.]
[Pointer to the deeper docs.]
---
## HOW — どう動かして、どう検証するか
### Local run
[3 lines max — install + dev command.]
### Verification commands
[Table or short list. Mark which are required pre-commit.]
### Manual verification (if applicable)
[For UI / integration work, the human-loop check the agent must do.]
---
## このプロジェクトで踏みやすい落とし穴
[Numbered list, ~5–10 items. Each is one of:
- An inverted default the agent will probably miss
- A non-obvious invariant
- A correction the user has had to give before
Each item is a 2–4 line micro-section: the rule, then "なぜ" / "どこで効く"
in one or two sentences.]
---
## コードを書くときのスタイル (project-specific only)
[Only the points that aren't in global rules / tooling.
Often this section is 3–6 bullets at most.]
---
## 変更を加える前のチェックリスト
[Markdown checkboxes. Mix of "did you preserve the WHY premises" and
"did you run the verification commands".]
---
## 参考
[Links to deeper docs.]
Step 5: Self-review against the principles
Before declaring it done, read the draft once and ask:
- Could a fresh agent read this in 5 minutes and start working without immediately doing the wrong thing?
- Is anything here that the linter / type checker / test runner would already catch?
- Is anything here that's just taste with no project-specific reason? (delete it)
- Are the verification commands actually correct? (run them once)
- Is the file under 300 lines? If not, what can move into a linked file?
- Does every "this is weird" item in the project have either an explanation or a pointer?
If the user has been correcting the agent during the session, do a final sweep: every correction either belongs in this file or in a memory record.
Anti-patterns (do not produce)
- Generic philosophy ("write clean code", "DRY", "SOLID") — agents already know this; it adds zero project-specific signal.
- Tooling restatement — listing prettier rules, ESLint rules, the test framework's basic API. Tooling enforces itself.
- Promises with no teeth — "always write tests" without saying which test command to run. Either commit to a verifiable rule or skip.
- Marketing copy — "blazing fast, modern, scalable…". Agents don't market the code; they edit it.
- Stale roadmap — long lists of "future work". Goes out of date, pollutes context. One short "currently considered, deferred" list at the bottom is fine.
- Duplicating README.md — if the user-facing doc covers something well, link to it; don't restate.
- Leaning on ALL-CAPS MUST/NEVER — almost always a smell that the
reasoning is missing. Replace
NEVER use Xwithwe don't use X because …. The model can then judge edge cases.
When the user has an existing AGENTS.md / CLAUDE.md
The job is editing, not rewriting from scratch. Process:
- Read the existing file end to end.
- Read the codebase enough to test its claims — anything stale gets flagged.
- Categorize each section: keep / shorten / move-to-docs / delete.
- Apply the principles above to the result.
- Show the user the diff (or the rewritten version) and the rationale for structural changes before saving.
If the existing file is over 300 lines, the most likely improvement is
moving 60% of it into docs/ and leaving sharp pointers behind.
Output handling
- Default save location: project root, filename matching what the user
asked for (
AGENTS.md,CLAUDE.md,GEMINI.md,.cursor/rules, etc.) - If unsure which file the user wants, ask once. AGENTS.md is the cross-tool standard; CLAUDE.md is Claude-specific; the others are tool-specific.
- Don't add the file to git or commit it unless the user asks.
- After writing, report the final line count and offer to lift any over-long section into a linked doc if the file ended up >300 lines.
Quick-reference templates
For very small projects (single binary, no docs/), the full skeleton is overkill. Use a condensed form:
# AGENTS.md
[1-line project description.]
## Run / verify
[install + dev + verify commands, 3–5 lines.]
## Premises that must not be casually overturned
- [3–5 bullets]
## Pitfalls
- [3–6 bullets]
About 40 lines, still useful.
For monorepos, write a top-level AGENTS.md that orients to the layout and points each package's own AGENTS.md. Don't try to cover all packages in one file.
Reference
A worked example for a small Vanilla-TS realtime app lives at:
references/example-vanilla-ts.md — read it if you want to see the
skeleton applied end-to-end.