fix-typescript
БесплатноБез исполняемых скриптовНе проверенFix TypeScript errors with strict anti-reward-hacking rules. **ALWAYS use when** the user says 'fix type errors', 'fix typescript', 'type-check is failing'…
от coalesce-labs★ 20 звёзд на GitHubОб этом скилле
Fix TypeScript Errors
Fix TypeScript type errors for runtime type safety, not just to satisfy the linter. If a fix would pass tsc but could still crash at runtime, it's wrong.
Forbidden patterns
The canonical, exhaustive forbidden-pattern table — as any, as unknown as, @ts-ignore / @ts-expect-error, void tricks, underscore-prefixed unused locals, non-null assertions without a guard, forEach(async, and exported unused types, each with severity and acceptable/unacceptable examples — lives in the /catalyst-dev:scan-reward-hacking skill. Run it before marking this work complete; don't re-derive the list here.
Two more rules are process-level, not grep-able code patterns, so /catalyst-dev:scan-reward-hacking doesn't scan for them — they are still forbidden:
- Commenting out code instead of deleting it (git has history).
- Excluding files from
tsconfigto hide errors instead of fixing them.
Stricter than the canonical scan
Three cases the canonical scan accepts are not acceptable here, because you are actively fixing the error rather than auditing pre-existing code: an exported-but-unused type must be removed or unexported outright, not left as the canonical scan's informational note; @ts-ignore / @ts-expect-error are never acceptable, even with a documented reason and tracking ticket — fix the error instead of suppressing it; and a test mock's as any is not a license to introduce a new one while you're resolving a production type error.
Fix at the source, not the consumer
// WRONG - cast a query result
const users = (await db.from("users").select("*")) as unknown as User[];
// CORRECT - use the query builder's generic typing
const { data: users } = await db.from("users").select("*").returns<User[]>();
For external data (API requests, webhooks, uploads), validate with Zod at the boundary instead of casting:
// WRONG
const webhook = req.body as WebhookPayload;
// CORRECT
const webhook = WebhookPayloadSchema.parse(req.body);
When a type assertion is acceptable
Only for a third-party library limitation, documented with what was verified at runtime and a tracking ticket:
// LIBRARY TYPE LIMITATION: thirdPartyWrapper() returns a type TS can't verify.
// Verified at runtime it has the required methods. TODO: remove when the library
// updates types (tracked in TICKET-XXX).
const wrapped = thirdPartyResult as unknown as ExpectedInterface;
Process
- Read the TypeScript error; find the root cause — why doesn't the type already match?
- Fix at the source (the producing function/type), not the consumer.
- Detect the package manager (
bun.lockb/pnpm-lock.yaml/yarn.lock/package-lock.json, elsenpx tsc --noEmit) and run itstype-checkscript. - Run
/catalyst-dev:scan-reward-hackingon the files you changed. Work is not complete until it passes.
The golden rule
If you reach for as, ask "why doesn't the type already match?" and fix that instead. A type assertion means the source has wrong types (fix the source), external data wasn't validated (add Zod), or a library has incomplete types (document and track) — never use it to silence an error.
Установить fix-typescript в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadEditBashGrepFAQ
Что делает скилл fix-typescript?
Fix TypeScript errors with strict anti-reward-hacking rules. **ALWAYS use when** the user says 'fix type errors', 'fix typescript', 'type-check is failing', or when TypeScript compilation errors need to be resolved. Ensures runtime type safety — fixes root causes instead of silencing errors with casts.
Как установить скилл fix-typescript?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл fix-typescript запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic