agentleFS
PanQiWeiPanQiWei/pqw-skills/skills/write-agents-md/SKILL.md

write-agents-md

Skill1 starsChanged 8 days agoMITView on GitHub

指导 AGENTS.md 的撰写与治理:创建、修订、压缩、评审或迁移 AGENTS.md,设计继承的提示作用域,判断内容归属,并协调父子文件的重叠与矛盾。新建或修订任何一份 AGENTS.md(或宿主的同类入口文件)时加载。

9 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

29 rules. 0 are common, 29 are distinctive, and 0 are very specific to this project.

  • 0

    Common

    Most of the 9 edited versions we read keep these.

  • 29

    Distinctive

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Treat an AGENTS.md as persistent cognitive infrastructure, not a convenient place for every useful rule.

    line 8
  2. Distinctive:

    Follow its applicable writing rules.

    line 14
  3. Distinctive:

    Keep this skill's authority boundaries, prompt structure, and required report.

    line 15
  4. Distinctive:

    Keep three layers distinct:

    line 19
  5. Distinctive:

    Keep content resident only when it is mostly:

    line 44
  6. Distinctive:

    Do not teach DDD, OOP, TDD, Python, REST, or other mature-model basics unless the project deliberately deviates from the common meaning.

    line 65
  7. Distinctive:

    Treat AGENTS.md as the owner of agent entry, orientation, navigation, and escalation.

    line 70
  8. Distinctive:

    If two normative sources conflict, stop prompt authoring and reconcile them.

    line 79
  9. Distinctive:

    Never hide an unresolved project decision inside prompt wording.

    line 80
  10. Distinctive:

    Use this derivation shape:

    line 84
  11. Distinctive:

    Before writing, identify every parent AGENTS.md inherited at the target path.

    line 94
  12. Distinctive:

    Put a principle at the highest scope where it is both true and useful.

    line 97
  13. Distinctive:

    Put local topology and local red lines at the narrowest common parent that covers their consumers.

    line 98
  14. Distinctive:

    Do not repeat a parent's rule to show importance.

    line 100
  15. Distinctive:

    Do not use a universal line limit.

    line 110
  16. Distinctive:

    Resolve ownership gaps first: If an operational table in AGENTS.md is the only surviving definition, move it to a proper owner or gate …

    line 123
  17. Distinctive:

    Make red lines sparse and memorable: Keep only project-specific, high-blast-radius prohibitions.

    line 131
  18. Distinctive:

    Write decision triggers, not workflows: Use “when deciding X, read Y because it owns Z.” Move execution steps to a skill or developer guide.

    line 133
  19. Distinctive:

    Update the whole chain atomically: Add a new child entry before removing the parent content it replaces.

    line 135
  20. Distinctive:

    Prefer plain, image-forming language.

    line 139
  21. Distinctive:

    Every paragraph passes the five-job admission gate.

    line 151
  22. Distinctive:

    Every taste and red line traces to a current owner.

    line 159
  23. Distinctive:

    No sentence creates a second business SSOT.

    line 160
  24. Distinctive:

    No manually maintained counts, completion snapshots, or dated inventory.

    line 175
  25. Distinctive:

    No generic best-practice tutorial, command catalog, or long checklist.

    line 176
  26. Distinctive:

    All relative links resolve.

    line 178
  27. Distinctive:

    Every removed hard rule has a confirmed new owner or gate.

    line 180
  28. Distinctive:

    Use realistic task probes, not only prose review.

    line 182
  29. Distinctive:

    Do not claim success from line-count reduction alone.

    line 202

“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Write AGENTS.md

Treat an AGENTS.md as persistent cognitive infrastructure, not a convenient place for every useful rule. Give the agent the project's mind, map, taste, hard boundaries, and routes to deeper knowledge. Assume a frontier model already knows ordinary engineering technique.

Load the clear-writing skill before you write or revise documentation. Follow its applicable writing rules. Keep this skill's authority boundaries, prompt structure, and required report.

The Content Model

Keep three layers distinct:

  • Keep the way (道) resident: project-specific mental models, maps, decision taste, and a few non-negotiable boundaries.
  • Load the rule (法) on demand: domain contracts, local conventions, governance mechanisms, and task-specific constraints.
  • Externalize technique (术): generic best practice, commands, procedures, templates, field catalogs, checklists, and tool usage belong in skills, developer docs, scripts, or CI.

Admit a paragraph only when it has one of five jobs:

JobWhat it gives the agentAuthority relationship
Mental modelA durable way to see the systemShort projection of philosophy or architecture
MapWhere concepts, ownership, code, or knowledge liveMinimal projection of the current topology
TasteA preferred direction when several designs could workTraceable to design taste, an effective ADR, or stable design
Red lineA hard stop against a costly, cross-boundary errorTraceable to a normative owner
TriggerWhen and where to load more specific knowledgeOwned by the prompt as navigation; never copies the target's body

Move a paragraph out when it does not fit one of these jobs. Usefulness alone does not justify permanent prompt cost.

Decide What Deserves Residency

Keep content resident only when it is mostly:

  • specific to this project and not reliably inferable from industry knowledge;
  • relevant across multiple likely tasks beneath this directory;
  • consequential to boundaries, ownership, safety, or long-term evolvability;
  • difficult to enforce completely through code, types, tests, lint, or CI;
  • stable enough to express in one or two memorable sentences.

Default these elsewhere:

ContentBetter home
Domain meaning, exact fields, invariants, current architectureThe owning design/spec/contract
Why a consequential decision was madeADR
Reusable task procedure or judgment methodSkill
Commands and contributor mechanicsDeveloper guide or command help
Deterministic naming/import/generated-file checksScript, lint, or CI
Templates and field-complete protocolsTemplate/reference owned by the mechanism
Counts, progress, dates, inventoriesGenerated/queryable status
Temporary plans and campaign stateThe project's scratch-plan location

Do not teach DDD, OOP, TDD, Python, REST, or other mature-model basics unless the project deliberately deviates from the common meaning.

Preserve Authority

Treat AGENTS.md as the owner of agent entry, orientation, navigation, and escalation. Do not let it become the owner of business semantics.

  • Link each taste and red line to one current normative source.
  • Change the owner first and its prompt projection second.
  • Let a child prompt refine local consequences; never let it reverse a parent mental model or red line.
  • Apply path specificity only to working guidance. It does not make a nearer prompt authoritative over a business claim.
  • If two normative sources conflict, stop prompt authoring and reconcile them. Never hide an unresolved project decision inside prompt wording.
  • State when a sentence is a map or shorthand projection so readers do not mistake it for the full SSOT.

Use this derivation shape:

normative owner
    └── short AGENTS projection
            └── narrower local refinement

Design the Inheritance Chain

Before writing, identify every parent AGENTS.md inherited at the target path. Judge the active chain as one prompt, not as isolated files.

  • Put a principle at the highest scope where it is both true and useful.
  • Put local topology and local red lines at the narrowest common parent that covers their consumers.
  • Do not repeat a parent's rule to show importance. Translate only the local consequence, or link back.
  • Let each level answer a different question:
    • root: What are we building, how do we see it, and what must never break?
    • area: How does this area embody the architecture, and where are its owners?
    • leaf: What is locally surprising, constrained, or easy to get wrong?
  • Route a normal task to its owner in at most two navigation hops when practical.
  • Say what can remain unread. Progressive disclosure needs a stopping rule, not only more links.

Do not use a universal line limit. Set a budget proportional to how often and how broadly the file is inherited; roots need the strictest budget. When a chain feels long, remove duplicated technique before compressing useful mental models into cryptic prose.

Author or Revise

  1. Read the inheritance chain and local owners. Inspect parent prompts, current target content, child prompts affected by the change, and the normative sources behind every proposed taste or red line.
  2. Inventory before deleting. Classify each existing section as resident mind/map/taste/red-line/trigger, on-demand rule, externalizable technique, generated status, or obsolete duplication.
  3. Resolve ownership gaps first. If an operational table in AGENTS.md is the only surviving definition, move it to a proper owner or gate before removing it. Compression must not silently erase policy.
  4. Write the role sentence first. State in one sentence what cognitive value this prompt adds beyond its parent. Reject sections that do not support it.
  5. Write maps and taste before routes. Give enough orientation for the agent to choose the right route; a link table without a mental model is a search index, not a prompt.
  6. Make red lines sparse and memorable. Keep only project-specific, high-blast-radius prohibitions. Link the why instead of reproducing it.
  7. Write decision triggers, not workflows. Use “when deciding X, read Y because it owns Z.” Move execution steps to a skill or developer guide.
  8. Update the whole chain atomically. Add a new child entry before removing the parent content it replaces. Repair inbound section references and child statements that cite the old layout.

Prefer plain, image-forming language. A good shorthand such as “blueprint is the script, runtime is the performance” can preserve a boundary more effectively than a dense responsibility table, provided it links to the owner and does not distort it.

Validate

Require all of the following.

Cognitive Value

  • The file's role is expressible in one sentence.
  • Every paragraph passes the five-job admission gate.
  • A representative agent can restate the correct mental model and decision direction without reading every linked document.
  • Taste guides ambiguous choices without pretending to be an absolute rule.
  • Red lines are few, hard, project-specific, and memorable.

Authority Integrity

  • Every taste and red line traces to a current owner.
  • No sentence creates a second business SSOT.
  • Parent and child prompts refine rather than contradict one another.
  • Unresolved owner conflicts are surfaced, not papered over.
  • Projections, evidence, tracking, and history do not masquerade as owners.

Progressive Disclosure

  • A representative task reaches its normative owner in at most two hops when practical.
  • Unrelated procedures and catalogs stay unloaded.
  • The prompt says when deeper reading is needed and when it can stop.
  • The inherited prompt chain contains no material duplication.

Maintenance Quality

  • No manually maintained counts, completion snapshots, or dated inventory.
  • No generic best-practice tutorial, command catalog, or long checklist.
  • Mechanically enforceable rules point to automation instead of duplicating it.
  • All relative links resolve.
  • Inbound references to removed headings are updated.
  • Every removed hard rule has a confirmed new owner or gate.

Use realistic task probes, not only prose review. Include at least:

  • one ordinary local change that should remain lightweight;
  • one boundary-changing task that must trigger deeper design;
  • one apparent document/implementation conflict;
  • one temptation to bypass a package or service boundary.

For each probe, verify the mental model expressed, owner reached, irrelevant context avoided, and stopping point.

Report the Result

Summarize:

  • the role of each changed AGENTS.md;
  • what stayed resident and why;
  • what moved to owners, skills, docs, scripts, or CI;
  • any unresolved source contradiction or ownership gap;
  • the inherited-chain size and task-probe results.

Do not claim success from line-count reduction alone. The outcome is better judgment at lower recurring context cost.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.