agentleFS
eyupcanbodureyupcanbodur/agent-knowledge-hub/AGENTS.md

agent-knowledge-hub

AGENTS.md0 starsChanged 6 months agoMITView on GitHub

A personal, agent-maintained knowledge monorepo. Holds any number of knowledge hubs, each a set of dense, code-grounded notes that coding agents read (to prime on a topic) and write (to capture durable findings). This file is the umbrella charter: how hubs are organized and isolated. Each hub has its own AGENTS.md with that hub's domain context and note rules. Canonical vocabulary for the whole system is in CONTEXT.md. Use those terms: the monorepo (this repo) vs a sub-hub (a child…

  • 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,337 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 repository2 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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    If the user names a hub, use that.

    line 13
  2. Very specific:

    If the working directory is inside a hub (hubs/<name>/), use that hub.

    line 14
  3. Very specific:

    If there is only one hub in hubs/, use it as the default.

    line 15
  4. Distinctive:

    If there are multiple hubs and no clear signal, ask which hub before doing anything.

    line 16
  5. Distinctive:

    All content operations happen inside the active hub:

    line 20
  6. Very specific:

    Never write one hub's content into another hub's directory.

    line 26
  7. Distinctive:

    If asked to run something across all hubs (e.g.

    line 30
  8. Distinctive:

    Read the hub's AGENTS.md first.

    line 34
  9. Very specific:

    Read the hub's INDEX.md to find existing notes before creating a new one.

    line 35
  10. Distinctive:

    If two charters could claim it, the charters themselves should declare which wins (each charter carries its own scope test and …

    line 47
  11. Distinctive:

    Gather: Do the work. Capture provenance as you go (file:line, thread/ticket URLs, queries).

    line 76
  12. Very specific:

    Capture: When a finding clears the bar (30+ minutes, reusable, non-obvious), /store-to-hub.

    line 77
  13. Very specific:

    Read before writing. Check the hub's INDEX.md and related notes before creating a file.

    line 102
  14. Distinctive:

    Verify before asserting. A grep hit is a lead, not an answer.

    line 104
  15. Very specific:

    Every new or renamed note gets an INDEX.md entry in its hub.

    line 106
  16. Very specific:

    Never store sensitive data (see CONTEXT.md): cite the pointer, never the payload.

    line 107

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

agent-knowledge-hub

A personal, agent-maintained knowledge monorepo. Holds any number of knowledge hubs, each a set of dense, code-grounded notes that coding agents read (to prime on a topic) and write (to capture durable findings). This file is the umbrella charter: how hubs are organized and isolated. Each hub has its own AGENTS.md with that hub's domain context and note rules.

Canonical vocabulary for the whole system is in CONTEXT.md. Use those terms: the monorepo (this repo) vs a sub-hub (a child under hubs/), note vs work, never a bare "hub" for a specific referent.

Hub Isolation

Hubs are isolated from each other. Every operation (read, store, lint, query) targets a single hub at a time.

Determining the Active Hub

  1. If the user names a hub, use that.
  2. If the working directory is inside a hub (hubs/<name>/), use that hub.
  3. If there is only one hub in hubs/, use it as the default.
  4. If there are multiple hubs and no clear signal, ask which hub before doing anything.

Path Rules

All content operations happen inside the active hub:

  • Notes: hubs/<active>/*.md
  • Project research: hubs/<active>/works/<project>/
  • Hub index: hubs/<active>/INDEX.md
  • Hub charter: hubs/<active>/AGENTS.md

Never write one hub's content into another hub's directory. Cross-hub references use a relative path (../<other-hub>/<note>.md), never a bare filename.

Multi-Hub Operations

If asked to run something across all hubs (e.g. "lint all hubs"), run sequentially, one hub at a time, and present results grouped by hub.

Working in a Hub

  1. Read the hub's AGENTS.md first. It has the domain context, note voice, and rules for that specific hub.
  2. Read the hub's INDEX.md to find existing notes before creating a new one.
  3. The umbrella owns shared machinery: template/ (new-hub starter), scripts/hub (CLI), scripts/checks/ (bookkeeping checks). Hubs inherit these; they do not duplicate them.

Sub-hubs

The monorepo holds any number of sub-hubs; the set grows with the domains you work in. Each sub-hub's AGENTS.md charter declares its scope. This template ships one example sub-hub (hubs/example/); read it for the style, then clear it and create your own.

Routing (which sub-hub does a finding belong in)

Routing is charter-driven, not hardcoded:

  1. Match the finding against each sub-hub's charter (its scope declaration). File it in the hub whose charter claims it.
  2. If two charters could claim it, the charters themselves should declare which wins (each charter carries its own scope test and tie-breakers). Never split one topic across two hubs; one canonical note.
  3. If no charter fits, do not force it. Suggest creating a new sub-hub: propose a name and a one-line scope, then ./scripts/hub create <name>. A finding that has no home is a signal the hub set should grow. After creating a sub-hub, fill its charter's scope line and add it to the root INDEX.md (the sub-hub catalog).

store-to-hub implements exactly this: classify against charters, route, or propose a new sub-hub.

Notes vs works

Two kinds of content, two lifecycles:

  • A note is atomic, concept-oriented, and useful across projects. It lives at a sub-hub root and is findable via INDEX.md. (Evergreen-note style.)
  • A work (works/<slug>/) is a goal-bound project: a linear story across numbered files, plus status. Routed to a sub-hub by the same charter matching as notes.

When an investigation done inside a work is reusable beyond that project, promote it to a note (so it is findable) and link it from the work, rather than burying it in the project folder. The test: if future-you would search for it independent of the project, it is a note; otherwise it lives in the work. See CONTEXT.md.

Context sources (the full context layer)

This monorepo is one leg of a wider context layer. When working, pull from the right leg instead of re-deriving:

  1. Hubs (here): curated domain knowledge. Notes + works, retrieved via /load-context (INDEX then TL;DR then body; never bulk-load).
  2. Live sources (MCP, CLIs): external state that changes: telemetry, tickets, docs, chat. Authoritative for anything that changes outside this repo; a hub note caches a finding, the live source verifies it is still true.
  3. Harness capabilities: passive session memory (if you run one), skills, browser tools.

Rule of thumb: knowledge that compounds goes in a hub; state that changes stays behind live sources and gets cited, not copied wholesale.

Working in a session

A session runs in four phases:

  1. Prime. /load-context <topic> pulls existing hub notes (one-liners + TL;DRs).
  2. Gather. Do the work. Capture provenance as you go (file:line, thread/ticket URLs, queries). A note without cited sources is incomplete.
  3. Capture. When a finding clears the bar (30+ minutes, reusable, non-obvious), /store-to-hub. Offer this proactively after a substantive investigation.
  4. Maintain. /hub-lint periodically, and before trusting notes for important work. A weekly scheduled run of scripts/hub-maintenance.sh automates the deterministic half.

CLI

./scripts/hub list              # list all hubs with note counts
./scripts/hub create <name>     # scaffold a new hub from template/

Harness compatibility

This file (AGENTS.md) is the contract, and it is the open standard most coding agents read natively: Claude Code, Codex, Cursor, Copilot, Gemini CLI, Aider, and others (CLAUDE.md is a redirect). The skills (/load-context, /store-to-hub, /hub-lint) are Claude Code / Codex conveniences installed by ./install.sh; every operation underneath is harness-agnostic and any agent can run it directly:

node skills/load-context/bin/match.mjs "<topic>" --json    # retrieve
node skills/store-to-hub/bin/classify.mjs "<topic>" --json # classify + dedup
scripts/checks/hub-lint.sh hubs/<name>                       # health gate
scripts/checks/append-log.sh <hub> <op> <note> "<why>"       # log a write

Skills resolve the hub root from the HUB_ROOT env var (written by install.sh).

Rules

  1. Read before writing. Check the hub's INDEX.md and related notes before creating a file. Update an existing note instead of forking.
  2. Cite code, do not paraphrase. Include file paths with line ranges; quote the relevant lines.
  3. Verify before asserting. A grep hit is a lead, not an answer. Open the file before claiming anything.
  4. Dense, opinionated, code-grounded prose. No filler.
  5. Every new or renamed note gets an INDEX.md entry in its hub.
  6. Never store sensitive data (see CONTEXT.md): cite the pointer, never the payload.

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.