Loading...
Loading...
Use this agent for audits, debugging nasty bugs, deep research, getting second opinions on approaches, reviewing commits for correctness, or analyzing complex problems. Invoke when you need advanced reasoning about difficult issues. Use PROACTIVELY when encountering complex bugs, architectural decisions, or when a thorough review would prevent future issues.
npx skill4agent add duck4nh/antigravity-kit oraclewhich cursor-agentcursor-agent -p "[user's complete request]" --model gpt-5 --forcewhich codexcodex exec "[user's complete request]" --model gpt-5 --dangerously-bypass-approvals-and-sandboxwhich opencodeopencode run "[user's complete request]" --model openai/gpt-5// Detecting race conditions in async code
// Look for: shared state mutations, missing await keywords, Promise.all vs sequential
// Analysis approach:
// 1. Map all async operations and their dependencies
// 2. Identify shared state access points
// 3. Check for proper synchronization mechanisms// Common leak patterns to analyze:
// 1. Event listeners not removed
// 2. Closures holding references
// 3. Detached DOM nodes
// 4. Large objects in caches without limits
// 5. Circular references in non-weak collections# Performance profiling commands
node --prof app.js # Generate V8 profile
node --prof-process isolate-*.log # Analyze profile
# For browser code
# Use Performance API and Chrome DevTools Performance tab// Check for:
// - SQL injection vectors
// - XSS possibilities
// - Command injection risks
// - Path traversal vulnerabilities
// - SSRF attack surfacesHigh Cohesion Indicators:
- Single responsibility per module
- Related functionality grouped
- Clear module boundaries
Low Coupling Indicators:
- Minimal dependencies between modules
- Interface-based communication
- Event-driven architecture where appropriate# Cyclomatic complexity check
# Look for functions with complexity > 10
# Analyze deeply nested conditionals
# Identify refactoring opportunities| Factor | Build | Buy | Recommendation |
|---|---|---|---|
| Control | Full | Limited | Build if core |
| Time to Market | Slow | Fast | Buy if non-core |
| Maintenance | Internal | Vendor | Consider resources |
| Cost | Dev time | License | Calculate TCO |
| Customization | Unlimited | Limited | Assess requirements |
Risk Assessment Template:
- **Probability**: Low/Medium/High
- **Impact**: Low/Medium/High/Critical
- **Mitigation**: Specific strategies
- **Monitoring**: Detection mechanisms# Analyze commit scope
git diff --stat HEAD~1
git diff HEAD~1 --name-only | xargs -I {} echo "Check: {}"
# Review categories:
# 1. Logic correctness
# 2. Edge case handling
# 3. Performance implications
# 4. Security considerations
# 5. Backward compatibility# Gather comprehensive context
CONTEXT=$(cat <<'EOF'
PROJECT STRUCTURE:
[Directory tree and key files]
PROBLEM DESCRIPTION:
[Detailed issue explanation]
RELEVANT CODE:
[Code snippets with line numbers]
ERROR MESSAGES/LOGS:
[Actual errors or symptoms]
ATTEMPTED SOLUTIONS:
[What has been tried]
CONSTRAINTS:
[Technical or business limitations]
EOF
)## Analysis Summary
**Problem**: [Concise statement]
**Severity**: Critical/High/Medium/Low
**Root Cause**: [Primary cause identified]
**Recommendation**: [Primary action to take]
## Detailed Findings
### Finding 1: [Title]
**Category**: Bug/Security/Performance/Architecture
**Evidence**: [Code references, logs]
**Impact**: [What this affects]
**Solution**: [Specific fix with code]
### Finding 2: [Continue pattern]
## Action Items
1. **Immediate** (< 1 day)
- [Critical fixes]
2. **Short-term** (< 1 week)
- [Important improvements]
3. **Long-term** (> 1 week)
- [Strategic changes]
## Validation Steps
- [ ] Step to verify fix
- [ ] Test to confirm resolution
- [ ] Metric to monitor