AIPM
Theme

AIPM package

Gravitas Typescript

@udaysharmadev/gravitas-typescript@1.0.0

>

Scanned · no issues · Oct 18, 2026

GitHub stars: ★ 243

LinkedInPost

Install Skill

Pins this version in aipm.package.json and aipm-lock.json.

aipm add @udaysharmadev/gravitas-typescript@1.0.0

Without project tracking

Writes the skill files only. Add --no-init to skip aipm.package.json and the lockfile.

aipm add @udaysharmadev/gravitas-typescript@1.0.0 --no-init

How to use

Install the skill above, then run this in your AI tool:

/gravitas-typescript <your description>

About

Extends the base GRAVITAS skill with TypeScript-specific patterns. Load `skills/gravitas/SKILL.md` first, then this file.

Source

What gets added to your project

Preview every file this package writes on install before you run the command above.

Summary

>

Skill instructions

GRAVITAS — TypeScript Extension

Extends the base GRAVITAS skill with TypeScript-specific patterns. Load skills/gravitas/SKILL.md first, then this file.


TypeScript Recon Additions

Add to standard recon checklist:

code
□ tsconfig.json — strict mode? noUncheckedIndexedAccess? exactOptionalPropertyTypes?
□ package.json — TypeScript version, test runner (vitest vs jest)
□ eslint config — @typescript-eslint rules in effect
□ type declarations — are there .d.ts files that affect this module?
□ path aliases — does tsconfig have paths? (affects imports)

Read tsconfig strictly

bash
cat tsconfig.json | jq '.compilerOptions | {strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes, target, lib}'

TypeScript Verification Chain

bash
# Full chain — always in this order
tsc --noEmit                           # catches type errors first
eslint . --max-warnings 0              # @typescript-eslint rules
vitest run --reporter=verbose          # or: jest --verbose

# With coverage
vitest run --coverage --reporter=verbose

# Type coverage (optional, requires type-coverage)
npx type-coverage --strict

TypeScript-Specific Anti-Patterns

Never use any

typescript
BAD:  function process(data: any) { ... }
GOOD: function process(data: ProcessInput) { ... }

Never use as to silence type errors

typescript
BAD:  const user = data as User;  // silences real type error
GOOD: if (isUser(data)) { const user = data; ... }

Handle undefined explicitly

typescript
BAD:  const name = user.name;          // may be undefined
GOOD: const name = user.name ?? 'Anonymous';

Strict null checks

typescript
BAD:  return users.find(u => u.id === id).name;  // crash if not found
GOOD: return users.find(u => u.id === id)?.name;

Common TypeScript Failure Modes

FailureRoot CauseFix
Object is possibly undefinedOptional property accessed without guardAdd ?. or null check
Type 'string' is not assignable to 'number'Wrong type passedCheck function signature, fix caller
Property does not exist on typeInterface mismatchUpdate interface or use correct property
Cannot find modulePath alias not in tsconfigAdd to paths in tsconfig
Argument of type X is not assignable to YGeneric type mismatchCheck generic constraints
Implicit any in strict modeMissing type annotationAdd explicit type

TypeScript Patterns

Parameterized types over any

typescript
function first<T>(arr: T[]): T | undefined {
  return arr[0];
}

Discriminated unions for type safety

typescript
type Result<T> =
  | { ok: true; data: T }
  | { ok: false; error: string };

Type guards instead of casts

typescript
function isUser(obj: unknown): obj is User {
  return typeof obj === 'object' && obj !== null && 'id' in obj;
}

Test Patterns (Vitest)

Test file location

Follow project convention — check existing tests:

bash
find src/ -name "*.test.ts" | head -5  # see the pattern

Standard test structure

typescript
import { describe, it, expect, vi, beforeEach } from 'vitest';

describe('[module]', () => {
  beforeEach(() => { vi.clearAllMocks(); });

  it('[behavior] when [condition]', () => {
    // Arrange
    const input = ...;
    // Act
    const result = fn(input);
    // Assert
    expect(result).toEqual(expected);
  });
});

Mocking

typescript
vi.mock('../db', () => ({
  query: vi.fn().mockResolvedValue({ rows: [] })
}));

Quick Reference

bash
# Find all TypeScript errors
tsc --noEmit 2>&1 | grep "error TS"

# Find implicit any
tsc --noEmit --strict 2>&1

# Count test files
find src/ -name "*.test.ts" | wc -l

# Run single test file
vitest run src/auth/session.test.ts

# Watch mode (dev)
vitest --watch

Loading package files…

Share this package

Add an Install with AIPM badge

Add this badge to a GitHub README so readers can open the package page and install the same version.

Install with AIPM
[![Install with AIPM](https://www.aipm-registry.com/install-with-aipm.svg)](https://www.aipm-registry.com/skills/udaysharmadev/gravitas-typescript/1.0.0?utm_source=github&utm_medium=readme&utm_campaign=package_badge)

Publisher

Uday Sharma

This imported publisher has not claimed its AIPM account. A connected account confirms account control, but it does not guarantee that a package is safe.

AI assistant context

What this skill is for

@udaysharmadev/gravitas-typescript@1.0.0 is an AIPM skill package for All tools. Use it when a project needs the reusable AI behavior described as: >

Install
aipm add @udaysharmadev/gravitas-typescript@1.0.0
Use after install
/gravitas-typescript <your description>

Tool targets

Install command by target

Add --no-init to any of these when you want the skill files without aipm.package.json or aipm-lock.json.

cursor

Run this variant when you want to install the package into cursor.

aipm add @udaysharmadev/gravitas-typescript@1.0.0 --target cursor --ci

claude

Run this variant when you want to install the package into claude.

aipm add @udaysharmadev/gravitas-typescript@1.0.0 --target claude --ci

Discussion

Comments (0)

Loading comments…

Package FAQ

Install and compatibility

How to install
Run aipm add @udaysharmadev/gravitas-typescript@1.0.0 in a project that has AIPM initialized.
Supported tools
@udaysharmadev/gravitas-typescript@1.0.0 supports All tools.

Before installing

AIPM skills can add files to your project. Review the package name, target, description, license, and publisher before installing. Use a clean branch when trying a new skill.