Tsc build check
TypeScript/Next.js プロジェクトで commit/push 前に行う型チェック→ビルド検証の標準パターン。発火: TS プロジェクトで `tsc --noEmit` `npm run build` 連続呼び出し時、CI失敗時、本番デプロイ前のローカル verifyFrom its SKILL.md
npx -y skills add bokuwalily/claude-code-skills --skill tsc-build-checkAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
1.6 KB, 494 tokens by cl100k_base, as published. Nobody here has run it
Procedure
npx tsc --noEmit 2>&1 | head -40で型エラー先頭40行を取得- exit code チェック:
$? = 0ならビルドへ進む(非ゼロなら型エラーを修正して再実行) npm run build 2>&1 | tail -30で末尾30行を取得- exit 0 確認、warning が >0 ならログ全文を確認
git diff --cachedで staged 差分の最終 review
Pitfalls
npx tscのキャッシュが古いと false positive が発生 →rm -rf .next node_modules/.cacheで clean run- Next.js は
npm run buildで型エラーを catch することがあり、tsc単体では検出しない型もある(next/image 型など) --incremental利用時は.tsbuildinfoが >200KB になると逆効果(post_tsc_check.sh の adaptive 戦略を参照)tail -30で見切れる場合はtail -100に拡張、または2>&1 | tee build.logで全文保存
Verification
- 検出: ログに
found 0 error/Compiled successfullyが含まれる - 比較: 前回 commit ハッシュとの diff で regression(増えたエラー)なし
- exit code:
tscとbuild両方が 0 npx tsc --noEmit; echo "tsc=$?"; npm run build; echo "build=$?"の連結で両方の終了コードを 1 行で確認可能
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.