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

| Task | Tools |
|------|-------|
| Quick orientation | `architecture(action="components")`, `architecture(action="endpoints")`, `context(action="task")` |
| Understand architecture | `symbol(action="hierarchy")`, `architecture(action="dependencies")` |
| Find related patterns | `search(action="symbols")`, `file(action="symbols")` |
| Identify dependencies | `file(action="imports")` |
| Assess existing coverage | `tests(action="for_file")`, `file(action="related")` |

## First-Time Orientation

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

# 2. Targeted context for specification
context(action="task", task="understand codebase for <feature> specification", token_budget=1500, prefer_kinds=["class", "function"])
```

## Discovery Workflow for Specification

```text
# 1. Understand existing architecture
architecture(action="components")
architecture(action="endpoints", limit=50)
context(action="task", task="understand codebase for <feature> specification", token_budget=1500)

# 2. Find related existing patterns
search(action="symbols", query="%<RelatedTerm>%", kind="class", limit=30)
search(action="symbols", query="%<RelatedTerm>%", kind="function", limit=30)

# 3. Understand data models in scope
symbol(action="hierarchy", fqn="<BaseModel>", direction="descendants")
file(action="symbols", path="<models_dir>", kinds=["class"])
```

## CLI Conversion

| MCP | CLI |
|-----|-----|
| `architecture(action="components")` | `civyk-repoix query architecture --action components` |
| `architecture(action="endpoints", limit=N)` | `civyk-repoix query architecture --action endpoints --limit N` |
| `context(action="task", task="...", token_budget=N)` | `civyk-repoix query context --action task --task "..." --token-budget N` |
| `search(action="symbols", query="...", kind="...")` | `civyk-repoix query search --action symbols --query "..." --kind "..."` |
| `file(action="symbols", path="...", kinds=["..."])` | `civyk-repoix query file --action symbols --path "..." --kinds "..."` |
| `symbol(action="hierarchy", fqn="...")` | `civyk-repoix query symbol --action hierarchy --fqn "..."` |
