agentleFS
KevinArceKevinArce/create-bun-api/AGENTS.md

create-bun-api

AGENTS.md11 starsChanged 22 days agoApache-2.0View on GitHub

A toolkit that scaffolds agent-ready Bun HTTP APIs. It has three parts: Releases: never publish to npm or crates.io, or push release tags, without the owner's explicit go-ahead. Releases are staged by .github/workflows/release.yml and approved by the owner with 2FA; see docs/releasing.md. Every user-visible change gets a line under [Unreleased] in CHANGELOG.md. The roadmap is docs/PLAN.md; the reasons behind it are in docs/decisions/. - Contract changes (commands, flags, exit codes, error codes, JSON fields) start in src/manifest.ts and schemas/result.v1.json. Tests…

  • 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,774 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 repository5 other files it gives its agents.

The file

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

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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:

    Releases: never publish to npm or crates.io, or push release tags, without the owner's explicit go-ahead.

    line 9
  2. Very specific:

    Every expected failure is a CliError(code, message, hint).

    line 31
  3. Distinctive:

    Never exit 0 after a failed step.

    line 32
  4. Very specific:

    Update its lockfile by running bun install in that directory.

    line 42
  5. Distinctive:

    Keep every AGENTS.md at 150 lines or fewer (a test checks this).

    line 47

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

create-bun-api

A toolkit that scaffolds agent-ready Bun HTTP APIs. It has three parts:

  • src/: the CLI (TypeScript on Bun, zero runtime dependencies). Its public contract is src/manifest.ts.
  • templates/api/: the template, a real runnable project with its own bun.lock, tests, and AGENTS.md.
  • skills/: Agent Skills (SKILL.md), copied into generated projects and also installable on their own.

Releases: never publish to npm or crates.io, or push release tags, without the owner's explicit go-ahead. Releases are staged by .github/workflows/release.yml and approved by the owner with 2FA; see docs/releasing.md. Every user-visible change gets a line under [Unreleased] in CHANGELOG.md. The roadmap is docs/PLAN.md; the reasons behind it are in docs/decisions/.

Commands

TaskCommand
Setupbun install && (cd templates/api && bun install)
Run the CLIbun src/cli.ts <dir> [flags], e.g. bun src/cli.ts /tmp/demo --json
All tests (about 30 s)bun test tests
Fast subsetbun test tests/unit.test.ts tests/contract.test.ts
Template checkscd templates/api && bun run verify
Everything CI would runbun run ci
Before tagging a releasebun run release:check vX.Y.Z

Rules

  • Contract changes (commands, flags, exit codes, error codes, JSON fields) start in src/manifest.ts and schemas/result.v1.json. Tests compare the two. Removing or renaming anything is a breaking change: bump the schema id (for example bun-api/result@2).
  • Every expected failure is a CliError(code, message, hint). The hint says what to do next. Never exit 0 after a failed step.
  • new builds in a temporary sibling directory and renames it into place at the end, so a failed run leaves nothing behind. tests/faults.test.ts checks this; keep it true.
  • The CLI never prompts without a TTY, never runs remote scripts, and never goes through a shell: run() takes an argv array.
  • With --json, stdout carries exactly one JSON object. Human progress goes to stderr.
  • Templates contain no template syntax. The only substitution is the placeholder bun-api-template-app, in the files listed in TEMPLATES[].substituteIn. Dotfiles that npm drops are stored without the dot (gitignore) and renamed on copy through rename.
  • Template changes: edit templates/api, run its bun run verify, then bun test tests/e2e.test.ts. Update its lockfile by running bun install in that directory. Never hand-edit bun.lock.
  • Skills: name equals the directory name. description says what the skill does and includes "Use when …". The body stays under 500 lines, with details in references/. tests/skills.test.ts applies the code in skills/add-endpoint/references/notes-module.md to a new project and runs verify. Regenerate that file from a working project; don't edit it blindly.
  • Keep every AGENTS.md at 150 lines or fewer (a test checks this).

Layout

src/cli.ts         argv → command → result → output and exit code
src/manifest.ts    commands, flags, exit and error codes, templates (the single source of truth)
src/commands/      new.ts, doctor.ts, describe.ts
src/engine/        name validation, file planning, subprocess runner, version comparison
schemas/           JSON Schema for --json output
scripts/           check-release.ts: tag, version, CHANGELOG, and repository.url checks before a release
templates/api/     the API template; its own AGENTS.md describes its conventions
skills/            create-bun-api (for the toolkit), plus add-endpoint, add-model, verify-and-debug (copied into projects)
tests/             unit, contract, faults (failure injection), e2e, skills, pack (the published tarball)
evals/             agent task evaluations (see evals/README.md)
docs/              PLAN.md, decisions/

Test-only hook

BUN_API_TEMPLATES_DIR points the CLI at another templates directory. Tests use it to inject broken templates. It isn't part of the public contract.

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.