agentleFS
estebanmr99estebanmr99/lean-agents/AGENTS.md

lean-agents

AGENTS.md4 starsChanged 3 days agoMITView on GitHub

Instructions for coding agents (Claude Code, OpenCode, Copilot CLI) that work on this repository. Not to be confused with core/AGENTS.md, which is the rule set lean-agents installs on users' machines.

  • 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,266 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 repository8 other files it gives its agents.

The file

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

7 rules. About 0 are common, 1 is distinctive, and 6 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

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

    Never touch the real HOME: Every engine run in development or tests uses --home <temp dir>.

    line 26
  2. Very specific:

    Public repo: no private data: No usernames, home paths, employer names or internal tools, cloud project IDs, emails, keys or tokens.

    line 27
  3. Very specific:

    Verify, don't guess: Every install command, config key and CLI flag comes from the tool's current upstream docs or from a real binary in CI.

    line 28
  4. Very specific:

    Never overwrite user files: Use the engine's action kinds in scripts/lib/fsops.mjs: file (owned files with the managed by lean-agents …

    line 30
  5. Very specific:

    Commit as the owner (their GitHub no-reply email is already in the clone's git config) and add a Co-Authored-By: trailer for the agent.

    line 44
  6. Very specific:

    Add changes/<issue>.md (see changes/README.md).

    line 45
  7. Distinctive:

    Search before reading; open only the relevant lines.

    line 50

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

Working on lean-agents

Instructions for coding agents (Claude Code, OpenCode, Copilot CLI) that work on this repository. Not to be confused with core/AGENTS.md, which is the rule set lean-agents installs on users' machines.

Read first

  1. docs/SPEC.md section 0 (current state) and section 2 (non-negotiable rules).
  2. The next unchecked session in docs/SPEC.md section 14. Work only on that session.

Commands

TaskCommand
Install dev dependenciesnpm ci
Engine tests (temp HOME, no external commands)npm test
Shell lintshellcheck install.sh scripts/*.sh tests/*.sh
Workflow lintnode scripts/lint-workflows.mjs
Privacy check (run before every commit)bash scripts/check-private.sh
Try the installer safelynode scripts/lean.mjs --home "$(mktemp -d)" --no-exec --yes --dry-run --agents claude,opencode-v2 --all-tools
Real OpenCode 2 check (needs opencode on PATH)bash tests/real-opencode.sh
Real Skills CLI undo check (safe locally, throwaway HOME)bash tests/real-skills-undo.sh claude,opencode-v2
Interactive menus in a pseudo-terminal (macOS; temp HOME, dry run)python3 tests/real-interactive.py

Hard rules

  • Never touch the real HOME. Every engine run in development or tests uses --home <temp dir>; use --no-exec unless the task is to test real tool installs inside a throwaway HOME or CI. Never run install.sh or scripts/lean.mjs without --home on the owner's machine.
  • Public repo: no private data. No usernames, home paths, employer names or internal tools, cloud project IDs, emails, keys or tokens. scripts/check-private.sh must pass; it also reads the gitignored .private-denylist.
  • Verify, don't guess. Every install command, config key and CLI flag comes from the tool's current upstream docs or from a real binary in CI. Record source and date in docs/compatibility.md. Mark anything unverified as VERIFY.
  • Prove it in CI. The owner does not test on their working machines. A feature is done when a CI job with real binaries and a throwaway HOME shows it works.
  • Never overwrite user files. Use the engine's action kinds in scripts/lib/fsops.mjs: file (owned files with the managed by lean-agents mark), json (JSONC edits that keep comments and user values), block (marked block in text files). Every change must be undone by --uninstall.
  • Do not add tools the owner rejected: Oh My OpenAgent, Graphify. Warp and Orca are config-only integrations (terminal desktop app installers were removed in 2.0.0).
  • Ask before pushing, opening PRs, or anything irreversible.

Code style

  • Node 22.20+, ES modules, no dependencies beyond jsonc-parser and @clack/prompts (pinned; menus only, loaded only on a real terminal). Ask the owner before adding any other. Small pure functions; adapters return { actions, commands }.
  • Bash 3.2 compatible (macOS default) and shellcheck clean. PowerShell 5.1 compatible and PSScriptAnalyzer clean.
  • Match the comment density of the surrounding code: a short header per file, comments only where the why is not obvious.
  • Tests in tests/*.test.mjs with node:test, always against a temp HOME.

Git

  • One branch per session: session-<n>-<short-name>. Conventional commits (feat:, fix:, docs:, ci:, chore:).
  • Commit as the owner (their GitHub no-reply email is already in the clone's git config) and add a Co-Authored-By: trailer for the agent.
  • Add changes/<issue>.md (see changes/README.md); node scripts/changelog.mjs <version> folds them into CHANGELOG.md in the release PR. Update the README compatibility tables (EN and ES) and docs/compatibility.md in the same PR as the feature.
  • Mark the session [x] in docs/SPEC.md section 14 when its PR merges.

Token efficiency while working here

  • Search before reading; open only the relevant lines. Use Serena symbol tools if available.
  • Delegate exploration and upstream research to cheap subagents (explore, research), review the diff with review before reporting done.
  • Report: what changed, how it was verified (command + result), what is pending.

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.