internal/skills/content/troubleshooting/SKILL.md
Debugging and problem-solving workflow. Use when stuck on an issue for more than 30 minutes, encountering cryptic errors, or needing a systematic approach to diagnose and fix problems.
npx skillsauth add ar4mirez/samuel troubleshootingInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Emergency procedures when stuck, tests failing, or errors occurring. Use after 30+ minutes stuck on same issue.
STOP IMMEDIATELY - Don't keep trying random solutions
Follow this process:
Document What You've Tried
Simplify & Isolate
Check Fundamentals
Search for Similar Issues
.claude/memory/ for similar past problemsAsk for Help
Record the Solution
.claude/memory/YYYY-MM-DD-issue-name.mdIdentify When It Broke
# Check recent changes
git diff HEAD~1
# Run tests on last commit
git checkout HEAD~1
npm test # or cargo test, pytest, go test
Isolate the Failing Test
# Run single test file
npm test path/to/test.spec.ts
# Run single test case
npm test -t "specific test name"
Check for Flakiness
If tests broke after your change:
# Option 1: Revert and re-apply incrementally
git reset --hard HEAD~1
# Re-apply changes one file at a time, testing after each
# Option 2: Git bisect (find exact breaking commit)
git bisect start
git bisect bad HEAD
git bisect good <last-known-good-commit>
# Git will checkout commits; run tests and mark good/bad
If tests broke without your changes:
package-lock.json, Cargo.lock changes)PRIORITY: CRITICAL
DO NOT COMMIT vulnerable code
# Stash changes if needed
git stash
Fix Immediately
Add Regression Test
Document in Memory
.claude/memory/YYYY-MM-DD-security-fix-NAME.mdReview Similar Code
SQL Injection:
// ❌ Vulnerable
db.query(`SELECT * FROM users WHERE id = ${userId}`);
// ✅ Fixed
db.query('SELECT * FROM users WHERE id = ?', [userId]);
XSS (Cross-Site Scripting):
// ❌ Vulnerable
element.innerHTML = userInput;
// ✅ Fixed
element.textContent = userInput;
// Or use framework escaping (React auto-escapes)
Hardcoded Secrets:
// ❌ Vulnerable
const API_KEY = "sk_live_abc123";
// ✅ Fixed
const API_KEY = process.env.API_KEY;
Measure First
cargo flamegraph, py-spy, pprof)Identify Bottleneck
# Node.js
node --prof app.js
node --prof-process isolate-*.log
# Python
python -m cProfile -o output.prof script.py
python -m pstats output.prof
# Go
go test -bench . -cpuprofile=cpu.prof
go tool pprof cpu.prof
Common Culprits
Dependency Conflicts:
# Node.js
rm -rf node_modules package-lock.json
npm install
# Python
pip install --upgrade pip
pip install -r requirements.txt --force-reinstall
# Go
go clean -modcache
go mod tidy
go mod download
# Rust
cargo clean
cargo build
Version Mismatch:
nvm, pyenv, gvm, rustupMissing Environment Variables:
# Check .env.example vs .env
diff .env.example .env
# Set required variables
export DATABASE_URL="..."
export API_KEY="..."
# Show conflicted files
git status
# Open files, look for conflict markers:
<<<<<<< HEAD
Your changes
=======
Their changes
>>>>>>> branch-name
# Resolve manually, then:
git add <resolved-files>
git commit
CRITICAL - Act immediately:
# Remove from last commit (if not pushed)
git reset HEAD~1
# Remove secret from file
# Add file to .gitignore
git add .
git commit -m "Remove secrets"
# If already pushed - rotate the secret immediately
# Then use BFG Repo-Cleaner or git-filter-branch
# Find lost commits
git reflog
# Recover lost commit
git checkout <commit-hash>
# Create branch from recovered commit
git checkout -b recovery-branch
Stop immediately if you encounter these:
any or unsafe to "make TypeScript/Rust happy"When you see red flags:
"Cannot find module"
npm install
# or
npm install <package-name>
"Type 'X' is not assignable to type 'Y'"
as Yunknown and narrowing"Module not found" (frontend)
"ModuleNotFoundError"
pip install -r requirements.txt
# Or
pip install <module-name>
"IndentationError"
"AttributeError: ... has no attribute ..."
type() or debugger)hasattr())"cannot find package"
go mod tidy
go mod download
"undefined: ..."
"cannot borrow x as mutable"
"use of moved value"
&)After resolving any major issue:
.claude/memory/ if significantRemember: Being stuck is normal. Following a systematic process beats random attempts. Document your solutions - future you will thank you!
development
Zig language guardrails, patterns, and best practices for AI-assisted development. Use when working with Zig files (.zig), build.zig, or when the user mentions Zig. Provides comptime patterns, allocator conventions, C interop guidelines, and testing standards specific to this project's coding standards.
tools
WordPress framework guardrails, patterns, and best practices for AI-assisted development. Use when working with WordPress projects, or when the user mentions WordPress. Provides theme development, plugin architecture, REST API, blocks, and security guidelines.
tools
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs. Use when testing web apps, automating browser interactions, or debugging frontend issues.
tools
Suite of tools for creating elaborate, multi-component web applications using modern frontend technologies (React, Tailwind CSS, shadcn/ui). Use for complex projects requiring state management, routing, or shadcn/ui components - not for simple single-file HTML/JSX pages.