agentleFS
plumbkitplumbkit/plumb/AGENTS.md

plumb

AGENTS.md4 starsChanged 4 months agoMITView on GitHub

Source of truth: edit AGENTS.md only. CLAUDE.md and GEMINI.md are relative symlinks to it; never edit, replace, or unlink those paths. This is the always-loaded engineering contract for the public Plumb codebase. Keep rules here and reference detail in docs/; make check-brief enforces the budget. Plumb gives coding agents an IDE intelligence layer over MCP: LSP semantics, a tree-sitter topology index, project memory, and a complete safe-filesystem toolkit. plumb serve is a resilient stdio proxy in front of a shared…

  • 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,691 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 repository3 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

13 rules. About 0 are common, 4 are distinctive, and 9 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.

  • 9

    Very specific

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

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

    Avoid version drift: Read VERSION and CHANGELOG.md for the current version.

    line 12
  2. Distinctive:

    Concurrency-safe durability: Write tools use per-path locks, optimistic checks, atomic rename, and the shared durable-write path.

    line 19
  3. Distinctive:

    Per-session isolation: Read tracking, rate limits, and caches belong to a connection or declared agent, never accidental process globals.

    line 20
  4. Very specific:

    Every durable write goes through internal/fsync.AtomicWrite.

    line 39
  5. Distinctive:

    Use Australian English in prose, comments, logs, and errors.

    line 65
  6. Very specific:

    Use log/slog; wrap errors with context.

    line 67
  7. Very specific:

    Do real wiring in constructors, not init().

    line 68
  8. Very specific:

    Every //nolint needs an inline reason.

    line 70
  9. Very specific:

    Keep tests beside code and table-driven where appropriate.

    line 76
  10. Very specific:

    Use topology_affected during the edit loop.

    line 79
  11. Very specific:

    Use conventional commit types (feat, fix, refactor, test, docs, ci, chore).

    line 86
  12. Distinctive:

    Treat concurrency, the rate limiter, read tracking, and the stats schema as high-risk invariants.

    line 87
  13. Very specific:

    Keep this file as rules plus pointers.

    line 88

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

Plumb — Agent Instructions

Source of truth: edit AGENTS.md only. CLAUDE.md and GEMINI.md are relative symlinks to it; never edit, replace, or unlink those paths.

This is the always-loaded engineering contract for the public Plumb codebase. Keep rules here and reference detail in docs/; make check-brief enforces the budget.

Working contract

  • Use Plumb's lane. When Plumb exposes a capability, use its MCP tool instead of native file, search, shell, or Git tools. Native tools bypass Plumb's concurrency guards, diagnostics, and session tracking. Exceptions are capabilities Plumb does not cover and read-only commodity tools hidden by a lean profile.
  • Bootstrap and guard writes. Call session_start first, passing a stable per-agent session_id (on Claude Code the identity hook supplies it and stamps every later call; a session_id alone identifies only that call). After read_file, use Plumb edits and pass its mtime or sha256 as expected_mtime or expected_sha when a concurrent writer may intervene. Prefer configured run_task slots over raw build/test/lint commands.
  • Trust live descriptions. Tool behaviour and schemas come from tools/list; session_start supplies client-specific guidance. This brief is orientation, not a second tool reference.
  • Avoid version drift. Read VERSION and CHANGELOG.md for the current version.

Purpose and invariants

Plumb gives coding agents an IDE intelligence layer over MCP: LSP semantics, a tree-sitter topology index, project memory, and a complete safe-filesystem toolkit. plumb serve is a resilient stdio proxy in front of a shared daemon.

  1. LSP-correct semantics. Writes notify language servers through workspace/didChangeWatchedFiles; capabilities are negotiated, including server-initiated registration.
  2. Concurrency-safe durability. Write tools use per-path locks, optimistic checks, atomic rename, and the shared durable-write path.
  3. Per-session isolation. Read tracking, rate limits, and caches belong to a connection or declared agent, never accidental process globals.
  4. Configurable safety. Compiled defaults, global config, project config, and environment overrides resolve with explicit provenance.

Architecture

Lower layers never import higher ones. internal/arch assigns every first-party package and tests reject violations, missing assignments, and stale entries.

Foundation (paths, durable writes, tokenisation, redaction, colour data)
→ Transport (MCP/LSP) → Domain (symbols, edits, capabilities)
                    → Intelligence (topology)
                    → Application (composite tools, caching, rate-limiting)
                    → Presentation (TUI, CLI)

The package map, daemon/persistence layout, extractor choices, and concurrency model live in docs/architecture.md. Hard seams worth keeping in context:

  • internal/quality is foundation; internal/mcp and internal/lsp are transport; internal/cache is domain; internal/topology is intelligence; internal/tools is application; internal/cli and internal/tui are presentation. internal/arch/layers.go holds the full list — read it rather than guessing, because its tests reject a wrong, missing, or stale entry.
  • internal/lsp/adapters/base.Adapter exports exactly lsp.Client. Put escape hatches in package functions, not methods, or every embedded adapter gains a false capability.
  • Every durable write goes through internal/fsync.AtomicWrite; every SQLite DSN goes through internal/sqlitex.
  • internal/langsupport is the source of truth for each language's structural engine and LSP adapter.

Reference map

  • Architecture, package map, daemon, workspace detection, persistence: docs/architecture.md.
  • Config precedence, every section, reload tiers, trust: docs/configuration.md.
  • Tool inputs and behaviour: each MCP description, then docs/tools.md.
  • Setup, hooks, skills, doctor, session/mail CLI: docs/cli-reference.md.
  • Build, style, testing, commits, and TUI rules: docs/contributing.md.
  • Adapter validation and implementation: docs/adding-an-lsp.md.

Configuration and clients

Resolution is compiled defaults → global config → project .plumb/config.toml → environment; use plumb config show for values and provenance. The lean profile hides the non-lean remainder (37 tools today, out of 58) only for clients with verified deferred discovery; hidden tools remain callable by name.

plumb setup <client> registers MCP configuration. plumb skills sync installs eight idempotent user-scoped skills for clients that read SKILL.md: plumb-explore, plumb-refactor, plumb-testing, plumb-minimal-change, plumb-memory, plumb-diagnose, plumb-git, and plumb-chat. Lifecycle hooks are separate and opt-in through plumb hooks install [client].

Contributor recipes live in .claude/skills/: use add-mcp-tool for a new tool and add-lsp-adapter for a new language server.

Available tools (58)

Full schemas live in tools/list and docs/tools.md. Use the smallest semantic lane that answers the question: workspace_search → topology/LSP → exact search_in_files → bounded read_file. Prefer semantic edits for symbols, Plumb filesystem writes for text, the policy-gated git tool for repositories, and topology_affected plus run_task for verification.

Code style rules

  • Use Australian English in prose, comments, logs, and errors; external protocol and library identifiers keep canonical spelling.
  • Format through golangci-lint run --fix ./..., never a standalone gofumpt; install the pinned hooks after cloning.
  • Use log/slog; wrap errors with context; put context.Context first on blocking/I/O calls; document each type's concurrency contract.
  • Do real wiring in constructors, not init(). Add no globals beyond the documented TUI styles and intentional tool locks.
  • Comments explain non-obvious why. Keep production files near 600 lines, tests near 900, and first-party non-test functions at cyclomatic complexity 15 or below.
  • Every //nolint needs an inline reason. Re-review deliberately rejected linters before enabling one.

Detailed rules and exceptions live in docs/contributing.md; TUI code uses Bubble Tea/Lip Gloss/Bubbles v2 only.

Testing requirements

  • Keep tests beside code and table-driven where appropriate. internal/lsp, internal/cache, and internal/tools require meaningful coverage; write-tool tests use WriteDeps{} and session-isolation tests stay with the package they protect.
  • Internal tool-to-tool Execute calls use canonical parameter names because aliases resolve only at the MCP dispatch boundary.
  • Gate tests needing external binaries with //go:build integration; do not chase TUI coverage.
  • Use topology_affected during the edit loop. Before delivery run make verify-full; run make lint-cross after platform-constrained or linter-config changes. make cover and make vuln remain separate CI/on-demand gates.
  • make test puts t.TempDir() under repository .testcache; tests must not assume a system-temp ancestry.

Delivery and risk

  • make install-hooks is required after cloning; make verify-full (verify + the integration suite) defines ready to commit. make help and docs/contributing.md own the full command matrix.
  • Version resolution is exact tag → VERSION → short commit. After rebuilding, run plumb restart; source changes do not activate in an old daemon.
  • Use conventional commit types (feat, fix, refactor, test, docs, ci, chore). Keep changes bisectable and add a CHANGELOG.md entry for each discrete change.
  • Treat concurrency, the rate limiter, read tracking, and the stats schema as high-risk invariants; inspect their tests and architecture before editing.
  • Keep this file as rules plus pointers. make check-brief enforces its line and byte budgets.

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.