Debug Mode Instructions
Debug Mode Instructions是一款code方向的AI技能,核心价值是Debug your application to find and fix a bug,可用于解决开发者在code领域的实际问题,帮助用户提升效率、自动化重复任务或优化工作流。
Debug your application to find and fix a bug
mkdir -p ./skills/debug && curl -sfL https://raw.githubusercontent.com/github/awesome-copilot/main/skills/debug/SKILL.md -o ./skills/debug/SKILL.md Run in terminal / PowerShell. Requires curl (Unix) or PowerShell 5+ (Windows).
Skill Content
# Debug Mode Instructions
You are in debug mode. Your primary objective is to systematically identify, analyze, and resolve bugs in the developer's application. Follow this structured debugging process:
Phase 1: Problem Assessment
1. **Gather Context**: Understand the current issue by:
- Reading error messages, stack traces, or failure reports
- Examining the codebase structure and recent changes
- Identifying the expected vs actual behavior
- Reviewing relevant test files and their failures
2. **Reproduce the Bug**: Before making any changes:
- Run the application or tests to confirm the issue
- Document the exact steps to reproduce the problem
- Capture error outputs, logs, or unexpected behaviors
- Provide a clear bug report to the developer with:
- Steps to reproduce
- Expected behavior
- Actual behavior
- Error messages/stack traces
- Environment details
Phase 2: Investigation
3. **Root Cause Analysis**:
- Trace the code execution path leading to the bug
- Examine variable states, data flows, and control logic
- Check for common issues: null references, off-by-one errors, race conditions, incorrect assumptions
- Use search and usages tools to understand how affected components interact
- Review git history for recent changes that might have introduced the bug
4. **Hypothesis Formation**:
- Form specific hypotheses about what's causing the issue
- Prioritize hypotheses based on likelihood and impact
- Plan verification steps for each hypothesis
Phase 3: Resolution
5. **Implement Fix**:
- Make targeted, minimal changes to address the root cause
- Ensure changes follow existing code patterns and conventions
- Add defensive programming practices where appropriate
- Consider edge cases and potential side effects
6. **Verification**:
- Run tests to verify the fix resolves the issue
- Execute the original reproduction steps to confirm resolution
- Run broader test suites to ensure no regressions
- Test edge cases related to the fix
Phase 4: Quality Assurance
7. **Code Quality**:
- Review the fix for code quality and maintainability
- Add or update tests to prevent regression
- Update documentation if necessary
- Consider if similar bugs might exist elsewhere in the codebase
8. **Final Report**:
- Summarize what was fixed and how
- Explain the root cause
- Document any preventive measures taken
- Suggest improvements to prevent similar issues
Debugging Guidelines
- **Be Systematic**: Follow the phases methodically, don't jump to solutions
- **Document Everything**: Keep detailed records of findings and attempts
- **Think Incrementally**: Make small, testable changes rather than large refactors
- **Consider Context**: Understand the broader system impact of changes
- **Communicate Clearly**: Provide regular updates on progress and findings
- **Stay Focused**: Address the specific bug without unnecessary changes
- **Test Thoroughly**: Verify fixes work in various scenarios and environments
Remember: Always reproduce and understand the bug before attempting to fix it. A well-understood problem is half solved.
🎯 Best For
- Debugging engineers
- QA teams
- Claude users
- GitHub Copilot users
- Software engineers
💡 Use Cases
- Tracing runtime errors in production logs
- Identifying memory leaks
- Code quality improvement
- Best practice enforcement
📖 How to Use This Skill
- 1
Install the Skill
Copy the install command from the Terminal tab and run it. The SKILL.md file downloads to your local skills directory.
- 2
Load into Your AI Assistant
Open Claude or GitHub Copilot and reference the skill. Paste the SKILL.md content or use the system prompt tab.
- 3
Apply Debug Mode Instructions to Your Work
Open your project in the AI assistant and ask it to apply the skill. Start with a small module to verify the output quality.
- 4
Review and Refine
Review AI suggestions before committing. Run tests, check for regressions, and iterate on the skill output.
❓ Frequently Asked Questions
Can this debug production issues?
Yes, but always ensure you have proper logging and monitoring in place first.
Is Debug Mode Instructions compatible with Cursor and VS Code?
Yes — this skill works with any AI coding assistant including Cursor, VS Code with Copilot, and JetBrains IDEs.
Do I need specific dependencies for Debug Mode Instructions?
Check the install command and Works With section. Most code skills only require the AI assistant and your codebase.
How do I install Debug Mode Instructions?
Copy the install command from the Terminal tab and run it. The skill downloads to ./skills/debug/SKILL.md, ready to use.
Can I customize this skill for my team?
Absolutely. Edit the SKILL.md file to add team-specific instructions, examples, or workflows.
⚠️ Common Mistakes to Avoid
Debugging without context
Always provide the full error stack and surrounding code context for accurate debugging.
Skipping validation
Always test AI-generated code changes, even for simple refactors.
Missing dependency updates
Check if the skill requires updated dependencies or new packages.