TDD-debug
Test-Driven Development debug workflow combined with multi-agent collab-fix. Use when the user asks to "TDD debug", "reproduce and fix with a test", or wants a bug fixed with a failing test written first and verified after the fix.
What this skill does
# TDD Debug Protocol Debug the user's bug using a **Test-Driven Development** approach combined with the **collab-fix** protocol. ## Overview 1. Write a **failing** test that reproduces the bug. 2. Fix the bug using multi-agent collaboration. 3. Verify the test passes after the fix. ## Requirements - A `code-reviewer` subagent if available; otherwise use the `general-purpose` agent. - A `test-automator` subagent for test design review if available; otherwise use the `general-purpose` agent. ## Constraints - **Timeout**: pass `timeout: 1200000` (20 min) when calling Bash for codex/gemini commands. - The test MUST fail before the fix and MUST pass after the fix. - Preserve the user's bug description verbatim alongside any expansion you add. --- ## Phase 1: Reproduce the Bug with a Failing Test ### 1.1 Analyze the Bug Expand the bug description with context: expected behavior, actual (buggy) behavior, relevant code paths, the project's testing framework. Keep the user's wording verbatim alongside your notes. ### 1.2 Design the Test (parallel) Ask codex, gemini-cli, and a `test-automator` subagent to each propose a reproducing test: - codex: `echo "Given this bug: <description>. Design a test case that will FAIL when the bug exists and PASS when fixed. Include the test code and explain why it catches this bug." | codex exec --skip-git-repo-check --sandbox read-only - 2>/dev/null` - gemini-cli: `gemini "Given this bug: <description>. Design a test case that will FAIL when the bug exists and PASS when fixed. Include the test code and explain why it catches this bug." -o json 2>/dev/null | jq -r '.response'` - subagent: launch a test-automator agent to independently design a reproducing test ### 1.3 Select and Implement 1. Compare the 3 proposals and summarize approaches. 2. Use `AskUserQuestion` to let the user pick. 3. Implement the chosen test in the appropriate test file. ### 1.4 Verify the Test Fails 1. Run the test to confirm it **FAILS** (proving the bug exists). 2. Use `AskUserQuestion`: - Does the test correctly reproduce the bug? - Does the failure match the expected buggy behavior? - Is the test implementation acceptable? 3. If the user rejects the test, iterate (return to 1.2). 4. **Do not proceed to Phase 2 until the user confirms the test is valid.** --- ## Phase 2: Fix the Bug (collab-fix with test verification) ### 2.1 Propose Fix Plans (parallel) - codex: `echo "Analyze this bug: <description>. We have a failing test that reproduces it. Propose a fix plan with steps and tradeoffs. The fix must make the test pass." | codex exec --skip-git-repo-check --sandbox read-only - 2>/dev/null` - gemini-cli: `gemini "Analyze this bug: <description>. We have a failing test that reproduces it. Propose a fix plan with steps and tradeoffs. The fix must make the test pass." -o json 2>/dev/null | jq -r '.response'` - subagent: launch a `code-reviewer` agent to propose a fix independently ### 2.2 Select Fix Compare the 3 plans, summarize tradeoffs, and ask the user only the **necessary** questions via `AskUserQuestion`. ### 2.3 Implement Ultrathink and implement the fix yourself. Do **not** git commit. ### 2.4 Verify Test Passes Run the reproducing test. If it still fails, analyze and iterate. ### 2.5 Cross-Review (parallel) - codex: `(echo "Review the following uncommitted diff. Verify: 1) The fix is correct, 2) The test is feasible and properly validates the fix, 3) No regressions introduced."; git diff) | codex exec --skip-git-repo-check --sandbox read-only - 2>/dev/null` - gemini-cli: `(echo "Review the following uncommitted diff. Verify: 1) The fix is correct, 2) The test is feasible and properly validates the fix, 3) No regressions introduced."; git diff) | gemini -o json 2>/dev/null | jq -r '.response'` - subagent: launch a `code-reviewer` agent focused on test validity ### 2.6 Iterate Resolve human-preference items via `AskUserQuestion`. Repeat 2.3–2.5 until all three reviewers are satisfied AND the test passes, or **5 rounds** are reached. If no consensus after 5 rounds, report: - Root cause of the bug - Remaining disputed items - Whether the test is passing or failing - Recommendations for resolution --- ## Summary Output After completion, report: 1. **Bug description** (original) 2. **Test created** — location and purpose 3. **Fix applied** — summary of the changes 4. **Test status** — confirmation it now passes 5. **Review consensus** — final reviewer feedback
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.