# Nexus documentation lookup

Search Nexus documentation and explain a concept with examples.

## Arguments

$ARGUMENTS — Concept to look up (e.g. "hooks", "tree entity", "CASL permissions", "field factories", "computed entity", "standalone actions")

## Step 1: Search documentation files

Search these files in order for relevant information:

1. **AGENTS.md** files (quick reference with gotchas):
   - `packages/sdk/AGENTS.md`
   - `packages/backend/AGENTS.md`
   - `packages/client/AGENTS.md`
   - `packages/ui/AGENTS.md`

2. **llms.txt** (project overview and file map)

3. **CLAUDE.md** (conventions and patterns)

4. **Source code** (for detailed API):
   - `packages/sdk/src/types/` — type definitions
   - `packages/sdk/src/fields/` — field factories
   - `packages/backend/src/runtime/` — entity services
   - `packages/backend/src/core/` — middleware, CASL, events

Use Grep to search for the concept across these files.

## Step 2: Search demo code

Check demos for usage examples:

- `demos/demo-backend/` — app developer patterns
- `demos/demo-plugin/` — plugin developer patterns

## Step 3: Explain

Present the answer in this format:

```markdown
## {Concept}

**What:** One-line description

**When to use:** Scenarios where this applies

**Example:**
{Minimal working code example}

**Gotchas:**
- {List of common mistakes}

**Reference files:**
- {Paths to relevant source files}
```

## Rules

- Always include a working code example (not pseudocode)
- Include gotchas specific to the concept
- Reference the actual source files where the implementation lives
- If the concept has different behavior per entity type, show each
- Do NOT make up API signatures — verify against actual source code
- This command works WITHOUT Neural MCP — it reads local files only
