deno
Deno runtime for TypeScript/JavaScript. Covers permissions, standard library, testing, and Deploy. Use for secure, TypeScript-native backend development. USE WHEN: user mentions "deno", "permissions", "Deno.serve", asks about "deno test", "deno deploy", "standard library", "top-level await", "npm compatibility" DO NOT USE FOR: Node.js runtime - use `nodejs` skill instead DO NOT USE FOR: Fresh/Oak frameworks - use framework-specific skills DO NOT USE FOR: Language syntax - use `typescript` skill
What this skill does
# Deno Core Knowledge
> **Full Reference**: See [advanced.md](advanced.md) for production readiness, testing patterns, middleware, Deno Deploy, and npm compatibility.
> **Deep Knowledge**: Use `mcp__documentation__fetch_docs` with technology: `deno` for comprehensive documentation.
## Basics
### Running Scripts
```bash
# Run a TypeScript file
deno run main.ts
# Run with permissions
deno run --allow-net --allow-read main.ts
# Run remote script
deno run https://deno.land/std/examples/welcome.ts
# Check/compile without running
deno check main.ts
```
### TypeScript Native
```typescript
// main.ts - TypeScript works out of the box
interface User {
id: number;
name: string;
email: string;
}
async function fetchUser(id: number): Promise<User> {
const response = await fetch(`https://api.example.com/users/${id}`);
return await response.json();
}
// Top-level await - no async wrapper needed
const user = await fetchUser(1);
console.log(user.name);
```
---
## Permissions
### Permission Types
| Flag | Description |
|------|-------------|
| `--allow-read` | File system read access |
| `--allow-write` | File system write access |
| `--allow-net` | Network access |
| `--allow-env` | Environment variable access |
| `--allow-run` | Subprocess execution |
| `--allow-ffi` | Foreign function interface |
| `--allow-sys` | System information |
| `-A` or `--allow-all` | All permissions |
### Granular Permissions
```bash
# Specific paths
deno run --allow-read=/etc,/tmp script.ts
# Specific hosts
deno run --allow-net=api.example.com,db.example.com:5432 script.ts
# Specific environment variables
deno run --allow-env=DATABASE_URL,API_KEY script.ts
```
### Runtime Permission Requests
```typescript
// Request permission at runtime
const status = await Deno.permissions.request({ name: "read", path: "/etc" });
if (status.state === "granted") {
const data = await Deno.readTextFile("/etc/passwd");
}
// Query current permission
const netStatus = await Deno.permissions.query({
name: "net",
host: "api.example.com"
});
console.log(netStatus.state); // "granted", "denied", or "prompt"
```
---
## Standard Library
### File System
```typescript
// Read file
const content = await Deno.readTextFile("./data.txt");
// Write file
await Deno.writeTextFile("./output.txt", "Hello, World!");
// Read directory
for await (const entry of Deno.readDir("./")) {
console.log(entry.name, entry.isFile, entry.isDirectory);
}
// File info
const stat = await Deno.stat("./file.txt");
console.log(stat.size, stat.mtime);
// Copy/remove files
await Deno.copyFile("./src.txt", "./dest.txt");
await Deno.remove("./temp.txt");
await Deno.remove("./temp-dir", { recursive: true });
```
### Path Operations
```typescript
import { join, basename, dirname, extname } from "https://deno.land/std/path/mod.ts";
const fullPath = join("home", "user", "documents", "file.txt");
console.log(basename(fullPath)); // "file.txt"
console.log(dirname(fullPath)); // "home/user/documents"
console.log(extname(fullPath)); // ".txt"
```
### Async Utilities
```typescript
import { delay } from "https://deno.land/std/async/delay.ts";
import { deadline } from "https://deno.land/std/async/deadline.ts";
// Delay
await delay(1000); // Wait 1 second
// Deadline (timeout)
try {
const result = await deadline(fetchData(), 5000); // 5 second timeout
} catch (e) {
if (e instanceof DeadlineError) {
console.log("Request timed out");
}
}
```
---
## Deno.serve (Modern HTTP)
### Basic Server
```typescript
Deno.serve((req: Request) => {
return new Response("Hello, World!");
});
```
### With Configuration
```typescript
Deno.serve({
port: 8000,
hostname: "0.0.0.0",
onListen: ({ port, hostname }) => {
console.log(`Server started at http://${hostname}:${port}`);
},
}, handler);
```
### Routing
```typescript
Deno.serve((req: Request) => {
const url = new URL(req.url);
const { pathname } = url;
if (req.method === "GET" && pathname === "/") {
return new Response("Home");
}
if (req.method === "GET" && pathname === "/api/users") {
return Response.json(users);
}
if (req.method === "POST" && pathname === "/api/users") {
return handleCreateUser(req);
}
// Pattern matching
const userMatch = pathname.match(/^\/api\/users\/(\d+)$/);
if (userMatch && req.method === "GET") {
const userId = parseInt(userMatch[1]);
return Response.json(users.find(u => u.id === userId));
}
return new Response("Not Found", { status: 404 });
});
```
---
## Testing
### Basic Tests
```typescript
import { assertEquals, assertThrows } from "https://deno.land/std/assert/mod.ts";
Deno.test("simple test", () => {
assertEquals(1 + 1, 2);
});
Deno.test("async test", async () => {
const response = await fetch("https://api.example.com/health");
assertEquals(response.status, 200);
});
Deno.test("throws test", () => {
assertThrows(
() => { throw new Error("boom"); },
Error,
"boom"
);
});
```
### Running Tests
```bash
# Run all tests
deno test
# Run specific file
deno test user_test.ts
# With permissions
deno test --allow-net --allow-read
# Watch mode
deno test --watch
# Coverage
deno test --coverage=coverage
deno coverage coverage --lcov > coverage.lcov
```
---
## deno.json Configuration
```json
{
"tasks": {
"dev": "deno run --watch --allow-net main.ts",
"start": "deno run --allow-net main.ts",
"test": "deno test --allow-read"
},
"imports": {
"@std/": "https://deno.land/[email protected]/",
"express": "npm:express@4",
"zod": "npm:zod"
},
"compilerOptions": {
"strict": true
}
}
```
---
## When NOT to Use This Skill
| Scenario | Use Instead |
|----------|-------------|
| Node.js runtime specifics | `nodejs` skill |
| Fresh framework | Framework-specific skill |
| Oak framework | Framework-specific skill |
| TypeScript syntax | `typescript` skill |
| npm package ecosystem | `nodejs` skill |
---
## Anti-Patterns
| Anti-Pattern | Why It's Bad | Correct Approach |
|--------------|--------------|------------------|
| Using --allow-all | Defeats security model | Grant specific permissions |
| Not versioning imports | Breaking changes | Pin versions in imports |
| Ignoring lock file | Reproducibility issues | Commit deno.lock |
| Mixing npm: and https: imports | Inconsistent deps | Prefer one approach |
| Not handling permission errors | Runtime failures | Check permissions first |
| Synchronous file I/O | Blocks runtime | Use async Deno APIs |
| No error boundaries | Unhandled errors | Add error middleware |
| Hardcoded URLs | Portability issues | Use environment variables |
---
## Quick Troubleshooting
| Issue | Cause | Solution |
|-------|-------|----------|
| "PermissionDenied" | Missing permission flag | Add --allow-* flag |
| "Module not found" | Wrong URL or version | Check import URL |
| "Integrity check failed" | Lock file mismatch | Run with --lock-write |
| "Top-level await not allowed" | .js file extension | Use .ts or .mjs |
| "Cannot find module 'node:fs'" | Node compat needed | Use Deno.* APIs instead |
| Slow startup | Downloading remote modules | Use vendor or deno cache |
| Type errors with npm packages | Missing types | Use @types or as any |
| Test failures | Permissions in tests | Add --allow-* to test command |
---
## Reference Documentation
- [Permissions](quick-ref/permissions.md)
- [Standard Library](quick-ref/std.md)
- [Testing](quick-ref/testing.md)
> **Deep Knowledge**: Use `mcp__documentation__fetch_docs` with technology: `deno` for comprehensive documentation.
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.