skills/troubleshoot/SKILL.md
Hypothesis-driven root-cause fix
npx skillsauth add laststance/skills troubleshootInstall 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.
When running this skill in Codex, translate Claude Code-only primitives before acting: AskUserQuestion -> chat/request_user_input, TodoWrite -> update_plan, Task/TaskCreate/TeamCreate/SendMessage -> spawn_agent/send_input/wait_agent when available and allowed, and EnterPlanMode/ExitPlanMode -> a concise chat plan plus explicit approval.
Resolve Read/Write/Edit/Bash/WebSearch/WebFetch to Codex file/shell/web tools, and map ~/.claude/... paths to ~/.agents/... or ~/.codex/... unless the task explicitly targets Claude Code.
When running this skill in Cursor Agent, translate Claude Code-only primitives before acting: AskUserQuestion -> AskQuestion; TodoWrite -> Cursor TodoWrite or an equivalent checklist; Task/TaskCreate/TeamCreate/SendMessage/multi-agent flows -> Cursor Task (subagents), parallel Tasks, or run_in_background when allowed (TeamCreate/SendMessage may have no exact match); EnterPlanMode/ExitPlanMode -> Plan mode (SwitchMode / CreatePlan) plus explicit user approval.
Resolve Read/Write/Edit/StrReplace/Bash/web/search/MCP via Cursor Composer or Agent equivalents. MCP names written as mcp__server__tool typically map to call_mcp_tool with configured server identifiers. Map ~/.claude/... to ~/.cursor/skills/, .cursor/skills/, and .cursor/rules/ unless the task explicitly targets Claude Code.
Systematic issue diagnosis with root cause tracing, validated fixes, and prevention guidance.
<essential_principles>
Call the following Serena tools at the specified points. Never skip them.
| Checkpoint | Tool | When | Purpose |
|------------|------|------|---------|
| Adherence Gate | mcp__serena__think_about_task_adherence | Before each code edit in Phase 4 (Fix) | Confirm fix aligns with identified root cause |
| Completion Gate | mcp__serena__think_about_whether_you_are_done | Before exiting Phase 5 (Verify) | Confirm fix is verified with evidence |
After Phase 1 and again after Phase 2, do a short evidence sufficiency self-check in prose (repro steps, observed vs expected, hypotheses tied to concrete evidence). If gaps remain, collect more evidence before continuing—do not rely on a removed Serena tool.
</essential_principles>
Understand and reproduce the issue before diagnosing.
git diff or git log for recent changes that may have caused itIf cannot reproduce: Ask user for more context before proceeding.
Tools: Bash, Read, Grep, Glob
Form hypotheses about the root cause — do not jump to fixing.
🤔 Hypothesis A: Missing dependency after package update
🤔 Hypothesis B: Type mismatch from recent refactor
🤔 Hypothesis C: Environment variable not set
Systematically verify or eliminate each hypothesis.
🎯 Root cause: X confirmed. Evidence: [specific line/behavior]
Tools: Read, Grep, Glob, mcp__serena__find_symbol, mcp__context7__query-docs
Apply the fix with adherence checks before each edit.
For each code change:
think_about_task_adherence — Is this edit aligned with the identified root cause?📊 Fix: Change X to Y in file:line because [reason]
Tools: Edit, Write, Bash
Prove the fix works with concrete evidence. No fix is complete without verification.
pnpm lint & pnpm typecheck & pnpm test & wait
If any check fails → return to Phase 3 with new evidence.
--frontend-verify (when flag is provided)Visual verification across platforms. Auto-detect platform from package.json:
| Dependency | Platform | Preflight | Verification Tool |
|------------|----------|-----------|-------------------|
| (default) | Web | kill-port <port> && pnpm dev | playwright-cli (open --headed, snapshot, screenshot) |
| electron | Electron | pnpm electron:dev | /qa-electron skill (playwright-cli attached to Electron CDP) |
| expo / react-native | Mobile | mcp__ios-simulator__open_simulator | iOS Simulator MCP (screenshot, ui_tap, ui_swipe) |
| commander / inquirer / oclif | CLI | shell session | Shellwright MCP (TUI/CLI operation and output verification) |
Frontend Verify Workflow:
/dnd to load the drag-and-drop coordinate protocol. Ref-based drag reports false success on dnd-kit and similar libraries — required before any Web or Electron interaction.kill-port <port> && pnpm dev, confirm playwright-cli is available (Web direct; Electron via playwright-cli attach --cdp=http://localhost:9222)playwright-cli to capture the broken state (if reproducible in UI)playwright-cli to capture the corrected stateWhen verifying authenticated apps (SaaS dashboards, admin panels, OAuth-protected pages), use playwright-cli's auth persistence:
| Strategy | Command | Use Case |
|----------|---------|----------|
| state-save / state-load | playwright-cli state-save auth.json | Session cookies + localStorage. Best for most web apps |
| --profile <dir> | playwright-cli open <url> --profile ./browser-data | Full Chromium user data dir. Best for complex OAuth (Google, GitHub SSO) |
OAuth Flow:
playwright-cli open <login-url> --headed (must be headed for OAuth redirects)snapshot + fill + clickplaywright-cli state-save auth.json to persist sessionplaywright-cli state-load auth.json before navigating to appSecurity:
auth.json, browser-data/ to .gitignore--headed for initial OAuth setup (redirects require visible browser)🔶 think_about_whether_you_are_done — Is the fix verified with evidence?
Summarize findings for the user.
/troubleshoot "TypeError: Cannot read properties of undefined"
/troubleshoot build is failing after upgrading React
/troubleshoot tests pass locally but fail in CI --frontend-verify
/troubleshoot API response time doubled since last deploy
[Reproduce] → 🔶 info gate
↓
[Hypothesize] → 🔶 info gate
↓
[Investigate]
↓
[Fix] → 🔶 adherence gate (per edit)
↓
[Verify] → 🔶 completion gate
↓
[Report]
Will:
Will Not:
testing
Cited research briefs
development
Daily coding habit prompts JP
development
React core deep-dive JP
data-ai
Copy last agent reply