Skip to content

AI agents

discord0 ships files and tools for coding agents such as Claude Code, Cursor, and Codex. An agent can read the API from the package, test its changes offline, and fix errors from the error text alone, without opening a browser.

File For
node_modules/discord0/skills/discord0/SKILL.md A short primer: the mental model, an API cheat sheet, and common mistakes
node_modules/discord0/ERRORS.md Every error code, with why it happens and how to fix it
AGENTS.md in new projects Points agents at the primer and at discord0 test

discord0 init writes AGENTS.md into every new project, so an agent working in the project finds the primer without being told about it.

Every error starts with a stable code. Then it says what went wrong, with the specific names and values, why, and how to fix it:

[INVALID_TASK] Invalid task name "Daily": use 1-64 lowercase letters, digits, hyphens, and underscores
Why: Task names become host resource names (Cloudflare Cron Triggers, EventBridge schedules, Netlify functions), so they're limited to 1-64 lowercase letters, digits, `-`, and `_`.
Fix: Rename it, for example to "daily".
Docs: https://github.com/natebabyak/discord0/blob/main/packages/discord0/ERRORS.md#invalid_task

When the fix depends on your code, the Fix: line names it. An invalid name comes with a valid one to use, and an unknown task, command, or option lists the valid ones. Errors from Discord’s API list the fields Discord rejected, name the request with tokens redacted, and suggest a fix for common codes such as 10062 (answered too late) and 50001 (missing access).

Thrown errors are Discord0Error instances, with code, detail, why, fix, and docs properties, and JSON.stringify gives a structured log entry. Match on code, not on the message text. See the error reference for every code.

Failures discord0 recovers from, such as a handler that throws, are logged the same way, as [HANDLER_FAILED] The handler for /ping threw followed by the original error.

discord0/testing runs the app the way Discord would, without Discord or a network. After an agent changes a command, one command runs the tests and checks the reply:

Terminal window
npx discord0 test

A test result’s errors lists what handlers threw. A misspelled command, subcommand, or option fails with INVALID_TEST_INPUT, and the error lists the valid names.

The docs site publishes /llms.txt, an index of every page with its description, and /llms-full.txt, every page in one Markdown file for a model’s context.