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.