typescript-strict

Strict TypeScript rules. Use when writing ANY TypeScript.

25 stars

Best use case

typescript-strict is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Strict TypeScript rules. Use when writing ANY TypeScript.

Teams using typescript-strict should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/typescript-strict/SKILL.md --create-dirs "https://raw.githubusercontent.com/ComeOnOliver/skillshub/main/skills/aiskillstore/marketplace/barnhardt-enterprises-inc/typescript-strict/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/typescript-strict/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How typescript-strict Compares

Feature / Agenttypescript-strictStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Strict TypeScript rules. Use when writing ANY TypeScript.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Strict TypeScript Standards

## Rules

### 1. NO `any`
```typescript
// NEVER
function process(data: any) {}

// CORRECT
function process(data: unknown) {
  if (isValidData(data)) { /* use data */ }
}
```

### 2. Explicit Returns
```typescript
// NEVER
function getUser(id: string) { return db.find(id); }

// CORRECT
function getUser(id: string): Promise<User | null> { return db.find(id); }
```

### 3. Typed Errors
```typescript
// NEVER
catch (e) { console.log(e.message); }

// CORRECT
catch (error: unknown) {
  if (error instanceof AppError) { logger.error(error.message); }
  else if (error instanceof Error) { logger.error(error.message); }
  else { logger.error('Unknown error', { error }); }
}
```

### 4. No Unexplained Assertions
```typescript
// NEVER
const user = users.find(u => u.id === id)!;

// CORRECT
const user = users.find(u => u.id === id);
if (!user) throw new NotFoundError(`User ${id} not found`);
```

### 5. Prefer Type Inference Where Obvious
```typescript
// Unnecessary - type is inferred
const count: number = 5;

// Good - type is inferred
const count = 5;

// Good - explicit for function signatures
function add(a: number, b: number): number {
  return a + b;
}
```

### 6. Use Discriminated Unions
```typescript
// CORRECT
type Result<T> =
  | { success: true; data: T }
  | { success: false; error: string };

function handle(result: Result<User>) {
  if (result.success) {
    // TypeScript knows result.data exists
    console.log(result.data.name);
  } else {
    // TypeScript knows result.error exists
    console.log(result.error);
  }
}
```

## Quick Reference

| Pattern | Status |
|---------|--------|
| `any` | NEVER |
| Implicit return | NEVER |
| `!` without comment | NEVER |
| `// @ts-ignore` | NEVER |
| `as` casting | MINIMIZE |
| `unknown` + guards | PREFERRED |

Related Skills

microsoft-typescript

25
from ComeOnOliver/skillshub

ALWAYS use when editing or working with *.ts, *.tsx, *.mts, *.cts files or code importing "typescript". Consult for debugging, best practices, or modifying typescript, TypeScript.

typescript-mcp-server-generator

25
from ComeOnOliver/skillshub

Generate a complete MCP server project in TypeScript with tools, resources, and proper configuration

javascript-typescript-jest

25
from ComeOnOliver/skillshub

Best practices for writing JavaScript/TypeScript tests using Jest, including mocking strategies, test structure, and common patterns.

typescript-pro

25
from ComeOnOliver/skillshub

Master TypeScript with advanced types, generics, and strict type safety. Handles complex type systems, decorators, and enterprise-grade patterns. Use PROACTIVELY for TypeScript architecture, type inference optimization, or advanced typing patterns.

javascript-typescript-typescript-scaffold

25
from ComeOnOliver/skillshub

You are a TypeScript project architecture expert specializing in scaffolding production-ready Node.js and frontend applications. Generate complete project structures with modern tooling (pnpm, Vite, N

dbos-typescript

25
from ComeOnOliver/skillshub

DBOS TypeScript SDK for building reliable, fault-tolerant applications with durable workflows. Use this skill when writing TypeScript code with DBOS, creating workflows and steps, using queues, using DBOSClient from external applications, or building applications that need to be resilient to failures.

typescript-write

25
from ComeOnOliver/skillshub

Write TypeScript and JavaScript code following Metabase coding standards and best practices. Use when developing or refactoring TypeScript/JavaScript code.

typescript-review

25
from ComeOnOliver/skillshub

Review TypeScript and JavaScript code changes for compliance with Metabase coding standards, style violations, and code quality issues. Use when reviewing pull requests or diffs containing TypeScript/JavaScript code.

tdd-vitest-typescript

25
from ComeOnOliver/skillshub

Test-Driven Development (TDD) using Vitest and TypeScript. Use when the user requests help with TDD, writing tests before code, test-first development, Vitest test setup, TypeScript testing patterns, unit testing, integration testing, or following the Red-Green-Refactor cycle with Vitest.

typescript-node-expert

25
from ComeOnOliver/skillshub

Expert TypeScript/Node.js developer for building high-quality, performant, and maintainable CLI tools and libraries. Enforces best practices, strict typing, and modern patterns.

typescript-dev

25
from ComeOnOliver/skillshub

TypeScript development best practices, code quality tools, and documentation templates. Activated when working with .ts, .tsx files or TypeScript projects.

typescript-strict-guard

25
from ComeOnOliver/skillshub

Use when writing or reviewing TypeScript code. Enforces strict mode standards, explicit typing, and best practices. Prevents 'any' types, @ts-ignore comments, and non-null assertions. This is a COMPREHENSIVE skill - consult the detailed guides before writing any TypeScript code.