agentleFS
RohiRIKRohiRIK/claude-code-config/AGENTS.md

claude-code-config

AGENTS.md10 starsChanged 5 months agoMITView on GitHub

Orientation for coding agents working in this repo. Keep this handy; follow commands and conventions before editing.

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository4 other files it gives its agents.

The file

Show its rules and text

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

32 rules. About 1 is common, 11 are distinctive, and 20 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 20

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Run all tests (default short): pnpm test

    line 21
  2. Very specific:

    Run all including long-running: pnpm test --filter-tags long-running

    line 22
  3. Very specific:

    Run a single bats test by name: bats test/test.bats --filter "pattern"

    line 23
  4. Very specific:

    Run a single bats test by tag: bats test/test.bats --filter-tags tagname

    line 24
  5. Distinctive:

    Prefer explicit return types on exported functions.

    line 37
  6. Very specific:

    Avoid any; use unknown or generics.

    line 38
  7. Distinctive:

    Use interfaces for public contracts.

    line 39
  8. Distinctive:

    Keep enums minimal; favor literal unions when possible.

    line 40
  9. Very specific:

    Always await promises; handle rejections.

    line 41
  10. Very specific:

    Use const over let where possible.

    line 42
  11. Very specific:

    Keep functions small; extract helpers in src/lib when shared.

    line 43
  12. Distinctive:

    Use named imports over namespace unless the module exports a single primary object.

    line 50
  13. Distinctive:

    Do not fight Biome; align code to its output before committing.

    line 55
  14. Distinctive:

    Keep comments scarce; explain *why*, not *what*.

    line 56
  15. Very specific:

    Prefer typed errors or Error with clear messages.

    line 66
  16. Distinctive:

    Use guard clauses; return early on invalid input.

    line 68
  17. Very specific:

    When interacting with filesystem/network, handle ENOENT, timeouts, and auth failures gracefully.

    line 70
  18. Very specific:

    Default store pulled from MXBAI_STORE or mgrep.

    line 75
  19. Very specific:

    Write descriptive test names (@test "search returns results for valid query").

    line 81
  20. Very specific:

    Keep fixtures in test/assets/.

    line 84
  21. Very specific:

    Never commit secrets: API keys, .env, tokens, private keys.

    line 92
  22. Distinctive:

    Read before writing: inspect relevant files (commands, libs) first.

    line 103
  23. Very specific:

    Prefer existing helpers over new utilities.

    line 104
  24. Distinctive:

    Keep changes minimal; avoid mixing refactors with features.

    line 105
  25. Distinctive:

    After edits to TS/JS, expect hooks to run format/typecheck suggestions.

    line 106
  26. Very specific:

    Run pnpm typecheck && pnpm format:check && pnpm test before handing off.

    line 107
  27. Very specific:

    Avoid console.log spam; logging is intercepted.

    line 108
  28. Distinctive:

    Keep binary assets out of repo unless required.

    line 113
  29. Common:

    No secrets or debug logs; imports ordered.

    line 139
  30. Very specific:

    When unsure, mirror existing patterns in src/commands/search.ts and src/lib/store.ts.

    line 144
  31. Very specific:

    No Cursor rules detected (.cursor/ or .cursorrules missing).

    line 147
  32. Very specific:

    No GitHub Copilot instructions found under .github/copilot-instructions.md.

    line 148

≈ “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

AGENTS GUIDE (Mixedbread mgrep)

Orientation for coding agents working in this repo. Keep this handy; follow commands and conventions before editing.

Project Snapshot

  • Runtime: Node.js 18+ (CI uses 20/24)
  • Language: TypeScript 5.x, ESM ("type": "module", module: "NodeNext")
  • Package manager: pnpm (lockfile present)
  • Lint/format: Biome (biome.json), import organize on save
  • Tests: bats (Bash Automated Testing System)
  • Dist: tsc outputs to dist/; CLI entry dist/index.js

How to Build/Test Fast

  • Install deps: pnpm install
  • Build: pnpm build
  • Dev run CLI: pnpm dev (compiles then runs dist/index.js)
  • Type check only: pnpm typecheck
  • Lint/format fix: pnpm format
  • Lint/format check (CI): pnpm format:check
  • Lint only: pnpm lint
  • Run all tests (default short): pnpm test
  • Run all including long-running: pnpm test --filter-tags long-running
  • Run a single bats test by name: bats test/test.bats --filter "pattern"
  • Run a single bats test by tag: bats test/test.bats --filter-tags tagname
  • CI pipeline order: format:check → test (long-running) → typecheck → build

Repo Conventions

  • ESM everywhere: use .js extension in imports, even for TS files (import { foo } from "./lib/foo.js").
  • Paths: prefer node:path utilities; avoid string concat for paths.
  • Logging: src/lib/logger.ts wires console to Winston; avoid new loggers unless necessary.
  • Git helpers live in src/lib/git.ts; prefer them over custom git shells.
  • Commands live under src/commands/; installers under src/install/; shared utils under src/lib/.
  • CLI wired in src/index.ts via Commander; add commands there when introducing new functionality.

TypeScript Style

  • strict mode on; noUnused*, noImplicitReturns, noFallthrough enforced.
  • Prefer explicit return types on exported functions.
  • Avoid any; use unknown or generics. Narrow early.
  • Use interfaces for public contracts; types acceptable for internal utility shapes.
  • Keep enums minimal; favor literal unions when possible.
  • Always await promises; handle rejections. Return typed results, not Promise<void> unless appropriate.
  • Use const over let where possible; avoid var entirely.
  • Keep functions small; extract helpers in src/lib when shared.

Imports & Ordering

  1. Node built-ins (node:fs, node:path, etc.)
  2. Third-party packages
  3. Internal absolute imports (rooted at src/ with ./ prefixes for ESM)
  4. Relative siblings Use named imports over namespace unless the module exports a single primary object. Avoid default exports for new code.

Formatting & Biome

  • Biome handles both linting and formatting; run pnpm format to auto-fix.
  • Config: 2-space indent, double quotes, import organize on.
  • Do not fight Biome; align code to its output before committing.
  • Keep comments scarce; explain why, not what.

Naming

  • Files: kebab-case (sync-helpers.ts).
  • Classes/Types/Interfaces: PascalCase (SearchOptions).
  • Functions/variables: camelCase (resolveStore).
  • Constants: UPPER_SNAKE_CASE (DEFAULT_STORE).
  • CLI flags: kebab-case; environment variables: UPPER_SNAKE_CASE (MXBAI_API_KEY).

Error Handling

  • Prefer typed errors or Error with clear messages; include action hints.
  • Wrap CLI entrypoints with user-friendly messaging; avoid raw stack traces to users unless in debug.
  • Use guard clauses; return early on invalid input.
  • Validate external input with zod where practical.
  • When interacting with filesystem/network, handle ENOENT, timeouts, and auth failures gracefully.
  • Log operational errors via console (wired to Winston) so they reach rotating logs.

CLI Behavior

  • Commander is the source of truth; register options there.
  • Default store pulled from MXBAI_STORE or mgrep; keep defaults minimal and quiet.
  • Background watcher respects .gitignore and .mgrepignore; maintain that contract when changing watch logic.
  • Preserve exit codes: non-zero on failure; zero on success.

Testing Practices

  • Tests are bats in test/test.bats; add new cases there.
  • Write descriptive test names (@test "search returns results for valid query").
  • Mark slow tests with tags (# bats test_tags=long-running) so default pnpm test skips them.
  • For bug fixes, add a regression test; for features, cover happy path + edge.
  • Keep fixtures in test/assets/; reuse existing fixtures where possible.

Releases & CI Notes

  • Release workflow tags v*.*.*, verifies tag matches package.json, runs format:check, pnpm test --filter-tags long-running, pnpm build, then npm publish --provenance.
  • Prepare script runs build on install; ensure build stays deterministic.
  • Husky is declared but may need npx husky init locally if hooks are desired.

Security & Secrets

  • Never commit secrets: API keys, .env, tokens, private keys.
  • Auth options: device login via mgrep login or MXBAI_API_KEY env for CI.
  • Respect size limits in watcher (defaults in README); do not silently broaden.

Local Tooling Guardrails

  • Dev servers must run inside tmux; the dev command hook blocks non-tmux runs.
  • Long commands in Bash prompt a tmux reminder; consider tmux new -s dev.
  • Git pushes prompt for a quick review pause before continuing.
  • MD/TXT creation is blocked unless the path is README/CLAUDE/AGENTS/CONTRIBUTING.

Workflow for Agents

  • Read before writing: inspect relevant files (commands, libs) first.
  • Prefer existing helpers over new utilities; search src/lib.
  • Keep changes minimal; avoid mixing refactors with features.
  • After edits to TS/JS, expect hooks to run format/typecheck suggestions.
  • Run pnpm typecheck && pnpm format:check && pnpm test before handing off.
  • Avoid console.log spam; logging is intercepted. Remove debug logs before commit.

File/Path Expectations

  • Generated output belongs in dist/; do not edit generated files.
  • Respect .gitignore, .mgrepignore, Biome include/exclude.
  • Keep binary assets out of repo unless required.

Documentation Touchpoints

  • User-facing changes: update README.md.
  • Contribution/process changes: update CONTRIBUTING.md.
  • Architectural or agent-facing patterns: update this file.

Single-Test Quickstart (copy-paste)

# Short path: run one bats test matching a name
bats test/test.bats --filter "watch indexes"  

# Run tagged slow test explicitly
bats test/test.bats --filter-tags long-running

Troubleshooting Cheatsheet

  • Formatting diffs? run pnpm format.
  • Type errors on imports? ensure .js extension and NodeNext module resolution.
  • Permissions on logs? src/lib/logger.ts writes under ~/.local/state/mgrep/logs; ensure writable or expect silent logger.
  • Device login loops? mgrep logout then mgrep login; CI prefers MXBAI_API_KEY.

Pre-push sanity list

  • pnpm typecheck
  • pnpm format:check
  • pnpm test (or targeted bats when iterating)
  • No secrets or debug logs; imports ordered; ESM extensions correct.

Contact

Cursor/Copilot Rules

  • No Cursor rules detected (.cursor/ or .cursorrules missing).
  • No GitHub Copilot instructions found under .github/copilot-instructions.md.

End of AGENTS.md

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.