← Back to Skills Marketplace
kirkraman

typescript

by KirkRaman · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
88
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install kirk-typescript
Description
Write type-safe TypeScript with proper narrowing, inference patterns, and strict mode best practices.
README (SKILL.md)

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

Topic File
Generic patterns generics.md
Utility types utility-types.md
Declaration files declarations.md
Migration from JS migration.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\x3CT>() 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
Usage Guidance
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.
Capability Analysis
Type: OpenClaw Skill Name: kirk-typescript Version: 1.0.0 The skill bundle is a collection of educational documentation and best practices for TypeScript development. It covers topics such as type narrowing, generics, declaration files, and migration strategies across files like SKILL.md, generics.md, and migration.md. There are no executable code snippets, network requests, or instructions that attempt to subvert the agent's behavior or exfiltrate data.
Capability Assessment
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.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install kirk-typescript
  3. After installation, invoke the skill by name or use /kirk-typescript
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of the TypeScript skill. - Provides concise explanations of type-safe TypeScript patterns and common pitfalls. - Includes quick reference table for generics, utility types, declarations, and JS migration. - Emphasizes proper use of unknown vs. any, and cautions about narrowing failures. - Documents best practices for discriminated unions, type inference, and literal types. - Adds strict guidance for null handling, module boundaries, and type-only imports.
Metadata
Slug kirk-typescript
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is typescript?

Write type-safe TypeScript with proper narrowing, inference patterns, and strict mode best practices. It is an AI Agent Skill for Claude Code / OpenClaw, with 88 downloads so far.

How do I install typescript?

Run "/install kirk-typescript" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is typescript free?

Yes, typescript is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does typescript support?

typescript is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created typescript?

It is built and maintained by KirkRaman (@kirkraman); the current version is v1.0.0.

💬 Comments