my-test-driven-debug

Diagnose and fix bugs through test-driven reproduction, root cause analysis, and logged debugging workflows.

Updated Jun 11, 2026
One-click install
npx skills add https://github.com/marcocpt/trae_skills --skill my-test-driven-debug-marcocpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: my-test-driven-debug
Source: https://github.com/marcocpt/trae_skills/tree/main/my-test-driven-debug
Command: npx skills add https://github.com/marcocpt/trae_skills --skill my-test-driven-debug-marcocpt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When bugs appear, developers often jump straight to guessing fixes without reproducing the issue or finding the root cause, leading to recurring problems and wasted time. This Skill enforces a disciplined test-driven debugging workflow: reproduce with a failing test first, investigate the root cause systematically, then fix and refactor. ## Core Features & Use Cases - Test-First Reproduction: Write a minimal failing test that reproduces the bug before any fix attempt, ensuring the problem is truly understood. - Systematic Root Cause Investigation: Trace data flow, compare working reference code, and validate hypotheses one variable at a time instead of guessing. - Automatic Log Collection: Fetch runtime logs from local log directories or Xcode MCP tools (run logs, build logs, test results) as debugging evidence. - Structured Debug Logs: Record every debugging session to debug-logs/YYYY-MM-DD-<issue>.md with a standardized template covering reproduction, root cause, and fix. - Use Case: A user reports a crash in your iOS app. The Skill pulls the latest run log, writes a failing test reproducing the crash, traces the nil value to its source, applies a single targeted fix, verifies all tests pass, and documents the entire analysis. ## Quick Start Use the test-driven debug skill to reproduce this failing behavior with a test, find the root cause, fix it, and log the analysis.

Frequently Asked Questions about my-test-driven-debug

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I debug a bug using test-driven development?

Write a minimal failing test that reproduces the bug first, then investigate the root cause by tracing data flow and testing hypotheses one at a time. Apply a single targeted fix, verify the test passes, and refactor while keeping tests green.

How to find the root cause of a bug instead of guessing fixes?

Collect evidence from error messages and stack traces, reproduce the issue reliably, then trace where bad values originate by following the data flow upward. Form one hypothesis at a time and validate it with a minimal change before proposing any fix.

Can this debugging workflow fetch Xcode run logs automatically?

Yes, it first checks the local worktree logs directory for the newest log file, then falls back to MCP Xcode log tools for run logs, build logs, and test results. If neither source works, it asks the user to provide error details and reproduction steps.

What should I do when a bug fix fails multiple times?

If a fix fails fewer than three times, return to root cause investigation with the new information and form a new hypothesis. After three or more failed attempts, stop and question the architecture itself, discussing the design with the user.

Does this debugging skill handle lint checks and git commits?

No, its scope ends after the refactor step. Lint checks and git commits are the responsibility of the calling workflow or the user, keeping the skill focused on reproduction, root cause analysis, fixing, and refactoring.