agentleFS
AWSKnown publisheraws/graph-explorer/AGENTS.md

graph-explorer

AGENTS.md484 starsChanged 2 months agoApache-2.0View on GitHub

Correct behavior is necessary but not sufficient — structural quality is a hard requirement. Don't accept a messy implementation just because it passes tests. Read the relevant doc before working in that area:

The file

Show its rules and text

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

28 rules. About 0 are common, 18 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈18

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every commit should have no type errors, lint errors, formatting issues, or failing tests

    line 5
  2. Distinctive:

    Don't hard-wrap Markdown prose to a fixed column width, let it soft-wrap

    line 6
  3. Distinctive:

    When possible, create failing tests first then implement the logic to make the tests pass

    line 7
  4. Distinctive:

    Add or update tests for the code you change, even if nobody asked

    line 8
  5. Very specific:

    Write temporary files (scratch notes, intermediate output) to the git-ignored .scratch/ directory at the repo root, never elsewhere in the …

    line 9
  6. Distinctive:

    Prefer deep modules: simple interface, substantial implementation.

    line 16
  7. Distinctive:

    Prefer single-pass, copy-free processing for collections that can grow large.

    line 17
  8. Distinctive:

    Prefer "code judo": restructurings that delete whole layers, branches, or concepts rather than rearrange them.

    line 18
  9. Distinctive:

    Don't push a file from under 1000 lines to over without explicit justification — treat the boundary as a decomposition signal and extract …

    line 19
  10. Distinctive:

    Prefer direct, legible code.

    line 21
  11. Very specific:

    Avoid unnecessary any, unknown, casts, or optionality.

    line 22
  12. Distinctive:

    Keep feature logic in the feature layer.

    line 23
  13. Distinctive:

    Don't serialize independent work or leave related state half-applied when a more atomic structure is available.

    line 24
  14. Distinctive:

    Default to none; justify every one.

    line 28
  15. Distinctive:

    Prefer descriptive names instead.

    line 30
  16. Very specific:

    Prefer named function syntax over anonymous arrow functions for module-level declarations (function handleClick() {}, not const handleClick …

    line 36
  17. Very specific:

    Use an explicit type alias instead of ReturnType<typeof ...> when one exists (e.g.

    line 37
  18. Distinctive:

    Prefer Zod at boundaries to enforce contract and strong typing

    line 39
  19. Very specific:

    Don't change the VS Code setting typescript.autoClosingTags

    line 40
  20. Distinctive:

    Prefer throwing upward over local error laundering

    line 41
  21. Very specific:

    Prefer named domain types over Record<string, unknown>

    line 42
  22. Distinctive:

    Do not encode uncertainty as adapters, defaults, optionals, spreads, or catch blocks.

    line 43
  23. Very specific:

    No branch or commit message prefixes (no chore:, fix:, feature/, etc.)

    line 48
  24. Distinctive:

    Keep commit messages brief and descriptive

    line 50
  25. Distinctive:

    Read the relevant doc before working in that area:

    line 54
  26. Very specific:

    Every code review, including /code-review, uses these standards sources:

    line 68
  27. Very specific:

    Run from project root with pnpm.

    line 77
  28. Very specific:

    Default label vocabulary (needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix).

    line 97

≈ “Common” is an estimate: at least 1 in 5 of the 16,595 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

Agent Rules

Core Rules

  • Every commit should have no type errors, lint errors, formatting issues, or failing tests
  • Don't hard-wrap Markdown prose to a fixed column width, let it soft-wrap
  • When possible, create failing tests first then implement the logic to make the tests pass
  • Add or update tests for the code you change, even if nobody asked
  • Write temporary files (scratch notes, intermediate output) to the git-ignored .scratch/ directory at the repo root, never elsewhere in the tree

Code Quality Standards

Correct behavior is necessary but not sufficient — structural quality is a hard requirement. Don't accept a messy implementation just because it passes tests.

  • Follow YAGNI principles.
  • Prefer deep modules: simple interface, substantial implementation.
  • Prefer single-pass, copy-free processing for collections that can grow large; small fixed lists don't need it.
  • Prefer "code judo": restructurings that delete whole layers, branches, or concepts rather than rearrange them. Don't stop at "a bit cleaner."
  • Don't push a file from under 1000 lines to over without explicit justification — treat the boundary as a decomposition signal and extract instead.
  • Push new conditionals and special cases into a dedicated helper, state machine, or module — don't tangle them into an unrelated flow.
  • Prefer direct, legible code. Flag thin wrappers, identity abstractions, and generic mechanisms that hide simple structure.
  • Avoid unnecessary any, unknown, casts, or optionality; make invariants explicit at boundaries instead of papering over them with silent fallbacks.
  • Keep feature logic in the feature layer; reuse existing canonical helpers instead of introducing near-duplicates in shared modules.
  • Don't serialize independent work or leave related state half-applied when a more atomic structure is available.

Comments

  • Default to none; justify every one.
  • Capture rationale, never what or how the code already says.
  • Prefer descriptive names instead.
  • Doc comments (JSDoc) state what a symbol does — the exception.
  • Be extremely concise.

TypeScript

  • Prefer named function syntax over anonymous arrow functions for module-level declarations (function handleClick() {}, not const handleClick = () => {}). Arrow functions inside a function body are fine.
  • Use an explicit type alias instead of ReturnType<typeof ...> when one exists (e.g. AppStore, not ReturnType<typeof getAppStore>)
  • Prefer a branded type over a raw string/number whenever the value is used for a lookup or passed to a function expecting a value that represents a specific concept — an ID, a node/edge label, a type name, etc. Construct them with their creator function (e.g. createVertexId()); never cast a bare string. This makes "which kind of string is this" a compile-time guarantee.
  • Prefer Zod at boundaries to enforce contract and strong typing
  • Don't change the VS Code setting typescript.autoClosingTags
  • Prefer throwing upward over local error laundering
  • Prefer named domain types over Record<string, unknown>
  • Do not encode uncertainty as adapters, defaults, optionals, spreads, or catch blocks. Resolve it into the owned contract.

Git

  • Single trunk branch main, always releasable
  • No branch or commit message prefixes (no chore:, fix:, feature/, etc.)
  • Each commit is self-contained and cohesive — one logical change per commit
  • Keep commit messages brief and descriptive

Conventions

Read the relevant doc before working in that area:

  • docs/agents/design.md — visual design system: color tokens, dark mode policy, Tailwind conventions
  • docs/agents/react.md — components, hooks, query-language translation
  • docs/agents/testing.md — Vitest patterns, DbState, factories, backward-compat
  • docs/agents/connectors.md — Gremlin/openCypher/SPARQL query templates
  • docs/agents/schema.md — schema storage, discovery, Jotai atoms
  • docs/agents/issue-tracker.md — GitHub issue and PR conventions
  • docs/agents/documentation.md — writing user-facing docs (READMEs, guides, docs site)
  • docs/agents/product.md — product overview, supported databases, architecture
  • docs/development.md — toolchain setup, the pinned pnpm and node versions, and the pnpm upgrade procedure

Reviews

Every code review, including /code-review, uses these standards sources:

  • REVIEW.md — severity, what not to report, and the verification bar. Wins where it conflicts with the others.
  • This file, plus the docs/agents/*.md doc for each area the diff touches.

Pass REVIEW.md by path to every reviewer sub-agent, not only the standards one. Sub-agents don't always load this file.

Commands

Run from project root with pnpm. Use only these scripts — never invoke tsc, vitest, oxlint, or oxfmt directly or via pnpx. The scripts pin tool versions and configs and cover every workspace package; bare tools use the wrong version and miss project context.

  • pnpm check:types — typecheck all packages (no per-file/per-package option; this is the granularity)
  • pnpm checks — all static checks (types + lint + format); default validation for small changes
  • pnpm check:lint / pnpm lint — lint / lint and fix
  • pnpm check:format / pnpm format — check / fix formatting
  • pnpm test — run all tests
  • pnpm test <path> — test files matching a path substring (file, dir, or partial)
  • pnpm test -t "suite > name" — test by name, with segments joined by a spaced > exactly as the reporter prints them; a single segment such as -t "renders empty state" also works (no -- separator; pnpm forwards args verbatim, unlike npm)

pnpm check:types runs in parallel across packages in under a minute; just run it.

Agent skills

Issue tracker

Issues are tracked in GitHub Issues on aws/graph-explorer; external PRs are also a triage surface. See docs/agents/issue-tracker.md.

Triage labels

Default label vocabulary (needs-triage, needs-info, ready-for-agent, ready-for-human, wontfix). See docs/agents/triage-labels.md.

Domain docs

Single-context layout — one GLOSSARY.md + docs/adr/ at the repo root. See docs/agents/domain.md.

CONTEXT.md was renamed to GLOSSARY.md. When a skill or doc asks for CONTEXT.md or CONTEXT-MAP.md, use GLOSSARY.md or GLOSSARY-MAP.md instead.

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.