Typescript Javascript logo

Typescript Javascript

Community
d-padmanabhan
typescript-javascript

TypeScript and JavaScript development standards for modern web and Node.js development. Covers strict TypeScript configuration, type safety patterns, ESM modules, async/await, testing with Jest/Vitest, and security best practices. Use when working with .ts, .tsx, .js, .mjs files, package.json, tsconfig.json, or when asking about TypeScript/JavaScript best practices.

Overview

Publisherd-padmanabhan
Repositoryagent-engineering-handbook
Skill nametypescript-javascript
Stars
20
Forks
3
Bundled files
3
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 3 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by d-padmanabhan on GitHub. Read the source before you install it.

Installation

Install the Typescript Javascript AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/typescript-javascript
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook.git /tmp/agent-engineering-handbook
mkdir -p .claude/skills
cp -r /tmp/agent-engineering-handbook/skills/typescript-javascript .claude/skills/typescript-javascript
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Typescript Javascript in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Typescript Javascript on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Typescript Javascript is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

TypeScript & JavaScript Development

Mandatory gates are owned by the JavaScript and TypeScript rule (${HANDBOOK_ROOT}/rules/225-javascript-typescript.mdc). This skill and its references own procedures and examples.

Guiding Principles

  1. Type Safety: Leverage strict mode, avoid any, use discriminated unions
  2. Explicit Over Implicit: Prefer explicit types for clarity and maintainability
  3. Modern Defaults: ESM, const/let, async/await, optional chaining
  4. Security First: Never use eval, sanitize HTML, validate inputs

Quick Reference

AspectTypeScriptJavaScript
Package Managerpnpm preferredpnpm preferred
Module SystemES ModulesES Modules + // @ts-check
Lintingeslint --max-warnings=0eslint --max-warnings=0
FormattingPrettierPrettier
TypesStrict modeJSDoc types

Non-Negotiables

NN-1: Validate at trust boundaries

Static types do not validate runtime data. Treat HTTP bodies, responses, webhooks, queue messages, localStorage/sessionStorage, environment variables, CLI args, and JSON files as unknown until validated with Zod or an explicit type guard.

Reject:

  • JSON.parse(raw) as T
  • await response.json() as T
  • unchecked property access on remote JSON
  • as any or double assertions (value as unknown as T)

NN-2: Fetch/API calls require timeout + status check + schema validation

Every service/network fetch must include a timeout, check response.ok, and validate the JSON shape before returning typed data.

typescript
import { z } from 'zod';

async function fetchJson<T>(
  url: string,
  schema: z.ZodType<T>,
  options: RequestInit = {},
): Promise<T> {
  const response = await fetch(url, {
    ...options,
    signal: options.signal ?? AbortSignal.timeout(5_000),
    headers: { Accept: 'application/json', ...options.headers },
  });
  if (!response.ok) {
    throw new Error(`request failed: HTTP ${response.status}`);
  }
  return schema.parse(await response.json());
}

NN-3: Production servers are hardened by default

Node/Express/Fastify services need bounded request bodies, explicit CORS, security headers, request IDs, structured logging, generic 5xx responses, and graceful shutdown. Do not use direct app.listen(...) examples for production services without retaining and closing the server.

Use the observability skill (${HANDBOOK_ROOT}/skills/observability/SKILL.md) for event schemas, redaction, metric cardinality, trace propagation, SLOs, alerts, and telemetry pipelines. Keep runtime-specific logger and OpenTelemetry integration in this skill.

NN-4: Package manager and runtime are pinned

Declare packageManager and Node engine policy in package.json; CI uses Corepack and the declared package manager.

Production applications normally use the newest supported active LTS Node.js line accepted by the deployment target. Pin the exact package manager and tested CI runtime, commit one native lockfile, and test compiler upgrades. Follow the dependency and toolchain currency workflow (${HANDBOOK_ROOT}/skills/core-engineering/references/dependency-and-toolchain-currency.md).

json
{
  "packageManager": "pnpm@10.0.0",
  "engines": { "node": ">=22" }
}

NN-5: Exported APIs have explicit type and documentation contracts

  • Production JavaScript uses // @ts-check and precise JSDoc types for exported parameters, return values, callbacks, generics, and shared object shapes.
  • TypeScript exported functions and public methods use explicit parameter and return types. Keep type inference for obvious local variables.
  • Add TSDoc or JSDoc when callers need behavior, error, ownership, blocking, side-effect, constraint, or lifecycle information that the signature cannot express.
  • Use @param, @returns, @throws, @remarks, and examples only when they add contract information.
  • Do not add comments that merely repeat names or types.
  • Static types and documentation never replace runtime validation at trust boundaries.

Critical Patterns

typescript
// 1. Use strict equality
if (value === 0) { }        // ✅ GOOD
if (value == 0) { }         // ❌ BAD

// 2. Handle Promise rejections
fetchData().catch(err => console.error(err));  // ✅ GOOD

// 3. Optional chaining and nullish coalescing
const name = user?.profile?.name ?? 'Guest';  // ✅ GOOD

// 4. Use Set/Map for lookups
const seen = new Set();     // ✅ GOOD (O(1))
const seen = [];            // ❌ BAD (O(n))

// 5. Never use eval or new Function
eval(userInput);            // ❌ NEVER DO THIS

// 6. Sanitize HTML
element.textContent = userInput;  // ✅ GOOD
element.innerHTML = userInput;    // ❌ BAD (XSS)

TypeScript Configuration

json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "noUncheckedIndexedAccess": true,
    "esModuleInterop": true,
    "skipLibCheck": false
  }
}

Avoid any - Use Proper Types

typescript
// ❌ BAD - Loses all type safety
function processData(data: any): any {
  return data.value;
}

// ✅ GOOD - Generic type
function processData<T>(data: T): T {
  return data;
}

// ✅ GOOD - Unknown for truly unknown types
function processData(data: unknown): string {
  if (typeof data === 'object' && data !== null && 'value' in data) {
    return String((data as { value: unknown }).value);
  }
  throw new Error('Invalid data');
}

Discriminated Unions

typescript
type SuccessResponse = {
  status: 'success';
  data: { id: string; name: string };
};

type ErrorResponse = {
  status: 'error';
  error: { code: number; message: string };
};

type ApiResponse = SuccessResponse | ErrorResponse;

function handleResponse(response: ApiResponse): void {
  if (response.status === 'success') {
    console.log(response.data.id);  // Type-safe
  } else {
    console.log(response.error.message);  // Type-safe
  }
}

Utility Types

typescript
interface User {
  id: string;
  name: string;
  email: string;
  password: string;
}

type UserUpdate = Partial<User>;           // All optional
type UserCredentials = Pick<User, 'email' | 'password'>;
type UserPublic = Omit<User, 'password'>;  // Exclude password
type RequiredUser = Required<User>;        // All required
type ReadonlyUser = Readonly<User>;        // Immutable

Async Patterns

typescript
// Parallel execution
const [users, products] = await Promise.all([
  fetchUsers(),
  fetchProducts()
]);

// Handle partial failures
const results = await Promise.allSettled([
  fetchUsers(),
  fetchProducts()
]);

results.forEach(result => {
  if (result.status === 'fulfilled') {
    console.log(result.value);
  } else {
    console.error(result.reason);
  }
});

Security Rules (Mandatory)

  • Never use eval, new Function, or unsanitized innerHTML
  • Use textContent for DOM insertion
  • Validate and sanitize all external inputs
  • Do not log secrets/tokens/PII
  • Use parameterized queries; no string-built queries
  • Enforce HTTPS; secure cookies (HttpOnly, SameSite)

Naming Conventions

TypeConventionExample
Functions/VariablescamelCasefetchUserData
Classes/InterfacesPascalCaseUserService
ConstantsUPPER_SNAKE_CASEMAX_RETRIES
TypesPascalCaseApiResponse

Detailed References

  • TypeScript Patterns: See TypeScript patterns (${HANDBOOK_ROOT}/skills/typescript-javascript/references/typescript-patterns.md) for advanced types, generics, and mapped types
  • JavaScript Patterns: See JavaScript patterns (${HANDBOOK_ROOT}/skills/typescript-javascript/references/javascript-patterns.md) for JSDoc, ESM, and performance

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Typescript Javascript AI skill do?

TypeScript and JavaScript development standards for modern web and Node.js development. Covers strict TypeScript configuration, type safety patterns, ESM modules, async/await, testing with Jest/Vitest, and security best practices. Use when working with .ts, .tsx, .js, .mjs files, package.json, tsconfig.json, or when asking about TypeScript/JavaScript best practices.

Why use Typescript Javascript on TypingMind?

Because you install it once and use it with any model. Typescript Javascript is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Typescript Javascript in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/typescript-javascript. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Typescript Javascript?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Typescript Javascript?

As many as you like. As long as a model supports skills, you can use Typescript Javascript with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Typescript Javascript AI skill free?

Yes. It is published on GitHub by d-padmanabhan under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇