/ts-dev-kit:debug [error-description or sentry-issue-url]from ts-dev-kit
Triages, reproduces, and fixes bugs across the full stack using multi-agent orchestration. Integrates with Sentry and PostHog for production error investigation.
Ships in ts-dev-kit. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
<live_context>
Recent git changes (regression candidates):
!git log --oneline -10 2>/dev/null || echo "(not a git repo)"
Working tree status:
!git status --short 2>/dev/null || echo "(not a git repo)"
</live_context>
<trigger_examples>
<phase_1_triage> Classify the bug before investigating. This determines which agents to dispatch.
| Layer | Signals |
|---|---|
| Frontend | UI doesn't render, hydration errors, blank pages, console errors, wrong data displayed |
| API | HTTP error codes (4xx/5xx), validation failures, timeout, wrong response body |
| Database | Missing data, wrong query results, migration issues, connection errors |
| Queue/Worker | Jobs stuck, not processing, duplicate execution, Redis connectivity |
| Infrastructure | Docker containers down, ports in use, env vars missing |
| Cross-cutting | Data flows correctly in one layer but breaks in another |
# Recent changes that might have introduced the bug
git log --oneline -10
git diff HEAD~3 --stat
# Infrastructure health
docker compose ps
State the triage result to the user:
TRIAGE: [layer(s)] — Brief description of what appears to be happening. </phase_1_triage>
<phase_2_execution_mode> Based on the triage, decide the execution mode:
SINGLE-LAYER — The bug is isolated to one layer. Debug directly without dispatching agents.
MULTI-LAYER — The bug spans 2+ layers. Act as orchestrator and dispatch specialized debugging agents.
State the decision:
EXECUTION MODE: SINGLE-LAYER — I will investigate and fix this directly.
OR
EXECUTION MODE: MULTI-LAYER — I will dispatch specialized agents to investigate each layer in parallel. </phase_2_execution_mode>
<phase_3_reproduce> Reproduce the bug before investigating. Never fix what you can't reproduce.
<reproduction_strategies>
API bugs — Use curl or Bash to hit the endpoint directly:
# Discover the API base URL and endpoints from CLAUDE.md, package.json, or route files
curl -v http://localhost:<port>/<endpoint> | jq .
Frontend bugs — Use browser automation MCPs:
mcp__chrome-devtools__list_pages or mcp__plugin_playwright_playwright__browser_tabs to check current state.Queue/Worker bugs — Check Redis and BullMQ state:
# Check Redis connectivity
redis-cli ping
# Check queue state — discover the dev command from package.json scripts
# e.g., yarn dev, npm run dev, or the relevant workspace command
Database bugs — Query directly:
# Discover database credentials and container names from docker-compose.yml or .env
docker compose exec <db-container> psql -U <user> -c "SELECT * FROM ... LIMIT 5"
If reproduction fails, add strategic logging and retry. See references/debug-dispatch.md for logging patterns. </reproduction_strategies> </phase_3_reproduce>
<phase_4_investigate> With the bug reproduced, investigate the root cause.
<single_layer_investigation> Follow the data flow from the error point backward:
Load relevant skills before diving in:
When the bug involves library API misuse, version-specific behavior, or unclear method signatures, query Context7 for up-to-date documentation:
mcp__context7__resolve-library-id — resolve the library name (e.g., "fastify", "drizzle-orm", "bullmq") to its Context7 ID.mcp__context7__query-docs — query with the specific API, method, or error message you're investigating.Use Context7 when:
<multi_layer_investigation> Dispatch specialized agents in parallel. Each agent investigates its layer independently and reports findings.
See references/debug-dispatch.md for the agent prompt templates and dispatch patterns.
<debugging_roles>
| Role | Agent type | Domain | MCPs |
|---|---|---|---|
| Backend debugger | debugger | API routes, use cases, DB queries, server hooks | Sentry, PostHog, Context7 |
| Frontend debugger | debugger | Pages, components, client state, network | Chrome DevTools, Playwright, Context7 |
| Queue debugger | debugger | Job queues, workers, Redis state | Context7 |
| E2E verifier | playwright-expert | Reproduce and verify via browser automation | Playwright |
Each debugging agent should use Context7 (mcp__context7__resolve-library-id + mcp__context7__query-docs) to verify library API usage when the bug involves unclear method signatures, version-specific behavior, or suspected API misuse. Include this instruction in agent prompts — see references/debug-dispatch.md.
</debugging_roles>
<dispatch_rules>
<model_selection>
haikusonnetopus
</model_selection>
</multi_layer_investigation>
</phase_4_investigate><phase_5_fix> Implement the minimal fix that addresses the root cause.
<fix_principles>
<fix_dispatch> In MULTI-LAYER mode, the orchestrator decides who fixes what:
<phase_6_verify> A fix is not done until it's verified end-to-end.
tsc, lint, test).If any step fails, return to phase 5 and fix the issue. Re-run all verification steps from the beginning. </phase_6_verify>
<common_patterns> Quick reference for the most frequent bugs in this stack. Use these to accelerate triage.
Frontend → API boundary
API → Database boundary
API → Redis/Queue boundary
Frontend rendering
Do not add explanations, caveats, or follow-up suggestions unless the user asks.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
debugging, multi-agent, sentry, posthog, full-stack, error-triage
npx claudepluginhub jgamaraalv/ts-dev-kit --plugin ts-dev-kit22 skills in this plugin
/bullmqBullMQ queue system reference for Redis-backed job queues, workers, flows, and schedulers. Use when: (1) creating queues and workers with BullMQ, (2) adding jobs (delayed, prioritized, repeatable, deduplicated), (3) setting up FlowProducer parent-child job hierarchies, (4) configuring retry strategies, rate limiting, or concurrency, (5) implementing job schedulers with cron/interval patterns, (6) preparing BullMQ for production (graceful shutdown, Redis config, monitoring), or (7) debugging stalled jobs or connection issues/codebase-adapterAdapts ts-dev-kit plugin files to the host project where it is installed. Use when: (1) installing ts-dev-kit in a new project for the first time, (2) project tech stack or structure has changed, (3) agents reference wrong paths, unavailable skills, or missing MCPs, (4) the user says 'adapt the plugin', 'configure ts-dev-kit for this project', 'sync plugin to this codebase', or 'update plugin context'. Surgically edits specific sections in plugin skills and agent definitions — domain area tables, skill/MCP references, quality gate commands, project paths, and package names — without touching any workflow logic, execution protocols, or dispatch patterns./composition-patternsReact composition patterns that scale. Use when refactoring components with boolean prop proliferation, building flexible component libraries, or designing reusable APIs. Triggers on tasks involving compound components, render props, context providers, or component architecture. Includes React 19 API changes./conventional-commitsWrite, review, and validate commit messages following the Conventional Commits v1.0.0 specification. Use when: (1) crafting a git commit message for any change, (2) reviewing or correcting an existing commit message, (3) choosing the right commit type for a change, (4) deciding how to mark a breaking change, (5) writing multi-line commits with body and footers, or (6) understanding how commits map to SemVer bumps (PATCH/MINOR/MAJOR). Covers all standard types: feat, fix, docs, chore, refactor, perf, test, build, ci, style, revert./core-web-vitalsCore Web Vitals reference for measuring, diagnosing, and improving LCP, INP, and CLS. Use when: (1) auditing page performance against Google's thresholds, (2) implementing the web-vitals JS library for field monitoring, (3) diagnosing slow LCP, high INP, or layout shifts, (4) choosing between field and lab measurement tools, (5) optimizing specific metrics with the Chrome team's top recommendations, (6) explaining what each metric measures to non-technical stakeholders, or (7) generating a visual CWV report from metric values or a Lighthouse JSON file./dockerDocker containerization reference — multi-stage builds, Compose configs, image optimization, and container security for Yarn 4 monorepos. Use when: (1) creating or optimizing Dockerfiles, (2) configuring docker-compose for dev or production, (3) reducing image size with multi-stage builds, (4) hardening container security, or (5) setting up health checks and resource limits.Other plugins' skills for the same job