agentleFS
smgglrs-aismgglrs-ai/navra/AGENTS.md

navra

AGENTS.md2 starsChanged 5 months agoApache-2.0View on GitHub

All AI agents working in this project must follow these rules. These apply to all agents: main session, subagents, worktree agents, and team members. Building and testing this workspace is HEAVY: full builds take gigabytes of RAM per rustc/linker process, and the navra-server test binaries each spawn real server processes. The primary development machine is the user's daily-driver workstation — running heavy jobs there disrupts the user's desktop and is treated as a critical process failure. 1. No heavy builds…

  • Reads credentials
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,040 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 repository11 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

30 rules. About 0 are common, 19 are distinctive, and 11 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈19

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    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. Distinctive:

    All AI agents working in this project must follow these rules.

    line 3
  2. Very specific:

    Check resources before and during: Before starting work on the build machine, check free -g, df -h, current load (uptime), and that no …

    line 27
  3. Very specific:

    Use just test-server-guarded (serialized + a watchdog that aborts if more than 10 navra processes are alive at once) — preferred, or plain …

    line 40
  4. Very specific:

    Run ONE filtered test at a time: cargo test -p navra-server --test <binary> <name> -- --test-threads=1 cargo test -p <other-crate> may run …

    line 43
  5. Distinctive:

    When referencing files, use exact paths relative to the project root.

    line 55
  6. Distinctive:

    Read CLAUDE.md for architecture, conventions, and build commands

    line 66
  7. Very specific:

    Read .lean/plan.yml to understand what's in progress (generated from .lean/items/*.yml, the source of truth — regenerate with bash …

    line 67
  8. Distinctive:

    Run git log --oneline -10 for recent context

    line 70
  9. Very specific:

    If assigned a crate, read its lib.rs top-level doc comment

    line 71
  10. Distinctive:

    Do not re-read files you already have in context

    line 75
  11. Distinctive:

    If you need a fact about the codebase, grep or read — do not guess

    line 76
  12. Very specific:

    When switching crates, read the new crate's lib.rs and test files

    line 77
  13. Distinctive:

    Before claiming any work is complete:

    line 81
  14. Very specific:

    Tests pass: run on the designated build machine per rule 0 — cargo test -p <crate> for non-server crates, just test-server-guarded (or one …

    line 83
  15. Distinctive:

    No new warnings: read the full build output, not just the exit code

    line 89
  16. Distinctive:

    Security warnings are fatal: if clippy or your own review flags a security concern, fix it or escalate — never defer

    line 90
  17. Distinctive:

    If tests fail, fix them. Do not report partial success as complete.

    line 93
  18. Very specific:

    Never commit: .env, *.pem, *.key, Cargo.lock changes (let the build update it), model weights, database files

    line 99
  19. Distinctive:

    Never force push, rewrite history, or run destructive git commands

    line 101
  20. Distinctive:

    Write commit messages in imperative mood: "add X", not "added X"

    line 102
  21. Distinctive:

    If two agents need to change the same file, they cannot run in parallel — sequence them or have one agent do both changes

    line 130
  22. Distinctive:

    Every agent in a worktree must:

    line 135
  23. Distinctive:

    When working as part of a Claude Code team:

    line 145
  24. Distinctive:

    No silent work: if you hit a blocker, message the lead immediately

    line 149
  25. Distinctive:

    No scope creep: do your assigned task, nothing more

    line 150
  26. Distinctive:

    Prefer tasks in ID order (lowest first) when multiple are available

    line 151
  27. Distinctive:

    Before modifying a crate, understand its patterns:

    line 155
  28. Very specific:

    Check for a local test_ctx() helper — use it, don't invent your own

    line 157
  29. Very specific:

    Check the error handling pattern: CallToolResult::error() vs anyhow

    line 158
  30. Very specific:

    Check whether the crate uses #[tokio::test] or sync tests

    line 159

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

All AI agents working in this project must follow these rules. These apply to all agents: main session, subagents, worktree agents, and team members.

0. Build Machine Rules (ABSOLUTE — no exceptions)

Building and testing this workspace is HEAVY: full builds take gigabytes of RAM per rustc/linker process, and the navra-server test binaries each spawn real server processes. The primary development machine is the user's daily-driver workstation — running heavy jobs there disrupts the user's desktop and is treated as a critical process failure.

  1. No heavy builds on the user's workstation. cargo build, cargo test, cargo clippy, and cargo check must NEVER run on the machine you develop on. The only permitted cargo commands there are cargo fmt / cargo fmt --check. Run all compilation and tests on the designated build machine (ask the lead/operator which host that is — it is reached over SSH and configured as a git remote). Workflow: push your branch to that remote, clone or check out into your OWN directory there (one per agent, never shared), and iterate fix → commit → push → re-test over SSH. Never edit files on the build machine directly; git is the only transport.
  2. Check resources before and during. Before starting work on the build machine, check free -g, df -h, current load (uptime), and that no stray processes from earlier runs are alive (pgrep -f 'target/debug/navra' — kill any you find, report them). If memory or disk are tight, or load is already high, stop and coordinate instead of piling on. While your jobs run, they must stay within the resource envelope below.
  3. navra-server tests are serialized, EVERYWHERE. Plain cargo test -p navra-server runs every integration binary in parallel and each spawns multiple navra server processes — dozens of navra instances at once, on any machine. This is why just test-crate navra-server is blocked. The rule applies on every machine, including the build machine:
    • Use just test-server-guarded (serialized + a watchdog that aborts if more than 10 navra processes are alive at once) — preferred, or plain just test-server, or
    • Run ONE filtered test at a time: cargo test -p navra-server --test <binary> <name> -- --test-threads=1 cargo test -p <other-crate> may run in parallel on the build machine, but never more than one cargo invocation at a time per agent. Never run two test-server invocations concurrently.
  4. Clean up after yourself: kill any navra test processes you started (pkill -f 'target/debug/navra'), tell the lead which directory you used on the build machine, and leave no stray processes behind.

1. Path Precision

When referencing files, use exact paths relative to the project root.

  • navra-auth/src/permissions/acl.rs:42 — correct
  • navra-core/tests/session_test.rs — correct
  • "the security file" — wrong
  • "acl.rs" — wrong (which crate?)

2. Context Protocol

Session start

  1. Read CLAUDE.md for architecture, conventions, and build commands
  2. Read .lean/plan.yml to understand what's in progress (generated from .lean/items/*.yml, the source of truth — regenerate with bash ~/.claude/lean/scripts/generate-plan.sh)
  3. Run git log --oneline -10 for recent context
  4. If assigned a crate, read its lib.rs top-level doc comment

During work

  • Do not re-read files you already have in context
  • If you need a fact about the codebase, grep or read — do not guess
  • When switching crates, read the new crate's lib.rs and test files

3. Work Quality Gates

Before claiming any work is complete:

  1. Tests pass: run on the designated build machine per rule 0 — cargo test -p <crate> for non-server crates, just test-server-guarded (or one filtered test at a time) for navra-server
  2. Clippy clean: cargo clippy -p <crate> -- -D warnings on the designated build machine
  3. No new warnings: read the full build output, not just the exit code
  4. Security warnings are fatal: if clippy or your own review flags a security concern, fix it or escalate — never defer

If tests fail, fix them. Do not report partial success as complete.

4. Git Discipline

  • Sign all commits: git commit -s -m "description"
  • One feature = one commit. Commit immediately after tests pass.
  • Never commit: .env, *.pem, *.key, Cargo.lock changes (let the build update it), model weights, database files
  • Never force push, rewrite history, or run destructive git commands
  • Write commit messages in imperative mood: "add X", not "added X"

5. Worktree Protocol

When to use worktrees

  • Parallel work on independent crates (e.g., tests + docs)
  • Multi-agent team assignments
  • Experimental changes that might not land

How worktrees work

  1. Plan on main: design the approach, decompose into crate-scoped work packages, identify file ownership boundaries
  2. Implement in worktree: each agent gets its own worktree on its own branch, modifying only its assigned crates
  3. Commit before exiting: git add -A && git commit -s -m "summary" — uncommitted work is lost when the worktree is cleaned up
  4. Merge back: git merge --no-ff <worktree-branch> -m "Merge: description"

File ownership

Crate boundaries are the natural ownership boundary. When multiple agents work in parallel:

  • Each agent owns one or more crates (all files under that crate dir)
  • Shared files (Cargo.toml workspace, CLAUDE.md, AGENTS.md) are owned by the lead session — agents do not modify them
  • If two agents need to change the same file, they cannot run in parallel — sequence them or have one agent do both changes

Agent checklist

Every agent in a worktree must:

  • Read CLAUDE.md and AGENTS.md at session start
  • Read the target crate's lib.rs and existing tests
  • Run tests before and after changes
  • Commit all work before finishing
  • Report what was done, what was not, and why

6. Team Coordination

When working as part of a Claude Code team:

  • Lead decomposes the task, assigns crates, creates the task list
  • Members claim tasks, work in worktrees, report via SendMessage
  • No silent work: if you hit a blocker, message the lead immediately
  • No scope creep: do your assigned task, nothing more
  • Prefer tasks in ID order (lowest first) when multiple are available

7. Crate Conventions

Before modifying a crate, understand its patterns:

  • Check for a local test_ctx() helper — use it, don't invent your own
  • Check the error handling pattern: CallToolResult::error() vs anyhow
  • Check whether the crate uses #[tokio::test] or sync tests
  • Match the existing naming: test_deny_wins_over_allow, not test1
  • Respect the dependency layering in CLAUDE.md — never add a dependency that violates the crate hierarchy

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.