---
name: matrixone-docs
description: |
  Use when the user asks about MatrixOne SQL syntax, built-in functions, operators,
  MySQL compatibility, or MatrixOne dialect-specific behavior. Also use when a
  run_sql error may be dialect-related or the user asks to search MatrixOne docs.

  Trigger phrases: "MatrixOne docs", "MO docs", "search MatrixOne syntax",
  "MatrixOne functions", "MO SQL syntax", "MatrixOne operator".
---

# MatrixOne Docs Skill

Search and read the official MatrixOne SQL documentation from the terminal.

## Quick Start

```bash
export MO_DOCS_VERSION="3.0.13"
bash skills/matrixone-docs/scripts/fetch-index.sh
bash skills/matrixone-docs/scripts/search-docs.sh "DATE_FORMAT"
bash skills/matrixone-docs/scripts/read-doc.sh "MatrixOne/Reference/Functions-and-Operators/date-and-time-functions/date-format/"
```

## When to Use

- The user asks about MatrixOne SQL syntax or behavior.
- The user needs to check MySQL compatibility.
- The user asks about a MatrixOne function or operator.
- A SQL execution error may be caused by MatrixOne dialect differences.

## Scripts

| Script | Purpose |
|--------|---------|
| `scripts/fetch-index.sh` | Download and cache index files |
| `scripts/search-docs.sh` | Search cached indexes |
| `scripts/read-doc.sh` | Read a documentation page by path |

## Version Configuration

Set `MO_DOCS_VERSION`, pass `--version`, or use the default `3.0.13`. Indexes are cached under `skills/matrixone-docs/cache/v{version}/`.

## Common Mistakes

- Run `fetch-index.sh` before searching or reading a new version.
- Use an `x.y.z` version such as `3.0.13`; `latest` is not supported.
- Pass a `doc_path` to `read-doc.sh`, not a full URL.
- Use `--kind sql`, `function`, or `operator` to narrow common searches.

## Document Kinds

| Kind | Index File | Description |
|------|------------|-------------|
| `sql` | llms-sql.txt | SQL reference |
| `function` | llms-func.txt | Built-in functions |
| `operator` | llms-op.txt | Operators |
| `all` | all three | Search all kinds |
