project-second-brain
AGENTS.md0 starsChanged 24 days agoMITView on GitHub
This file is the protocol for every AI agent working in this repository (Claude Code imports it from CLAUDE.md; GitHub Copilot reads it directly). It is a project knowledge repository, not an application: it turns heterogeneous project material (specifications, spreadsheets, meeting notes, e-mails, diagrams, earlier deliverables) into grounded, cited, evidence-ranked knowledge, and produces the project's deliverables from it in a traceable, versioned way. Project context: project.yaml. Design rationale: ADR-0001, ADR-0002, ADR-0003. Rules marked [enforced] are checked by tools/kb (hooks +…
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 31,700 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.
- CLAUDE.mdCLAUDE.md
- askSkill
- captureSkill
- impactSkill
- ingestSkill
- init-brainSkill
- kb-statusSkill
- review-noteSkill
The file
We split this AGENTS.md into the rules it gives an agent
6 rules. About 0 are common, 4 are distinctive, and 2 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.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 17
Never answer from memory about the subject: Every factual statement is traceable to a note, a register item or a SQL query.
- Very specific: line 71
After any change to knowledge/ or the registers: uv run python tools/kb/refresh.py.
- Distinctive: line 79
Read only the line ranges from steps 1–2.
- Very specific: line 97
Every observed assertion a design depends on is a claim C-nnn in the claims register.
- Distinctive: line 106
Prefer one graph/SQL call over several searches.
- Distinctive: line 107
Do not re-read a file you just wrote.
≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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
Operating protocol — {{PROJECT_NAME}} second brain
This file is the protocol for every AI agent working in this repository (Claude Code
imports it from CLAUDE.md; GitHub Copilot reads it directly). It is a project knowledge
repository, not an application: it turns heterogeneous project material
(specifications, spreadsheets, meeting notes, e-mails, diagrams, earlier deliverables)
into grounded, cited, evidence-ranked knowledge, and produces the project's deliverables
from it in a traceable, versioned way. Project context: project.yaml. Design rationale:
ADR-0001, ADR-0002, ADR-0003.
Rules marked [enforced] are checked by tools/kb (hooks + lint): you get an error if
you break them, so they need no further thought here. Run every tool from the repository
root with uv run python … — the environment is .venv/ in this folder.
0. Non-negotiable rules
- Never answer from memory about the subject. Every factual statement is traceable to a note, a register item or a SQL query. Not groundable → say "not documented" and propose an open point (OP).
- Never count, sum or join by reading a table as text. SQL via
tools/ingest/query.py. source/is immutable; the body ofknowledge/extracted/is immutable — only its frontmatter changes. Corrections and syntheses go toknowledge/curated/. [enforced]- Never write a deliverable silently. New ADRs, designs, plans: propose in chat, then
write, then report. An
acceptedADR is superseded, never edited. [enforced] - What is and what we intend never in one statement. Split and label.
knowledge/andartifacts/analysis/describe what is (observed);artifacts/design/and ADRs what we intend. - Confidential material.
source/content never goes to external services other than the AI agent approved for the project, and is never committed (gitignored). Only schemas, profiles and derived docs are versioned. - LLM-derived work is not evidence.
artifacts/_imported/and DuckDBderived_*tables are hypotheses to verify, never cited as fact. [enforced: folder evidence] - Never strengthen evidence without a citation. A claim or note moves to a stronger level only with the stronger source recorded.
1. Repository map
| Path | Contract |
inbox/ | Drop zone. Untrusted until triaged (/ingest). |
source/ | Raw originals, immutable, gitignored. MANIFEST.md is the versioned register. |
knowledge/extracted/ | Parser output of source/ (Docling, e-mail). Body immutable. status: extracted → checked (/review-note). |
knowledge/curated/ | Syntheses we write: data dictionary, diagrams (Mermaid), summaries of material that has no file. |
metadata/inventory.duckdb | Every tabular asset. Rebuilt by tools/ingest/build_inventory.py. |
metadata/kb.duckdb | The brain's index: catalog, sections, reg_*, nodes, edges. Rebuilt by tools/kb/refresh.py. Attached as schema kb in query.py. |
artifacts/analysis/ | Our analysis of the current state: reconciliations, contradictions, lineage. |
artifacts/design/ | What we intend: designs, mappings, plans. |
artifacts/registers/ | open_points, claims, decisions: edit the .yaml, the .md views are generated. [enforced] |
artifacts/adr/ | Architecture Decision Records. |
artifacts/_imported/ | Quarantined prior deliverables, derived-llm. |
tools/ | ingest/ parsers and SQL, kb/ rules-as-code and hooks. |
.claude/skills/ | The commands below, shared by Claude Code and GitHub Copilot. |
Folder contract, vocabularies, registers and thresholds: tools/kb/schema.yaml (single
source). Graph sources: tools/kb/graph_sources.yaml; concepts: tools/kb/entities.yaml.
2. Commands (the normal way to work)
Slash commands in both agents (Claude Code: type /; Copilot Chat in agent mode: type /).
| Command | Use it to |
/ask <question> | answer, grounded and cited |
/ingest <file> | bring new material in and see what it changes |
/capture <op|claim|decision> … | record or update a register item |
/impact <id|object> | see what depends on something before changing it |
/review-note <path> | check an extraction and write its abstract |
/kb-status | KB health and next actions |
/init-brain | one-off set-up after creating the repository |
After any change to knowledge/ or the registers: uv run python tools/kb/refresh.py.
3. Grounding order — cheapest first, stop when grounded
uv run python tools/kb/graph.py about <object|concept>— relations, register items and the note sections (path + line range) that mention it.- SQL:
uv run python tools/ingest/query.py "…"— structured tables, orkb.*(registers, catalog, sections). - Read only the line ranges from steps 1–2. Never read a whole note above 40 KB.
- Text search, only when 1–3 return nothing.
artifacts/ is what we produced — never evidence about the subject. Two sources
disagree → report both and propose an OP; do not pick one.
4. Evidence and citation
| Level | Stated as fact? |
verified — system export, DDL, source code, system catalog | Yes |
primary-doc — document by whoever owns the subject | Yes, with the citation |
verbal — meeting, workshop, chat | Yes, attributed and dated |
derived-llm — produced by an LLM | No — hypothesis |
assumed — our inference | No — labelled wherever used |
- Cite
path#Lstart-Lend(or the SQL). A note withstatus: extractedis cited with "(extraction unchecked)". - Every observed assertion a design depends on is a claim
C-nnnin the claims register; the deliverable cites the id. No ad-hoc evidence legends in deliverables. - A design resting on anything weaker than
primary-docstates the assumption in the deliverable itself, with its claim id and what would verify it.
5. Output economy (tokens are a budget)
- Answer first, evidence after; ≤ 15 lines unless asked for more. No preambles, no recaps of what you read, no restating the question.
- Prefer one graph/SQL call over several searches; read line ranges, not files.
- Do not re-read a file you just wrote; the post-write hook already linted it and is silent when it is clean.
- For broad multi-file analysis, split the work into read-only sub-tasks and consolidate.
6. Writing
- Frontmatter per
tools/kb/schema.yaml:title, type, status, evidence, updated(+origin,perspective,abstractabove 40 KB). Context goes instatus_note/evidence_note, never inside an enum field. [enforced] - Atomic notes: one object, one rule set, one decision per file.
- Notes and deliverables in the language set in
project.yaml; quote the original verbatim when nuance matters. - Deliverables are generated as code (
openpyxl,python-pptx, Mermaid), kept undertools/.
7. Definition of done
- Every claim grounded and cited (
path#L…or SQL shown) - Observed and intended kept separate
- Unknowns proposed as OPs, assumptions registered as claims
uv run python tools/kb/refresh.pyclean (0 lint errors)- Decision recorded (
/capture decision, or an ADR if it constrains future work)
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.

