types

A TypeScript type-error debugging command that analyzes reported errors and guides a minimal fix. TypeScript is JavaScript with checks that describe what kinds of values code may use.

In plain words
What is it for?
Use it with an error message, file path, or full typecheck to investigate and repair type errors in the whole project or one package.
Why use it?
It helps distinguish a real type mismatch from stale generated package files and avoids guessing at fixes.

Command for Claude Code

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 commands/dork-labs/dorkos/types
Clone the repo
git clone --depth 1 https://github.com/dork-labs/dorkos

Made for: Claude Code.

Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 752 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.00013 $0.00752
Opus 5 $0.00006 $0.00376
Sonnet 5 $0.00003 $0.00150
Haiku 4.5 $0.00001 $0.00075

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

Security

Grade A, and why

types 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.

.claude/commands/debug/types.md · 41 lines

How it starts

The opening of the file, as written. The whole thing — 41 lines — stays where its author put it; the contents beside it link to each section on GitHub.

TypeScript Type Error Debugging

Debug and fix the TypeScript error(s) described by $ARGUMENTS (an error message, a file path, or empty for a full typecheck). Load the debugging-typescript-errors skill — it carries the methodology (trace the real mismatch, minimal verified fix, explain the underlying concept). This command adds the project-specific ground truth below.

Running typecheck in this repo

pnpm typecheck                              # All packages via Turborepo (~28s)
pnpm --filter @dorkos/server typecheck      # One package (~4s) — prefer for the fix loop
pnpm --filter @dorkos/client typecheck

Gotcha: after pulling, a stale @dorkos/shared dist causes false-red errors in downstream packages (imports resolve to old types). Rebuild first: pnpm --filter @dorkos/shared build. If errors reference @dorkos/shared exports that clearly exist in packages/shared/src/, this is almost certainly the cause.

Project-specific type landscape

  • Zod is the type source of truth for runtime data: schemas in packages/shared/src/schemas.ts, relay-schemas.ts, mesh-schemas.ts, config-schema.ts; derive with z.infer<typeof Schema> rather than hand-writing parallel interfaces.
  • Database types come from Drizzle — schemas in packages/db (SQLite). Use Drizzle's inferred types ($inferSelect / $inferInsert), not manual assertions.
  • Cross-package imports use @dorkos/shared/* subpaths (/types, /agent-runtime, /transport, ...). "Cannot find module" on these usually means a stale dist (see gotcha) or a missing subpath in packages/shared/package.json exports.
  • Server is NodeNext — relative imports in apps/server need explicit .js extensions; TS2307 there is often a missing extension, not a missing file.
  • Client hooks are typed TanStack Query wrappers in apps/client/src/layers/entities/*/model/; Express routes validate bodies with Schema.safeParse(req.body) (Express 5: req.body can be undefined on empty POSTs).
  • any is banned (project rule) — fix the type, don't silence it. Prefer type guards over assertions.

Read the full file on GitHub · 41 lines

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 · 41 lines · 13 tokens per session scan A 0310b7e2dc9b

Subscribe to this mod's changes

types is a command published in the GitHub repository dork-labs/dorkos (9 stars, last pushed 2d ago), licensed MIT. It adds 13 tokens to every session and 752 once invoked, about $0.0001 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.