auto-type-checking — скилл для Claude Code: проверка типов после
Гоняет tsc --noEmit после каждой правки TypeScript-файла и показывает ошибки типов сразу, а не на сборке.
npx skills add spencerpauly/awesome-cursor-skills --skill auto-type-checking -a claude-codeЧто делает auto-type-checking
Скилл запускает проверку типов после того, как агент отредактировал .ts или .tsx. Вручную это выглядит так: npx tsc --noEmit 2>&1 | head -30, и найденные ошибки правятся до перехода к следующей задаче. Автоматический вариант — хук Cursor в .cursor/hooks.json на событие afterFileEdit со скриптом check-types.sh и маской **/*.{ts,tsx}. Скрипт делает npx tsc --noEmit --pretty 2>&1 | head -20 и завершается с exit 0, поэтому агент не блокируется даже при ошибках — он просто видит вывод.
Что смотреть в выводе: пропущенный импорт (Cannot find name), несовпадение типов, отсутствующее свойство в интерфейсе, возможный null без проверки, невыполненное ограничение дженерика. Каждый случай чинится по месту — добавить импорт, поправить тип или значение, расширить интерфейс.
На большом проекте tsc может тормозить, поэтому в самом скилле советуют --incremental или проверку только изменённых файлов. С алиасами путей всё сломается, если paths в tsconfig.json настроены неверно. В монорепозитории запускать tsc нужно из корня пакета, а не из корня воркспейса. Для цикла «править, пока не станет чисто» скилл предлагают сочетать с grinding-until-pass.
Какие задачи решает
- поймать ошибку типов сразу после правки файла
- убрать пропущенный импорт до запуска сборки
- починить несовпадение типов в аргументе функции
- добавить недостающее свойство в интерфейс
- проверить возможный
nullи поставить optional chaining
Примеры запросов агенту
- проверь типы после правки
- запусти tsc --noEmit и покажи первые ошибки
- прогони проверку типов по изменённым файлам
Как установить auto-type-checking
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill auto-type-checking -a claude-code2Вручную: положить файлы
~/.claude/skills/auto-type-checking/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/auto-type-checking/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill auto-type-checking -a codex2Вручную: положить файлы
.agents/skills/auto-type-checking/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill auto-type-checking -a cursor2Вручную: положить файлы
.cursor/skills/auto-type-checking/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install spencerpauly/awesome-cursor-skills auto-type-checking2Вручную: положить файлы
.github/skills/auto-type-checking/SKILL.md1Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill auto-type-checking -a gemini-cli2Командой платформы
gemini skills install https://github.com/spencerpauly/awesome-cursor-skills --path resources/auto-type-checkingВручную: положить файлы
.devin/skills/auto-type-checking/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill auto-type-checking -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о auto-type-checking
Как установить auto-type-checking в Claude?
Выполните npx skills add spencerpauly/awesome-cursor-skills --skill auto-type-checking -a claude-code. Скилл окажется в ~/.claude/skills/auto-type-checking/SKILL.md.
Что делает auto-type-checking?
Запускает проверку типов TypeScript после каждой правки файла и показывает ошибки, пока агент ещё работает над задачей.
Нужен ли Cursor для автоматического режима?
Хуки на afterFileEdit описаны для Cursor через .cursor/hooks.json. В остальных случаях остаётся ручной запуск npx tsc --noEmit.
Исходный текст
SKILL.md · CC0-1.0
---
name: auto-type-checking
description: Run TypeScript type checking after file edits and immediately flag type errors before moving on. Uses Cursor hooks for automatic enforcement.
user-invocable: true
---
# Auto Type Checking
Catch type errors immediately after every edit instead of discovering them at build time.
## Manual Workflow
After editing a TypeScript file, run:
```bash
npx tsc --noEmit 2>&1 | head -30
```
If errors appear, fix them before moving on.
## Automated with Cursor Hooks
Add to `.cursor/hooks.json` to run automatically after every file edit:
```json
{
"hooks": [
{
"event": "afterFileEdit",
"script": "check-types.sh",
"pattern": "**/*.{ts,tsx}"
}
]
}
```
Create `.cursor/hooks/check-types.sh`:
```bash
#!/bin/bash
# Quick type check — only reports errors, doesn't block
npx tsc --noEmit --pretty 2>&1 | head -20
exit 0 # Don't block the agent even if there are errors
```
```bash
chmod +x .cursor/hooks/check-types.sh
```
## What to Check
When type errors appear:
1. **Missing imports**: `Cannot find name 'X'` → add the import
2. **Type mismatches**: `Type 'string' is not assignable to type 'number'` → fix the type or the value
3. **Missing properties**: `Property 'x' does not exist on type 'Y'` → add the property to the interface or fix the access
4. **Null safety**: `Object is possibly 'null'` → add null check or optional chaining
5. **Generic constraints**: `Type 'X' does not satisfy the constraint 'Y'` → fix the generic parameter
## Tips
- Use `--noEmit` to type-check without producing output files
- For large projects, `tsc` can be slow — consider `--incremental` or running only on changed files
- If using path aliases, ensure `tsconfig.json` paths are configured correctly
- For monorepos, run `tsc` from the package root, not the workspace root
- Pair with `grinding-until-pass` for a full "fix until clean" loop
© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills