agentleFS
GhostPawJSGhostPawJS/email/AGENTS.md

email

AGENTS.md1 starsChanged 11 days agoMITView on GitHub

A zero runtime dependency IMAP/SMTP library with a local SQLite cache and CLI. Install with npm install @ghostpaw/email in a consuming project (Node 24 or newer). Use Mailbox.connect() for live protocol operations and disconnect after use. Tool implementations live in src/tools/. The shared facade is tools.aligned.emailTools, with listEmailToolDefinitions() and getEmailToolByName() on that namespace. Handlers take a context containing read, write, and network surfaces plus input, and return a promise of { ok, outcome, summary, next, data }. Outcomes include success,…

  • Installs packages
  • 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,439 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 repository2 other files it gives its agents.

The file

We split this AGENTS.md into the rules it gives an agent

4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use Mailbox.connect() for live protocol operations and disconnect after use.

    line 25
  2. Distinctive:

    Use Node 24. Dependencies are already installed in the maintenance workspace.

    line 50
  3. Distinctive:

    Do not add runtime dependencies.

    line 51
  4. Distinctive:

    Run the full gate:

    line 56

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

@ghostpaw/email

A zero runtime dependency IMAP/SMTP library with a local SQLite cache and CLI.

Use

Install with npm install @ghostpaw/email in a consuming project (Node 24 or newer).

import { runtime, read } from '@ghostpaw/email';

const { db } = runtime.init({
  imap: { host: 'imap.example.com', port: 993 },
  smtp: { host: 'smtp.example.com', port: 587 },
  auth: { user: 'reader@example.com', pass: 'secret' },
  storage: 'email.sqlite',
});
try {
  console.log(read.createReadSurface(db, 1).folders());
} finally {
  db.close();
}

Use Mailbox.connect() for live protocol operations and disconnect after use. Tool implementations live in src/tools/. The shared facade is tools.aligned.emailTools, with listEmailToolDefinitions() and getEmailToolByName() on that namespace. Handlers take a context containing read, write, and network surfaces plus input, and return a promise of { ok, outcome, summary, next, data }. Outcomes include success, no_op, needs_clarification and error. The deprecated tools.emailTools and tools.getEmailToolByName() retain { outcome, summary, entities, nextSteps }.

Layout

  • src/index.ts: package exports; mailbox.ts: connection lifecycle.
  • src/runtime.ts, src/schema/, src/store/: database initialization and cache.
  • src/imap/, src/smtp/, src/mime/: protocols and message formats.
  • src/read.ts, src/write.ts, src/network.ts: application surfaces.
  • src/sync/, src/tools/, src/skills/: synchronization and workflow facades.
  • src/cli/: CLI; docs/: detailed usage; scripts/: build checks.
  • src/surfaces/: shared MCP, CLI, skill and manifest implementations.
  • src/surface/: email bindings; src/mcp.ts, src/cli.ts and src/mcp_server_bin.ts: entries.
  • scripts/surfaces/: generates SKILL.md, skills/email workflow references and directory manifests. Run npm run surfaces; do not edit generated outputs manually. The preserved skills/email/references/cli.md is a static reference.
  • scripts/guard/, scripts/bench/: compatibility guards and offline benchmarks.

Contribute

Use Node 24. Dependencies are already installed in the maintenance workspace. Do not add runtime dependencies. Keep dependencies and devDependencies unchanged for maintenance sweeps. Preserve exported signatures, synchronous functions, existing tool input fields, CLI flags and database schemas; add APIs alongside existing ones when their result shapes differ.

Run the full gate:

npm run lint && npm run typecheck && npm test && npm run build
npm run check

Tests use node:test and node:assert/strict in adjacent *.test.ts files. Assert observable behaviour; use local protocol peers or stream fakes rather than external services. Preserve existing assertions and coverage inclusion. Format changed files with npx biome check --write <files> when needed. Build emits ESM and CJS libraries and an ESM CLI; the post-build script also sets the CLI executable bit. Verify both library formats after runtime changes.

Record changes under Unreleased in CHANGELOG.md using Added, Changed or Fixed. Releases use npm run release:patch or npm run release:minor; these commands update the version, tag and push, and CI publishes with provenance. Maintainers run release commands after review; maintenance work stays uncommitted.

The single gate includes generated-surface drift, size and startup budgets, API snapshots, a packed consumer check and ratchet tests. The consumer check installs a local tarball offline in a temporary directory. Budget increases require [budget-increase-approved], API snapshot changes require [api-change-approved], and guard, workflow or lint configuration changes require [guardrails-change-approved] in the reviewed commit message.

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.