Deno TypeScript LSP
Use this skill when working with TypeScript/JavaScript files (.ts, .tsx, .js, .jsx, .mts, .cts, .mjs, .cjs) in Deno projects, or when the user asks about Deno-specific patterns, imports, configuration, testing, or tooling.
What this skill does
# Deno TypeScript Development
Deno is the primary TypeScript/JavaScript runtime and language server. It replaces the entire Node.js toolchain: no tsc, eslint, prettier, jest, webpack needed.
## Core Philosophy
- **One tool** - Deno handles typecheck, lint, format, test, coverage, benchmark
- **Security first** - Explicit permissions, minimal external dependencies
- **Import maps** - All dependencies declared in `deno.json`, never direct imports
- **ESM only** - No CommonJS, always include `.ts` extensions in relative imports
## Configuration - deno.json
Single source of truth for all project configuration:
```json
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"noUnusedLocals": true,
"noUnusedParameters": true
},
"imports": {
"@/": "./src/",
"@std/assert": "jsr:@std/assert@^1.0.14",
"@std/fs": "jsr:@std/fs@^1.0.19",
"zod": "npm:zod@^3.23.8"
},
"tasks": {
"dev": "deno run --watch --allow-net --allow-read src/main.ts",
"test": "deno test --allow-all --coverage=coverage",
"check": "deno check src/**/*.ts",
"lint": "deno lint",
"fmt": "deno fmt"
},
"exclude": ["coverage/", "node_modules/"],
"lock": true
}
```
## Import Strategy
**CRITICAL:** Never use direct JSR/npm imports in source files.
```typescript
// ✅ GOOD - Use import map aliases
import { assertEquals } from "@std/assert";
import { z } from "zod";
import { Agent } from "@/domain/agent.ts";
import { helper } from "./utils.ts"; // Extension required!
// ❌ BAD - Direct registry imports
import { z } from "npm:zod@^3.23.8";
import { assertEquals } from "jsr:@std/assert";
```
**Import Order:**
1. Standard library (`@std/*`)
2. Third-party (`zod`, etc.)
3. Internal absolute (`@/domain/...`)
4. Relative (`./utils.ts`)
**Version Pinning:** Always pin versions in `deno.json`. No floating `@latest`.
## Dependency Sources (Priority Order)
1. **`jsr:` registry** - First choice for TypeScript modules
2. **`npm:` specifier** - When JSR unavailable, prefer ESM-compatible
3. **URL imports** - Rarely needed with import maps
```json
{
"imports": {
"@std/assert": "jsr:@std/assert@^1.0.14",
"zod": "npm:zod@^3.23.8"
}
}
```
## Testing
**Co-locate unit tests with source:**
```
src/
└── domain/
├── agent.ts
└── agent.test.ts # Test file next to source
```
**Test file naming:** Always use `.test.ts` suffix.
**AAA Pattern (Arrange-Act-Assert):**
```typescript
import { assertEquals } from "@std/assert";
Deno.test("agent processes valid input", () => {
// Arrange
const agent = new Agent({ name: "Test" });
// Act
const result = agent.process("hello");
// Assert
assertEquals(result.status, "success");
});
```
**Coverage requirements:**
- Line coverage: 80%+ (non-negotiable)
- Branch coverage: 60-80% (non-negotiable)
**Use `@std/testing` for test utilities:**
```typescript
import { FakeTime } from "@std/testing/time";
import { stub, spy } from "@std/testing/mock";
Deno.test("timer behavior", () => {
using time = new FakeTime();
time.tick(1000);
// Deterministic time control
});
```
## Permissions Model
Default to minimum required permissions:
```bash
# ❌ BAD
deno run --allow-all script.ts
# ✅ GOOD
deno run --allow-read=./data --allow-net=api.example.com script.ts
```
**Common flags:**
- `--allow-read[=<path>]` - File system read
- `--allow-write[=<path>]` - File system write
- `--allow-net[=<domain>]` - Network access
- `--allow-env[=<var>]` - Environment variables
- `--allow-run[=<program>]` - Subprocess execution
## Essential Commands
```bash
# Development
deno run --watch src/main.ts # Watch mode
deno check src/**/*.ts # Type-check
deno fmt # Format
deno lint # Lint
# Testing
deno test # Run tests
deno test --watch --fail-fast # Watch mode
deno test --coverage=coverage # With coverage
deno coverage coverage --html # Generate report
# Dependencies
deno add jsr:@std/path # Add dependency
deno cache --reload # Update cache
deno cache --lock=deno.lock --lock-write # Update lockfile
# Tasks
deno task dev # Run defined task
```
## Standard Library (@std/*)
Use JSR standard library for common utilities:
- `@std/assert` - Testing assertions
- `@std/fs` - File system utilities
- `@std/path` - Path manipulation
- `@std/http` - HTTP server/client
- `@std/async` - Async utilities (debounce, retry, etc.)
- `@std/testing` - Mock, spy, FakeTime
- `@std/ulid` - ULID generation
## Anti-Patterns to Avoid
```typescript
// ❌ Direct registry imports in source
import { z } from "npm:zod@^3.23.8";
// ❌ Missing file extension
import { helper } from "./utils";
// ❌ Node.js APIs
import * as fs from "node:fs";
const fs = require("fs");
// ❌ Unnecessary async wrapper
async function validate(input: string): Promise<boolean> {
return input.length > 0; // No await needed
}
// ❌ Test delays instead of FakeTime
await new Promise(r => setTimeout(r, 100));
```
## Lockfile Management
- **Always commit** `deno.lock` to version control
- Update lockfile: `deno cache --lock=deno.lock --lock-write`
- CI mode: `deno run --lock=deno.lock --lock-write=false`
Related in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.