eduardbar/migestion/typescript

Claude Code and agent skill by eduardbar/migestion

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

TypeScript strict patterns and best practices. Trigger: When implementing or refactoring TypeScript in .ts/.tsx (types, interfaces, generics, const maps, type guards, removing any, tightening unknown).

Install

npx vskill@latest install eduardbar/migestion/typescript

SKILL.md

The same SKILL.md was published earlier as eduardbar/migestion/typescript.

Const Types Pattern (REQUIRED)

typescript
// ✅ ALWAYS: Create const object first, then extract type
const CLIENT_STATUS = {
ACTIVE: 'active',
INACTIVE: 'inactive',
PENDING: 'pending',
} as const;
type ClientStatus = (typeof CLIENT_STATUS)[keyof typeof CLIENT_STATUS];
// ❌ NEVER: Direct union types
type ClientStatus = 'active' | 'inactive' | 'pending';

Why? Single source of truth, runtime values, autocomplete, easier refactoring.

Flat Interfaces (REQUIRED)

typescript
// ✅ ALWAYS: One level depth, nested objects → dedicated interface
interface ClientAddress {
street: string;
city: string;
}
interface Client {
id: string;
name: string;
address: ClientAddress;
}
interface Admin extends Client {
permissions: string[];
}
// ❌ NEVER: Inline nested objects
interface Client {
address: { street: string; city: string }; // NO!
}

Never Use any

typescript
// ✅ Use unknown for truly unknown types
function parse(input: unknown): Client {
if (isClient(input)) return input;
throw new Error('Invalid input');
}
// ✅ Use generics for flexible types
function first<T>(arr: T[]): T | undefined {
return arr[0];
}
// ❌ NEVER
function parse(input: any): any {}

Utility Types

typescript
Pick<Client, 'id' | 'name'>; // Select fields
Omit<Client, 'id'>; // Exclude fields
Partial<Client>; // All optional
Required<Client>; // All required
Readonly<Client>; // All readonly
Record<string, Client>; // Object type
Extract<Union, 'a' | 'b'>; // Extract from union
Exclude<Union, 'a'>; // Exclude from union
NonNullable<T | null>; // Remove null/undefined
ReturnType<typeof fn>; // Function return type
Parameters<typeof fn>; // Function params tuple

Type Guards

typescript
function isClient(value: unknown): value is Client {
return typeof value === 'object' && value !== null && 'id' in value && 'name' in value;
}

Import Types

typescript
import type { Client } from './types';
import { createClient, type Config } from './utils';

Strict Mode

TypeScript strict mode is enabled. No implicit any, strict null checks.

typescript
// ✅ Explicit types
function greet(name: string): string {
return `Hello, ${name}`;
}
// ❌ Implicit any (not allowed)
function greet(name) {
// Error!
return `Hello, ${name}`;
}

Prisma Types

typescript
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
type PrismaClient = typeof prisma;
type Client = PrismaClient['client'];
// Prisma input types
import { Prisma } from '@prisma/client';
type ClientCreateInput = Prisma.ClientCreateInput;
type ClientUpdateInput = Prisma.ClientUpdateInput;

Commands

bash
npm run typecheck # Type check all
npm run typecheck --workspace=@migestion/api # API only
npm run typecheck --workspace=@migestion/web # Web only

Security

  • Security scanPassed, 90 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/eduardbar/migestion/typescript/badge)](https://verified-skill.com/skills/eduardbar/migestion/typescript)

Something wrong with this skill or its page? Tell us.