strategic-investigation
Proactive recovery using plan mode and subagents. After 1-2 failed attempts, STOP trying variations. Enter plan mode and launch parallel Explore/Plan agents to find idiomatic solutions instead of spinning wheels.
Best use case
strategic-investigation is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Proactive recovery using plan mode and subagents. After 1-2 failed attempts, STOP trying variations. Enter plan mode and launch parallel Explore/Plan agents to find idiomatic solutions instead of spinning wheels.
Teams using strategic-investigation should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/strategic-investigation/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How strategic-investigation Compares
| Feature / Agent | strategic-investigation | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Proactive recovery using plan mode and subagents. After 1-2 failed attempts, STOP trying variations. Enter plan mode and launch parallel Explore/Plan agents to find idiomatic solutions instead of spinning wheels.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# Strategic Investigation: Plan Mode Recovery **CORE PRINCIPLE: After 1-2 failed attempts, STOP trying variations. Enter plan mode and investigate properly using parallel subagents.** ## When to Use This Skill Use this skill when: - You've tried 1-2 approaches and they didn't work - You don't understand WHY something isn't working - You're tempted to try "just one more thing" or add a hacky workaround - The error message doesn't make sense - Multiple approaches seem valid and you're unsure which is idiomatic - You find yourself guessing instead of knowing **Warning signs you should have used this earlier:** - You've been trying variations of the same approach for 5+ minutes - You're adding workarounds or "temporary" hacks - The code is getting messier instead of cleaner - You're saying "this should work but doesn't" ## The Process ### Step 1: STOP and Acknowledge When you recognize you're stuck: 1. **Stop immediately** - Don't try "just one more thing" 2. **Tell the user:** ``` "I've tried [X approaches] and they're not working. Instead of continuing to guess, I'm going to step back and investigate this systematically using parallel subagents. This should find the idiomatic solution." ``` ### Step 2: Enter Plan Mode Request plan mode to structure your investigation. Plan mode signals you're stepping back from implementation to investigate properly. ### Step 3: Launch Parallel Subagents Spawn 2-4 focused Explore agents **in parallel** to gather information: **Subagent Design Principles:** - Each agent gets ONE focused question - Agents explore DIFFERENT angles (not variations of same thing) - Agents are read-only (Explore type) - Each returns concrete findings with file paths and code snippets **Common Explore Agent Types:** ``` Explore Agent 1: Pattern Search - Search labs/packages/patterns/ for similar patterns - Search patterns/examples/ for curated examples - Look for patterns that solve similar problems - Return: file paths, relevant code snippets, patterns used Explore Agent 2: Documentation Deep-Dive - Read relevant sections of ~/Code/labs/docs/common/ - Focus on DEBUGGING.md, PATTERNS.md, CELLS_AND_REACTIVITY.md - Look for exact guidance on this situation - Return: relevant doc sections, warnings, recommended approaches Explore Agent 3: Community Knowledge - Search community-docs/superstitions/ for similar issues - Check if others have hit this problem - Return: relevant superstitions, known workarounds Explore Agent 4: Framework Conventions - Study how working patterns structure similar code - What's the "frameworky" way to do this? - Return: conventions observed, idioms to follow ``` ### Step 4: Synthesize Findings After agents complete: 1. **Review gathered information:** - What patterns did similar code use? - What exactly do the docs say? - What community knowledge exists? 2. **Identify the idiomatic solution:** - Which approach follows framework conventions? - What do working examples do differently? - What would a framework expert do? 3. **Understand WHY this is the right solution:** - Don't just copy-paste from examples - Be able to explain why this works - Understand the underlying principle ### Step 5: Execute with Confidence Now implement the chosen approach: - You understand WHY this approach is right - You've verified it matches framework conventions - You're not guessing anymore ### Step 6: Handle Continued Failure **If the solution doesn't work after investigation:** 1. Return to Step 3 with NEW context: "Approach X didn't work because Y" 2. Investigate why the expected solution failed 3. This often reveals the real underlying issue **After 2 plan-mode investigation cycles without resolution:** - Escalate to user - Summarize what you investigated - Show approaches you tried - Explain what you learned - This gives user actionable context to help ## Example Investigation ### Scenario: "Cell not updating reactively" **Failed attempts:** Changed dependencies, added .get() calls, restructured code **Investigation plan (launch in parallel):** ``` Explore Agent 1: Pattern Search "Search labs/packages/patterns/ for computed() usage patterns. Find 3+ examples of computed cells that update correctly. Note what they do differently from my failing code." Explore Agent 2: Documentation "Read ~/Code/labs/docs/common/CELLS_AND_REACTIVITY.md thoroughly. Focus on computed() section and any gotchas. Look for 'don't do X' warnings." Explore Agent 3: Community Knowledge "Search community-docs/superstitions/ for 'computed', 'reactive', 'update'. Check if this is a known edge case with solutions." Explore Agent 4: Framework Behavior "Study how other patterns structure reactive computations. What cell access patterns do working examples use?" ``` **Likely synthesis:** - Reactivity requires direct cell access, not derived values - Creating new cells inside computed() breaks tracking - Need to maintain stable cell references - Idiomatic approach: lift cell creation to pattern body level ## Good vs Bad Uses ### GOOD - Use Strategic Investigation - "I've tried computed() and derive() and neither updates. Let me investigate." - "The type error doesn't make sense. Let me understand what the framework expects." - "This feels hacky. Let me find the idiomatic way." - "I'm not sure which approach is right. Let me explore the options properly." ### BAD - Don't Use Strategic Investigation - Simple typos - just fix them - Missing imports - just add them - Error message tells you exactly what's wrong - just apply the fix - Problem you've solved before - apply known pattern ## Key Principle: Idiomatic Over Working The goal is not just to find SOMETHING that works, but to find the IDIOMATIC solution: - **Hacky:** "I'll just cast to any and suppress the error" - **Idiomatic:** "The framework expects X pattern, let me use that" If investigation reveals the "right" way is significantly different from your approach, that's valuable - even if your hack might have worked. ## Integration with Other Skills | Skill | Relationship | | ----------------------- | ------------------------------------------------------------------------------- | | **community-docs** | Quick check FIRST. If doesn't help after 1-2 attempts → strategic-investigation | | **recovery-strategies** | Strategic investigation is Step 2.5 in that flow | | **issue-filing** | Use AFTER investigation if problem is a framework limitation | | **pattern-dev** | Contains development practices. This skill is for when you're stuck | ## Remember **Investigation time is NOT wasted time.** A 5-minute proper investigation often saves 30 minutes of trial-and-error on wrong approaches. Don't skip plan mode thinking "this should be simple" - that's often when you need it most. **When in doubt, investigate.** It's better to investigate a simple problem than to spin wheels on a complex one.
Related Skills
testing
Test patterns with Playwright browser automation. Navigate to deployed patterns, interact with UI elements, verify functionality. Use when testing patterns after deployment or when debugging pattern behavior in browser.
Superstition Verification Skill
Use this skill to systematically verify superstitions in
session-startup
Session initialization sequence for community-patterns development. Use at the start of every Claude Code session. Checks for upstream updates, loads workspace configuration, and ensures dev servers are running.
recovery-strategies
Escalation path when stuck on pattern development. Use when encountering TypeScript errors, framework confusion, unexpected behavior, or blocked progress. Five-step recovery: check docs, study examples, strategic investigation (plan mode + subagents), reset and retry, ask user.
pattern-dev
Day-to-day pattern development best practices. Use when actively developing patterns. Covers incremental development, commits, communication guidelines, and general development workflow.
land-branch
Land a feature branch: pull from main, rebase the branch, create a PR, and merge it via rebase with automatic branch deletion. Use when ready to land a completed feature branch.
issue-filing
File framework issues after exhausting other approaches. Document complex problems with multiple failed attempts for framework authors. REQUIRES user permission. Use only after checking docs, community-docs, and trying multiple approaches.
git-workflow
Git operations and pull request workflows. Create PRs, rebase branches, resolve conflicts, merge to upstream. Use when ready to create PR or when working with git branches and upstream.
deployment
Deploy and update patterns. Use when deploying new patterns, updating existing deployments, or testing syntax. Includes deployment commands and the first custom pattern celebration.
community-docs
Community superstitions - unverified observations from pattern development. Use when encountering undocumented edge cases or framework quirks not in official docs. Verified knowledge should be upstreamed to labs docs.
claude-permissions-update
Sync auto-approved permissions from all community-patterns directories (including community-patterns-2, -3, etc.) to the shared project settings. Shows new permissions for review before adding.
performing-malware-persistence-investigation
Systematically investigate all persistence mechanisms on Windows and Linux systems to identify how malware survives reboots and maintains access.