agent-wiki AGENTS.md

A project documentation standard and service for keeping one agent-readable AGENTS.md wiki per project. It includes rules, an indexer, a read-only web interface, and an API.

In plain words
What is it for?
Use it to define AGENTS.md files, build searchable project and topic indexes, validate documentation, and browse project links, backlinks, and raw documents.
Why use it?
It gives coding agents a consistent place to learn a project's purpose, architecture, deployment details, and known problems. Indexing and validation make those documents easier to search and check.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/psecor/agent-wiki/agents-md
Clone the repo
git clone --depth 1 https://github.com/psecor/agent-wiki

Made for: Codex, OpenCode.

Per session 4,087 This file is loaded in full into every session.
When invoked 4,087 The same file — it is already loaded in full.
Security scan B 1 finding. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.04087 $0.04087
Opus 5 $0.02044 $0.02044
Sonnet 5 $0.00817 $0.00817
Haiku 4.5 $0.00409 $0.00409

Measured 2d ago against content hash cb0b4b5215ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

agent-wiki AGENTS.md scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

**Production updates:** `git pull && (cd service && npm install && npm run build) && (cd ui && npm install && npm run build) && sudo systemctl restart agent-wiki`.
AGENTS.md · 254 lines

How it starts

The opening of the file, as written. The whole thing — 254 lines — stays where its author put it; the contents beside it link to each section on GitHub.

AGENTS.md — agent-wiki

What This Is

A documentation standard and supporting service for per-project agent-readable wikis. Each project in your workspace gets a single AGENTS.md describing intent, architecture, deployment, gotchas, and cross-project links. This repo defines the spec, hosts cross-cutting topics, and runs a small read-only browser/API.

Status

Spec + indexer + server + UI + sweeper. All pieces working:

  • Spec defined (spec/schema.md), template (spec/template.md), topics tier rules (spec/topics.md).
  • Indexer parses frontmatter + sections + links, validates, writes index/{projects,topics,backlinks,search,validation}.json. Also writes generated backlinks footers back into source AGENTS.md files (write_backlinks.ts).
  • Read-only HTTP API in service/src/server/ with Google OAuth (allowlist) + file-based sessions, mounted at PATH_PREFIX (default /wiki). JSON endpoints for projects, topics, search, validation, raw doc bodies.
  • React + Vite UI in ui/, served by the Express process from ui/dist/. Pages: Home, Project, Topic, Search, Validation, Login. Markdown rendered with react-markdown + remark-gfm; cross-doc links rewritten to in-app routes.
  • Sweeper service in service/src/sweeper/: gathers per-project git activity since last_updated, calls the Claude API (streaming, 32k max_tokens, string-aware brace-counter parser), applies section-level patches, updates frontmatter. CLI supports per-project runs, --all fan-out, and --dry-run.
  • Optional automation: a daily user-mode systemd timer (agent-wiki-sweeper.timer) runs sweeper --all && indexer build; a Claude Code Stop-hook (deploy/sweep-on-stop.sh) fires per-project sweeps async, debounced to 60 min/project.

Repository Layout

agent-wiki/
├── AGENTS.md                  this file (own dogfood)
├── README.md                  human-facing intro
├── LICENSE                    MIT
├── spec/
│   ├── schema.md              the AGENTS.md spec — sections, frontmatter, links
│   ├── template.md            starter file for new projects
│   ├── initial-AGENTS.md      minimal bootstrap doc for programmatic project init
│   └── topics.md              when to use a topic vs a project gotcha
├── topics/                    cross-cutting knowledge files (scaffolded; populate as needed)
├── index/                     generated by the indexer (gitignored)
│   ├── projects.json          per-project metadata, sections, links
│   ├── topics.json            per-topic metadata
│   ├── backlinks.json         reverse link graph
│   ├── search.json            flat per-section search entries
│   └── validation.json        spec-compliance issues
├── service/                   Node + TypeScript backend
│   ├── package.json
│   ├── tsconfig.json
│   ├── .env.example           copy to .env and fill in for deploy
│   └── src/
│       ├── indexer/           build index/*.json from AGENTS.md files
│       │   ├── cli.ts         CLI: build | validate
│       │   ├── build.ts       orchestration
│       │   ├── parse.ts       frontmatter, sections, links
│       │   ├── validate.ts    spec-compliance checks
│       │   ├── write_backlinks.ts  rewrite generated backlinks footers in source files
│       │   ├── types.ts       shared types + canonical section list
│       │   └── sources/       Source interface + filesystem impl
│       │       ├── types.ts   pluggable for future GitHub-backed source
│       │       └── fs.ts      walks PROJECTS_ROOT
│       ├── server/            Express + Passport (Google OAuth) + JSON API
│       │   ├── index.ts       app entry; mounts PATH_PREFIX, listens on PORT
│       │   ├── config.ts      env-driven config; required()/optional()
│       │   ├── auth.ts        Google OAuth + ALLOWED_EMAILS allowlist
│       │   ├── api.ts         JSON endpoints under /api
│       │   └── data.ts        reads index JSON + raw markdown (path-traversal safe)
│       └── sweeper/           per-project doc maintenance via Claude API
│           ├── cli.ts         CLI: run | dry-run; per-project or all
│           ├── run.ts         orchestrates one project's sweep
│           ├── gather.ts      git log + diffstat + changed files since last_updated
│           ├── prompt.ts      assembles the system + user prompt
│           ├── claude.ts      Claude API client wrapper
│           ├── apply.ts       applies section-level patches + frontmatter updates
│           ├── diff.ts        shows the proposed change
│           └── types.ts       shared sweeper types
├── ui/                        React + Vite SPA, served by the backend
│   ├── package.json
│   ├── vite.config.ts         base: PATH_PREFIX, dev proxy → backend
│   ├── index.html
│   └── src/
│       ├── main.tsx           BrowserRouter basename=PATH_PREFIX
│       ├── App.tsx            auth gate + routes
│       ├── api.ts             typed fetch client for ${PATH_PREFIX}/api/*
│       ├── styles.css
│       ├── components/
│       │   ├── Layout.tsx     topbar + search box + nav + user
│       │   └── Markdown.tsx   react-markdown w/ in-app link rewriting
│       └── pages/             Home, Project, Topic, Search, Validation, Login
└── deploy/
    ├── agent-wiki.service           systemd unit for the web service (hardened)
    ├── agent-wiki-sweeper.service   user-mode unit invoked by the timer / Stop-hook
    ├── agent-wiki-sweeper.timer     daily 03:00 fan-out sweep + reindex
    ├── run-daily.sh                 timer entrypoint: sweeper --all then indexer build
    ├── sweep-on-stop.sh             Claude Code Stop-hook: debounced async per-project sweep
    ├── sweep-project.sh             single-project sweep helper used by hook + systemd-run
    ├── apache.conf                  ProxyPass example
    └── setup.md                     step-by-step install walkthrough

Read the full file on GitHub · 254 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 254 lines · 4,087 tokens per session scan B cb0b4b5215ca

Subscribe to this mod's changes

agent-wiki AGENTS.md is an instructions file published in the GitHub repository psecor/agent-wiki (2 stars, last pushed 2mo ago), licensed MIT. It adds 4,087 tokens to every session, about $0.0204 per session on Opus 5. A static security scan graded it B with 1 finding (asks for root). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other instructions, from other repositories

spec-kit AGENTS.md

AGENTS.md instructions for github/spec-kit, covering agents.md, about spec kit and specify, quickstart — add a new integration in 5 steps, integration architecture and integrationmanifest — file tracking.

github/spec-kit · 7,104 tokens

vscode buildNext.instructions.md

Working notes and architecture documentation for the new esbuild-based build system in build/next. Use when making changes to the new build pipeline (transpile/bundle commands, NLS plugin, source-map handling, resource copying, or self-hosting watch tasks).

microsoft/vscode · 6,785 tokens

codex AGENTS.md

AGENTS.md instructions for openai/codex, covering rust/codex-rs, the codex-core crate, code review rules, crate api surface and model visible context.

openai/codex · 5,182 tokens

langchain AGENTS.md

AGENTS.md instructions for langchain-ai/langchain, covering global development guidelines for the langchain monorepo, corridor security analysis, project architecture and context, monorepo structure and development tools & commands.

langchain-ai/langchain · 4,345 tokens

vscode oss-third-party-notices.instructions.md

Instructions for microsoft/vscode, covering vs code oss third-party-notices pipeline, architecture, pipeline flow in ci, applying the notice (cutover) and fallback chain (never fail the build).

microsoft/vscode · 5,001 tokens

next.js AGENTS.md

Instructions for vercel/next.js, covering next.js development guide, codebase structure, monorepo overview, core package: packages/next and other important packages.

vercel/next.js · 7,296 tokens