Deepsearch

From JeremyDev87/codingbuddy · View interactive version

Deepsearch is an AI agent skill from the GitHub repository JeremyDev87/codingbuddy. Use when simple grep/glob is insufficient and you need comprehensive, multi-pass codebase understanding

How to use this skill

Skill file

Deep Search

Overview

Single-pass searches miss connections. Grep finds strings, not understanding.

Core principle: ALWAYS search in multiple passes with increasing precision. A single query never gives the full picture.

Violating the letter of this process is violating the spirit of thorough search.

The Iron Law

NO CONCLUSIONS WITHOUT CROSS-REFERENCED EVIDENCE FROM MULTIPLE PASSES

If you haven't completed at least Phases 1-3, your understanding is incomplete.

When to Use

Use when simple grep/glob is insufficient:

Use this ESPECIALLY when:

Don't use when:

The Four Phases

You MUST complete each phase before drawing conclusions.

Phase 1: Broad Search — Cast a Wide Net

Goal: Discover all potentially relevant files and symbols.

  1. Start with Multiple Search Strategies
  1. Use Varied Query Terms
  1. Record Everything

Output: A list of all candidate files and symbols to investigate.

Phase 2: Narrow Focus — Understand Each Hit

Goal: Read and understand each candidate in context.

  1. Classify Each Result
  1. Read Surrounding Context
  1. Build a Symbol Map
  1. Identify Indirection

Phase 3: Cross-Reference — Connect the Dots

Goal: Map relationships between all discovered symbols and files.

  1. Trace Data Flow
  1. Trace Control Flow
  1. Identify Dependency Chains
  1. Check for Side Effects
  1. Verify Completeness

Phase 4: Validate — Confirm Your Understanding

Goal: Prove your mental model is correct.

  1. Test Your Hypothesis
  1. Check for Gaps
  1. Look for Dead Code
  1. Verify with Tests
  1. Summarize Findings

Red Flags — STOP and Search Deeper

If you catch yourself thinking:

ALL of these mean: STOP. You're making assumptions. Return to Phase 1.

Common Rationalizations

| Excuse | Reality |

|--------|---------|

| "Grep found it, I'm done" | Grep finds strings, not relationships. Continue to Phase 2. |

| "Only one file imports this" | Check for dynamic imports, re-exports, and test files. |

| "The naming is clear enough" | Names lie. Read the implementation. |

| "Tests aren't relevant" | Tests reveal intended behavior and edge cases. Always check. |

| "This is a small codebase" | Small codebases have hidden complexity too. Follow the process. |

| "I'll trace the rest later" | Incomplete understanding leads to broken refactors. Trace now. |

Quick Reference

| Phase | Key Activities | Success Criteria |

|-------|---------------|------------------|

| 1. Broad Search | Multiple strategies, varied terms, record all | Complete candidate list |

| 2. Narrow Focus | Classify, read context, build symbol map | Understand each hit |

| 3. Cross-Reference | Trace data/control flow, find dependencies | Map all relationships |

| 4. Validate | Test hypothesis, check gaps, verify with tests | Confirmed mental model |

Search Strategy Checklist

Use this checklist to ensure thorough coverage:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.