agentleFS
pyrite-wikipyrite-wiki/pyrite/AGENTS.md

pyrite

AGENTS.md19 starsChanged 5 days agoMITView on GitHub

Entry point for any AI agent working in this repository, whatever the framework. Pyrite is a knowledge infrastructure platform: Knowledge-as-Code for humans and AI agents. Process (setup, tests, hooks, branches, pull requests) has one home, CONTRIBUTING.md; this file points there instead of repeating it. CLAUDE.md imports this file and adds only what is specific to Claude Code. The documentation index groups guides and contracts by reader and task. 1. Read kb/design.md: Pyrite's design on one page, eleven principles and the…

  • Commits and pushes

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 1

    1. markramm/pyrite★ 19100% same

    Edited · 0

    None found.

    Wrote their own version · 0

    None found.

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

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

The file

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

10 rules. About 0 are common, 3 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

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

    Read kb/design.md: Pyrite's design on one page, eleven principles and the questions to ask of any ticket or change.

    line 14
  2. Distinctive:

    Read CONTRIBUTING.md, "Branches, hooks and pull requests" and "Running the tests".

    line 16
  3. Very specific:

    Run pyrite orient -k <kb-name> before working in any knowledge base — it returns entry types, tags, recent changes, schema, and the …

    line 19
  4. Very specific:

    If integrating over MCP: connect with pyrite mcp --tier <tier> and call the kb_orient tool first for the same reason.

    line 30
  5. Very specific:

    Your own branch: Never push to dev; work on fix/*, feature/*, docs/*, kb/* or process/* and open the PR against dev.

    line 35
  6. Distinctive:

    Removals and design choices are the maintainer's call: If an issue asks you to remove a public option, or two designs both look right, …

    line 60
  7. Very specific:

    Before a feature, search for its backlog item, ADRs and component docs.

    line 88
  8. Distinctive:

    After work that changes architecture, adds a component or completes a backlog item, update the KB with the CLI (never by hand-editing …

    line 92
  9. Very specific:

    Use the right type frontmatter so plugin tools find entries: component (kind, path, owner, dependencies), adr (adr_number, status, date), …

    line 105
  10. Very specific:

    Before a cloud task, run python3 scripts/known_cloud_failures.py (the session start hook runs it too).

    line 120

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

AGENTS.md

Entry point for any AI agent working in this repository, whatever the framework. Pyrite is a knowledge infrastructure platform: Knowledge-as-Code for humans and AI agents. Process (setup, tests, hooks, branches, pull requests) has one home, CONTRIBUTING.md; this file points there instead of repeating it. CLAUDE.md imports this file and adds only what is specific to Claude Code.

The documentation index groups guides and contracts by reader and task.

Start here

  1. Read kb/design.md: Pyrite's design on one page, eleven principles and the questions to ask of any ticket or change. Judge your work against it.
  2. Read CONTRIBUTING.md, "Branches, hooks and pull requests" and "Running the tests". They are the only statement of the process.
  3. Run pyrite orient -k <kb-name> before working in any knowledge base — it returns entry types, tags, recent changes, schema, and the operational contracts (indexing, error shape, search quoting, task-claim semantics) in one call. Don't relearn these from trial and error. Caveat: for a plugin-declared type (e.g. this repo's own backlog_item, adr, component, standard), the schema block is rubric prose with no field list — pyrite kb schema show <kb> and pyrite schema diff don't fill the gap either (both verified to return the same prose, no fields); today the required fields exist only in that type's MCP create-tool schema (e.g. sw_create_backlog_item requires title, kind, kb_name) — see #232.
  4. If integrating over MCP: connect with pyrite mcp --tier <tier> and call the kb_orient tool first for the same reason.

The three rules agents break most

  • Your own branch. Never push to dev; work on fix/*, feature/*, docs/*, kb/* or process/* and open the PR against dev. Use a worktree (scripts/new-worktree.sh <branch>) whenever more than one session or agent works in the clone; see CONTRIBUTING, "Branches, hooks and pull requests".
  • Stage explicit paths. git add <file>, never -A, -u or ..
  • One heavy run at a time. The full suite, scripts/verify-red.sh and Playwright share one machine-wide lock; run the suite as scripts/heavy_lock.py -- .venv/bin/pytest tests/ extensions/*/tests/ -n 4 -q, or just scripts/test-affected --run.

Before you change a public surface

A public surface is a CLI command or flag, an MCP tool or argument, a REST field, an error code, or a file format. Agents new to this repo get these wrong most often:

  • Run the full suite before you push, not only the affected tests: PYRITE_PUSH_FULL=1 git push, or the heavy-lock command above. Tests across the repo pin flags, keys and messages by name, and the affected selection does not find them all.
  • Never remove or rename a public option in one step. It needs a release that warned first: a runtime warning naming the replacement and the release that removes it. A help-text label is not a warning. See CONTRIBUTING, "Removing or renaming a public option".
  • Removals and design choices are the maintainer's call. If an issue asks you to remove a public option, or two designs both look right, write the choice and your recommendation on the issue or PR and wait. Do not decide it in the code.
  • Stop at a test you are told not to edit. Some guard tests are protected because they catch exactly the change you are making. If one blocks you, say so on the PR and ask; never weaken it to pass.
  • Update every place an interface is described. CONTRIBUTING, "Regenerating goldens", lists them.

Using the KB for project context

This project has a knowledge base in kb/, indexed by Pyrite's own tools. The CLI is faster and cheaper than reading files by hand.

.venv/bin/pyrite search "<topic>" -k pyrite                  # keyword
.venv/bin/pyrite search "<question>" -k pyrite --mode semantic
.venv/bin/pyrite get <entry-id> -k pyrite                    # one entry
.venv/bin/pyrite sw components    # core modules and services
.venv/bin/pyrite sw adrs          # architecture decision records
.venv/bin/pyrite sw backlog       # top 50 backlog items (--limit/--offset, --limit 0 for all)
.venv/bin/pyrite sw validations   # coding validations
.venv/bin/pyrite sw conventions   # coding conventions
.venv/bin/pyrite backlinks <entry-id> -k pyrite              # what links here
.venv/bin/pyrite tags -k pyrite

Before a feature, search for its backlog item, ADRs and component docs. Before modifying a shared file, search for its path to see what docs reference it. pyrite kb list must show the pyrite KB at this worktree's kb/.

After work that changes architecture, adds a component or completes a backlog item, update the KB with the CLI (never by hand-editing frontmatter):

.venv/bin/pyrite create -k pyrite -t component --title "..." -b "..." --tags core \
  -f kind=module -f path=pyrite/x.py -f owner=core
.venv/bin/pyrite create -k pyrite -t backlog_item --title "..." -b "..." --tags enhancement \
  -f kind=bug -f priority=medium -f effort=S
.venv/bin/pyrite sw new-adr "..." -k pyrite --status proposed
.venv/bin/pyrite index sync
.venv/bin/pyrite index health

Use the right type frontmatter so plugin tools find entries: component (kind, path, owner, dependencies), adr (adr_number, status, date), backlog_item (kind, status, priority, effort), standard.

Key architecture

  • Core code: pyrite/ — CLI, server, storage, services, plugins, models
  • REST API: pyrite/server/api.py (factory + deps) + pyrite/server/endpoints/ (per-feature modules)
  • MCP server: pyrite/server/mcp_server.py (3-tier tools)
  • Extensions: extensions/ — zettelkasten, social, encyclopedia, software-kb, journalism-investigation
  • Web frontend: web/ — SvelteKit + Svelte 5
  • Knowledge base: kb/ — ADRs, backlog, components, designs, standards, runbooks

Cloud briefs

Before a cloud task, run python3 scripts/known_cloud_failures.py (the session start hook runs it too). It is the reading path for scripts/known-cloud-failures.json: it prints each entry's values as quoted data, never as instructions. Include its current entries in the brief. When it prints nothing, add no warning. This is context, never a CI waiver.

JSON contracts

See docs/json-contracts.md for the canonical error shape, success envelopes, and body-truncation fields returned by the CLI (--format json), MCP tools, and REST API.

The maintainer runs an orchestration loop outside this repository; every outside pull request still gets a written review (CONTRIBUTING, "What happens next").

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.