AxioDB
AGENTS.md35 starsChanged 9 days agoMITView on GitHub
AxioDB — Embedded NoSQL Database for TypeScript & AI Agents. Zero native deps, TS 6.0 strict → CJS, Node ≥20 (engine minimum; Docker runs on Node 23; verified on Node, Bun & Deno), singleton, file-per-doc, InMemoryCache, Worker Threads, ACID transactions & WAL, GUI 27018, TCP 27019. SOLID + DRY: duplicate logic (2+ files) → source/Helper/{Feature}.helper.ts static stateless. Naming: files {Feature}.{operation|service|helper}.ts, PascalCase classes, camelCase verbs, UPPER_SNAKE_CASE consts. Magic strings → enums/as const. Nesting >3 → refactor. Try-catch every async; log detailed,…
- Commits and pushes
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,843 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 repository12 other files it gives its agents.
- cli/AGENTS.mdAGENTS.md
- Docker/AGENTS.mdAGENTS.md
- Document/AGENTS.mdAGENTS.md
- electron/AGENTS.mdAGENTS.md
- Email/AGENTS.mdAGENTS.md
- GUI/AGENTS.mdAGENTS.md
- Scripts/AGENTS.mdAGENTS.md
- source/AGENTS.mdAGENTS.md
- Test/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- skillSkill
The file
We split this AGENTS.md into the rules it gives an agent
9 rules. About 0 are common, 7 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 32
All registries JSONL append-only, last-line-wins, truncated when empty.
- Distinctive: line 40
Never leave incomplete work — Done checklist must pass.
- Distinctive: line 41
Read before edit; follow existing patterns.
- Very specific: line 117
After file changes, if graphify is available and graphify-out/ exists, rebuild: python3 -c "from graphify.watch import _rebuild_code.
- Distinctive: line 121
Always ask user permission before:
- Distinctive: line 127
Do NOT ask for:
- Distinctive: line 134
If confused or unclear about anything — ask the user.
- Distinctive: line 135
Do web search when you need external data or documentation.
- Distinctive: line 136
Ask mid-task too, not just at the start.
≈ “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.
Files
AxioDB — Agent Instructions
AxioDB — Embedded NoSQL Database for TypeScript & AI Agents. Zero native deps, TS 6.0 strict → CJS, Node ≥20 (engine minimum; Docker runs on Node 23; verified on Node, Bun & Deno), singleton, file-per-doc, InMemoryCache, Worker Threads, ACID transactions & WAL, GUI 27018, TCP 27019.
Directory Layout
source/
config/ # DB init, Keys, constants
Services/ # Collection, Database, Index, Transaction, Auth, Aggregation
engine/ # Core query engine, storage engine
Memory/ # InMemoryCache, IndexCache
tcp/ # TCP server (27019), handler/
server/ # HTTP Fastify (27018), router/ + controller/
client/ # *Proxy.ts — TCP client wrappers
Helper/ # Static stateless helpers
utility/ # Shared utils (ResponseHelper, etc.)
Test/
modules/ # 14 test suites (JS, node-based)
helpers/ # TestRunner, assertions, fixtures
Docker/ # Dockerfile, MCP config
Document/ # Vite docs site (port 5173), SEO scripts, AI artifacts
cli/ # CLI commands
Email/ # Cloudflare Email Worker Agent (triage, vectorless RAG, auto-responder)
skill/ # Agent skill, runbooks, references, scriptsConstraints — never violate
- No
any. Useunknown+ guard. Noeval,setTimeouthacks, temp fixes. - Singleton:
new AxioDB()twice throws; tests run isolated child processes. - All registries JSONL append-only, last-line-wins, truncated when empty; filenames via
Generalsource/config/Keys/Keys.ts— never hardcode. - Dual-write indexes: memory + disk; random TTL
5-15m—InMemoryCacherandomizes between the configurableminTTL/maxTTLoptions;IndexCachehardcodesMath.floor(Math.random()*(MAX_TTL_MS-MIN_TTL_MS+1)+MIN_TTL_MS). - Inputs validated (reject non-object/array), path sanitized
replace(/[^a-zA-Z0-9-_]/g,'_')+path.join, never log secrets/stack.
Rules — non-negotiable
npm run buildafter every change — never ship TS errors.Test/node/modules/must be updated for any feature;npm run node-testall 14 suitescrud|transaction|read|aggregation|auth|http-api|tcp-auth|tcp-noauth|tcp-transaction|tcp-tls|crash-recovery|mcp-confirm|mcp-functional|cache-options.- Never leave incomplete work — Done checklist must pass.
- Read before edit; follow existing patterns.
- Production-grade only.
- Core → surfaces sync: new core feature (
Services/Collection,Index,Transaction, etc.) → ask user: expose via HTTP 27018 / CLI / MCP 27020 / Docker / GUI? If yes, implement consistently (HTTPserver/router+controller, TCPtcp/handler+client/*Proxy, CLIcli/cmd, MCPHelper/mcp/McpTools,Document/docs + AI) with same RBAC/tests.
Code standards
SOLID + DRY: duplicate logic (2+ files) → source/Helper/{Feature}.helper.ts static stateless. Naming: files {Feature}.{operation|service|helper}.ts, PascalCase classes, camelCase verbs, UPPER_SNAKE_CASE consts. Magic strings → enums/as const. Nesting >3 → refactor. Try-catch every async; log detailed, return friendly via ResponseHelper. Perf: cache before disk, Promise.all, Map not Array.find loop.
Don't (anti-patterns)
// ❌ Never hardcode filenames — use Keys.ts
const dir = './data/MyDB';
// ❌ Never use any — use unknown + type guard
function parse(input: any) { ... }
// ❌ Never nest >3 levels — extract helper
if (a) { if (b) { if (c) { if (d) { ... } } } }
// ❌ Never use Array.find in hot paths — use Map
items.find(i => i.id === targetId);Tests
Framework: custom TestRunner + assert from Test/node/helpers/. Run all: npm run node-test. Single suite: npm run node-test crud. New test file: Test/node/modules/{feature}.test.js, extend TestRunner, use fixtures for data, clean up in setUp()/tearDown().
const TestRunner = require('../helpers/TestRunner');
const { assert } = require('../helpers/assertions');
class MyTests extends TestRunner {
constructor() { super('My Test Suite'); }
async setUp() { /* create temp dir, init DB */ }
async tearDown() { /* rm temp dir */ }
}Version sync (16 places — all must match)
package.json→"version"package-lock.json→ auto vianpm installGUI/package.json→"version"electron/package.json→"version"Document/package.json→"version"Email/package.json→"version"cli/VERSION→ plain text versioncli/cmd/version.go→var cliVersionDocument/src/data/changelog.ts→ latest entryDocument/src/components/layout/Footer.tsx→ displayed versionDocument/public/llms.txt→ version lineDocument/public/llms-full.txt→ version lineDocument/index.html→ JSON-LDsoftwareVersionDocument/public/feed.xml→ RSS feed title + guidDocker/README.md→ shield badge versionskill/SKILL.md→ version tag Regen AI artifacts:cd Document && npx tsx scripts/generate-seo-files.ts
Documentation — same commit as code
README, Document/ (npm run dev 5173), Dockerfile ports/env, JSDoc with @param/@returns/@throws/@example. Single source: Document/src/data/serverApi.ts → docs + openapi.json. Never blur: core · Dashboard · HTTP API 27018 · TCP 27019 · MCP 27020 (core & Docker).
Commands
npm run build # mandatory
npm run node-test # all 14
npm run node-test <suite> # see Rules 2
npm run lint # ESLint
cd Document && npm run dev # docs 5173Workflows: Services/Collection/collection.operation.ts → typed try-catch → HTTP server/router+controller → TCP tcp/handler → tests → docs+AI → build/test. Helper: Helper/{Feature}.helper.ts. TCP: tcp/handler/{cmd}.ts + client/{Feature}Proxy.ts → command map → tests → docs.
Graphify (optional)
After file changes, if graphify is available and graphify-out/ exists, rebuild: python3 -c "from graphify.watch import _rebuild_code; from pathlib import Path; _rebuild_code(Path('.'))"
Ask before action
Always ask user permission before:
git commit— confirm message and changesgit push— confirm branch and remotenpm run node-test(full suite) — may be slow- Launching sub-agents (explore/plan) — costly and time-consuming; user may already know the answer or have a better approach
Do NOT ask for:
npm run node-test <suite>(scoped) — run directlynpm run build— run directlynpm run lint— run directly
Never assume
- If confused or unclear about anything — ask the user. Don't guess.
- Do web search when you need external data or documentation.
- Ask mid-task too, not just at the start. Always prefer asking over assuming — wrong assumptions waste more time than a quick question.
Git
- Branches:
main(production),maintainer/<name>(personal). Never force-pushmain. - Commits: conventional format —
feat:,fix:,refactor:,docs:,test:,chore:. One logical change per commit.
Done checklist
npm run buildpassesTest/node/modules/updated,npm run node-test14/14npm run lintpasses- Docs updated (README, Document, Dockerfile, JSDoc)
- Changelog if major/breaking
- AI artifacts updated + regenerated, version synced (16 places)
- No
any, SOLID+DRY, patterns (singleton/dual-write/TTL) followed - Security validated
- No perf regressions
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.

