con un clic
systematic-debugging
// A systematic 4-phase debugging framework for reproducing, analyzing, fixing, and verifying bugs
// A systematic 4-phase debugging framework for reproducing, analyzing, fixing, and verifying bugs
Comprehensive code review framework for evaluating code quality, security, performance, and maintainability
Standards and workflows for creating and maintaining high-quality documentation
Manage Git worktrees for parallel development workflows without switching branches
Core Kilo agent configuration with comprehensive coding capabilities and workflow management
Template for creating new skills - customize and rename for your use case
Enforce Red-Green-Refactor TDD workflow for writing tests before implementation
| name | systematic-debugging |
| version | 1.0.0 |
| description | A systematic 4-phase debugging framework for reproducing, analyzing, fixing, and verifying bugs |
A structured approach to debugging that ensures consistent, reliable bug fixes with verification.
Use this skill when:
Goal: Create a minimal, reliable reproduction
Steps:
Evidence Format:
REPRODUCTION:
Environment: [OS, runtime version, dependencies]
Steps:
1. [step 1]
2. [step 2]
3. [step 3]
Expected: [what should happen]
Actual: [what actually happens]
Best Practices:
Goal: Identify why the issue occurs
Steps:
file:line referencesAnalysis Template:
ANALYSIS:
file:line - [description of problematic code]
ACTUAL: [what the code does]
EXPECTED: [what it should do]
ROOT CAUSE: [wrong input | wrong order | missing dep | config | logic | external]
EVIDENCE:
- [evidence point 1 with file:line]
- [evidence point 2 with file:line]
- [evidence point 3 with file:line]
Investigation Techniques:
Goal: Apply minimal, targeted fix
Steps:
Fix Guidelines:
Implementation Template:
### Fix Implementation
**Approach**: [brief description of fix strategy]
**Changes**:
1. `file:line` - [what changed and why]
2. `file:line` - [what changed and why]
**Edge Cases Considered**:
- [edge case 1]: [how it's handled]
- [edge case 2]: [how it's handled]
**Tests Added/Modified**:
- [test name]: [what it verifies]
Before/After Example:
BEFORE (file:line):
[code snippet showing the bug]
AFTER (file:line):
[code snippet showing the fix]
EXPLANATION:
[why this fixes the issue]
Goal: Confirm the fix works and doesn't break anything
Steps:
Verification Checklist:
VERIFICATION:
- [ ] Original reproduction case passes
- [ ] All existing tests pass
- [ ] New tests pass (if added)
- [ ] No lint/type errors introduced
- [ ] Edge cases handled
- [ ] No performance regression
- [ ] Documentation updated (if needed)
Test Commands:
# Run relevant tests
cargo test <test_name>
# Run all tests
cargo test
# Run linter
cargo clippy
# Format check
cargo fmt -- --check
SYMPTOM: NullPointerException, None.unwrap() panic, undefined errors
INVESTIGATION:
1. Trace where value originates
2. Check initialization order
3. Verify conditional logic
4. Check for race conditions
FIX:
- Add null checks/validation
- Use Option/Result types properly
- Provide default values where appropriate
SYMPTOM: Wrong state, stale data, unexpected mutations
INVESTIGATION:
1. Trace state changes over time
2. Check for unintended mutations
3. Verify state transitions
4. Check async/await timing
FIX:
- Make state immutable where possible
- Add state validation
- Fix mutation logic
- Handle async properly
SYMPTOM: Wrong behavior in specific environments
INVESTIGATION:
1. Check config files
2. Verify environment variables
3. Check feature flags
4. Compare environments
FIX:
- Add missing config
- Fix config precedence
- Add validation
- Update documentation
SYMPTOM: Failures when components interact
INVESTIGATION:
1. Check API contracts
2. Verify data formats
3. Check error handling
4. Trace integration points
FIX:
- Align API contracts
- Fix data transformation
- Improve error handling
- Add integration tests
// Rust tracing
use tracing::{debug, info, warn, error};
debug!("Processing item: {:?}", item);
info!("Operation completed successfully");
warn!("Unexpected condition: {}", condition);
error!("Operation failed: {:?}", error);
// Runtime assertions for debugging
assert!(condition, "message");
assert_eq!(actual, expected, "message");
debug_assert!(condition); // Only in debug builds
# Find when bug was introduced
git bisect start
git bisect bad [current_commit]
git bisect good [last_known_good]
# Check recent changes
git log --oneline -20
# See what changed in a file
git log -p -- path/to/file
# Find who changed a line
git blame path/to/file
#[test]
fn test_bug_reproduction() {
// Write a failing test that demonstrates the bug
let result = function_with_bug(input);
assert_eq!(result, expected_output);
}
#[test]
fn test_fix_verification() {
// After fix, test should pass
let result = function_with_fix(input);
assert_eq!(result, expected_output);
}
❌ Don't:
✅ Do:
file:line referencesThis skill integrates with Kilo's development workflow:
Use with other skills: