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
- pyrite-wiki/pyriteword for word, first seen Nov 27, 2026
Other versions1 project uses a version of this.
Word for word · 1
- pyrite-wiki/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.
- CLAUDE.mdCLAUDE.md
- extension-builderSkill
- kb-lifecycleSkill
- kbSkill
- pyrite-devSkill
- software-kbSkill
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
- Very specific: line 14
Read kb/design.md: Pyrite's design on one page, eleven principles and the questions to ask of any ticket or change.
- Distinctive: line 16
Read CONTRIBUTING.md, "Branches, hooks and pull requests" and "Running the tests".
- Very specific: line 19
Run pyrite orient -k <kb-name> before working in any knowledge base — it returns entry types, tags, recent changes, schema, and the …
- Very specific: line 30
If integrating over MCP: connect with pyrite mcp --tier <tier> and call the kb_orient tool first for the same reason.
- Very specific: line 35
Your own branch: Never push to dev; work on fix/*, feature/*, docs/*, kb/* or process/* and open the PR against dev.
- Distinctive: line 60
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, …
- Very specific: line 88
Before a feature, search for its backlog item, ADRs and component docs.
- Distinctive: line 92
After work that changes architecture, adds a component or completes a backlog item, update the KB with the CLI (never by hand-editing …
- Very specific: line 105
Use the right type frontmatter so plugin tools find entries: component (kind, path, owner, dependencies), adr (adr_number, status, date), …
- Very specific: line 120
Before a cloud task, run python3 scripts/known_cloud_failures.py (the session start hook runs it too).
≈ “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.
Files
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
- 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. - Read CONTRIBUTING.md, "Branches, hooks and pull requests" and "Running the tests". They are the only statement of the process.
- 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 ownbacklog_item,adr,component,standard), the schema block is rubric prose with no field list —pyrite kb schema show <kb>andpyrite schema diffdon'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_itemrequirestitle,kind,kb_name) — see #232. - If integrating over MCP: connect with
pyrite mcp --tier <tier>and call thekb_orienttool first for the same reason.
The three rules agents break most
- Your own branch. Never push to
dev; work onfix/*,feature/*,docs/*,kb/*orprocess/*and open the PR againstdev. 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,-uor.. - One heavy run at a time. The full suite,
scripts/verify-red.shand Playwright share one machine-wide lock; run the suite asscripts/heavy_lock.py -- .venv/bin/pytest tests/ extensions/*/tests/ -n 4 -q, or justscripts/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 pyriteBefore 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 healthUse 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").
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
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.

