# altimate-opencode-plugin
Altimate data engineering plugin for [opencode](https://opencode.ai) — bundles dbt skills, Snowflake optimization skills, and altimate-code subprocess delegation behind opencode's native plugin + skills system.
> Mirror of the [`data-engineering-skills`](https://github.com/AltimateAI/data-engineering-skills) Claude Code plugin, ported to opencode's plugin contract.
## What this gives your opencode agent
| Surface | Mechanism | What it does |
|---|---|---|
| **Skills** (11) | `~/.config/opencode/skills/` + `.opencode/skills/` | dbt creating/testing/debugging/refactoring/documenting/migrating/incremental + Snowflake query optimization + altimate-code delegation guidance. Loaded on-demand via opencode's native `skill` tool. |
| **Deterministic dbt tools** | TypeScript plugin tools | `altimate_dbt_columns`, `altimate_dbt_source`, `altimate_dbt_compile`, `altimate_dbt_build` — structured-output replacements for grep+read+bash workflows |
| **Subprocess delegation** | `altimate_code` tool | Spawn a fresh altimate-code subprocess for cross-warehouse / multi-session work the in-process agent can't drive |
## Install
```bash
# 1. Install the plugin into opencode (clones from GitHub, updates ~/.config/opencode/opencode.json)
opencode plugin github:AltimateAI/altimate-opencode-plugin --global
# 2. Install altimate-code — the CLI agent the plugin spawns
# (also provides the `altimate-dbt` binary the deterministic tools call)
npm install -g altimate-code
```
`opencode plugin` accepts an npm package name, a git specifier (`github:owner/repo`
or full `https://…` URL), or a local path (`file:./path`). The command writes
the resolved entry into the top-level `plugin` array of
`~/.config/opencode/opencode.json` and removes the need to hand-edit the file.
> opencode's config schema uses `plugin` (singular array of specifiers) and
> `skills.paths` (array under a `skills` object). Earlier drafts of these docs
> documented `plugins` / `skills: [...]` — those keys are silently ignored by
> opencode.
## Skills, mapped from data-engineering-skills
```
skills/
├── altimate-code/SKILL.md
├── dbt/
│ ├── creating-dbt-models/SKILL.md
│ ├── debugging-dbt-errors/SKILL.md
│ ├── documenting-dbt-models/SKILL.md
│ ├── developing-incremental-models/SKILL.md
│ ├── migrating-sql-to-dbt/SKILL.md
│ ├── refactoring-dbt-models/SKILL.md
│ └── testing-dbt-models/SKILL.md
└── snowflake/
├── finding-expensive-queries/SKILL.md
├── optimizing-query-by-id/SKILL.md
└── optimizing-query-text/SKILL.md
```
These are byte-identical to the Claude Code source. opencode's skill loader honors the same SKILL.md format and YAML frontmatter — no translation needed.
## Plugin tools
| Tool | Purpose |
|---|---|
| `altimate_dbt_columns(model)` | Get columns of a dbt model from the manifest |
| `altimate_dbt_source(source, table)` | Get columns of a dbt source |
| `altimate_dbt_compile(model)` | Compile a model and return the final SQL |
| `altimate_dbt_build(project_dir?, model?, downstream?, select?)` | Run `altimate-dbt build`; optionally restrict to a single `model` (with `downstream` to also build descendants). `select` is a back-compat alias for `model`. |
| `altimate_code(task, project_dir?, yolo?, timeout_sec?)` | Spawn a fresh altimate-code subprocess for free-form delegation |
## Why these tools
Empirically, when the agent has access to deterministic tools that replace grep+read loops, it converges to its answer with fewer turns and lower spend. See the [plugin skill experiments](https://github.com/AltimateAI/data-engineering-skills/blob/main/docs/EXPERIMENTS.md) for benchmark data.
## Dev
```bash
bun install
bun run typecheck
```
## License
MIT — see [LICENSE](./LICENSE).