AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Language Typescript

skill-lugassawan-swe-workbench-language-typescript · by lugassawan

TypeScript and JavaScript idioms — strict mode, type safety, discriminated unions, async patterns, and Node. Auto-load when working with .ts, .tsx, .js, .jsx files, package.json, or when the user mentions TypeScript, JavaScript, Node, type safety, or tsconfig.

— No reviews yet
0 installs
45 views
0.0% view→install

Install

$ agentstack add skill-lugassawan-swe-workbench-language-typescript

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • ✓ Prompt-injection patterns
  • ✓ Secret / credential exfiltration
  • ✓ Dangerous shell & filesystem operations
  • ✓ Untrusted network calls
  • ✓ Known-malicious package signatures

What it can access

  • ● Network access Used
  • ✓ Filesystem access No
  • ✓ Shell / process execution No
  • ✓ Environment & secrets No
  • ✓ Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-lugassawan-swe-workbench-language-typescript)

Reliability & compatibility

✓ Security review passed
0 installs to date
— no reviews yet
● 2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Language Typescript? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

TypeScript / JavaScript

Strict mode or nothing

Enable in tsconfig.json:

{
  "compilerOptions": {
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "noImplicitOverride": true,
    "exactOptionalPropertyTypes": true
  }
}

Without these, types lie.

Prefer unknown over any

any turns off the type system. unknown forces narrowing.

function parse(input: unknown): User {
  if (!isUser(input)) throw new Error("invalid user");
  return input;
}

Discriminated unions over enums

Enums have runtime quirks and poor exhaustiveness. Use string-literal unions with a discriminant.

type Event =
  | { kind: "click"; x: number; y: number }
  | { kind: "submit"; form: FormData };

function handle(e: Event) {
  switch (e.kind) {
    case "click":  return trackClick(e.x, e.y);
    case "submit": return submit(e.form);
    default: {
      const _exhaustive: never = e; return _exhaustive;
    }
  }
}

Branded types for domain primitives

Stop UserId from being passed where an OrderId is expected.

type Brand = K & { readonly __brand: T };
type UserId = Brand;
type OrderId = Brand;
const makeUserId = (s: string): UserId => s as UserId;

Async patterns

  • await everything that returns a promise. Floating promises silently swallow errors.
  • Enable @typescript-eslint/no-floating-promises.
  • Promise.all for all-or-fail; Promise.allSettled when partial failure is acceptable.
  • Don't mix .then() chains with await in the same function.
  • Timeouts belong on every external call. AbortController is the standard.
const ac = new AbortController();
const t = setTimeout(() => ac.abort(), 5_000);
try {
  const r = await fetch(url, { signal: ac.signal });
  return await r.json();
} finally {
  clearTimeout(t);
}

Structural typing gotchas

TypeScript types are shapes, not identities. Two unrelated types with the same fields are interchangeable. Brand when you need nominal behavior.

Error handling

  • Throw Error subclasses, not strings.
  • Catch unknown at boundaries; narrow before use.
  • For domain code, consider Result-style unions over throwing — explicit, typed, exhaustively handled.

Modules and imports

  • ESM ("type": "module") in new projects.
  • Absolute imports via paths in tsconfig; don't ship ../../../ ladders.
  • Keep barrels (index.ts) shallow — deep barrels slow cold-start and break tree-shaking.

React / TSX notes

  • ReactNode for children props. JSX.Element is narrower than you usually want.
  • Avoid FC — it adds implicit children and breaks generic components. Prefer function Thing(props: Props) { ... }.
  • useEffect only for synchronizing with external systems. Derived state belongs in render.

Tooling

  • Imports: npx organize-imports-cli (reliable regardless of ESLint config); or eslint --fix if eslint-plugin-import / @typescript-eslint/consistent-type-imports is configured
  • Format: prettier --write .
  • Lint: eslint . + tsc --noEmit
  • Test: vitest / jest (see Testing below)

Testing

  • Vitest or Jest — pick one.
  • tsd or expectType for type-level tests of public APIs.
  • Avoid snapshot tests of implementation details.

Avoid

  • any, // @ts-ignore, as unknown as T in production code.
  • Non-null assertions (!) without a comment explaining why.
  • Object, Function, {} as types — they are never what you want.
  • Classes where a function and a closure would do.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.