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

| Task | Tools |
|------|-------|
| Quick orientation | `architecture(action="components")`, `architecture(action="endpoints")`, `context(action="task")` |
| Before modifying | `quality(action="impact")`, `symbol(action="callers")`, `symbol(action="references")` |
| Find patterns | `file(action="symbols")`, `quality(action="duplicates", source_only=true)`, `symbol(action="similar")` |
| Understand deps | `file(action="imports")`, `architecture(action="dependencies")` |
| Find tests | `tests(action="for_file")`, `file(action="related")` |
| Verify integration | `quality(action="dead_code")`, `quality(action="circular_deps")` |

## First-Time Orientation

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

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

## Before Modifying Any Code

```text
# 1. Understand what you're changing
file(action="symbols", path="<file_to_modify>", include_private=true)
file(action="imports", path="<file_to_modify>")

# 2. Analyze impact BEFORE making changes
quality(action="impact", fqn="<symbol_to_modify>", depth=3, include_tests=true)
symbol(action="callers", fqn="<function_to_modify>", depth=2)
symbol(action="references", fqn="<class_to_modify>")

# 3. Find tests to update
tests(action="for_file", path="<file_to_modify>", include_indirect=true)
```

## Before Creating New Code

```text
# 1. Check for similar existing code
quality(action="duplicates", source_only=true, similarity_threshold=0.7, limit=30)
symbol(action="similar", fqn="<similar_class>", similarity_threshold=0.6)

# 2. Understand existing patterns
context(action="task", task="find existing patterns for <feature>", token_budget=1500)
search(action="symbols", query="%<PatternName>", kind="class", limit=20)
```

## After Implementation

```text
# Verify no orphaned code
quality(action="dead_code", limit=30)

# Check for new circular dependencies
quality(action="circular_deps", level="file")
```

## CLI Conversion

| MCP | CLI |
|-----|-----|
| `architecture(action="components")` | `civyk-repoix query architecture --action components` |
| `architecture(action="endpoints", kind="...", limit=N)` | `civyk-repoix query architecture --action endpoints --kind "..." --limit N` |
| `context(action="task", task="...", token_budget=N)` | `civyk-repoix query context --action task --task "..." --token-budget N` |
| `file(action="symbols", path="...", include_private=true)` | `civyk-repoix query file --action symbols --path "..." --include-private true` |
| `file(action="imports", path="...")` | `civyk-repoix query file --action imports --path "..."` |
| `quality(action="impact", fqn="...", depth=N, include_tests=true)` | `civyk-repoix query quality --action impact --fqn "..." --depth N --include-tests true` |
| `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 "..."` |
| `tests(action="for_file", path="...", include_indirect=true)` | `civyk-repoix query tests --action for_file --path "..." --include-indirect true` |
| `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="symbols", query="...", kind="...")` | `civyk-repoix query search --action symbols --query "..." --kind "..."` |
| `quality(action="dead_code", limit=N)` | `civyk-repoix query quality --action dead_code --limit N` |
| `quality(action="circular_deps", level="file")` | `civyk-repoix query quality --action circular_deps --level file` |
