debugging-typescript-errors

A method for diagnosing TypeScript compiler errors by tracing where the mismatched types come from.

In plain words
What is it for?
Use it to inspect compiler errors, classify their cause, make the smallest correct change, and rerun the type check.
Why use it?
It helps fix the underlying data, type definition, or inference problem instead of hiding the error with broad type changes or forced assertions.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/dork-labs/dorkos/debugging-typescript-errors
Any agent
npx skills add dork-labs/dorkos --skill debugging-typescript-errors
Clone the repo
git clone --depth 1 https://github.com/dork-labs/dorkos

Made for: Claude Code, Codex.

Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 399 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00039 $0.00399
Opus 5 $0.00019 $0.00199
Sonnet 5 $0.00008 $0.00080
Haiku 4.5 $0.00004 $0.00040

Measured 2d ago against content hash 2dbae2b36d6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

debugging-typescript-errors scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/debugging-typescript-errors/SKILL.md · 56 lines

What it actually says

Debugging TypeScript Errors

Overview

This is the shared-skill replacement for the legacy Claude Code /debug:types workflow.

Use it when TypeScript errors need real diagnosis rather than cargo-cult assertions or broad type loosening.

Read First

Before acting, read:

  • .agents/skills/debugging-systematically/SKILL.md
  • AGENTS.md

Core Workflow

  1. Collect the error
    • use the provided error text when available
    • otherwise run the narrowest useful typecheck scope
  2. Parse the compiler signal
    • error code
    • file and location
    • expected vs actual type
  3. Read the surrounding code
    • never propose a fix before reading the file
  4. Trace the type source
    • where the actual type comes from
    • where the expected type is defined
    • where inference or narrowing goes wrong
  5. Classify the problem
    • wrong data
    • wrong type definition
    • missing narrowing
    • generic inference failure
    • invalid assertion
  6. Apply the smallest correct fix
    • fix data before widening types
    • fix definitions before forcing assertions
    • use assertions only as a last resort
  7. Re-run typecheck
    • confirm the original error is gone
    • check that no new related errors were introduced

Cross-Agent Rules

  • Treat this skill as the portable replacement for /debug:types.
  • Keep a short execution plan, but do not depend on a tool-specific todo API.
  • Ask bounded clarification only when the repair strategy changes system behavior or type contracts materially.
  • Prefer preserving strictness over silencing the compiler.
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 56 lines · 39 tokens per session scan A 2dbae2b36d6f

Subscribe to this mod's changes

debugging-typescript-errors is a skill published in the GitHub repository dork-labs/dorkos (9 stars, last pushed 2d ago), licensed MIT. It adds 39 tokens to every session and 399 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

hive.chart-creation-foundations

Required reading whenever any chart tool is available. Teaches the one-tool embedding contract (call chartrender → live chart appears in chat AND a downloadable PNG lands in the queen session dir), the ECharts (data viz) vs Mermaid (structural diagrams) decision, the BI/financial-grade aesthetic baseline (no…

aden-hive/hive · 133 tokens

browser-edge-cases

SOP for debugging browser automation failures on complex websites. Use when browser tools fail on specific sites like LinkedIn, Twitter/X, SPAs, or sites with Shadow DOM.

aden-hive/hive · 40 tokens

perf-code-paths

Use when mapping code paths, entrypoints, and likely hot files before profiling.

agent-sh/agentsys · 21 tokens

compare-harnesses

Diff two scaffolded harnesses (ADR-031). Reports manifest meta drift + host list + per-file fingerprint changes (added/removed/changed). Exits 0 IDENTICAL, 1 DRIFT, 2 missing manifest. Use --bundle for the ADR-031 schema-1 JSON envelope.

ruvnet/metaharness · 66 tokens

repo-genome

7-section readiness scorecard for a LOCAL repo. Reports repo type + agent topology + MCP risk + test confidence + release readiness + recommended harness plan + scorecard. Exit 0 ready, 1 needs-work, 2 blocked. --json for the 6-field scorecard, --bundle for the ADR-031 schema-1 envelope.

ruvnet/metaharness · 73 tokens

review

Validate plans, execution, or PRs against wish criteria — returns SHIP / FIX-FIRST / BLOCKED with severity-tagged gaps.

automagik-dev/genie · 29 tokens