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

| Task | Tools |
|------|-------|
| Quick orientation | `architecture(action="components")`, `architecture(action="endpoints")`, `context(action="task")` |
| Understand architecture | `architecture(action="dependencies")`, `symbol(action="hierarchy")` |
| Find patterns | `search(action="symbols")`, `file(action="symbols")` |
| Identify risks | `git(action="hotspots")`, `quality(action="circular_deps")`, `quality(action="dead_code")` |
| Find duplicates | `quality(action="duplicates", source_only=true)`, `symbol(action="similar")` |
| Understand API surface | `symbol(action="references")` |

## First-Time Orientation

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

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

## Discovery Workflow

```text
# 1. Get architecture overview
architecture(action="components")
architecture(action="dependencies")
context(action="task", task="understand project architecture", token_budget=2000)

# 2. Check code quality indicators
quality(action="circular_deps", level="component")
git(action="hotspots", since="90d", group_by="component", limit=30)
quality(action="dead_code", limit=50)
quality(action="duplicates", source_only=true, similarity_threshold=0.7, limit=30)

# 3. Find existing patterns to extend
search(action="symbols", query="%Service", kind="class", limit=50)
search(action="symbols", query="%Repository", kind="class", limit=50)
search(action="symbols", query="%Controller", kind="class", limit=50)
```

## CLI Conversion

| MCP | CLI |
|-----|-----|
| `architecture(action="components")` | `civyk-repoix query architecture --action components` |
| `architecture(action="dependencies")` | `civyk-repoix query architecture --action dependencies` |
| `context(action="task", task="...", token_budget=N)` | `civyk-repoix query context --action task --task "..." --token-budget N` |
| `quality(action="circular_deps", level="component")` | `civyk-repoix query quality --action circular_deps --level component` |
| `git(action="hotspots", since="90d", group_by="...")` | `civyk-repoix query git --action hotspots --since 90d --group-by "..."` |
| `quality(action="dead_code", limit=N)` | `civyk-repoix query quality --action dead_code --limit N` |
| `quality(action="duplicates", source_only=true)` | `civyk-repoix query quality --action duplicates --source-only true` |
| `search(action="symbols", query="...", kind="...")` | `civyk-repoix query search --action symbols --query "..." --kind "..."` |
