Debug
LSP-driven debugging patterns for TypeScript codebases. Complements the general debugging methodology in the `superpowers:systematic-debugging` skill. Use in Phase 3-4 escalation scenarios or when investigating unexpected behavior.From its SKILL.md
npx -y skills add JunjaK/ai-harness --skill debugAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.5 KB, as published. Nobody here has run it
Debug (LSP Patterns)
This skill covers LSP-accelerated debugging patterns specific to this harness. For the full systematic debugging methodology (reproduce → narrow → hypothesize → test), use the superpowers:systematic-debugging skill.
When to Use This Skill
- Investigating TypeScript-specific errors (type mismatches, undefined access, stale refactor artifacts)
- Tracing call paths in unfamiliar code before proposing fixes
- Verifying refactors did not leave orphaned callers
Workflow (MUST execute in order)
- Reproduce — Use the
superpowers:systematic-debuggingskill for the reproduction step - Locate — Use LSP to find the failing symbol's definition and callers
- Inspect types — Use
hoverto check inferred types against assumptions - Trace call paths — Use
incomingCalls/outgoingCallsto map the flow - Propose fix — Minimal, targeted, with file:line reference
- Verify — Run the authoritative type-check (project-profile
stack.md→ "Build & Verify") + project test command; confirm no regression
LSP Investigation Patterns
| Symptom | First LSP operation | Second (if needed) |
|---|---|---|
X is not a function | goToDefinition on X — is it exported? | findReferences — is everyone importing the same symbol? |
Cannot read property Y of undefined | hover on the object — what's the inferred type? | goToDefinition on the type — does it declare Y? |
| Type mismatch after refactor | findReferences on the changed type | goToImplementation on interfaces — any implementer missed? |
| Downstream code broken unexpectedly | incomingCalls on the changed function | Check each caller manually |
| Stale cache / wrong data | findReferences on store/query key | Confirm every call site uses the same key |
| Unfamiliar function signature | hover for signature | documentSymbol for neighboring helpers |
Structural Traps (load on demand)
When a bug looks like a type-system or dependency-injection failure rather than ordinary logic — a cascading "property does not exist" flood, an intermittent context/i18n/inject crash, or an opaque deserialization error on a bulk request — read resources/ts-structural-traps.md BEFORE rewriting logic. These have non-obvious structural causes (inference cycles, context-scoped singleton init order, deserialization caps) with near-zero-runtime-change fixes; diagnosing them as logic bugs wastes hours.
Root Cause Rules
- Fix the root cause, not the symptom (duplicate from the
superpowers:systematic-debuggingskill) - After any type-related fix, MUST run the authoritative type-check (project-profile
stack.md→ "Build & Verify") before declaring the fix complete - After any refactor, MUST use
findReferencesto confirm no orphaned callers
Escalation (when to stop debugging)
- Cannot reproduce after 3 attempts → request reproduction steps
- Root cause spans 3+ modules → request architectural review (Phase 1)
- Fix requires API/backend changes not in plan → escalate to Team Leader
- Bug is timing-dependent → add logging, do not guess
For non-TypeScript investigation patterns, fall back to the superpowers:systematic-debugging skill.