Debug issues by investigating logs, database state, and git history
Systematically debug issues by investigating logs, database state, and git history. Use when you encounter problems during manual testing or implementation to identify root causes without editing files.
/plugin marketplace add iamladi/cautious-computing-machine--primitives-plugin/plugin install primitives@cautious-computing-machineYou are tasked with helping debug issues during manual testing or implementation. This command allows you to investigate problems by examining logs, database state, and git history without editing files. Think of this as a way to bootstrap a debugging session without using the primary window's context.
Before you start initial response, read the DEBUG.md file in the repo root to get project-specific debugging information (log locations, database tools, etc.).
When invoked WITH a plan/ticket file:
I'll help debug issues with [file name]. Let me understand the current state.
What specific problem are you encountering?
- What were you trying to test/implement?
- What went wrong?
- Any error messages?
I'll investigate the logs, database, and git state to help figure out what's happening.
When invoked WITHOUT parameters:
I'll help debug your current issue.
Please describe what's going wrong:
- What are you working on?
- What specific problem occurred?
- When did it last work?
I can investigate logs, database state, and recent changes to help identify the issue.
After the user describes the issue:
Read any provided context (plan or ticket file):
Quick state check:
Form Initial Hypotheses (2-4 possibilities):
Spawn parallel investigations targeting your hypotheses:
Task 1 - Check Logs:
Task 2 - Database/Backend State:
Task 3 - Git and File State:
Based on the investigation, present a focused debug report:
## Debug Report
### What's Wrong
[Clear statement of the issue based on evidence]
### Hypotheses Tested
**Hypothesis 1**: [Most likely cause]
- Evidence for: [Supporting findings]
- Evidence against: [Contradicting findings]
- **Status**: ✓ Confirmed / ✗ Eliminated / ⚠️ Uncertain
**Hypothesis 2**: [Alternative cause]
- Evidence for: [Supporting findings]
- Evidence against: [Contradicting findings]
- **Status**: ✓ Confirmed / ✗ Eliminated / ⚠️ Uncertain
[More hypotheses as needed...]
### Evidence Collected
**From Logs**:
- [Error/warning with timestamp]
- [Pattern or repeated issue]
**From Database/Backend**:
- [Finding from database]
- [Relevant state or data]
**From Git/Files**:
- [Recent changes that might be related]
- [File state issues]
### Root Cause
[Confirmed explanation based on hypothesis testing]
### The Fix
1. **Immediate Action**:
```bash
[Specific command or code change]
Why this works: [Brief explanation]
Prevent Recurrence:
If That Doesn't Work:
Some issues might be outside my reach:
Would you like me to investigate something specific further?
## Important Notes
- **Think like a senior dev** - Form hypotheses first, then gather evidence to test them
- **Test multiple hypotheses** - Don't fixate on one cause; consider 2-4 possibilities
- **Systematic elimination** - Mark each hypothesis as confirmed/eliminated with evidence
- **Focus on manual testing scenarios** - This is for debugging during implementation
- **Always require problem description** - Can't debug without knowing what's wrong
- **Read files completely** - No limit/offset when reading context
- **Check DEBUG.md for specifics** - Project-specific log locations, database tools, etc.
- **Guide back to user** - Some issues (browser console, system internals) are outside reach
- **No file editing** - Pure investigation only
- **Document the reasoning** - Show your hypothesis testing process, not just the answer
## Generic Quick Reference
**Git State**:
```bash
git status
git log --oneline -10
git diff
File Investigation:
# Find recent files
find . -type f -mtime -1
# Check permissions
ls -la [file]
Process Management:
# Check running processes
ps aux | grep [process-name]
See DEBUG.md in repo root for project-specific commands and tools.
Remember: This command helps you debug systematically like a senior developer—form hypotheses, test them with evidence, eliminate possibilities, and find the root cause. All without burning your primary window's context. Perfect for when you hit an issue during manual testing.