deno-typescript — Claude Code skill: what it does, how to install
Development guidelines for Deno and TypeScript covering project conventions, security flags, built-in tooling, and Deno KV or Hono setups.
npx skills add Mindrally/skills --skill deno-typescript -a claude-codeWhat deno-typescript does
This skill defines programming patterns tailored to the Deno runtime. It enforces explicit parameter and return typing while blocking any. File organization relies on ES modules with explicit file extensions, centralized imports in deps.ts, and packages from JSR.
The guide includes patterns for native Deno.serve HTTP handlers, web backends using Hono, and persistence with Deno KV. For quality checks, the skill specifies std/assert assertions alongside native CLI commands.
Deno runs code in a sandbox by default. Application scripts fail on disk and network operations unless executed with explicit permission flags such as --allow-net or --allow-read.
What it helps with
- structure files and configure import maps in
deno.json - configure runtime security flags for disk and network access
- build HTTP endpoints using
Deno.serve, Hono, or Fresh - store and query key-value entries with Deno KV
- write BDD test suites using
std/assert
Example prompts for the agent
- Build an HTTP route in Deno using Hono and Zod validation
- Create a data access module that queries Deno KV by prefix
- Set up a test suite for user_service.ts using assertRejects and BDD helpers
How to install deno-typescript
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill deno-typescript -a claude-code2Manually: put the files in place
~/.claude/skills/deno-typescript/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/deno-typescript/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill deno-typescript -a codex2Manually: put the files in place
.agents/skills/deno-typescript/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill deno-typescript -a cursor2Manually: put the files in place
.cursor/skills/deno-typescript/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Mindrally/skills deno-typescript2Manually: put the files in place
.github/skills/deno-typescript/SKILL.md1Skills CLI (Vercel)
npx skills add Mindrally/skills --skill deno-typescript -a gemini-cli2Platform CLI
gemini skills install https://github.com/Mindrally/skills --path deno-typescriptManually: put the files in place
.devin/skills/deno-typescript/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Mindrally/skills --skill deno-typescript -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about deno-typescript
How do I install deno-typescript in Claude Code?
Run npx skills add Mindrally/skills --skill deno-typescript -a claude-code in your terminal.
What does deno-typescript do?
It guides coding assistants on Deno practices, focusing on strict TypeScript types, deps.ts dependency trees, and native CLI utilities.
How does it manage execution permissions?
The rules instruct assistants to specify narrow flags like --allow-net or --allow-env during execution or handle checks programmatically via Deno.permissions.request.
Source text
SKILL.md · Apache-2.0
---
name: deno-typescript
description: Guidelines for developing with Deno and TypeScript using modern runtime features, security model, and native tooling
metadata:
maintainer: Mindrally
source: https://github.com/Mindrally/skills
---
# Deno TypeScript Development
You are an expert in Deno and TypeScript development with deep knowledge of building secure, modern applications using Deno's native TypeScript support and built-in tooling.
## TypeScript General Guidelines
### Basic Principles
- Use English for all code and documentation
- Always declare types for variables and functions (parameters and return values)
- Avoid using `any` type - create necessary types instead
- Use JSDoc to document public classes and methods
- Write concise, maintainable, and technically accurate code
- Use functional and declarative programming patterns
- No configuration needed - Deno runs TypeScript natively
### Nomenclature
- Use PascalCase for classes, types, and interfaces
- Use camelCase for variables, functions, and methods
- Use kebab-case for file and directory names
- Use UPPERCASE for environment variables
- Use descriptive variable names with auxiliary verbs: `isLoading`, `hasError`, `canDelete`
- Start each function with a verb
### Functions
- Write short functions with a single purpose
- Use arrow functions for simple operations
- Use async/await for asynchronous operations
- Prefer the RO-RO pattern for multiple parameters
### Types and Interfaces
- Prefer interfaces over types for object shapes
- Avoid enums; use const objects with `as const`
- Use Zod for runtime validation with inferred types
- Use `readonly` for immutable properties
## Deno-Specific Guidelines
### Project Structure
```
src/
routes/
{resource}/
mod.ts
handlers.ts
validators.ts
middleware/
auth.ts
logger.ts
services/
{domain}_service.ts
types/
mod.ts
utils/
mod.ts
deps.ts
main.ts
deno.json
```
### Module System
- Use ES modules with explicit file extensions
- Use `deps.ts` pattern for centralized dependency management
- Import from URLs or use import maps in `deno.json`
- Use JSR (jsr.io) for Deno-native packages
```typescript
// deps.ts - centralized dependencies
export { serve } from "https://deno.land/[email protected]/http/server.ts";
export { z } from "https://deno.land/x/[email protected]/mod.ts";
// Using import maps in deno.json
{
"imports": {
"std/": "https://deno.land/[email protected]/",
"hono": "https://deno.land/x/[email protected]/mod.ts"
}
}
```
### Security Model
Deno is secure by default. Request only necessary permissions:
```bash
# Run with specific permissions
deno run --allow-net --allow-read=./data --allow-env main.ts
# Permission flags
--allow-net=example.com # Network access to specific domains
--allow-read=./path # File read access
--allow-write=./path # File write access
--allow-env=API_KEY # Environment variable access
--allow-run=cmd # Subprocess execution
```
```typescript
// Programmatic permission requests
const status = await Deno.permissions.request({ name: "net", host: "api.example.com" });
if (status.state === "granted") {
// Network access granted
}
```
### HTTP Server with Deno.serve
```typescript
// Simple HTTP server
Deno.serve({ port: 8000 }, (req) => {
const url = new URL(req.url);
if (url.pathname === "/api/users" && req.method === "GET") {
return Response.json({ users: [] });
}
return new Response("Not Found", { status: 404 });
});
```
### Using Hono with Deno
```typescript
import { Hono } from "https://deno.land/x/hono/mod.ts";
const app = new Hono();
app.get("/", (c) => c.text("Hello Deno!"));
app.get("/api/users", (c) => c.json({ users: [] }));
Deno.serve(app.fetch);
```
### Using Fresh Framework
```typescript
// routes/index.tsx
import { PageProps } from "$fresh/server.ts";
export default function Home(props: PageProps) {
return (
<div>
<h1>Welcome to Fresh</h1>
</div>
);
}
// routes/api/users.ts
import { Handlers } from "$fresh/server.ts";
export const handler: Handlers = {
async GET(_req, _ctx) {
const users = await getUsers();
return Response.json(users);
},
};
```
### Database Integration
```typescript
// Using Deno KV (built-in key-value store)
const kv = await Deno.openKv();
// Set a value
await kv.set(["users", "1"], { name: "John", email: "[email protected]" });
// Get a value
const result = await kv.get(["users", "1"]);
console.log(result.value);
// List values
const entries = kv.list({ prefix: ["users"] });
for await (const entry of entries) {
console.log(entry.key, entry.value);
}
```
### Environment Variables
```typescript
// Access environment variables (requires --allow-env)
const apiKey = Deno.env.get("API_KEY");
// Using dotenv
import { load } from "https://deno.land/std/dotenv/mod.ts";
const env = await load();
```
### Testing with Built-in Test Runner
```typescript
// user_test.ts
import { assertEquals, assertRejects } from "https://deno.land/std/assert/mod.ts";
import { describe, it, beforeEach } from "https://deno.land/std/testing/bdd.ts";
import { getUser, createUser } from "./user_service.ts";
describe("User Service", () => {
beforeEach(() => {
// Setup
});
it("should create a user", async () => {
const user = await createUser({ name: "John", email: "[email protected]" });
assertEquals(user.name, "John");
});
it("should throw for invalid email", async () => {
await assertRejects(
() => createUser({ name: "John", email: "invalid" }),
Error,
"Invalid email"
);
});
});
// Run tests
// deno test --allow-net --allow-read
```
### Built-in Tooling
```bash
# Formatting
deno fmt
# Linting
deno lint
# Type checking
deno check main.ts
# Bundle
deno bundle main.ts bundle.js
# Compile to executable
deno compile --allow-net main.ts
# Documentation generation
deno doc main.ts
# Dependency inspection
deno info main.ts
```
### Configuration with deno.json
```json
{
"tasks": {
"dev": "deno run --watch --allow-net --allow-env main.ts",
"start": "deno run --allow-net --allow-env main.ts",
"test": "deno test --allow-net",
"lint": "deno lint",
"fmt": "deno fmt"
},
"imports": {
"std/": "https://deno.land/[email protected]/",
"@/": "./src/"
},
"compilerOptions": {
"strict": true,
"lib": ["deno.window"]
},
"lint": {
"rules": {
"tags": ["recommended"]
}
},
"fmt": {
"indentWidth": 2,
"singleQuote": true
}
}
```
### Error Handling
```typescript
class AppError extends Error {
constructor(
message: string,
public statusCode: number = 500,
public code: string = "INTERNAL_ERROR"
) {
super(message);
this.name = "AppError";
}
}
const handleRequest = async (req: Request): Promise<Response> => {
try {
return await processRequest(req);
} catch (error) {
if (error instanceof AppError) {
return Response.json(
{ error: error.message, code: error.code },
{ status: error.statusCode }
);
}
console.error(error);
return Response.json(
{ error: "Internal Server Error" },
{ status: 500 }
);
}
};
```
### Web Standards
Deno embraces web standards. Use:
- `fetch()` for HTTP requests
- `Request` and `Response` objects
- `URL` and `URLSearchParams`
- `Web Crypto API` for cryptography
- `Streams API` for data streaming
- `FormData` for multipart data
### Performance
- Use web streams for large data processing
- Leverage Deno KV for fast key-value storage
- Use `Deno.serve` for high-performance HTTP
- Compile to standalone executables for deployment
© Mindrally · Apache-2.0 · Mindrally/skills