agentleFS
theyashguptatheyashgupta/dispatch/CLAUDE.md

dispatch

CLAUDE.md3 starsChanged 11 days agoMITView on GitHub

Run npm run check with NODE_ENV unset. It runs the unit tests (npm run test) and then, as its last step, the tmux and wall-clock tests (npm run test:timing). Both steps run in the check slot of scripts/with-check-slot.mjs. test:timing runs each file in TIMING_FILES (scripts/run-tests.mjs) alone and runs a failed file one more time. A file that passes on its second run does not fail the check. When a new test starts a real tmux server or asserts on real…

The file

Show its rules and text

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

16 rules. About 0 are common, 4 are distinctive, and 12 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 12

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Put each new frontend file in a route, a layer folder of src/web/modules/<feature>/ or a shared tier.

    line 3
  2. Very specific:

    Use only these layer folders: views, containers, components, hooks, domain, queries.

    line 4
  3. Distinctive:

    Call query and mutation hooks only in containers.

    line 7
  4. Very specific:

    Keep components free of TanStack Query, TanStack Router and the HTTP client.

    line 8
  5. Very specific:

    Keep domain files pure. Do not import React, and do not use fetch, window, document, localStorage or EventSource.

    line 9
  6. Distinctive:

    Do not import a sibling module.

    line 10
  7. Very specific:

    Add a primitive with npx shadcn@latest add.

    line 13
  8. Very specific:

    Do not use the JSX style prop, except in components/ui/ files, modules/<feature>/components/dnd/ files, src/web/viewer/ files and …

    line 15
  9. Very specific:

    Do not write a colour value outside src/web/styles/tokens.css.

    line 16
  10. Very specific:

    Put a <subject>.test.ts file next to each non-test domain file and each *-queries.ts file.

    line 19
  11. Very specific:

    Keep routes free of exec, tmux and git calls.

    line 25
  12. Distinctive:

    Keep business logic in services, not in routes or handlers.

    line 26
  13. Very specific:

    Do not read req or res in a service.

    line 27
  14. Distinctive:

    Write board state only through the store.

    line 28
  15. Very specific:

    Put a node:test file next to each new route, service and domain file.

    line 30
  16. Very specific:

    Use bootstrap/ as the composition root.

    line 32

≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.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
CLAUDE.md

Frontend agent rules

  1. Put each new frontend file in a route, a layer folder of src/web/modules/<feature>/ or a shared tier.
  2. Use only these layer folders: views, containers, components, hooks, domain, queries.
  3. A route renders one view, or one shared layout component that gets module views as children. Keep business logic, JSX layout and data transforms out of routes.
  4. Get server data only in query files. Only query files import the HTTP client.
  5. Call query and mutation hooks only in containers.
  6. Keep components free of TanStack Query, TanStack Router and the HTTP client. Only query files and http.ts call fetch.
  7. Keep domain files pure. Do not import React, and do not use fetch, window, document, localStorage or EventSource.
  8. Do not import a sibling module. Compose modules in a route or a shared layout component.
  9. Export only views and queryOptions factories from a module index.ts.
  10. Build UI from src/web/components/ui/ primitives, except the allowed custom families.
  11. Add a primitive with npx shadcn@latest add. Do not write a lookalike.
  12. Change a primitive with a cva variant in its own file, or with an edit that "Primitive conventions" names.
  13. Do not use the JSX style prop, except in components/ui/ files, modules/<feature>/components/dnd/ files, src/web/viewer/ files and src/web/viewer-main.tsx (U4-13). Use Tailwind token classes.
  14. Do not write a colour value outside src/web/styles/tokens.css.
  15. Show focus with an outline, not a ring or a box-shadow.
  16. Name .tsx files in PascalCase, except in components/ui/ and route files. Name .ts files in kebab-case.
  17. Put a <subject>.test.ts file next to each non-test domain file and each *-queries.ts file.

Backend agent rules

  1. Parse each route input with a zod schema in the route file.
  2. Throw a typed error from services/domain/errors.ts. Do not call res.status with a 4xx or 5xx code.
  3. Keep routes free of exec, tmux and git calls. A new route file calls boardRepository, not board.store.ts.
  4. Keep business logic in services, not in routes or handlers.
  5. Do not read req or res in a service.
  6. Write board state only through the store.
  7. Spawn a subprocess only through adapters/exec.ts or a named exception in code-review-rules.md.
  8. Put a node:test file next to each new route, service and domain file.
  9. A file imports only from its own folder and from folders earlier in this list: src/shared/, store/ and sources/, adapters/, services/infra/, services/orchestration/, routes/. store/ and sources/ do not import each other, and among these folders only adapters/ imports sources/. A file in services/domain/ imports src/shared/ only; orchestration files and routes can import it. The one exception is adapters/image-proxy.ts, which imports services/infra/config-holder.ts.
  10. Use bootstrap/ as the composition root. It can import every folder. Only bootstrap/index.ts calls setBoardRepository(store) in source code. A test can call setBoardRepository to install fakeBoardRepository.

Check rule

Run npm run check with NODE_ENV unset. It runs the unit tests (npm run test) and then, as its last step, the tmux and wall-clock tests (npm run test:timing). Both steps run in the check slot of scripts/with-check-slot.mjs. test:timing runs each file in TIMING_FILES (scripts/run-tests.mjs) alone and runs a failed file one more time. A file that passes on its second run does not fail the check. When a new test starts a real tmux server or asserts on real elapsed time, add it to TIMING_FILES. To run one timing file, use node scripts/run-tests.mjs timing <file>.

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.