{{include:repoix-discovery-base.md}}

| Task | Tools |
|------|-------|
| Quick orientation | `architecture(action="components")`, `architecture(action="endpoints")`, `context(action="task")` |
| Understand structure | `file(action="symbols")`, `files(...)` |
| Find dependencies | `file(action="imports")`, `symbol(action="callers")`, `symbol(action="references")` |
| Identify risky areas | `git(action="hotspots")`, `git(action="changes")` |
| Find similar patterns | `quality(action="duplicates", source_only=true)`, `symbol(action="similar")` |
| Understand API | `symbol(action="hierarchy")` |

## First-Time Orientation

```text
# 1. Quick architecture overview
architecture(action="components")
architecture(action="endpoints", kind="class", limit=20)

# 2. Targeted context for task breakdown
context(action="task", task="understand project for task breakdown", token_budget=1500, prefer_kinds=["class", "function"])
```

## Discovery Workflow

```text
# 1. Understand project structure
architecture(action="components")
files(include_stats=true, limit=100)
context(action="task", task="understand project for task breakdown", token_budget=1500)

# 2. Identify risky/complex areas (may need more tasks)
git(action="hotspots", since="90d", group_by="file", limit=30)
quality(action="dead_code", limit=30)

# 3. Find existing patterns (determine file locations)
search(action="symbols", query="%Service", kind="class", limit=30)
search(action="symbols", query="%Model", kind="class", limit=30)
architecture(action="endpoints", limit=50)
```

## CLI Conversion

| MCP | CLI |
|-----|-----|
| `architecture(action="components")` | `civyk-repoix query architecture --action components` |
| `files(include_stats=true)` | `civyk-repoix query files --include-stats true` |
| `context(action="task", task="...", token_budget=N)` | `civyk-repoix query context --action task --task "..." --token-budget N` |
| `git(action="hotspots", since="90d")` | `civyk-repoix query git --action hotspots --since 90d` |
| `quality(action="dead_code", limit=N)` | `civyk-repoix query quality --action dead_code --limit N` |
| `search(action="symbols", query="...", kind="...")` | `civyk-repoix query search --action symbols --query "..." --kind "..."` |
| `architecture(action="endpoints", limit=N)` | `civyk-repoix query architecture --action endpoints --limit N` |
