agentleFS
RSafargalinRSafargalin/sextant/AGENTS.md

sextant

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

Operational notes for anyone (human or agent) editing this repository. What the tool is belongs in README.md; the iteration history and the reasoning behind decisions belong in docs/. This file is only what you need in order to change the code without breaking something invisible. make lint runs sextant on its own sources with sextant-rules.json. The tool is dogfooded: if a change makes lint noisy on this repository, that is a finding about the change. Every change goes through a…

  • Commits and pushes
  • 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 33,398 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 repositoryOne other file it gives its agents.

The file

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

2 rules. About 0 are common, 2 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Every change goes through a branch and a pull request — maintainer changes included.

    line 21
  2. Distinctive:

    No references to ADRs, issues, or discussions in code comments.

    line 86

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 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.md — working on sextant

Operational notes for anyone (human or agent) editing this repository. What the tool is belongs in README.md; the iteration history and the reasoning behind decisions belong in docs/. This file is only what you need in order to change the code without breaking something invisible.

Build and verify

swift build && swift test          # 330 tests
make ci                            # build + test + self-lint — run this before committing
swift test --filter "<suite name>" # one suite

make lint runs sextant on its own sources with sextant-rules.json. The tool is dogfooded: if a change makes lint noisy on this repository, that is a finding about the change.

How a change lands

Every change goes through a branch and a pull request — maintainer changes included. main is protected: it takes no direct pushes, and a pull request merges only once CI is green on it.

git switch -c fix/what-it-fixes
# … work, `make ci` …
git push -u origin HEAD && gh pr create

The rule is written here because it was broken here. Five commits were pushed straight to main in one session, the last of them a change across twenty-one files, on the strength of a "commit straight to main" that had been said once about a one-line release chore. Nothing broke, and that is not the point: a green local make ci is a predictor, while CI on a pull request is a gate, and a twenty-one-file change with no reviewable unit is not reviewable in principle.

The protection is what makes this a rule rather than a resolution. It applies to administrators too — otherwise it would guard against everyone except the account that actually pushes here. An emergency turns it off in the repository settings, deliberately and visibly, which is the whole difference from bypassing it by habit.

Layout

  • Sources/SextantCore — all logic, testable. Anything worth a test lives here.
  • Sources/sextant — thin executable: argument dispatch, rendering, process exit. Keep it thin; the reason the codebase was refactored once already is that 1257 lines of main.swift were untestable.
  • Tests/SextantCoreTests — behavioural tests, plus a fixture package under Tests/Fixtures/IndexFixture used to exercise a real IndexStoreDB.
  • plugins/sextant — the Claude Code plugin: the MCP registration, a skill and a command. It ships no code of its own beyond two launcher scripts, registers no hooks (a hook that writes from the moment it is installed is the user's decision, not an install's), and it must not restate the MCP tool list — MCPTools.definitions() is that list, and the skill describes when to ask rather than what exists. .claude-plugin/marketplace.json at the root is what serves it.

The stability contract

These are public surface under semver. Renaming one is a breaking change, not a cleanup:

  • CLI command names and flags
  • --json output schemas
  • MCP tool names and their input schemas
  • exit codes (currently 0 success, 2 usage error)

Single sources of truth — do not add a second one

This codebase has been bitten by duplicated truth twice; both times it produced a silently wrong answer rather than a crash.

  • CommandCatalog generates help text, per-command help, and flag validation. Never write help text or a flag list anywhere else.
  • MCPTools.definitions() is the only declaration of the MCP surface; instructions are generated from it. Adding a tool is one edit — and the dispatcher test fails if you forget the handler. Do not hand-maintain a parallel list.
  • IndexFreshness is the only place that decides whether an index is fresh, and the only place that reads a store's timestamp. It reads the mtime of <store>/v*/units, because a build rewrites unit files without touching the store directory. Selecting or judging a store by directory mtime is the specific bug that made semantic queries go blind; if you need a freshness signal, call this layer.

Code conventions

  • Names in English, following the Apple API Design Guidelines. No *Manager / *Service suffixes. A file is named after its principal type.
  • Comments describe behaviour, not decisions. /// Loads data on first appearance. is a comment; // we use a struct here because… is not — that belongs in an ADR.
  • No references to ADRs, issues, or discussions in code comments.
  • Comments, CLI help, MCP tool descriptions and error messages are English. Docs written for people are bilingual (*.ru.md alongside the canonical English); docs/adr/ stays Russian as a historical record. See CONTRIBUTING for the full rule.

Evidence discipline

Claims in this project carry a confidence level, and the docs use them explicitly (Gate (L3), verified L4):

Meaning
L1asserted — opinion or memory, no source
L2documented — a source exists
L3verified in code — cited as file:line
L4verified against reality — an actual run or experiment
L5guarded by automation — a gate, an assert, a test

The rule that matters when you report on your own work: never present an unverified claim as a fact. If you did not run it, say so. Anything user-facing that is high-risk needs L3 or better. This is not ceremony — the tool's entire value proposition is that it does not return confident wrong answers, and a contributor who reports the same way is part of that.

Things that will bite you

  • sextant index executes the target project's build — its Package.swift, its SwiftPM plugins, its Xcode run-script phases. Never point it at a repository you do not trust. The MCP server deliberately refuses to trigger builds; keep it that way.
  • Semantic commands need a built index store. A test that queries semantics without one will pass vacuously. The integration fixture exists so this does not happen silently.
  • Do not add a fourth patch for index staleness. Four separate mechanisms existed once; they were replaced by one layer. A new special case is a signal that the layer is wrong, not that a patch is missing.
  • Benchmarks must stay reproducible on public repositories — see docs/benchmarks.md. A number that cannot be re-measured by a reader is not evidence.

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.