---
name: explore
description: Deep codebase exploration to answer specific questions
argument-hint: <question>
context: fork
agent: Explore
allowed-tools: Read, Grep, Glob, WebSearch, WebFetch
---

<objective>
Answer questions about the codebase through systematic investigation using direct search tools.

**Note:** This skill runs in an isolated context. Use Grep, Glob, and Read directly - do NOT launch Task agents.
</objective>

<quick_start>
```bash
/explore where is authentication handled?
/explore how does the payment flow work?
/explore what patterns are used for validation?
```
</quick_start>

## Task
Research the following question: $ARGUMENTS

<workflow>

## 1. Parse Question

- Extract key terms and concepts from the question
- Identify file types, patterns, or areas to search
- Determine if web research is needed

## 2. Search Codebase (Direct Tools)

Use direct search tools **in parallel** where possible:

**File discovery:**
```
Glob: pattern="**/*{keyword}*" to find related files
```

**Code search:**
```
Grep: pattern="{keyword}" to find content matches
Grep: pattern="class {Name}" or "function {name}" for implementations
```

**Targeted reading:**
```
Read: the most relevant 3-5 files discovered
```

**Web research** (if external context needed):
```
WebSearch: "{question} best practices"
WebFetch: documentation URLs found in the codebase
```

**CRITICAL**: Run independent searches in parallel for speed.

## 3. Analyze Findings

- Read relevant files found by searches
- Trace relationships between files
- Identify patterns and conventions
- Note file paths with line numbers (e.g., `src/app.ts:42`)

## 4. Answer Question

Provide comprehensive response:
- Direct answer to the question
- Supporting evidence with file references
- Code examples if relevant
- Architectural context when useful

</workflow>

<execution_rules>

- **PARALLEL SEARCH**: Run independent Grep/Glob searches simultaneously
- **CITE SOURCES**: Always reference file paths and line numbers
- **STAY FOCUSED**: Only explore what's needed to answer the question
- **BE THOROUGH**: Don't stop at first match - gather complete context
- **NO TASK AGENTS**: Use Grep, Glob, Read, WebSearch, WebFetch directly

</execution_rules>

<priority>
Accuracy > Speed > Brevity. Provide complete answers with evidence.
</priority>

<success_criteria>
- Question answered with supporting file references and line numbers
- All relevant code patterns and conventions identified
- Dependencies and connections mapped
</success_criteria>
