No slash command · from fuse-typescript
Covers TypeScript 7.0 language features: const type parameters, using/await using, standard decorators, satisfies, and fixes LLM-authored anti-patterns like legacy enum and namespace.
Ships in fuse-typescript. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
It also covers fixing LLM-authored anti-patterns: legacy enum (un-erasable by Node's type stripper, replace with const objects as const), namespace wrapping runtime code, and missing import type under verbatimModuleSyntax.
Out of scope: tsconfig/compiler flags belong to ts-config; SOLID structure and file-size rules belong to solid-generic; framework-specific APIs are not covered.
Before writing non-trivial TypeScript, spawn 3 agents in parallel, one Agent call each with a name:
verbatimModuleSyntax, tsconfig/microsoft/typescript for exact API shapesAfter writing, run fuse-ai-pilot:sniper for validation.
| Feature | What it gives you |
|---|---|
const type parameters | <const T> infers the narrowest literal type without as const at call sites |
using / await using | Deterministic cleanup via Symbol.dispose / Symbol.asyncDispose |
| Standard decorators | ECMAScript decorators — NOT experimentalDecorators |
satisfies | Validate a value against a type while keeping its narrow inferred type |
| 6.0 inference | Method-syntax callbacks are no longer contextually sensitive → order-independent inference |
| 7.0 template literals | Inference splits on Unicode code points, not UTF-16 surrogate halves |
import type is mandatory under verbatimModuleSyntax - type-only imports must say type, or emit/stripping breaks.enum - prefer const objects as const; enum is un-erasable by Node's type stripper.namespace with runtime code - use ESM modules; type-only namespace is acceptable.experimentalDecorators for new code.any - strict is the default since 6.0 (kept in 7.0); annotate or infer explicitly.| Topic | Reference | When to Consult |
|---|---|---|
| Resource management | resource-management.md | Load when using using / await using / disposables |
| Generics & inference | generics-and-inference.md | Load when using const type params, satisfies, or debugging inference |
| Decorators | decorators.md | Load when adding decorators |
| LLM pitfalls | llm-pitfalls.md | Load when reviewing or migrating legacy/AI-authored TypeScript |
| Template | When to Use |
|---|---|
| modern-patterns.md | Copy-paste const/satisfies/decorator examples |
| resource-management.md | Copy-paste using / DisposableStack examples |
const type parameterfunction first<const T extends readonly unknown[]>(arr: T): T[0] {
return arr[0];
}
const x = first(["a", "b"]); // x: "a" (literal, no `as const` needed)
using for deterministic cleanupfunction openFile(path: string) {
const handle = acquire(path);
return { handle, [Symbol.dispose]() { release(handle); } };
}
{
using file = openFile("./data"); // released automatically at block end
}
satisfiesconst config = {
port: 3000,
host: "localhost",
} satisfies Record<string, string | number>;
// config.port stays `number`, not widened to `string | number`
enum Color { Red } with const Color = { Red: "red" } as constusing over manual try/finally cleanup when a resource has a disposersatisfies instead of a type annotation when you want to keep the narrow inferred typeimport { SomeType } for a type-only import — use import type { SomeType }experimentalDecorators or emitDecoratorMetadata for new codenamespace to organize runtime code — that is what ESM modules are forreferences/decorators.md (opens in a new tab)references/generics-and-inference.md (opens in a new tab)references/llm-pitfalls.md (opens in a new tab)references/resource-management.md (opens in a new tab)references/templates/modern-patterns.md (opens in a new tab)references/templates/resource-management.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub fusengine/claude-plugins --plugin fuse-typescript7 skills in this plugin
/ts-configUse when creating or migrating a tsconfig.json, choosing module/moduleResolution, or fixing TS 6.0 deprecations that are hard errors in TS 7.0. Not for language syntax (ts-language-patterns)./ts-lint-formatUse when choosing or configuring a TS linter/formatter — Biome 2.x vs ESLint 10 flat config + typescript-eslint typed linting. Not for type checking itself (ts-config)./ts-packagingUse when publishing a TypeScript library — exports map, JSR vs npm, dual ESM/CJS, type validation, provenance. Not for application deployment.Other plugins' skills for the same job