Skip to content
Back to skills

Typescript Professional Usage

ASecurity

`analysis-agent`/`task-agent`/`review-agent`: use when TypeScript runtime validation, structural typing, async, numeric, or module semantics change; skip generic work.

  • 7 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 8, 2026
developmenttypescriptrustnodetestingapidatabasefrontendsecurityperformance

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 22, 2026

npx -y skills add machenjie/rd-skills --skill typescript-professional-usage --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Typescript Professional Usage?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Typescript Professional Usage
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/machenjie-typescript-professional-usage/badge)](https://www.skillsdirectory.com/skills/machenjie-typescript-professional-usage)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: typescript-professional-usage
description: "`analysis-agent`/`task-agent`/`review-agent`: use when TypeScript runtime validation, structural typing, async, numeric, or module semantics change; skip generic work."
---

# typescript-professional-usage

## Registry Trigger

**Use when**

- Inspect or change TypeScript trust-boundary validation, structural assignability, unsafe escapes, async cancellation, numeric meaning, emitted modules, or public declarations.
- Browser, Node, SDK, generated-client, storage, message, or package-export behavior can differ from what the type checker accepts.

**Do not use when**

- The open question is generic frontend state, API policy, package/build configuration, performance, testing, or language style without a TypeScript-specific semantic risk.
- No task-local TypeScript source, declaration, generated surface, compiler boundary, or emitted runtime behavior requires inspection or change.

## Skill Role

Protect TypeScript runtime semantics.

## High-Value Rules

- Derive runtime shape/compatibility from producer, trust/version and generation/storage/parsing guarantees. Gaps require owned validation/invalid-input outcomes; declarations prove no runtime shape/safety.
- Structural assignability can admit extra capabilities, erase nominal identity, or conflate absent/present-undefined. Add discriminants, exact parsers, brands, or `satisfies` only for concrete invariants.
- `any`, assertions, non-null operators, and suppressions need inspected evidence; boundary escapes (trust/storage/generated/public) need owners and cleanup triggers.
- Require observation of owned promises/background tasks; propagate supported cancellation (`AbortSignal` or equivalent); settle cleanup/state on rejection, timeout or stale completion.
- Classify safe integers, fractions, `NaN`, infinities, decimal money, `bigint`, serialized numbers, and units at behavior-changing conversions/comparisons.
- Check emitted imports (type-only/runtime), side effects, ESM/CJS/conditional exports, module resolution, declarations, and generated entrypoints on every supported runtime/build target.
- Verify public/generated types through named consumer compilation using selected config/files/module graph.
- Test version skew for contracts affecting or mismatching supported runtime behavior; source/emission evidence can prove unchanged boundaries.

## Anti-Patterns

- Types/compilation substitute for runtime validation.
- Structural compatibility moves domain/database objects or authority across DTO/SDK/storage/message boundaries.
- Unobserved promises, broad catches/defaults, or stale completion hide rejection, cancellation, or user-visible state.
- Type tests miss emitted-module/numeric-serialization failures.

## Stop Conditions

- Absent decisive runtime/consumer/emission/validation evidence, fail closed; types/assumptions cannot select behavior.
- Route API/SDK, product-state, money/timezone, security, package/build/bundler, runtime-performance/testing to their owners.

## Output Contract

- TypeScript semantic decision with runtime boundary, structural-type limits, and bounded escapes; async, cancellation, and numeric behavior; module emission and public/generated compatibility; proof limits and specialist routes.

## Targeted References

| Path | Type | Load when | Do not load when | Required by | Required output |
|---|---|---|---|---|---|
| [benchmarks and patterns](references/benchmarks-and-patterns.md) | benchmark-pattern | A TypeScript change affects runtime validation structural typing unsafe escapes async numeric module-emission or public-type semantics | The TypeScript edit preserves these boundaries and established compiler plus runtime behavior resolves the mechanism | task-agent, analysis-agent, review-agent | option-comparison, selected-approach |

Files in this skill

  • SKILL.md4.2 KB
  • references/benchmarks-and-patterns.md2.8 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…