typescript

v1.0.0

Write type-safe TypeScript with proper narrowing, inference patterns, and strict mode best practices.

0· 99·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for kirkraman/kirk-typescript.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "typescript" (kirkraman/kirk-typescript) from ClawHub.
Skill page: https://clawhub.ai/kirkraman/kirk-typescript
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install kirk-typescript

ClawHub CLI

Package manager switcher

npx clawhub@latest install kirk-typescript
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name and description describe TypeScript guidance and the skill only includes markdown docs about typing, generics, utility types, and migration; there are no unrelated requirements (no binaries, env vars, or config paths).
Instruction Scope
SKILL.md and the included documents provide coding guidance and reference local files only; there are no directives to read system files, environment variables, or to transmit data to external endpoints.
Install Mechanism
No install specification and no code files — it is instruction-only, which is the lowest-risk install model (nothing is downloaded or written to disk by an installer).
Credentials
The skill declares no required environment variables, credentials, or config paths; nothing in the docs asks for secrets or external API keys.
Persistence & Privilege
always is false (default) and model invocation is allowed (normal). The skill does not request persistent or elevated privileges or indicate it will modify other skills or system settings.
Assessment
This skill is a bundle of TypeScript guidance docs and appears internally consistent and low risk: it does not request credentials or install code. Before installing, note that the skill's source/homepage is not provided — if provenance matters to you, confirm the author or review the text for correctness and style you trust. Also remember an autonomous agent may call the skill when relevant (this is normal); if you want to restrict that, disable or control the skill in your agent settings.

Like a lobster shell, security has layers — review code before you run it.

aivk975adrw0s5ke212a9ad4bhh3985bp3slatestvk975adrw0s5ke212a9ad4bhh3985bp3s
99downloads
0stars
1versions
Updated 6d ago
v1.0.0
MIT-0

When to Use

User needs TypeScript expertise — from basic typing to advanced generics. Agent handles type narrowing, inference, discriminated unions, and strict mode patterns.

Quick Reference

TopicFile
Generic patternsgenerics.md
Utility typesutility-types.md
Declaration filesdeclarations.md
Migration from JSmigration.md

Stop Using any

  • unknown forces you to narrow before use — any silently breaks type safety
  • API responses: type them or use unknown, never any
  • When you don't know the type, that's unknown, not any

Narrowing Failures

  • filter(Boolean) doesn't narrow — use .filter((x): x is T => Boolean(x))
  • Object.keys(obj) returns string[], not keyof typeof obj — intentional, objects can have extra keys
  • Array.isArray() narrows to any[] — may need assertion for element type
  • in operator narrows but only if property is in exactly one branch of union

Literal Type Traps

  • let x = "hello" is string — use const or as const for literal type
  • Object properties widen: { status: "ok" } has status: string — use as const or type annotation
  • Function return types widen — annotate explicitly for literal returns

Inference Limits

  • Callbacks lose inference in some array methods — annotate parameter when TS guesses wrong
  • Generic functions need usage to infer — fn<T>() can't infer, pass a value or annotate
  • Nested generics often fail — break into steps with explicit types

Discriminated Unions

  • Add a literal type or kind field to each variant — enables exhaustive switch
  • Exhaustive check: default: const _never: never = x — compile error if case missed
  • Don't mix discriminated with optional properties — breaks narrowing

satisfies vs Type Annotation

  • const x: Type = val widens to Type — loses literal info
  • const x = val satisfies Type keeps literal, checks compatibility — prefer for config objects

Strict Null Handling

  • Optional chaining ?. returns undefined, not null — matters for APIs expecting null
  • ?? only catches null/undefined|| catches all falsy including 0 and ""
  • Non-null ! should be last resort — prefer narrowing or early return

Module Boundaries

  • import type for type-only imports — stripped at runtime, avoids bundler issues
  • Re-exporting types: export type { X } — prevents accidental runtime dependency
  • .d.ts augmentation: use declare module with exact module path

Comments

Loading comments...