| name | Investigation Patterns |
| description | This skill should be used when the user asks to "investigate code", "analyze implementation", "find patterns", "understand codebase", "debug issue", "find bug", "troubleshoot", or needs evidence-based code analysis and debugging. Provides systematic investigation and debugging methodology. |
Provide systematic patterns for codebase investigation and debugging, ensuring evidence-based analysis with proper confidence assessment.
Always provide file:line references for all findings using format path/to/file.ext:line_number
Rate confidence and coverage metrics for all investigation results
Complete investigation before proposing solutions
Use Serena symbol tools before reading entire files
Independently verify claims rather than confirming assumptions
Document information gaps and unclear points
Check multiple sources to increase confidence
Use systematic debugging phases (reproduce, isolate, investigate, hypothesize, fix)
Classify the question type to determine investigation approach
Does the question require understanding codebase structure or behavior?
Apply scope classification to determine investigation depth and tools
Consider requirements-definition skill for unclear requirements
Architecture: System design, component relationships
Implementation: Specific code behavior, algorithm details
Debugging: Error causes, unexpected behavior
Design: Pattern usage, code organization
Identify relevant sources for investigation
Is the codebase large or unfamiliar?
Apply source identification to locate relevant evidence efficiently
Directly examine known sources
Code: Use Serena for symbol search and dependency analysis
Documentation: Check inline comments, README, API docs
History: Git log for context on changes
External: Context7 for library documentation
Collect evidence systematically using appropriate tools
Do you have specific symbols or patterns to investigate?
Apply evidence collection with symbol-level tools
Start with source identification to locate relevant areas
find_symbol: Locate specific symbols by name
get_symbols_overview: Understand file structure
find_referencing_symbols: Trace dependencies
search_for_pattern: Find patterns across codebase
Synthesize findings with confidence metrics
Have you collected sufficient evidence from multiple sources?
Apply synthesis to combine findings with confidence metrics
Continue evidence collection to increase coverage
Combine evidence from multiple sources
Rate confidence based on evidence quality (0-100)
Report coverage of relevant code examined (0-100)
Identify and document information gaps
Confirm the issue is reproducible
Is this a bug or unexpected behavior investigation?
Apply reproduce pattern to confirm issue before debugging
Use other investigation patterns for analysis tasks
Gather exact steps to reproduce
Identify environment conditions
Determine consistency (always/sometimes fails)
Narrow down the problem scope
Is the bug reproducible but involves many components?
Apply isolate pattern to narrow down the problem scope
Proceed to investigate pattern if scope is clear
Identify when issue started (git bisect if needed)
Remove unrelated components
Create minimal reproduction case
Collect evidence systematically for debugging
Has the issue been reproduced and isolated?
Apply investigate pattern to collect debugging evidence
Complete reproduce and isolate patterns first
Examine error messages and stack traces
Check logs at relevant timestamps
Use Serena for code path analysis
Trace data flow through the system
Form and test hypotheses
Have you collected sufficient debugging evidence?
Apply hypothesize pattern to form and test root cause theories
Continue investigate pattern to gather more evidence
List possible causes
Rank by likelihood
Design tests to confirm/refute each
Implement and verify solution
Has a hypothesis been confirmed as the root cause?
Apply fix pattern to implement and verify solution
Continue hypothesize pattern to test other theories
Make minimal targeted change
Verify fix resolves the issue
Check for regressions
Add test to prevent recurrence
Gather initial observations
1. Document the symptom or question clearly
2. Identify relevant entry points for investigation
3. Form initial hypotheses
Systematically explore evidence
1. Use Serena tools to trace code paths
2. Build evidence chain from symptom to cause
3. Validate or invalidate hypotheses
Form evidence-based conclusions
1. Synthesize findings into coherent explanation
2. Rate confidence based on evidence quality
3. Document for future reference
Evidence trail incomplete
Note in report, proceed
Conflicting evidence found
Document issue, use AskUserQuestion for clarification
Root cause cannot be determined
STOP, present options to user
Investigation reveals security issue
BLOCK operation, require explicit user acknowledgment
Build evidence chains before conclusions
Cite specific file:line references
State confidence levels explicitly
Speculation without evidence
Confirmation bias in hypothesis testing
Concluding without exploring alternatives
Locate specific symbols by name in the codebase
Pattern to match symbol names
Optional path to restrict search
Depth to retrieve children (default 0)
Finding class, function, or variable definitions
Get high-level structure of a file
Path to file to analyze
Depth of symbol tree (default 0)
Understanding file organization before detailed investigation
Find all references to a symbol
Symbol to find references for
File containing the symbol
Tracing dependencies and usage patterns
Search for regex patterns across codebase
Regular expression to search
Optional path to restrict search
Limit to code files
Finding specific patterns or usage across files
Standards for collecting and reporting evidence
Citation: Always provide file:line references (path/to/file.ext:line_number)
Confidence levels:
- 90-100: Direct code evidence, explicit documentation
- 70-89: Strong inference from multiple sources
- 50-69: Reasonable inference with some gaps
- 0-49: Speculation, insufficient evidence
Coverage levels:
- 90-100: All relevant files examined
- 70-89: Most relevant files examined
- 50-69: Key files examined, some gaps
- 0-49: Limited examination