Home › Deno › Deno 2 AGENTS.md

Deno 2 AGENTS.md

AGENTS.md for Deno 2 projects: deno.json tasks, JSR and npm imports, permissions, and built-in tooling.

AGENTS.mdDeno

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

Note: Review and test before use. Provided as is, without warranty. See Terms.

AGENTS.mdDownload  
# AGENTS.md: Deno 2

## Commands
- `deno task dev` · `deno test -A` · `deno lint` · `deno fmt --check` · `deno check .`

## Dependencies
- Declare imports in `deno.json` `imports`; add with `deno add jsr:@std/path` or `deno add npm:zod`. Prefer JSR (`@std/*`) for standard utilities.
- No URL imports in new code and no `node_modules` assumptions unless `nodeModulesDir` is set.

## Permissions
- Run with the narrowest flags in tasks: `--allow-net=api.example.com`, `--allow-read=./data`, `--allow-env=API_KEY`. Don't add `-A` to production tasks.

## Code
- Web standard APIs first: `fetch`, `Request`/`Response`, `URL`, `crypto.subtle`, streams.
- HTTP servers with `Deno.serve(handler)`; split routing into modules or use the framework already in `deno.json` (Hono, Fresh).
- Env via `Deno.env.get()`; validate at startup.
- Tests: `Deno.test` with `@std/assert`; use `t.step` for sub-steps. Clean up resources so the leak sanitizers pass.
- Node built-ins only with the `node:` prefix.

## Done
`deno fmt --check && deno lint && deno check . && deno test` pass.

More: all Deno rules · all AGENTS.md rules

Related rules

REST API design AGENTS.md

AGENTS.md for designing consistent HTTP/JSON APIs: resource naming, status codes, errors, pagination, and versioning.

AGENTS.mdAPI design

Blazor (.NET 10) AGENTS.md

AGENTS.md for Blazor Web Apps on .NET 10: render modes, components, forms and validation, state, and bUnit tests.

AGENTS.md.NET / ASP.NET Core

Celery background jobs AGENTS.md

AGENTS.md for Celery 5 task queues in Python/Django: idempotent tasks, retries, time limits, and safe enqueueing.

AGENTS.mdPython

Express 5 API AGENTS.md

AGENTS.md for Express 5 REST APIs in TypeScript with zod validation, error middleware, and supertest.

AGENTS.mdNode.js / TypeScript

Flask 3 AGENTS.md

AGENTS.md for Flask 3 apps: app factory, blueprints, SQLAlchemy 2.0, and pytest with the test client.

AGENTS.mdFlask

Go stdlib HTTP service AGENTS.md

AGENTS.md for Go 1.27 services using only net/http, slog, and database/sql or pgx, with no web framework.

AGENTS.mdGo

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.