agentleFS
nexoralnexoral/AxioDB/source/AGENTS.md

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.

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
  1. Very specific:

    All filenames come from config/Keys/Keys.ts — never hardcode a path or directory name.

    line 37
  2. Very specific:

    Ask the user before fanning out to cli/, Docker/mcp, GUI/, Document/ — expose consistently, same RBAC.

    line 52
  3. Very specific:

    Update Test/node/modules/, docs, AI artifacts.

    line 53

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

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, Cookie

Commands (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 generated tsc output and is gitignored — never hand-edit it, never commit it.
  • No any — unknown + type guard. No eval, no setTimeout hacks, 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.
  • ResponseHelper for every outward response; try-catch every async, log detailed, return friendly.

Indexing & cache invariants

  • Dual-write: memory + disk, both kept in sync.
  • Random TTL 5–15m — InMemoryCache randomizes between the configurable minTTL/maxTTL; IndexCache hardcodes Math.floor(Math.random()*(MAX_TTL_MS-MIN_TTL_MS+1)+MIN_TTL_MS).
  • Cache before disk; Map (not Array.find) in hot paths; Promise.all for fan-out.

Adding a feature (core → surface fan-out)

  1. Implement in Services/{Feature}/ with typed try-catch; shared logic → Helper/{Feature}.helper.ts (2+ callers only).
  2. HTTP: server/router + server/controller.
  3. TCP: tcp/handler/{cmd}.ts → register in CommandHandler command map → client/{Feature}Proxy.ts.
  4. Ask the user before fanning out to cli/, Docker/mcp, GUI/, Document/ — expose consistently, same RBAC.
  5. Update Test/node/modules/, docs, AI artifacts; npm run build then 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 Map

Done for this folder

  • npm run build clean, npm run lint clean
  • Test/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

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.