Skip to content
strategic-investigation logo

Strategic Investigation: Plan Mode Recovery

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.

mattnigh/skills_collection0installs24stars

SKILL.md

Full skill instructions

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

SkillRelationship
community-docsQuick check FIRST. If doesn't help after 1-2 attempts → strategic-investigation
recovery-strategiesStrategic investigation is Step 2.5 in that flow
issue-filingUse AFTER investigation if problem is a framework limitation
pattern-devContains 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.

More skills from mattnigh

spring-framework-patterns logo
mattnigh/skills_collection

spring-framework-patterns

Comprehensive Spring Framework and Spring Boot best practices including dependency injection patterns, bean lifecycle and scopes, REST API development, Spring Data JPA, service layer design, Spring Security, testing strategies, caching, AOP, async processing, error handling, and common anti-patte...

24 0
View

TypeScript厳格モードによる型安全性設計を専門とするスキル。 📖 参照書籍: - 『Effective TypeScript』(Dan Vanderkam): 型設計 📚 リソース参照: - `resources/Level1_basics.md`: レベル1の基礎ガイド - `resources/Level2_intermediate.md`: レベル2の実務ガイド - `resources/Level3_advanced.md`: レベル3の応用ガイド - `resources/Level4_expert.md`: レベル4の専門ガイド - `resources/di...

24 0
View
deploying-cloud-k8s logo
mattnigh/skills_collection

deploying-cloud-k8s

Deploys applications to cloud Kubernetes (AKS/GKE/DOKS) with CI/CD pipelines. Use when deploying to production, setting up GitHub Actions, troubleshooting deployments. Covers build-time vs runtime vars, architecture matching, and battle-tested debugging.

24 0
View
moai-alfred-agent-guide logo
mattnigh/skills_collection

moai-alfred-agent-guide

19-agent team structure, decision trees for agent selection, Haiku vs Sonnet model selection, and agent collaboration principles. Use when deciding which sub-agent to invoke, understanding team responsibilities, or learning multi-agent orchestration.

24 0
View
mermaid-diagram-generator logo
mattnigh/skills_collection

mermaid-diagram-generator

Converts architecture descriptions, module specs, or workflow docs into Mermaid diagrams. Use when visualizing brick module relationships, workflows (DDD, investigation), or system architecture. Supports: flowcharts, sequence diagrams, class diagrams, state machines, entity relationship diagrams,...

24 0
View
pre-flight-check logo
mattnigh/skills_collection

pre-flight-check

INVOKE FIRST before any code work. Validates git workflow (branch, issue, worklog) and checks approach. Use at START of every task and END before completing. Prevents skipped steps.

24 0
View
browser-dev-tools logo
mattnigh/skills_collection

browser-dev-tools

This skill should be used when working with browser-rendered artifacts (i.e. Bun, React/React Native) to proactively validate that development work on localhost is being built appropriately and to support debugging browser-rendered content. Use this skill after making frontend changes to verify t...

24 0
View
lead-dev logo
mattnigh/skills_collection

lead-dev

Lead Développeur - Coordination technique opérationnelle, code review, mentoring et livraison. Pair de web-dev-process au niveau OPÉRATIONS.

24 0
View
worker-monitor logo
mattnigh/skills_collection

worker-monitor

Monitor Docker workers, RQ queue health, and auto-scale workers (max 4). Use when: checking job progress, monitoring queue depth, scaling workers up/down, diagnosing slow processing, or waiting for jobs to complete. Referenced by data-quality skill during reprocessing.

24 0
View
quality-advisor logo
mattnigh/skills_collection

quality-advisor

Proactive quality guidance system that monitors artifact creation and provides real-time feedback on documentation quality

24 0
View
bump-version logo
mattnigh/skills_collection

bump-version

This skill should be used when the user wants to bump the version number in the workspace. It updates versions across all pyproject.toml files (root, tde, and tda packages) and the CHANGELOG.md to keep them synchronized.

24 0
View

Popular AI tools

Kaiber logo
Video

Kaiber

Generate, edit, and beat-sync AI video with leading models in one workspace.

Paid
View
Vimcal logo
Productivity

Vimcal

The world's fastest calendar for remote work

Free
View

Transform Your Design with AI Designer by ImgCreator.ai

Freemium
View
Akool AI logo
Content & writing

Akool AI

Revolutionizing Video Production with AI-Powered Creativity

Paid
View

Extend an image past the frame and let AI fill the new aspect ratio.

Freemium
View
StarByFace logo
Security

StarByFace

Discover your celebrity doppelgänger with StarByFace!

Free
View
C

ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.

Freemium
View
Opus Clip logo
Coding & apps

Opus Clip

Opus.ai: Revolutionize Your Web Experience

Free
View