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

## Quick Reference by Mode

| Task | MCP (DISCOVERY_MODE=mcp) | CLI (DISCOVERY_MODE=cli) |
|------|--------------------------|--------------------------|
| Branch changes | `context(action="delta", include_symbols=true)` | `civyk-repoix query context --action delta --include-symbols true` |
| Impact analysis | `quality(action="impact", fqn="...", depth=2)` | `civyk-repoix query quality --action impact --fqn "..." --depth 2` |
| Who calls this | `symbol(action="callers", fqn="...", depth=2)` | `civyk-repoix query symbol --action callers --fqn "..." --depth 2` |
| Find references | `symbol(action="references", fqn="...")` | `civyk-repoix query symbol --action references --fqn "..."` |
| High-risk files | `git(action="hotspots", since="30d")` | `civyk-repoix query git --action hotspots --since 30d` |
| Circular deps | `quality(action="circular_deps", level="file")` | `civyk-repoix query quality --action circular_deps --level file` |
| Dead code | `quality(action="dead_code", limit=20)` | `civyk-repoix query quality --action dead_code --limit 20` |

---

## Primary Review Tools

### 1. Build Delta Context Pack (Branch Review)

**Use for reviewing all changes in current branch:**

```text
# MCP
context(action="delta", include_symbols=true, token_budget=3000)

# CLI
civyk-repoix query context --action delta --include-symbols true --token-budget 3000
```

Returns: changed files, symbols modified, affected callers, recommended tests.

**If auto-detect fails** with "Base branch not found", explicitly specify the base branch:

```text
# MCP - explicit base branch
context(action="delta", base_branch="main", include_symbols=true, token_budget=3000)

# CLI - explicit base branch
civyk-repoix query context --action delta --base-branch main --include-symbols true
```

### 2. Analyze Impact

**Understand ripple effects of a change:**

```text
# MCP
quality(action="impact", fqn="src.auth.login.validate_token", depth=3)

# CLI
civyk-repoix query quality --action impact --fqn "src.auth.login.validate_token" --depth 3
```

Returns: direct callers, indirect callers, breaking change risk.

### 3. Get Callers

**Find all code paths calling a function:**

```text
# MCP
symbol(action="callers", fqn="src.services.payment.process", depth=2)

# CLI
civyk-repoix query symbol --action callers --fqn "src.services.payment.process" --depth 2
```

### 4. Get References

**Find all usages of a symbol:**

```text
# MCP
symbol(action="references", fqn="src.models.User")

# CLI
civyk-repoix query symbol --action references --fqn "src.models.User"
```

### 5. Get Hotspots (High-Risk Areas)

**Files frequently changed = higher review scrutiny:**

```text
# MCP
git(action="hotspots", since="30d", limit=20)

# CLI
civyk-repoix query git --action hotspots --since 30d --limit 20
```

---

## Architecture Quality Tools

### Find Circular Dependencies

```text
# MCP
quality(action="circular_deps", level="file")

# CLI
civyk-repoix query quality --action circular_deps --level file
```

### Get Dead Code

```text
# MCP
quality(action="dead_code", limit=30)

# CLI
civyk-repoix query quality --action dead_code --limit 30
```

### Get Duplicate Code

```text
# MCP
quality(action="duplicates", source_only=true, min_similarity=0.8)

# CLI
civyk-repoix query quality --action duplicates --source-only true --min-similarity 0.8
```

---

## First-Time Orientation

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

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

---

## Full CLI Conversion Reference

| MCP | CLI |
|-----|-----|
| `status(action="check")` | `civyk-repoix query status --action check` |
| `context(action="delta", include_symbols=true)` | `civyk-repoix query context --action delta --include-symbols true` |
| `git(action="diff", include_symbols=true)` | `civyk-repoix query git --action diff --include-symbols true` |
| `quality(action="impact", fqn="...", depth=N)` | `civyk-repoix query quality --action impact --fqn "..." --depth N` |
| `symbol(action="callers", fqn="...", depth=N)` | `civyk-repoix query symbol --action callers --fqn "..." --depth N` |
| `symbol(action="references", fqn="...")` | `civyk-repoix query symbol --action references --fqn "..."` |
| `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` |
| `git(action="hotspots", since="30d")` | `civyk-repoix query git --action hotspots --since 30d` |
| `git(action="changes", since="7d", include_symbols=true)` | `civyk-repoix query git --action changes --since 7d --include-symbols true` |
| `file(action="symbols", path="...")` | `civyk-repoix query file --action symbols --path "..."` |
| `file(action="imports", path="...")` | `civyk-repoix query file --action imports --path "..."` |
| `file(action="related", path="...")` | `civyk-repoix query file --action related --path "..."` |
| `tests(action="for_file", path="...")` | `civyk-repoix query tests --action for_file --path "..."` |
| `quality(action="circular_deps", level="...")` | `civyk-repoix query quality --action circular_deps --level "..."` |
| `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` |
| `symbol(action="similar", fqn="...", similarity_threshold=N)` | `civyk-repoix query symbol --action similar --fqn "..." --similarity-threshold N` |
| `search(action="code", query="...", source_only=true)` | `civyk-repoix query search --action code --query "..." --source-only true` |
| `search(action="symbols", query="...", kind="...")` | `civyk-repoix query search --action symbols --query "..." --kind "..."` |
| `symbol(action="detail", fqn="...")` | `civyk-repoix query symbol --action detail --fqn "..."` |
