AxioDB / source
AGENTS.md35 starsChanged 9 days agoMITView on GitHub
Global rules live in ../AGENTS.md. This file only adds source/ specifics — read the root first. Role — the embedded engine. Compiled by tsc to lib/, published as the axiodb npm package (main: ./lib/config/DB.js). Every other folder (GUI/, cli/, Docker/, electron/, Document/) is a surface on top of this. Source of truth for HTTP 27018, TCP 27019.
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.
- AGENTS.mdAGENTS.md
- 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
- 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
3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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 37
All filenames come from config/Keys/Keys.ts — never hardcode a path or directory name.
- Very specific: line 52
Ask the user before fanning out to cli/, Docker/mcp, GUI/, Document/ — expose consistently, same RBAC.
- Very specific: line 53
Update Test/node/modules/, docs, AI artifacts.
≈ “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
source/ — AxioDB Core (Agent Instructions)
Global rules live in ../AGENTS.md. This file only adds source/ specifics — read the root first.
Role — the embedded engine. Compiled by tsc to lib/, published as the axiodb npm package (main: ./lib/config/DB.js). Every other folder (GUI/, cli/, Docker/, electron/, Document/) is a surface on top of this. Source of truth for HTTP 27018, TCP 27019.
Layout
config/ DB.ts, Keys/ (Keys.ts · Permissions.ts · StatusCode.ts), Interfaces/
Services/ Collection/ (collection.operation.ts), Database/, Index/, Transaction/, Auth/,
Aggregation/, CRUD Operation/, Indexation.operation.ts
engine/ query + storage engine — node/, Filesystem/, cli/
Memory/ memory.operation.ts — InMemoryCache, IndexCache
server/ HTTP Fastify (27018) — router/Routers/Router.ts, controller/ (Auth, Collections,
Database, Index, Operation, Stats)
tcp/ TCP (27019) — handler/CommandHandler.ts + handlers/, connection/, config/, types/
client/ AxioDBCloud client — *Proxy.ts wrappers + PooledConnection.ts (pooling/reconnect)
Helper/ static stateless helpers — {Feature}.helper.ts
utility/ BufferLoaderWithWorker, Searcher, SortData, StaticFile, ZipUnzip, Cors, CookieCommands (from repo root)
npm run build # tsc → lib/ — MANDATORY after every change
npm run lint # eslint source/
npm run node-test crud # one suite; `npm run node-test` = all 14 (ask first, slow)Hard rules
lib/is generatedtscoutput and is gitignored — never hand-edit it, never commit it.- No
any—unknown+ type guard. Noeval, nosetTimeouthacks, no temp fixes. - Singleton: a second
new AxioDB()throws. - File-per-document storage; registries are JSONL, append-only, last-line-wins, truncated when empty.
- All filenames come from
config/Keys/Keys.ts— never hardcode a path or directory name. - Inputs validated (reject non-object/array); paths sanitized
replace(/[^a-zA-Z0-9-_]/g,'_')+path.join; never log secrets or stacks. ResponseHelperfor every outward response;try-catchevery async, log detailed, return friendly.
Indexing & cache invariants
- Dual-write: memory + disk, both kept in sync.
- Random TTL 5–15m —
InMemoryCacherandomizes between the configurableminTTL/maxTTL;IndexCachehardcodesMath.floor(Math.random()*(MAX_TTL_MS-MIN_TTL_MS+1)+MIN_TTL_MS). - Cache before disk;
Map(notArray.find) in hot paths;Promise.allfor fan-out.
Adding a feature (core → surface fan-out)
- Implement in
Services/{Feature}/with typed try-catch; shared logic →Helper/{Feature}.helper.ts(2+ callers only). - HTTP:
server/router+server/controller. - TCP:
tcp/handler/{cmd}.ts→ register inCommandHandlercommand map →client/{Feature}Proxy.ts. - Ask the user before fanning out to
cli/,Docker/mcp,GUI/,Document/— expose consistently, same RBAC. - Update
Test/node/modules/, docs, AI artifacts;npm run buildthen the scoped suite.
Anti-patterns
const dir = './data/MyDB'; // ❌ hardcoded path — use Keys.ts
function parse(input: any) {} // ❌ any — use unknown + guard
if (a) { if (b) { if (c) { if (d) {} } } } // ❌ nesting > 3 — extract a helper
items.find(i => i.id === id); // ❌ Array.find in hot path — use MapDone for this folder
npm run buildclean,npm run lintcleanTest/node/modules/covers the change; scoped suite green- No
any; SOLID + DRY; singleton / dual-write / TTL patterns intact - HTTP + TCP (+ client proxy) updated if the surface changed; docs + JSDoc same commit
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.

