ワンクリックで
debugging
// Debug failures systematically: reproduce, hypothesize, bisect, and fix. Use when the user reports a bug, asks why something fails, or wants to find the root cause.
// Debug failures systematically: reproduce, hypothesize, bisect, and fix. Use when the user reports a bug, asks why something fails, or wants to find the root cause.
Complete development workflow from planning to GitHub PR using PARA methodology and RLM for large codebases. Use when implementing a feature, fixing a bug, refactoring, or taking work from plan to GitHub PR.
Analyze and improve performance: profile, find bottlenecks, optimize, and instrument code with observability for diagnosing performance issues (profiling, bottleneck tracing). Use when the user asks about performance, slow code, bottlenecks, profiling, optimization, or adding performance-specific observability.
Design and implement tests (unit, integration, e2e, accessibility, i18n), improve coverage, and run test suites. Use when the user asks to add tests, write tests, improve coverage, run tests, test accessibility, test translations, or implement test strategy.
Configure and fix CI/CD pipelines: build, test, lint, deploy, database migrations, environment config, observability setup (log shipping, metric collection, alert configuration), and releases. Use when the user asks about CI, pipeline, GitHub Actions, deploy, fix the build, environment variables, monitoring setup, or release process.
Write commit messages, changelogs, release notes, and manage versioning following Conventional Commits with required scope. Use when the user asks for a commit message, changelog, release notes, versioning, tagging, or how to format commits.
Configure MCP (Model Context Protocol) servers for Claude or Cursor. Use when the user runs /setup, wants to add Atlassian, Datadog, or Playwright MCP, or set up API keys for MCP connections.
| name | debugging |
| description | Debug failures systematically: reproduce, hypothesize, bisect, and fix. Use when the user reports a bug, asks why something fails, or wants to find the root cause. |
| triggers | ["/debug","fix this bug","why does this fail","root cause","reproduce the bug","this is broken","investigate"] |
"Reproduce first; then narrow down."
"Write a failing test before fixing." (TDD for Bug Fixes)
Get a reliable repro, form a hypothesis, test it, then fix. Avoid changing code until the cause is understood.
⚠️ MANDATORY: Always write a failing test that reproduces the bug BEFORE attempting to fix it. This ensures:
⚠️ MANDATORY: Write a Failing Test
Once you understand the reproduction steps, write a test that reproduces the bug:
# TDD Bug Fix Flow
1. Write test → 2. Verify test fails → 3. Fix code → 4. Verify test passes
If the user didn't provide steps, ask or infer and state assumptions. If you can't reproduce, say so and suggest what's needed (e.g. logs, repro repo).
git bisect, or disable/revert changes).| Action | Examples |
|---|---|
| Run failing test/code | npm test -- --grep "...", pytest path::test_name, run main with same input |
| Inspect logs/errors | Read stack trace, stderr, log file |
| Bisect history | git bisect start/bad/good/run |
| Search for usage | grep for the failing symbol or error string |
When the failure involves production or staged environments, use the Datadog MCP (after /setup) to search logs, inspect trace details, and query metrics. Use search_logs, get_log_details, query_traces, and query_metrics to correlate errors and narrow down the cause. Ensure /setup has been run so Datadog MCP is configured.
When a test failure appears intermittent (flaky):
pytest --count=20, npx jest --repeat=10) to confirm flakiness.Date.now(), Math.random(), or system-dependent values.| Aspect | Local Debugging | Production Debugging |
|---|---|---|
| Access | Full code, debugger, breakpoints | Logs, metrics, traces only |
| Reproduce | Run test directly | Analyze logs, attempt local repro with prod data shape |
| Tools | IDE debugger, console.log, pdb | Datadog MCP (search_logs, query_traces), error tracking |
| Safety | No risk | Read-only access; never modify prod data to debug |
| Strategy | Step through code | Correlate logs → traces → metrics to find the failure point |
When debugging with logs (local or production):
search_logs with filters for service, status, and time range.| Situation | Skill to invoke |
|---|---|
| Performance-related bug | performance skill (profile first) |
| Security-related bug | security-reviewer skill |
| Bug in CI/CD pipeline | ci-cd skill |
| Bug caused by dependency update | dependencies skill |
See also: testing skill for writing reproduction tests (TDD approach for bug fixes).