mazarbul
AGENTS.md2 starsChanged 31 days agoApache-2.0View on GitHub
Mazarbul is an agent system of record, the local-first system of records for the era of agents. Single Go binary (maz), embedded SQLite + LadybugDB + sqlite-vec + FTS5, JSONL event log as the source of truth, MCP as the primary integration surface. "Mazarbul, the system of records for the era of agents." Status: pre-alpha. Module: github.com/mo-cmyk/mazarbul. (Mazarbul is Khuzdul for "records", literally "the book of records" in Tolkien's lore. The slogan uses the more familiar enterprise-architecture phrase "system of…
- Reads credentials
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 repository41 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- 12-principles-of-animationSkill
- aip-namingSkill
- architectSkill
- babysit-abortSkill
- babysit-prSkill
- babysit-tickSkill
- baseline-uiSkill
- commit-pushSkill
- complex-refactorSkill
- critiqueSkill
- deadSkill
- devstackSkill
- go-backendSkill
- goSkill
- go-strictSkill
- greptileSkill
- impl-checkSkill
- inspect-dbSkill
- inspect-deploySkill
- inspect-runtimeSkill
- interaction-designSkill
- issue-planSkill
- lessonsSkill
- mergeSkill
- new-resourceSkill
- plan-featureSkill
- preflightSkill
- pr-reviewSkill
- review-fixSkill
- reviewSkill
- shipSkill
- simplifySkill
- task-execution-protocolSkill
- teamSkill
- tui-component-browserSkill
- tui-design-labSkill
- tui-designSkill
- verifySkill
- wrap-upSkill
- write-docsSkill
The file
We split this AGENTS.md into the rules it gives an agent
8 rules. About 0 are common, 5 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 11
Event log append-only: Never UPDATE/DELETE event rows.
- Distinctive: line 12
Provenance on every fact: Every entity, relation, and inference carries source, confidence, and timestamp.
- Distinctive: line 26
Simplicity First: Write the minimum code that solves the problem.
- Distinctive: line 38
Treat Claude as an engineer you're delegating to, not a pair programmer you guide line-by-line.
- Distinctive: line 49
Read this file (already done).
- Very specific: line 87
Rewind, don't correct: When Claude goes down a wrong path, don't type "that didn't work, try X instead" (keeps failed attempt in context).
- Distinctive: line 95
Verbal steering: if not changing effort: "Think carefully and step-by-step" for hard problems.
- Very specific: line 125
Audit trail: Every lessons-rotate action and self-promotion writes one line to agent-docs/lessons-changelog.md plus a git commit.
≈ “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.
Files
Mazarbul, Agent Context
Mazarbul is an agent system of record, the local-first system of records for the era of agents. Single Go binary (maz), embedded SQLite + LadybugDB + sqlite-vec + FTS5, JSONL event log as the source of truth, MCP as the primary integration surface. "Mazarbul, the system of records for the era of agents." Status: pre-alpha. Module: github.com/mo-cmyk/mazarbul.
(Mazarbul is Khuzdul for "records", literally "the book of records" in Tolkien's lore. The slogan uses the more familiar enterprise-architecture phrase "system of records" so non-Tolkien-aware readers grok the product immediately; the project name does the poetic work.)
Critical rules (always apply)
- No proto. Wire format is JSONL; schema is JSON Schema; types are Go structs with
json:tags. Nobuf.yaml, no Connect-RPC, nogen/directory. - AIP-compliant naming.
createTimenotcreatedAt. Resource paths plural lowercase. CRUD verbsCreate/Get/List/Update/Delete. Seeagent-docs/synthesis.mdsection 3 for the full mapping. - Event log append-only. Never UPDATE/DELETE event rows; only append + supersede. The event log is the source of truth; SQLite/LadybugDB/vector indexes are gitignored derivatives rebuilt on
maz rebuild(M4 addsmaz pullfor cloud sync). - Provenance on every fact. Every entity, relation, and inference carries source, confidence, and timestamp. "Enrichment proposes, the user disposes."
- Local-first. SQLite + LadybugDB + sqlite-vec embedded in-process. Cloud sync (Imladris) is opt-in.
- Theming rules. Thematic at emotional moments only (init,
mellon, Watchword, deletion, shared review). Plain in env vars (MAZ_API_KEY), config keys ([providers.anthropic]), error codes (E_AUTH_FAILED), SDK methods (client.Remember()). Seeagent-docs/lifecycle-theming.md. - Timestamps: UTC
time.Time, JSON RFC 3339, never*_atsuffixes. - No em-dashes. Anywhere. Code, comments, docs, commits, PR descriptions.
- Greptile, zero unresolved before merge. Greptile reviews every PR with inline P0/P1/P2 findings that are not surfaced in the top-level review status; checking only that Greptile reviewed is insufficient. Before merging, enumerate every inline thread via
./.claude/scripts/greptile-resolve-threads.sh list <PR>, classify each (real bug, valid nit, false positive), fix or justify each, reply on the thread, then resolve it. Merge only when./.claude/scripts/greptile-resolve-threads.sh verify <PR>printsVERIFY OK. The/greptileand/babysit-prskills automate this; when working without them, do the same steps by hand. Seeagent-docs/greptile-workflow.mdfor the full discipline and the bootstrap incident that produced this rule. - Hot-path PRs ship with a benchmark. When a change touches a hot path (event log writer, four-layer storage dispatcher, MCP request handler, recall composer, embedding call, anything else flagged by the issue's
## Hot path?field), the PR includes or updates a benchmark and records the baseline (ns/op,B/op,allocs/op) in the PR description. Bench files live next to the code under test (*_bench_test.go) and useb.ReportAllocs(). Profile before optimising; measure, don't guess. Seeagent-docs/profiling.mdformise run bench,mise run pprof:cpu,mise run pprof:mem. Regressions surface in PR review; gates land in M2+. - User-facing changes update docs in the same PR. A user-facing surface is a CLI command, an MCP tool, a TUI screen, a config knob, an env var, an error code, or anything else a human or external agent observes. When a PR ships one, it updates the corresponding
agent-docs/*.mdfile and appends a backlog entry toagent-docs/mintlify-backlog.md(intended path, status, last-update date) so Mintlify content is ready when the public docs site lights up. Internal-only refactors and tests skip both; the rule applies when behaviour visible from outsideinternal/changes.
How to think (Karpathy 4 principles)
These four principles, derived from Andrej Karpathy's Jan 2026 observations on agentic-coding failures, apply to every change:
- Think Before Coding. State your assumptions explicitly. If a request is ambiguous, present multiple interpretations instead of silently picking one. If you're confused, name what's unclear and ask. Push back when a simpler approach exists.
- Simplicity First. Write the minimum code that solves the problem. Nothing speculative. No abstractions for single-use code. No error handling for impossible scenarios. If 200 lines could be 50, rewrite it.
- Surgical Changes. Touch only what you must. Don't "improve" adjacent code. Match existing style. Every changed line must trace directly to the request.
- Goal-Driven Execution. Convert vague instructions into verifiable success criteria before starting. "Fix the bug" becomes "write a failing test that reproduces it, then make it pass". Loop until verified.
How to brief Claude
For non-trivial work, write a crisp brief in the first turn. Three things:
- Goal: what success looks like in plain language
- Constraints: non-goals, things not to touch, perf/API contracts, compliance rules
- Acceptance criteria: how you'll verify the work is done right
Treat Claude as an engineer you're delegating to, not a pair programmer you guide line-by-line. Crisp briefs lead to fewer interruptions and higher-quality output. When Claude asks too many clarifying questions, the brief was incomplete.
Prompting patterns that work
- Challenge the result: "Grill me on these changes, don't open a PR until I pass your test."
- Demand evidence: "Prove this works. Diff behavior between main and feature branch."
- Reset toward elegance: "Knowing what you know now, scrap this and implement the elegant solution."
- Spec, don't hint: detailed specs reduce ambiguity, better output.
How to start a task
- Read this file (already done).
- Invoke the matching skill:
- Go work on the kernel or any
internal/package:go-backendskill - API surface, MCP tool definition, JSON Schema, or new resource type:
aip-namingskill - TUI work (Bubble Tea, Charm components):
tui-designskill - Non-trivial work:
task-execution-protocolskill
- Go work on the kernel or any
- For unknown territory, read the matching
agent-docs/*.mdfrom the table below. - Plans for non-trivial features live in
.claude/plans/(gitignored, local scratch). Use them to align with the user before coding; the durable artifact is the implementation, the commit message, and the PR description, not the plan file.
Quick orientation
| What you need | File |
| Design synthesis (read first) | agent-docs/synthesis.md |
| Kernel + four-layer storage | agent-docs/designs/storage.md, agent-docs/designs/event-log.md |
| Provider / connector / extension model | agent-docs/plugins.md |
| Bootstrap-ingestion pipeline | agent-docs/ingestion.md |
| Canonical entities and resolution | agent-docs/identity.md |
| Scopes, mellon, Watchword | agent-docs/privacy.md |
| Team scope, roles, device keys, genesis pin | agent-docs/team.md |
| Theming rules (decided) | agent-docs/lifecycle-theming.md |
| Worktree workflow | agent-docs/worktree-workflow.md |
| Local dev runbook | agent-docs/devstack.md |
| pprof, bench, memory limit | agent-docs/profiling.md |
| TUI design system + themes | agent-docs/tui-design.md |
| PR description template | agent-docs/pr-description-template.md |
| Design doc template | agent-docs/design-doc-template.md |
| Lessons learned | agent-docs/lessons-learned.md |
| Repository tour | agent-docs/monorepo-tour.md |
| Lint policy, secret scanning | agent-docs/quality-security.md |
| Library: Zap | agent-docs/tech/zap.md |
| Library: Cobra | agent-docs/tech/cobra.md |
| Library: mcp-go | agent-docs/tech/mcp-go.md |
| Library: sqlite-vec | agent-docs/tech/sqlite-vec.md |
| Library: LadybugDB | agent-docs/tech/ladybug.md |
Context management
- Rewind, don't correct. When Claude goes down a wrong path, don't type "that didn't work, try X instead" (keeps failed attempt in context). Use
/rewind(or double-tap Esc) to drop the failed attempt entirely, then re-prompt with what you learned. /compactvs/clear./compact focus on X, drop Yfor lossy LLM summary keeping momentum./clearthen hand-write a brief for genuinely new tasks.- Auto-compact at 400k. Context rot begins at 300-400k tokens on the 1M model.
CLAUDE_CODE_AUTO_COMPACT_WINDOW=400000is set in.claude/settings.jsonto force early compaction while the model is still sharp.
Model and effort
- Default to Opus 4.7 with
xhigheffort (Boris's recommendation). Adaptive thinking, one-shots bigger tasks. /effort maxfor hard debugging, architecture decisions, tricky code (session-only; doesn't persist).- Verbal steering if not changing effort: "Think carefully and step-by-step" for hard problems; "Respond quickly" for simple ones.
- 4.7 vs 4.6 shifts: calibrated response length (specify if you want long/short), less automatic tool use (provide explicit tool guidance when needed), more judicious subagent spawning (explicitly request parallel agents for cross-file work).
Specialized subagents
Delegate focused work to these. Each has its own isolated context window.
@golang-developer: Go kernel andinternal/package authoring; Google Go Style Guide enforcement.@cli-developer: cobra command tree; TTY-aware mode switching between CLI and TUI; scripted/agent-callable surface with--json.@tui-developer: Bubble Tea / Charm specialist; ownsinternal/tui/; browsesbubblesandhuhbefore reinventing.@mcp-developer: MCP server surface; agent-accessible tool definitions, idiomatic JSON-RPC errors, clean response shapes.@plugin-developer: provider/connector/extension plugin system; clean install UX, declarative TOML manifests.@ontology-architect: JSON Schema design, AIP compliance, ULID + external IDs, type hierarchy.@ingestion-engineer: bootstrap-ingestion pipelines; tiered extraction, budget gates, dry-run + resume.@docs-writer:agent-docs/and Diataxis upkeep; Glamour-rendered help text in TUI.@backend-engineer: fresh-eyes Go review; production-grade discipline distinct from@golang-developer.@system-architect: structure, ADRs, scaling, RTO/RPO; Write/Edit access for ADR drafting.@security-engineer: OWASP-flavored threat modeling; capability tokens, encryption at rest, audit log.@qa-engineer: test suite design and coverage; race detector, table-driven, teatest snapshots.@devils-advocate: adversarial reviewer; surfaces hidden cost, complexity, second-order effects.@refactor-archaeologist: large-refactor specialist; surface partitioning, worktree coordination.@product-manager: business case, scope, prioritization; UX defense from the user's seat.
Self-healing
The lessons system is self-healing.
/lessonsskill appends one-paragraph entries toagent-docs/lessons-learned.mdwhenever a gotcha, non-obvious decision, workaround, or corrected assumption surfaces during a session. Newest at the top. The user does not invoke it manually; it fires from natural-language correction signals routed by.claude/hooks/route-prompt.sh..claude/hooks/lessons-rotate.shruns periodically on session Stop. Whenagent-docs/lessons-learned.mdexceeds 500 lines, the oldest entries (byLast seendate andRecurrencecount) move toagent-docs/lessons-archive.md. Entries taggedCompliance: truenever auto-archive..claude/hooks/post-compact-reinject.shruns after/compactor auto-compact. It re-injects this file's critical rules and the active task's context into the next-turn message so post-compaction sessions don't lose the load-bearing constraints.- Audit trail. Every lessons-rotate action and self-promotion writes one line to
agent-docs/lessons-changelog.mdplus a git commit.
You do nothing. Read agent-docs/lessons-changelog.md to see what self-healed when curious. Git history is the deeper safety net: git log -p agent-docs/lessons-learned.md shows every change with full context.
License and commit footer
- License: Apache-2.0 (Copyright 2026 Moritz Steigerwald). See
LICENSEfor the full text andNOTICEfor attribution. - Commit footer:
.claude/settings.jsonsets"includeCoAuthoredBy": false. Do not add theCo-Authored-By: Claudefooter automatically. If a commit was authored by Claude in collaboration, the human author owns the commit on the wire.
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.

