agentleFS
PratiyushPratiyush/llm-wiki/AGENTS.md

llm-wiki

AGENTS.md383 starsChanged 5 months agoMITView on GitHub

This file is the schema for Codex CLI and any other coding agent that reads AGENTS.md instead of CLAUDE.md (OpenCode, Gemini CLI, etc.). The workflows are identical to CLAUDE.md — only the language is agent-agnostic. Different agents write their transcripts to different locations. The adapter registry in llmwiki/adapters/ abstracts this away. The CLI auto-detects which adapter(s) to run. Override with --adapter <name>. Run from inside the repo: Or use the one-click scripts: ./sync.sh, ./build.sh, ./serve.sh (macOS/Linux); sync.bat, build.bat, serve.bat (Windows).

  • 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,439 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 repository7 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

13 rules. About 0 are common, 3 are distinctive, and 10 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.

  • 10

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Run from inside the repo:

    line 44
  2. Very specific:

    Read the source file(s) under raw/.

    line 59
  3. Very specific:

    Read wiki/index.md and wiki/overview.md for current wiki context.

    line 60
  4. Very specific:

    Update wiki/index.md — add the new source under ## Sources.

    line 62
  5. Very specific:

    Update wiki/overview.md if the source adds substantial new information.

    line 63
  6. Very specific:

    Create/update wiki/entities/<Name>.md for any people, companies, projects, tools, or libraries mentioned.

    line 64
  7. Very specific:

    Create/update wiki/concepts/<Name>.md for any ideas or patterns discussed.

    line 65
  8. Very specific:

    Read wiki/index.md and wiki/overview.md.

    line 74
  9. Distinctive:

    Read the pages most relevant to the question.

    line 75
  10. Very specific:

    If the answer is substantial, ask if it should be saved to wiki/syntheses/<slug>.md.

    line 77
  11. Very specific:

    Every entity page should declare entity_type in frontmatter:

    line 198
  12. Distinctive:

    No silent overwrites. Record contradictions, don't hide them.

    line 210
  13. Very specific:

    Do not ingest raw .jsonl files directly — only ingest the markdown under raw/.

    line 213

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

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

llmwiki — Codex CLI / Agent Schema

This file is the schema for Codex CLI and any other coding agent that reads AGENTS.md instead of CLAUDE.md (OpenCode, Gemini CLI, etc.). The workflows are identical to CLAUDE.md — only the language is agent-agnostic.

Three layers

raw/           IMMUTABLE. Session transcripts converted from the agent's session store.
               Never modify files here.

wiki/          LLM-maintained. Pages you write that summarise and cross-reference raw/.
  index.md         Catalog of every page. Update on every ingest.
  log.md           Append-only chronological record (auto-archives at 50KB).
  overview.md      Living synthesis.
  hints.md         Writing conventions and entity naming rules (load on demand).
  hot.md           Last 10 session summaries — global hot cache.
  hot/<project>.md Per-project hot caches (default ON, configurable).
  MEMORY.md        Cross-session facts (200-line cap, auto-consolidated).
  SOUL.md          Wiki identity and writing voice.
  CRITICAL_FACTS.md Must-know facts (<120 tokens).
  sources/         One page per raw source.
  entities/        People, companies, projects, products.
  concepts/        Ideas, frameworks, methods.
  syntheses/       Saved query answers.

site/          GENERATED. Static HTML from `python3 -m llmwiki build`. Do not edit.

Session stores by agent

Different agents write their transcripts to different locations. The adapter registry in llmwiki/adapters/ abstracts this away.

AgentSession storeAdapter
Claude Code~/.claude/projects/<project>/<uuid>.jsonlclaude_code.py
Codex CLI~/.codex/sessions/codex_cli.py (stub in v0.1)
Gemini CLI~/.gemini/ (TBD)gemini_cli.py (planned)
OpenCode~/.opencode/ (TBD)opencode.py (planned)

The CLI auto-detects which adapter(s) to run. Override with --adapter <name>.

Commands

Run from inside the repo:

python3 -m llmwiki sync           # convert new .jsonl → raw/sessions/*.md
python3 -m llmwiki build          # compile site/ from raw/ + wiki/
python3 -m llmwiki serve          # local HTTP server on 127.0.0.1:8765
python3 -m llmwiki init           # scaffold raw/, wiki/, site/ directories

Or use the one-click scripts: ./sync.sh, ./build.sh, ./serve.sh (macOS/Linux); sync.bat, build.bat, serve.bat (Windows).

Ingest Workflow

Triggered when the user says "ingest this", "sync the wiki", or runs /wiki-sync:

  1. Read the source file(s) under raw/.
  2. Read wiki/index.md and wiki/overview.md for current wiki context.
  3. For each source, write wiki/sources/<slug>.md using the Source Page Format below.
  4. Update wiki/index.md — add the new source under ## Sources.
  5. Update wiki/overview.md if the source adds substantial new information.
  6. Create/update wiki/entities/<Name>.md for any people, companies, projects, tools, or libraries mentioned.
  7. Create/update wiki/concepts/<Name>.md for any ideas or patterns discussed.
  8. Cross-link everything with [[wikilinks]] under ## Connections.
  9. Flag contradictions under ## Contradictions — keep both claims visible.
  10. Append to wiki/log.md: ## [YYYY-MM-DD] ingest | <title>

Query Workflow

Triggered by /wiki-query <question>:

  1. Read wiki/index.md and wiki/overview.md.
  2. Read the pages most relevant to the question.
  3. Synthesise an answer with [[wikilink]] citations.
  4. If the answer is substantial, ask if it should be saved to wiki/syntheses/<slug>.md.
  5. Append to wiki/log.md: ## [YYYY-MM-DD] query | <question>.

Lint Workflow

Triggered by /wiki-lint:

Check for:

  • Orphans — pages with no inbound [[links]].
  • Broken wikilinks — pointing to non-existent pages.
  • Contradictions — conflicting claims across pages.
  • Stale pages — last_updated older than the most recent contributing source.
  • Missing entity pages — entities mentioned in 3+ sources but no dedicated page.
  • Data gaps — questions the wiki can't answer.

Output a report. Offer to save it to wiki/lint-report.md.

Page formats

Source page (wiki/sources/<slug>.md)

---
title: "Source Title"
type: source
tags: []
date: YYYY-MM-DD
source_file: raw/sessions/<project>/<file>.md
project: <project-slug>
---

## Summary
2–4 sentences.

## Key Claims
- Claim 1
- Claim 2

## Key Quotes
> "Quote" — context

## Connections
- [[Entity]] — how they relate
- [[Concept]] — how it connects

Entity / Concept page

---
title: "Name"
type: entity   # or: concept
tags: []
sources: [slug-1, slug-2]
last_updated: YYYY-MM-DD
---

# Name

One paragraph.

## Key Facts
- Fact 1

## Sessions
- [[session-slug]] (YYYY-MM-DD) — what happened

## Connections
- [[Other]]

Index

# Wiki Index

## Overview
- [Overview](overview.md)

## Sources
- [Title](sources/slug.md) — one-line summary

## Entities
- [Name](entities/Name.md) — one-line description

## Concepts
- [Name](concepts/Name.md) — one-line description

## Syntheses
- [Title](syntheses/slug.md) — the question it answers

Log

## [YYYY-MM-DD] <operation> | <title>

<optional one-line notes>

Parse recent entries with: grep "^## \[" wiki/log.md | tail -10

Naming conventions

  • Source slugs: kebab-case
  • Entity / concept pages: TitleCase.md
  • Synthesis pages: kebab-case.md

Cross-project wiki access

Other projects can reference this wiki by adding to their agent config:

wiki_path: ~/Desktop/2026/production-draft/llm-wiki

Then read wiki/index.md first, navigate from there.

Entity types

Every entity page should declare entity_type in frontmatter:

person | org | tool | concept | api | library | project

Confidence & lifecycle

  • confidence: 0.85 — 4-factor score (source count, quality, recency, cross-refs)
  • lifecycle: draft — one of: draft, reviewed, verified, stale, archived

Hard rules

  1. raw/ is immutable. Never edit files there.
  2. No silent overwrites. Record contradictions, don't hide them.
  3. Cross-link everything — every page has a ## Connections section.
  4. Frontmatter is authoritative. Always populate title, type, tags, sources, last_updated, confidence, lifecycle, entity_type.
  5. Do not ingest raw .jsonl files directly — only ingest the markdown under raw/.

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.