Automated summary
Systematic bug fixing that combines code execution with documentation analysis to find the root cause of end-to-end issues.
Strengths
- Structured approach with documented phases
- Uses specification and architecture documents to guide analysis
- Handles multi-service issues (backend/frontend) effectively
- Can work in general mode even without documentation
Limitations
- Requires specific documentation for full diagnosis
- Not intended for unit test failures (use /test)
- May require user intervention for commands or file paths
Use this skill to fix end-to-end bugs where unit tests pass but functionality fails, such as backend-frontend mismatches or integration timing issues.
Do not use it for simple unit test failures; prefer the /test skill for that.
Security analysis
CautionThe skill uses Shell to run start commands for BE/FE environments and execute tests, which is legitimate debugging but grants the AI power to run arbitrary commands based on user-provided config files, posing moderate risk if misused or if malicious configs are supplied.
No concerns found
How this analysis is madeExamples
Debug the issue where the UI doesn't update after saving settings. Here's the error: 'Failed to update state' in console.Fix bug causing API timeout when fetching a large list of users. The endpoint returns 504 after 30 seconds.Fix bug: Error 'Cannot read property 'x' of undefined' when clicking the submit button. Trace the flow between backend and frontend.id: debug name: debug description: | Systematic bug fixing with direct code execution. Cross-references error with design flow to find root cause. Triggers: debug, fix, bugfix user-invocable: true version: 2.0.0 triggers: ["debug", "fix", "bugfix", "error fix"] requires: ["arch"] platform: all recommended_model: opus allowed-tools: [Read, Write, StrReplace, Glob, Grep, LS, Shell]
Global Rules: Adheres to
rules/archflow-rules.md. Code Mapping#Rule: Always usemax(existing #) + 1for new rows. NEVER reuse deleted numbers.
Model: Try Sonnet first. For complex bugs (multi-file, flow analysis), use Opus.
Debug Workflow
Systematically fix bugs by combining direct code execution with documentation analysis.
Scope
Debug is for E2E issues, not unit test failures.
- Unit test failures -> use
/test - E2E issues (unit tests pass but functionality fails) -> use
/debug
Common E2E issues: BE-FE mismatch, API contract violations, integration timing, environment-specific bugs.
Tool Fallback
| Tool | Alternative | |------|-------------| | Read/Grep | Request file path from user -> ask for copy-paste | | AskQuestion | "Please select: 1) OptionA 2) OptionB 3) OptionC" format | | Shell | Ask user to run commands and paste output |
Document Structure
docs/{serviceName}/
├── spec.md # Input (expected behavior)
├── arch-be.md # Input (flow, Code Mapping)
├── arch-fe.md # Input (flow, Code Mapping)
└── trace.md # Output (this skill produces)
Execution Path Resolution
Read from arch documents (Tech Stack section):
| Field | Source | Example |
|-------|--------|---------|
| BE Path | arch-be.md -> Tech Stack -> BE Path | apps/auth-api |
| FE Path | arch-fe.md -> Tech Stack -> FE Path | apps/auth-web |
| Run Command (BE) | arch-be.md -> Tech Stack -> Run Command | uv run uvicorn main:app |
| Run Command (FE) | arch-fe.md -> Tech Stack -> Run Command | npm run dev |
Phase 0: Skill Entry
0-0. Model and Environment Guidance
Required Documents (
docs/{serviceName}/):
- spec.md (required), arch.md (required), trace.md (optional - created if absent)
0-1. Collect Document Input
{"title":"Start Bug Fix","questions":[{"id":"has_requirements","prompt":"Do you have a requirements document? (docs/{serviceName}/spec.md)","options":[{"id":"yes","label":"Yes - I will provide via @filepath"},{"id":"no","label":"No - I don't have it"}]},{"id":"has_design","prompt":"Do you have a design document? (docs/{serviceName}/arch.md)","options":[{"id":"yes","label":"Yes - I will provide via @filepath"},{"id":"no","label":"No - I don't have it"}]},{"id":"has_changelog","prompt":"Do you have a changelog? (docs/{serviceName}/trace.md)","options":[{"id":"yes","label":"Yes - I will provide via @filepath"},{"id":"no","label":"No - Will be created upon completion"}]}]}
Processing:
- Requirements or design
no-> General Debug (below) - Changelog
no-> Will create in Phase 3 - All
yes-> Request file paths -> Phase 1
General Debug (When documents unavailable)
WARNING: Proceeding without documentation. Bug fixing uses only error log and code analysis. Cannot verify expected behavior or trace design flow.
General Debug Flow:
- Analyze error message/stack trace
- Grep + Read related code
- Estimate cause -> Confirm with user
- Implement fix
- Specify separate location for changelog
0-2. Infer serviceName
From file path: docs/alert/spec.md -> serviceName = "alert" -> Output: docs/alert/trace.md
0-3. Verify Error Information
Collect: error message, stack trace, variable state (if available).
"Please describe the error situation. If you have an error message or stack trace, please share it."
Phase 1: Document Analysis
1-1. Load Documents
| Document | Extract | |----------|---------| | spec.md | Expected behavior, normal scenario | | arch.md | Flow (call order), Code Mapping | | trace.md | Recent changes (possible cause) |
1-2. Cross-reference Error Location with Design Flow
Error Location (stack trace)
-> Check Code Mapping (which method)
-> Check requirements (expected behavior)
-> Identify mismatch
1-3. Report Analysis Results
## Analysis Results
**Error Location**: {file}:{line} - {error message}
**Design Behavior**: {flow from design document}
**Expected Behavior**: {feature description from requirements}
**Recent Changes**: {possibly related recent changes}
**Estimated Cause**: {cause hypothesis}
**Items Requiring Verification**: {additional checks needed}
Confirm with user: "Is this analysis correct? If yes, I will proceed with the fix."
Phase 2: Bug Fix
2-1. Confirm Cause
Read code at error location, verify exact problem point, decide fix direction.
2-2. Implement Fix
Fix matching: requirements, design flow, existing code style.
2-3. E2E Verification (Direct Execution)
Step 1: Read execution config from arch documents (BE/FE Path, Run Commands).
Step 2: Start E2E environment (Shell):
cd {BE Path} && {BE Run Command} &
# Wait for server ready (health check)
cd {FE Path} && {FE Run Command} # or: npm run test:e2e
Step 3: Verify fix:
| Result | Action | |--------|--------| | Success (no errors) | Proceed to Phase 3 | | Same error | Re-analyze -> Return to 2-1 | | New error | Analyze new error -> Return to 2-1 |
Tight feedback loop: See error -> Fix -> Re-run -> Confirm fix immediately.
Phase 3: Call trace Skill (Required)
WARNING: Must call trace skill after analysis/fix completion.
3-1. Call trace Skill
After fix: "Calling trace skill to record this session's results." Or guide: "Analysis complete. Would you like to record this in the changelog?"
3-1.5. Prepare Code Mapping Changes for trace
- Read arch.md Code Mapping table (get current
#numbers) - Identify changes: modified rows (MODIFY), new rows (ADD, # = last+1), deleted rows (DELETE)
- Pass to trace in structured format:
### Code Mapping Changes
| # | Feature | File | Class | Method | Action | Change | Synced |
|---|---------|------|-------|--------|--------|--------|--------|
| 3 | Auth | auth/svc.py | AuthSvc | validate() | Add null check | MODIFY | [ ] |
| 6 | Auth | auth/svc.py | AuthSvc | refresh() | Token refresh | ADD | [ ] |
This structured format enables sync skill to directly apply changes to arch.md
3-2. Recording by Result Type
| Result Type | Content to Record | |-------------|-------------------| | Code fix completed | Symptom, cause, fix content, design impact | | External cause identified | Symptom, external cause, recommended action | | Investigation ongoing/failed | Symptom, investigation content, next steps |
3-3. If Not Called
User can manually call: "trace" or "write changelog". Same session context will be used.
Phase 4: Completion Report
## Bug Fix Complete
### Analysis/Fix Summary
| Item | Content |
|------|---------|
| Symptom | {original bug symptom} |
| Cause | {identified cause} |
| Result Type | Code fix / External cause / Under investigation |
| Modified Files | {file list or "none"} |
### Test Method (if fixed)
1. {Verify with reproduction scenario}
2. {How to verify normal behavior}
### Recurrence Prevention (Required Checklist)
- [ ] Add tests (if applicable)
- [ ] Add guard/validation logic (if applicable)
- [ ] Add logging/monitoring (if applicable)
**Recurrence Probability**: High / Medium / Low
WARNING: Have you recorded this in the changelog? Call "trace" or "write changelog". External causes and investigation failures are also worth recording.
Integration Flow
[spec] -> spec.md -> [arch] -> arch.md -> [build] -> Implementation
-> (Bug occurs) -> [debug] -> Analysis/fix
-> [trace] -> trace.md -> (design impact) -> [sync] -> arch.md
Important Notes
- Runtime Info Helps - Providing error messages and stack traces improves effectiveness
- Documentation Dependency - Docs must be accurate; if doc-impl mismatch, sync first
- Changelog Management - All bug fixes should be recorded in trace
- Complex Bugs - Multi-file bugs -> use Opus; if unresolved, repeat analysis -> confirmation -> re-analysis
From the file to a first result
The download contains exactly the content displayed on this page. This copy may differ from the latest version in the source repository.
View the source and supporting filesThis download contains SKILL.md only. Any scripts, references, templates and dependencies are not included. Get the required files from the source, preserving their directory structure, before continuing.
1. Download the file
Download SKILL.mdFrom the root of a test project, save the file as .skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md, or use the command below. This folder is for inspecting the skill before installation.
Command for macOS/Linux or WSL: requires a POSIX shell and curl. On Windows without WSL, use the download button and create the folder manually.
mkdir -p '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7' && curl --fail --show-error --location 'https://skills-guides.com/api/skills/systematic-debugging-with-direct-code-execution-mm78nnr7/download' --output '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md.part' && mv '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md.part' '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md'2. Check prerequisites
Read SKILL.md before using it. If it references scripts or external services, inspect them and prepare the required access in your test environment.
No recognized prerequisites section in this file. This does not mean it is self-contained: libraries, tools and access requirements may be mentioned elsewhere in the content or source repository.
The platforms on this page are catalog indications. The paths below follow tool documentation; they do not prove this skill has been run in those tools. No minimum tool version is confirmed for this listing.
3. Load the skill
After inspection, copy the complete folder into your project using one of the commands below, then open a new tool session. The command stops if a folder with the same name already exists: compare the files before replacing it.
Claude Code
test -f '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md' && test -s '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md' && mkdir -p '.claude/skills' && test ! -e '.claude/skills/debug' && cp -R '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7' '.claude/skills/debug'Cursor
test -f '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md' && test -s '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md' && mkdir -p '.cursor/skills' && test ! -e '.cursor/skills/debug' && cp -R '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7' '.cursor/skills/debug'Codex
test -f '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md' && test -s '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md' && mkdir -p '.agents/skills' && test ! -e '.agents/skills/debug' && cp -R '.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7' '.agents/skills/debug'OpenSkills
OpenSkills must already be installed. The local install/read procedure is checked with OpenSkills 1.5.0, which requires Node.js ≥ 20.6.0. Catalog slugs are not resolved automatically.
Official OpenSkills installationopenskills install './.skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7'openskills read 'systematic-debugging-with-direct-code-execution-mm78nnr7'Reading should display the installed file content and its base directory. It does not run the skill or install its dependencies.
For an agent that reads AGENTS.md, then sync the index. This command changes AGENTS.md: review the diff before using it.
openskills syncManual method or another tool: attach SKILL.md to a conversation, or open it in an agent that can read files. Include any required supporting resources. No universal folder is recognized by every tool.
4. Try a first task
Use a short, synthetic input: an API endpoint, a small document or an interface brief. In a new conversation, attach the file or give the agent its path, then adapt this request:
Read .skill-downloads/systematic-debugging-with-direct-code-execution-mm78nnr7/SKILL.md and apply its instructions to this example: [describe a test input]. Identify any missing files, dependencies or access. Produce the result requested by the skill without inventing data or running unreviewed scripts.Expected result: output matching the skill instructions, or a precise list of missing prerequisites. A read confirmation alone does not validate a first use. If an external resource is unavailable, that path remains untested.
React Hook Form Best Practices
Development
Master React Hook Form: avoid anti-patterns, manage subscriptions, and handle reset, dirty state, and controlled inputs correctly.
Emotion to Mantine Migration
Development
Migrate Emotion styled-components to Mantine components with style props and CSS modules. Use when converting .styled.tsx files or removing @emotion imports.
Scope Creep Detector
Development
Analyzes git diffs against a stated intent to detect scope creep, unrelated files, broad PRs, and oversized changes, then suggests keep, split, or justify actions.