<!-- AUTO-GENERATED by scripts/gen-adapters.js - DO NOT EDIT -->
---
description: Generate and maintain a cached AST repo map (symbols, imports, exports) using ast-grep for accurate drift detection and analysis
agent: general
---

> **OpenCode Note**: Invoke agents using `@agent-name` syntax.
> Available agents: task-discoverer, exploration-agent, planning-agent,
> implementation-agent, deslop-agent, delivery-validator, sync-docs-agent, consult-agent
> Example: `@exploration-agent analyze the codebase`


# /repo-map - AST Repo Map

Generate a cached repository map of symbols and imports using ast-grep. This enables faster drift detection and more accurate code context.

## Arguments

Parse from `$ARGUMENTS`:

- **Action**: `init` | `update` | `status` | `rebuild` (default: `status`)
- `--force`: Force rebuild (for `init`)
- `--full`: Force full rebuild (for `update`)

Examples:

- `/repo-map init`
- `/repo-map update --full`
- `/repo-map status`

## Execution

### 1) Load Repo Map Module

*(JavaScript reference - not executable in OpenCode)*

### 2) Parse Arguments

*(JavaScript reference - not executable in OpenCode)*

### 3) Ensure ast-grep is Available

- Use AskUserQuestion tool for user input


### 4) Run Action

*(JavaScript reference - not executable in OpenCode)*

### 5) Validate Results (init/update only)

After `init` or `update`, run validation using the lightweight agent:

*(JavaScript reference - not executable in OpenCode)*

## Output Format

```markdown
## Repo Map Result

**Action**: init|update|status
**Files**: <count>
**Symbols**: <count>
**Languages**: <list>
**Commit**: <hash>

### Notes
- <warnings or validation results>
```
