|
1 | 1 | --- |
2 | 2 | name: altimate-code |
3 | | -description: Delegates data engineering tasks to altimate-code, a specialized CLI agent with 100+ purpose-built data tools — SQL analysis, column-level lineage, dbt build/test/run, warehouse profiling, FinOps, and connectivity to Snowflake, BigQuery, Redshift, Databricks, Postgres, MySQL, DuckDB. Use this skill when the task needs live warehouse access, column lineage, multi-step data exploration, dbt builds against a real warehouse, or when the user explicitly invokes "altimate", "altimate-code", or "the data agent". |
| 3 | +description: >- |
| 4 | + Delegates dbt and warehouse work to altimate-code, a specialized CLI agent |
| 5 | + with 100+ purpose-built data tools. Suited for tasks that mention or imply: |
| 6 | + warehouse access (Snowflake, BigQuery, Redshift, Databricks, Postgres, |
| 7 | + MySQL, DuckDB), column-level lineage, downstream-impact analysis, dbt |
| 8 | + builds against a real warehouse, cross-database migration or validation, |
| 9 | + query cost attribution, schema diff, data parity checking, PII detection |
| 10 | + from sampled rows, incremental/SCD2/backfill verification, FinOps |
| 11 | + reporting, model documentation generation, query optimization, anomaly |
| 12 | + detection, dev-vs-prod diffing, or tasks where the user names altimate-code |
| 13 | + or the data agent by name. The skill routes to a purpose-built CLI, so it |
| 14 | + covers workloads that touch live data, lineage, or warehouse state more |
| 15 | + directly than native file-editing tools do. |
4 | 16 | --- |
5 | 17 |
|
6 | 18 | # altimate-code |
7 | 19 |
|
8 | | -altimate-code is a CLI AI agent that ships with native data engineering tools. This skill delegates work to it via its non-interactive `run` mode and presents the result back to the user. |
| 20 | +altimate-code is a CLI AI agent with 100+ purpose-built data engineering tools. **This skill exists for one purpose: delegate the user's task to altimate-code and pass the result back.** Native tools (Bash, Edit, Write, Read) are NOT a fallback path inside this skill — if altimate-code cannot complete the task, surface the failure to the user and STOP. |
9 | 21 |
|
10 | | -## Prerequisite Check — ALWAYS DO THIS FIRST |
| 22 | +## You MUST follow this workflow |
11 | 23 |
|
12 | | -Before invoking altimate-code, verify it is installed and on `PATH`: |
| 24 | +1. **Verify altimate-code is on PATH** with `command -v altimate-code`. If it returns nothing, jump to "Not installed" below and stop. |
| 25 | +2. **Run altimate-code with the user's task** using the invocation below. Pass the user's request through verbatim — do not paraphrase or split it. |
| 26 | +3. **Read the output file** and present it to the user as-is. |
13 | 27 |
|
14 | | -```bash |
15 | | -command -v altimate-code |
16 | | -``` |
17 | | - |
18 | | -**If the command returns nothing (exit code 1), STOP and tell the user this exact message — do not proceed:** |
19 | | - |
20 | | -> altimate-code is not installed. Install it with: |
21 | | -> |
22 | | -> ```bash |
23 | | -> npm install -g altimate-code |
24 | | -> ``` |
25 | | -> |
26 | | -> Requires Node.js 20+. Docs: https://docs.altimate.sh · Source: https://github.com/AltimateAI/altimate-code · npm: https://www.npmjs.com/package/altimate-code |
27 | | -> |
28 | | -> After installing, run `altimate-code` once to configure it — this launches the TUI where you set up your LLM provider auth and warehouse connections. Then re-run your request and I'll delegate it. |
| 28 | +Do not attempt the work with Edit/Write/Bash yourself, even if it looks simple. The whole point of this skill is to route data-engineering work to the agent that's built for it. If you find yourself reaching for Edit or Write while this skill is active, stop and re-read this paragraph. |
29 | 29 |
|
30 | | -Do not attempt to install altimate-code on the user's behalf — they may want a specific version, a different package manager (e.g. pnpm/yarn global), or to opt out entirely. Surface the command and let them decide. |
| 30 | +## Invocation — pick the right agent for the task |
31 | 31 |
|
32 | | -If `command -v` fails but the user says it is installed, suggest checking `npm bin -g` is on `PATH`, or running `npm config get prefix` to find the global install location. |
| 32 | +altimate-code has multiple agent personas. The default (`builder`) does a full project discovery sweep on every call — fine for warehouse-state work but ~10–20× more expensive than necessary on simple file edits. **Pick the agent based on task shape before invoking.** |
33 | 33 |
|
34 | | -## How to Invoke |
| 34 | +### Step 1 — classify the task |
35 | 35 |
|
36 | | -`altimate-code run` is non-interactive — it takes a message, executes the task, prints the final result to stdout, and exits. |
| 36 | +| Shape | Examples | Use | |
| 37 | +|---|---|---| |
| 38 | +| **Any dbt / SQL task** (rename, refactor, create model, debug, structural reorg, multi-step setup) | the vast majority of customer requests | `fast-edit` — try this first | |
| 39 | +| **Multi-table aggregation correctness** | new model joining 3+ tables with `count(*)` / `sum() over (...)` / "first X, last X" logic that must be exactly right | `analyst` if `fast-edit` fails the user's verification | |
| 40 | +| **Warehouse-state work** | column-level lineage, downstream-impact, cross-DB migration / parity, query cost attribution against a real warehouse, schema diff between environments, PII detection, FinOps reporting | `builder` (default — has warehouse tools enabled) | |
| 41 | +| **Vague debug** ("X is broken", "make it work", "fix this") | unspecified failure mode | **Don't delegate yet.** Ask the user for the specific error message or symptom before invoking any agent — empirically all three agents fail vague debug prompts at ~700K tokens each. | |
37 | 42 |
|
38 | | -**Minimal invocation:** |
| 43 | +**Decision policy:** start with `fast-edit` for any dbt/SQL task. If the user reports the result is wrong (e.g. aggregation values don't match), retry with `analyst`. Only use `builder` when the task genuinely needs the warehouse-investigation tools (it's 10–20× more expensive than fast-edit and rarely required). |
39 | 44 |
|
40 | | -```bash |
41 | | -altimate-code run "<task description>" --yolo |
42 | | -``` |
| 45 | +### Step 2 — invoke with the chosen agent |
43 | 46 |
|
44 | | -**Recommended invocation** — captures the final response to a file and runs in the right directory: |
| 47 | +Pass the task through a here-doc into a variable so the shell never |
| 48 | +command-substitutes anything the user typed (a task like |
| 49 | +`refactor `whoami` and $(rm -rf ~)` would otherwise fire `whoami` and |
| 50 | +`rm -rf ~` before `altimate-code` ever runs). Write the result to a |
| 51 | +private temporary file, not a shared one under `/tmp`: |
45 | 52 |
|
46 | 53 | ```bash |
47 | | -altimate-code run "<task description>" \ |
| 54 | +TASK="$(cat <<'ALTIMATE_TASK' |
| 55 | +<user's task, verbatim> |
| 56 | +ALTIMATE_TASK |
| 57 | +)" |
| 58 | +umask 077 |
| 59 | +OUTPUT_FILE="$(mktemp -t altimate-result.XXXXXX.md)" |
| 60 | +altimate-code run "$TASK" \ |
| 61 | + --agent <fast-edit|analyst|builder> \ |
48 | 62 | --yolo \ |
49 | | - --output /tmp/altimate-result.md \ |
| 63 | + --output "$OUTPUT_FILE" \ |
50 | 64 | --dir "$(pwd)" |
51 | 65 | ``` |
52 | 66 |
|
53 | | -Then read `/tmp/altimate-result.md` and pass it straight back to the user. |
| 67 | +Then `Read "$OUTPUT_FILE"` and emit its contents to the user without re-summarising, re-formatting, or commenting on the result. altimate-code has already produced the answer. Delete `"$OUTPUT_FILE"` after presenting so warehouse rows, lineage, or PII findings don't linger on disk. |
54 | 68 |
|
55 | | -### Key flags |
| 69 | +### Required flags |
56 | 70 |
|
57 | | -| Flag | When to use | |
| 71 | +| Flag | Why it is required | |
58 | 72 | |---|---| |
59 | | -| `--yolo` | Required for non-interactive — auto-approves tool calls. Without this it hangs on the first permission prompt. | |
60 | | -| `--output <path>` | Write the final assistant response to a file. Use `.md` or `.txt`. | |
61 | | -| `--dir <path>` | Run the agent in a specific directory (e.g. a dbt project root). Defaults to cwd. | |
62 | | -| `--model provider/model` | Override the model. Useful for fast/cheap exploration. | |
63 | | -| `--format json` | Emit raw JSON events instead of formatted output. Use only when post-processing programmatically. | |
64 | | -| `--continue` / `--session <id>` | Continue a previous altimate-code session. | |
65 | | - |
66 | | -### Example invocations |
| 73 | +| `--agent <name>` | Picks the agent persona. Default `builder` is overkill for simple edits — see the classification table above. Wrong agent = either 10× too expensive (using `builder` on a rename) or wrong-answer (using `fast-edit` on a multi-table join). | |
| 74 | +| `--yolo` | Non-interactive mode. Without this the subprocess hangs on the first permission prompt and you will time out. | |
| 75 | +| `--output "$OUTPUT_FILE"` | Captures the final response. Use the private `mktemp` file from above — do NOT use a fixed path like `/tmp/altimate-result.md`; concurrent sessions clobber each other and a world-readable fixed path leaks data. | |
| 76 | +| `--dir "$(pwd)"` | Runs altimate-code in the current project so it picks up dbt project config, profiles.yml, etc. | |
67 | 77 |
|
68 | | -**Find expensive queries in Snowflake:** |
| 78 | +### Follow-up tasks in the same project |
69 | 79 |
|
70 | | -```bash |
71 | | -altimate-code run "Find the top 10 most expensive queries from the last 7 days in Snowflake and explain why each is slow." \ |
72 | | - --yolo --output /tmp/expensive.md |
73 | | -``` |
74 | | - |
75 | | -**Generate column-level lineage for a dbt model:** |
| 80 | +When the user makes a follow-up data task in the same project after a successful altimate-code delegation, prefer `--continue` to resume the warm session instead of starting a fresh one. Same here-doc + `mktemp` pattern: |
76 | 81 |
|
77 | 82 | ```bash |
78 | | -altimate-code run "Show column-level lineage for the dim_customers model, including upstream sources and downstream consumers." \ |
79 | | - --yolo --dir "$(pwd)" --output /tmp/lineage.md |
| 83 | +TASK="$(cat <<'ALTIMATE_TASK' |
| 84 | +<follow-up task> |
| 85 | +ALTIMATE_TASK |
| 86 | +)" |
| 87 | +umask 077 |
| 88 | +OUTPUT_FILE="$(mktemp -t altimate-result.XXXXXX.md)" |
| 89 | +altimate-code run "$TASK" \ |
| 90 | + --agent <fast-edit|analyst|builder> \ |
| 91 | + --yolo \ |
| 92 | + --output "$OUTPUT_FILE" \ |
| 93 | + --dir "$(pwd)" \ |
| 94 | + --continue # resumes the most recent session in this dir |
80 | 95 | ``` |
81 | 96 |
|
82 | | -**Profile a table:** |
| 97 | +altimate-code's prompt cache is warm in a continued session — project structure, profiles.yml, schema index, source definitions don't need to be re-investigated. Cache reads are billed at a fraction of fresh input on altimate-gateway. The downside is zero: if there's no useful cached context for the new task, you pay normal cold cost. |
83 | 98 |
|
84 | | -```bash |
85 | | -altimate-code run "Profile the events table — row count, null distribution per column, cardinality, and top 5 values for low-cardinality columns." \ |
86 | | - --yolo --output /tmp/profile.md |
87 | | -``` |
| 99 | +If the user starts a clearly unrelated workflow (different project, different schema, different debugging thread), drop `--continue` and start fresh — the warm cache is irrelevant and you'd carry unrelated history into the prompt. |
88 | 100 |
|
89 | | -## Presenting the Result |
| 101 | +## Failure modes — route every one to the user |
90 | 102 |
|
91 | | -Read the output file with the Read tool and pass the content through to the user as-is. Do not re-summarize, re-format, or interpret — altimate-code has already produced the answer. |
| 103 | +When altimate-code returns an error, **report the error to the user and STOP**. Do not fall back to Bash, Edit, or Write. The skill's contract is "altimate-code handles this, or the user is told why it couldn't." |
92 | 104 |
|
93 | | -## Failure Modes |
| 105 | +| Symptom | What to tell the user — verbatim | |
| 106 | +|---|---| |
| 107 | +| `command not found: altimate-code` | "altimate-code is not installed. Install with `npm install -g altimate-code` (Node 20+) and run `altimate-code` once to configure auth. Then re-run your request." | |
| 108 | +| `Unauthorized: Incorrect auth token` / `No provider configured` | "altimate-code's LLM provider auth is misconfigured. Run `altimate-code` in your terminal to open the TUI and reconfigure your provider, then re-run your request." | |
| 109 | +| Process hangs >5 min | "altimate-code is unresponsive. Try `altimate-code` to inspect the TUI for an open prompt, or re-run with `--model anthropic/claude-sonnet-4-6` to force a known-good model." | |
| 110 | +| Output file empty | "altimate-code returned without producing output. The task may be too ambiguous — please restate with more detail (target table, expected columns, time window)." | |
| 111 | +| Warehouse error mid-run (`UNKNOWN_USER`, `Database does not exist`) | "altimate-code can connect but the warehouse credentials it has are wrong for this project. Configure provider/warehouse auth via `altimate-code` TUI." | |
94 | 112 |
|
95 | | -| Symptom | Likely cause | Fix | |
96 | | -|---|---|---| |
97 | | -| `altimate-code: command not found` | Not installed or not on `PATH` | Run `npm install -g altimate-code` (Node 20+). If installed but not found, check `npm bin -g` is on `PATH`. See https://docs.altimate.sh | |
98 | | -| Hangs after starting | Missing `--yolo`, waiting on a permission prompt | Re-run with `--yolo` | |
99 | | -| Output is empty | Task too vague, agent gave up | Re-run with a more specific prompt | |
100 | | -| "No provider configured" | LLM provider creds missing | Run `altimate-code providers` to set up auth | |
101 | | -| Warehouse errors mid-run | DB credentials not configured for altimate-code | Configure provider/warehouse auth in `~/.config/opencode/` or via env vars | |
| 113 | +In every row, the instruction to the user is the action — you do not retry the task with native tools. If the user fixes the underlying issue and asks again, you delegate again. |
102 | 114 |
|
103 | 115 | ## Notes |
104 | 116 |
|
105 | | -- altimate-code runs its own LLM, separate from Claude Code's. Cost and rate limits accrue against altimate-code's configured provider, not Claude Code's. |
106 | | -- Sessions persist in altimate-code's local store — use `altimate-code session list` to find prior runs and `--continue` to resume. |
107 | | -- For long-running tasks, prefer `--output <file>` over scraping stdout. |
| 117 | +- altimate-code runs its own LLM, separate from the host agent's. Costs and rate limits accrue to altimate-code's configured provider. |
| 118 | +- Sessions persist in altimate-code's local store — `altimate-code session list` shows prior runs; `--continue` resumes the latest, `--session <id>` resumes a specific one. |
| 119 | +- For very long tasks, the `--output` file is the source of truth — stdout buffering can drop content. |
0 commit comments