mcpbeat Sign in

Typescript Check Agent Skill

TypeScript type checking via tsc --noEmit with actionable error output.

2k tokens
context cost
the whole folder, loaded on every use
1
files
instructions only
0
copies elsewhere
how many repositories repackaged it
413
stars on the repo
on the repository, not the skill itself

Install

one command, takes just this skill from the repository
npx skills add https://github.com/notque/vexjoy-agent --skill typescript-check

The instruction itself

16 sections, as written by the author

TypeScript Type Check Skill

Overview

This skill validates TypeScript code by running tsc --noEmit and parsing errors into structured, actionable reports organized by file. It is a read-only validation step (does not modify code) that implements a linear workflow: locate config → execute compiler → parse output → present results.

Use this skill when validating TypeScript code before commits, after refactors, or checking for type regressions. Do not use for linting, test execution, runtime errors, or projects without tsconfig.json.


Instructions

Step 1: Verify TypeScript Project

Locate tsconfig.json in the project. This step is mandatory—never skip it. tsc without a tsconfig.json falls back to default settings, missing project-specific configuration like paths, strict mode, and compiler targets.

ls tsconfig.json 2>/dev/null || ls */tsconfig.json 2>/dev/null

If no tsconfig.json exists, stop and inform the user. Do not proceed without configuration.

Why: Running without tsconfig.json produces unreliable results that don't match the project's actual settings.

Step 2: Run Type Check

Execute the TypeScript compiler in type-check-only mode using --noEmit:

npx tsc --noEmit 2>&1

Capture the exit code:

  • Exit 0: No type errors found. Report PASS.
  • Exit 1+: Type errors detected. Continue to Step 3.

Do not install TypeScript or dependencies. If TypeScript is not installed, inform the user and suggest npm install typescript --save-dev. This is a read-only skill—never modify package.json or run installation commands.

Why: --noEmit prevents generating .js files and gives you a clean type-only report. The exit code tells you definitively whether compilation succeeded.

Step 3: Parse Output

For each error line in the tsc output, extract:

  • File path: The .ts/.tsx file containing the error (use absolute paths for direct navigation)
  • Line:Column: Exact location in the file
  • Error code: TS#### identifier (e.g., TS2322, TS7006)
  • Message: Human-readable error description

Group errors by source file and sort by line number. This helps users fix issues systematically rather than jumping randomly through the codebase.

Why: Users need actual file paths, line numbers, and error codes to fix issues. Suppressing or summarizing this information (e.g., "5 errors found") makes errors unsolvable.

Step 4: Present Results

Format output using this structure. Always show the full exit code and complete error details:

=== TypeScript Type Check ===

Status: PASS / FAIL (N errors)

Errors by File:
---------------

src/components/Button.tsx
  Line 15:3  TS2322  Type 'string' is not assignable to type 'number'
  Line 28:10 TS2339  Property 'foo' does not exist on type 'Props'

src/utils/helpers.ts
  Line 5:1   TS7006  Parameter 'x' implicitly has an 'any' type

Summary: N files, M errors

Never present type errors as context for auto-fixing without explicit user request. Type check is a validation step—the user may want to review errors, may disagree with a fix approach, or may have a different solution in mind.

Why: Including the exit code and full output gives users all the context they need to make informed decisions about fixes.


Error Handling

Error: "Cannot find tsconfig.json"

Cause: No TypeScript configuration in the project root or specified path.

Solution:

  • Search for tsconfig.json in common locations (src/, app/, packages/)
  • If found elsewhere, re-run with --project path/to/tsconfig.json
  • If not found anywhere, inform user this requires a TypeScript project with a tsconfig.json file

Error: "Cannot find module 'typescript'"

Cause: TypeScript is not installed as a project dependency.

Solution:

  • Inform user that TypeScript must be installed first
  • Suggest npm install typescript --save-dev
  • Do not install it automatically—this is a read-only skill

Error: "npx: command not found"

Cause: Node.js toolchain is not installed or not in PATH.

Solution:

  • Verify Node.js is installed: node --version
  • If Node.js is present but npx missing, try npm exec tsc -- --noEmit
  • If Node.js is missing, inform user to install Node.js

Error: "Multiple tsconfig.json files found"

Cause: Project has nested or monorepo structure with multiple TypeScript configurations.

Solution:

  • List all tsconfig.json files and their paths
  • Ask user which configuration to use
  • Re-run with --project path/to/specific/tsconfig.json

Why explicit error handling matters: tsc may fail silently, produce incomplete output, or exit unexpectedly. Capturing and reporting the actual error lets the user understand what went wrong and how to fix it.


References

Common tsc Flags

| Flag | Purpose |

|------|---------|

| --noEmit | Type check only, do not generate .js files |

| --project path | Use specific tsconfig.json |

| --skipLibCheck | Skip type checking .d.ts files (faster on large projects) |

| --incremental | Use incremental compilation (faster for repeat runs) |

| --strict | Enable all strict type checks |

Integration Points

  • Before pr-workflow commit: Run type check before committing TypeScript changes
  • With vitest-runner: Run type check first, then tests
  • With code-linting: Run lint first, then type check

Optional Behaviors (OFF unless enabled)

  • --strict mode: Run with additional strict flags beyond tsconfig settings
  • --project path: Use a specific tsconfig.json when multiple exist
  • --skipLibCheck: Add --skipLibCheck to speed up checking on large projects
  • Specific files: Check only named files instead of entire project

Other skills for the same job

different authors, same section of the catalogue
MCP Builder
by anthropics
vendor ×13

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

30k tokens scripts
Changelog Generator
by frostant
×9

Automatically creates user-facing changelogs from git commits by analyzing commit history, categorizing changes, and transforming technical commits into clear, customer-friendly release notes. Turns hours of manual changelog writing into minutes of automated generation.

774 tokens
Finishing A Development Branch
by ZhanlinCui
×7

Use when implementation is complete, all tests pass, and you need to decide how to integrate the work - guides completion of development work by presenting structured options for merge, PR, or cleanup

1k tokens
MCP Builder
by JayZeeDesign
×7

Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).

37k tokens scripts
Vercel React Native Skills
by vercel-labs
vendor ×6

React Native and Expo best practices for building performant mobile apps. Use when building React Native components, optimizing list performance, implementing animations, or working with native modules. Triggers on tasks involving React Native, Expo, mobile performance, or native platform APIs.

39k tokens
Vercel React Best Practices
by ratacat
×5

React and Next.js performance optimization guidelines from Vercel Engineering. This skill should be used when writing, reviewing, or refactoring React/Next.js code to ensure optimal performance patterns. Triggers on tasks involving React components, Next.js pages, data fetching, bundle optimization, or performance improvements.

34k tokens
Next Best Practices
by vercel-labs
vendor ×4

Next.js best practices - file conventions, RSC boundaries, data patterns, async APIs, metadata, error handling, route handlers, image/font optimization, bundling

20k tokens
Using Git Worktrees
by ZhanlinCui
×4

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

1k tokens

How to use it

Copy the folder

Take notque/typescript-check from the repository into ~/.claude/skills for personal use, or into .claude/skills inside a project.

Check the name does not clash

The agent identifies a skill by the name field in its header. Two skills with the same name cannot sit side by side — one of them will be ignored.

Install what it needs

The instructions reference npm, npx. Without those the skill loads but fails at the first command.