Borrowing it
Nothing to install: this file belongs to dev-manul/kartograf. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/dev-manul/kartograf/master/AGENTS.mdgit clone --depth 1 https://github.com/dev-manul/kartografWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/dev-manul/kartograf/agents-md)<a href="https://agentmods.dev/instructions/dev-manul/kartograf/agents-md"><img src="https://agentmods.dev/badge/instructions/dev-manul/kartograf/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/dev-manul/kartograf/agents-md"><img src="https://agentmods.dev/badge/instructions/dev-manul/kartograf/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.01422 | $0.01422 |
| Opus 5.5 | $0.00569 | $0.00569 |
| Sonnet 5.5 | $0.00284 | $0.00284 |
| Haiku 4.5 | $0.00142 | $0.00142 |
Grade A, and why
kartograf AGENTS.md scanned grade A with 0 findings 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 28d 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.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.
AGENTS.md
Guidance for AI agents working in this repository.
What this is
kartograf builds a code map (symbols, references, call graph) of a project into SQLite and serves it to AI agents over MCP (stdio). Tree-sitter parsing, language-agnostic core, PHP/Go/TS adapters, an optional type-inference enrichment layer (go/types, PHPStan).
Build & test
cgo is required (tree-sitter, mattn/go-sqlite3) and so is the
sqlite_fts5 build tag — a compile guard
(internal/core/store/fts5guard.go) fails the build without it.
Always go through the Makefile:
make check # vet + test + fmt + build — run before every commit
make install # go install into $GOPATH/bin (MCP configs point there)
Plain go build ./... will fail with BUILD_WITH_TAG_sqlite_fts5... —
that is intentional, add -tags sqlite_fts5 or use make.
Layout
cmd/kartograf— CLI (cobra): index, serve, enrich, outline, hidden parse-tree.internal/core/model— language-neutral types (Symbol,Ref,Import,FileIndex). Nothing language-specific belongs here.internal/core/lang— adapter contract + registry.internal/core/indexer— walk (gitignore-aware), worker pool, mtime/sha256 change detection, go.mod module map collection.internal/core/store— SQLite schema, bulk/incremental writers, FTS5, enrichment table.internal/core/query— read side used by MCP tools.internal/lang/php,internal/lang/golang,internal/lang/ts— tree-sitter adapters.internal/enrich— go/types pass and PHPStan rule scaffolding + JSONL import.internal/mcpserver— MCP tool definitions.internal/taskctx— per-branch working notes in the git common dir, outside the index database.find_taskwalks nested git repos;.kartograf.ymltask.branchis an optional{id}template (empty means the branch name contains the id).
Hard-won rules (do not relearn these the hard way)
- Schema changes: any change to the SQLite schema requires bumping
schemaVersionininternal/core/store/store.go. A mismatch silently deletes and rebuilds the database — that is the designed migration strategy; never write ALTER migrations. - FQN dialects: PHP
App\Ns\Class::method(), Gomodule/pkg.Type.Method(), TSpath/module#Class.method()(module = extensionless file path, trailing/indexstripped). Symbol IDs prefix the language (php:...,go:...,ts:...). Query helpers (methodSplit,memberSep, suffix lookup) must stay separator-agnostic across all dialects. - tree-sitter node kinds: never trust documentation or memory —
dump the real CST with
kartograf parse-tree file.{php,go}(hidden command) and verify. Grammar quirks live in the adapter tests'testdata/fixtures; extend those fixtures when touching extraction. - MCP output schemas: Claude Code rejects tools whose
outputSchemais not a JSON object — wrap list results in a struct ({results: [...]}), never return a bare slice as the Out type. - PHPStan enrichment: the rule class is loaded via
--autoload-file(bootstrapFiles is too late for DI container construction). Edges travel as pseudo-errors with identifierkartograf.edgethrough--error-format=json— do NOT switch to a side-channel output file: PHPStan's result cache skips unchanged files and would silently drop their edges. - Enrichment lifecycle:
.kartograf/enrich.<source>.jsonlis the source of truth — at the root and in every nested project directory (enrich.Discoverwalks the tree past .git/vendor/dot-dirs/excludes).ext_edgesare keyed byorigin(root-relative path of the exchange file) and replaced wholesale per origin on import, auto-imported by index/serve on mtime change, and dropped when the file is deleted. Tool-reported paths resolve inside the owning project first (Exchange.Prefix), then root-relative, then by longest suffix. - TS specifics: JSX component renders are
callsedges with a()target so they join function-component FQNs; unqualified names resolve only through imports or file-local declarations (JS scoping — unknown names are globals and are skipped). Barrel re-exports (export { A } from,export * from) arereexportsedges (barrel#*is a star of the whole module). References, callers, callees and impact follow them a few hops. Vendor files still skip those edges (SkipRefs). - Vendor code is indexed shallow (
SkipRefs): declarations and hierarchy only. Don't emit call edges from vendor files. - Bulk vs incremental writes: an empty database takes
BeginBulkWrite(indexes/triggers dropped, FTS rebuilt once at commit). Incremental runs rely on the FTS triggers; keep both paths working when touching the store.
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.
- 28d ago Changed · +6 lines · +103 tokens per session 1338d43f07f2
- 2mo ago First seen · 115 lines · 1,319 tokens per session scan A 685ad82f518e
kartograf AGENTS.md is an instructions file published in the GitHub repository dev-manul/kartograf (2 stars, last pushed 29d ago), licensed MIT. It adds 1,422 tokens to every session, about $0.0057 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
kartograf AGENTS.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| kartograf AGENTS.mddev-manul/kartograf | Instructions file | 2 | 29d ago | MIT | A | 1,422 | Codex, OpenCode |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |