agentleFS
SuperJJ007SuperJJ007/papermachine/docs/AGENTS.md

papermachine

AGENTS.md59 starsChanged 50 days agoMITView on GitHub

This file defines document structure, Markdown tiers, writing rules, and verify-doc-budgets ceilings. Use dsh-doc for placement and validation, and dsh-prose-standard for required coverage and editorial judgment; the doc-tiers Agent Note owns rationale. These rules apply to human-facing documentation; Agent Notes remain outside their scope. A postmortem is an incident-scoped reference; chronology records evidence, not a teaching sequence. A document's subject and tree position fix its scope: describe its own subject at appropriate detail and direct children only by purpose, responsibility,…

We split this AGENTS.md into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before writing a tutorial, privately classify the reader's starting knowledge and each concept as beginner, intermediate, or advanced.

    line 11
  2. Very specific:

    Write directly: name actors and facts (decision).

    line 45
  3. Distinctive:

    When the gate goes red:

    line 51

≈ “Common” is an estimate: at least 1 in 5 of the 36,368 AGENTS.md files we read have a rule of the same kind, not the same words. “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
AGENTS.md

AGENTS.md — The documentation standard

This file defines document structure, Markdown tiers, writing rules, and verify-doc-budgets ceilings. Use dsh-doc for placement and validation, and dsh-prose-standard for required coverage and editorial judgment; the doc-tiers Agent Note owns rationale.

Document structure

These rules apply to human-facing documentation; Agent Notes remain outside their scope. A postmortem is an incident-scoped reference; chronology records evidence, not a teaching sequence. A document's subject and tree position fix its scope: describe its own subject at appropriate detail and direct children only by purpose, responsibility, and high-level behavior; link to the owning descendant for lower-level detail. Document type does not widen that scope. A reference may be exhaustive only about its own subject. Testing mechanisms, fixtures, and harnesses belong at the lowest owning level; higher documents link there.

Classify every in-scope document as a tutorial or reference. Tutorials follow an ordered path to an outcome and introduce only what each step needs. References define a lookup scope and current behavior without a teaching sequence. Separate substantial tutorial and reference content; label a section when either part is small.

Before writing a tutorial, privately classify the reader's starting knowledge and each concept as beginner, intermediate, or advanced. Establish prerequisites before dependent concepts, increase difficulty gradually, and move unnecessary advanced material to a later tutorial or reference.

Author in this order: locate the document in the tree; set its permitted detail; choose tutorial or reference; for a tutorial, order concepts by prerequisite and difficulty; relocate descendant-owned detail; replace lower-level explanations with links to their owners.

The tier taxonomy: one home per fact

Each fact has one home: the tier whose job it is; elsewhere, link there.

TierJobDoes NOT belong there
Root AGENTS.mdStanding orders: rules an agent needs in context in every session, one to three lines each, linking its homeStories, worked examples, situational procedures, anything restated from a linked home
Subtree AGENTS.md (packages/, docs/, .agents/notes/)Orders specific to that subtreeRepo-wide rules the root file already carries
architecture.mdOrdered map: composition, core packages, loop, seams, extension points; read before changing packages/Type definitions (→ subsystems), per-package detail (→ package READMEs), decision rationale (→ Agent Notes), implementation-status annotations
subsystems/One reference page per subsystem: type definitions, semantics, and the generated Cordis APIBehavior narration (→ architecture.md)
Agent NotesActive decision records: the why, what-was-given-up, and required verification; implemented/ notes describe shipped reality in present tenseMigration plans, acceptance-task checklists, fixture walkthroughs, and spec-speak ("should…") once the decision has shipped; archived notes are frozen history, never current authority
postmortem/Incident stories — the only tier where war-story narrative belongs—
cookbook/Step-by-step how-tos with numbered verify stepsDesign rationale (→ the Agent Note each guide links)
user/Product-facing guides published by the documentation websiteGenerated reference tables, contributor procedures, decision history
Package READMEThe per-package contract: config, semantics, limitations, extension points, and Model ExperienceJSDoc restatement, generated-catalog restatement (event/tool tables), other packages' concerns
development.mdContributor setup, daily workflow, and a summary of CI; a bilingual pair under the i18n contractRuntime/version rationale (→ Agent Notes), check-by-check lists that drift from package.json scripts
Generated reference: the per-page cordis-surface regions in subsystems/, the Cordis core API + inherited tier, tool-catalog, config-catalog, persistence-catalog, module-graph.mdExhaustive English sources regenerated from source and freshness-gated; reviewed Chinese counterparts follow the pairing workflowHand edits to generated English sources or regions; Chinese counterparts update through pairing only
Skills (.agents/skills/)Reusable workflows and specialized decision standardsProduct and runtime contracts (→ docs or source)

Placement: bugs → postmortems; rationale → Agent Notes; procedures → cookbooks; type definitions → subsystems; package contracts → READMEs; standing orders → root AGENTS.md with a rationale link.

Writing rules

  • Document current state, not change history. Name live mechanisms, not PRs, commits, stack positions, or "previously/now/no longer". Keep history in commits, PRs, Agent Notes, or postmortems. General Session-format prose links version/status authority; retain numbers for version-specific contracts, examples, or evidence.
  • Every non-trivial change includes at least one Agent Note in the same PR. Update the owning note or add one; only mechanical/local edits are exempt (scope).
  • One physical line per paragraph (verify-md-wrap): use editor soft-wrap. Code blocks, tables, and list structure keep their formatting; code comments stay under the linter's column limit.
  • Fenced ts blocks must compile (doc-typecheck); a pasted type declaration and its original JSDoc use ```ts type-equiv, while a body-stripped public class declaration uses ```ts public-api; register either in the manifest so neither can drift (mechanics).
  • The owning subsystems page updates in the same change that reshapes a documented type. verify-type-equiv catches drifted pastes, not never-documented new types; a type is documented on its declaring package group's page (page scoping).
  • Pairs update together: Terminology-guided, single-pass active-agent work repositions first-use annotations, preserves untouched prose, and re-records; dsh-translate-docs remains user-invoked (contract).
  • Comments and JSDoc state complete contracts, not reasoning transcripts. Preserve behavior, failure, timing, ownership, modality, exceptions, consequences, and non-obvious orientation; delete narration, test walkthroughs, review analysis, and code restatement. Keep the local contract and link its rationale. Use dsh-prose-standard for details.
  • Write directly: name actors and facts (decision). Reserve seam for the defined capability. Name the exact check, type, API, operation, or behavior instead of metaphorical "gate", "vocabulary", or "surface".

Wordcount Budgets

scripts/doc-budgets.manifest.json sets standing-doc ceilings; pnpm run verify-doc-budgets rejects excess or missing files.

When the gate goes red:

  1. Relocate content that belongs in another tier; leave a one-line link if needed.
  2. Condense content that belongs here but can be shorter.
  3. Raise the ceiling only when the words need the space; justify the manifest diff in the PR. A too-low ceiling is a budget bug.

Ceilings are guardrails, not reduction targets. At or below target, retain at least 5% headroom; above target, freeze the ceiling until relocation or condensation brings the document under target. Lower a ceiling only when the document still has room. Targets: root AGENTS.md ≤ 1,950; architecture.md ≤ 2,400; subtree AGENTS.md ≤ 600, except packages/AGENTS.md ≤ 750 and this file ≤ 1,320; packages/README.md ≤ 994; plus cordis-primer.md 600, defensive-patterns.md 550, testing.md 1,300, examples/AGENTS.md 310. Review governs unbudgeted tiers.

The slop checklist

Hunt these in any doc; dsh-doc runs this list as an audit:

  • The same rule stated in more than one home. Grep a distinctive phrase; keep one home and link the rest.
  • Narrated history or war stories: "previously", "now", "no longer", "used to", "renamed", "was moved", PRs, or commits. State the current fact; link an Agent Note or postmortem when needed.
  • Implementation-status annotations in prose or diagrams ("implemented!", "future: …"). Status rots; the repo layout and package manifests carry it.
  • Hand-restated catalogs, JSDoc, or inventories of tests, packages, and status when source or a generator is authoritative.
  • Reasoning transcripts: step-by-step implementation narration, proof of obvious branches, test walkthroughs, or rejected local alternatives. Keep the resulting contract or durable rationale; delete the path used to derive it.
  • Rationale repeated beside sibling methods instead of once at the owning capability or helper.
  • Paragraph walls: one paragraph carrying several rules and parenthetical asides. Split it or demote the detail to its home.
  • Emphasis inflation: bold, CAPS, or "critically" everywhere means nothing stands out. Reserve emphasis for the clause that changes behavior.
  • Spec-speak in implemented/ Agent Notes: "should", migration plans, acceptance checklists. An implemented Agent Note describes what is, per the implemented-note instructions.

Cross-reference with machine-checkable links, never free prose

Link repository references with relative Markdown paths, never bare filenames or Agent Note numbers. verify-md-links rejects missing targets and dead #fragment anchors.

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.

Reviews can't be read right now.

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.