agentleFS
metaspartanmetaspartan/cybara/AGENTS.md

cybara

AGENTS.md38 starsChanged 5 months agoMITView on GitHub

Rules for any AI agent or contributor working in this repo. Follow them exactly; they override default habits. Deeper conventions live in CLAUDE.md. - Never use any — not in signatures, casts, generics, or as any. It is banned. - Model real shapes with interface/type. For genuinely unknown input use unknown and narrow it before use (type guards, discriminated unions). - Type every exported function's parameters and return value explicitly. Do not rely on inference across module boundaries. - Avoid…

The file

Show its rules and text

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

21 rules. About 0 are common, 11 are distinctive, and 10 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    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:

    Always use Bun commands:

    line 9
  2. Very specific:

    Never use npm, npx, pnpm, yarn, or corepack.

    line 16
  3. Very specific:

    Treat bun.lock as the canonical lockfile.

    line 17
  4. Very specific:

    Prefer Bun-native APIs (Bun.spawn/Bun.spawnSync, Bun.file) over child_process/fs shell-outs.

    line 18
  5. Distinctive:

    If docs or snippets mention npm-style commands, translate them to Bun equivalents before running.

    line 22
  6. Distinctive:

    If a third-party instruction cannot run with Bun, stop and propose a Bun-compatible alternative.

    line 23
  7. Very specific:

    Never use any — not in signatures, casts, generics, or as any.

    line 27
  8. Very specific:

    Avoid non-null assertions (!).

    line 32
  9. Very specific:

    If a third-party type is missing, declare a local interface for the slice you use.

    line 34
  10. Distinctive:

    Keep functions and route handlers returning consistent, fully-typed API shapes (snake_case fields for HTTP responses — see CLAUDE.md).

    line 35
  11. Distinctive:

    Write code with no comments.

    line 40
  12. Very specific:

    Do not add header blocks, JSDoc, inline // notes, or commented-out code.

    line 41
  13. Distinctive:

    Never reference other products, competitors, or external projects anywhere in code or comments.

    line 42
  14. Distinctive:

    If an edit pushes a file over, extract a cohesive module instead.

    line 58
  15. Very specific:

    Do not leave dead exports.

    line 59
  16. Distinctive:

    Every behavior change or fix ships with tests.

    line 63
  17. Very specific:

    Use bun:test (describe/test/expect) under tests/, mirroring the source path.

    line 65
  18. Distinctive:

    Test the real contract: security fixes must prove the exploit is blocked (e.g.

    line 66
  19. Distinctive:

    Prefer fast, dependency-free tests.

    line 69
  20. Distinctive:

    Keep tests deterministic and isolated.

    line 71
  21. Very specific:

    Run the full gate and make it green — no skips, no --no-verify:

    line 75

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

Cybara Agent Rules

Rules for any AI agent or contributor working in this repo. Follow them exactly; they override default habits. Deeper conventions live in CLAUDE.md.

Package Manager Policy (Strict)

  • Bun is the only allowed JavaScript/TypeScript package manager and task runner.
  • Always use Bun commands:
    • bun install
    • bun add <pkg>
    • bun remove <pkg>
    • bun run <script>
    • bun test
    • bunx <tool>
  • Never use npm, npx, pnpm, yarn, or corepack.
  • Treat bun.lock as the canonical lockfile.
  • Prefer Bun-native APIs (Bun.spawn/Bun.spawnSync, Bun.file) over child_process/fs shell-outs.

Command Translation

  • If docs or snippets mention npm-style commands, translate them to Bun equivalents before running.
  • If a third-party instruction cannot run with Bun, stop and propose a Bun-compatible alternative.

TypeScript Type Safety

  • Never use any — not in signatures, casts, generics, or as any. It is banned.
  • Model real shapes with interface/type. For genuinely unknown input use unknown and narrow it before use (type guards, discriminated unions).
  • Type every exported function's parameters and return value explicitly. Do not rely on inference across module boundaries.
  • Avoid non-null assertions (!). Handle null/undefined with ?. and ??.
  • No @ts-ignore / @ts-expect-error to silence real errors — fix the type instead. If a third-party type is missing, declare a local interface for the slice you use.
  • Keep functions and route handlers returning consistent, fully-typed API shapes (snake_case fields for HTTP responses — see CLAUDE.md).

No Comments

  • Write code with no comments. Names and structure carry the meaning.
  • Do not add header blocks, JSDoc, inline // notes, or commented-out code.
  • Never reference other products, competitors, or external projects anywhere in code or comments.
  • The rare exception is a short /* ... */ note only when logic is genuinely non-obvious and cannot be made clear by renaming or restructuring; default to none.

DRY & Code Quality

  • Extract shared logic into a well-named helper or module; do not copy-paste blocks. Adapters/handlers that repeat a pattern should share a single utility (e.g. channels/access-gate.ts, wallet-url-guard.ts, api/html-escape.ts).
  • One responsibility per function; keep them small and composable.
  • Reuse existing helpers before writing new ones — search first.
  • Match the surrounding code's style, naming, and idioms.
  • Fail closed on security-sensitive paths (auth, path/URL validation, access control): when in doubt, deny.
  • Validate and sanitize all external input (tool args, webhooks, request bodies) at the boundary.
  • Hard file cap: no TypeScript file may exceed 5000 LOC (bun run check:loc). If an edit pushes a file over, extract a cohesive module instead.
  • Do not leave dead exports; bun run deadcode:report surfaces them.

Tests (Required)

  • Every behavior change or fix ships with tests. Bug fixes get a regression test that fails on the old code and passes on the new.
  • Use bun:test (describe/test/expect) under tests/, mirroring the source path.
  • Test the real contract: security fixes must prove the exploit is blocked (e.g. feed the malicious input and assert it is rejected), not just that the happy path still works.
  • Cover edge cases: empty/malformed input, boundaries, null/undefined, and failure modes.
  • Prefer fast, dependency-free tests. For network/protocol code, stand up a local fake (e.g. an in-process server) rather than mocking away the logic under test.
  • Keep tests deterministic and isolated; clean up any files/state they create.

Before You Finish

Run the full gate and make it green — no skips, no --no-verify:

bun run check:ci

This runs: typecheck + ui:typecheck (tsc --noEmit), lint + ui:lint (eslint), check:loc (5000-LOC cap), mobile typecheck, test:smoke, and deadcode:report. Report results honestly — if something fails or was skipped, say so.

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.