Browse docs
On this page

Agent Skills

Teach Claude Code, Codex, Cursor and other coding agents how to use ObiStack - set up a project, write alert rules, and investigate an incident - with three skills you install in one command.

An Agent Skill is a short set of instructions a coding agent loads when a task calls for it. Ours teach an agent how to do three jobs in ObiStack the way we would do them, so it does not have to work them out from scratch each time.

SkillWhat it teaches your agent
obistack-wizardSet up a project to send logs, metrics and traces with OpenTelemetry, send a test event, and prove the data arrived.
obistack-alertsTurn a postmortem or a description of a failure into ObiQL alert rules, and backtest each one against your history before proposing it.
obistack-runbookWork a firing incident step by step: read the alert, chart the errors, find what changed, follow one request, and write up a timeline with the query behind every claim.

Skills are plain text. They carry no key or token: the agent uses the obi command line and the MCP server with the access you have already given it, and can do nothing your own credential cannot. Anything a skill changes, such as creating an alert rule, it asks you about first.

Each skill is checked against every release of obi and the query language, so the commands and queries it shows keep working.

Read the skills

Open a skill to read exactly what your agent will be told. This is the same file the install command downloads.

obistack-wizardInstrument a project so it sends logs, metrics and traces to ObiStack, then prove the data arrived. Use when the user asks to set up ObiStack, add observability or logging to a repository, connect an app to ObiStack, or work out why an app's data is not showing up.

View raw file

# Set up ObiStack in a project

You are doing what the ObiStack setup wizard does: find out what the project
is built with, add OpenTelemetry to it, send a test event and check that it
arrived. Work in that order and show the user every change before you make it.

You use three things, and nothing else:

- the `obi` command line, signed in as the user,
- the ObiStack MCP tools, if the user has connected them,
- the project's own package manager and files.

Never write a key or token into a file that is committed. Read keys from
environment variables, and add the variable names (with no values) to the
project's example environment file if it has one.

## 1. Check you can reach ObiStack

```bash
obi whoami
```

If that fails, ask the user to run `obi login` themselves. Do not ask them to
paste a token into the chat.

Then see whether the workspace already has data, and from where:

```bash
obi get onboarding
obi get sources
```

With the MCP tools connected, `list_sources` answers the same question.

## 2. Detect the stack

Read the project's manifests before you decide anything:

| You find | The project is |
|---|---|
| `package.json` with `next` | Next.js (Node.js) |
| `package.json` with `express`, `fastify`, `@nestjs/core` or `koa` | Node.js service |
| `pyproject.toml` or `requirements.txt` with `django`, `flask` or `fastapi` | Python service |
| `go.mod` | Go service |
| `pom.xml` or `build.gradle` | Java service |
| `*.csproj` | .NET service |
| A Collector config (`otel-collector*.yaml`, a Helm values file) | Already using OpenTelemetry |

A monorepo can hold several of these. List what you found and ask which
services to instrument before changing anything.

If the project already exports OpenTelemetry, do not add a second SDK. Point
its existing exporter at ObiStack instead (step 4).

## 3. Add OpenTelemetry

Use the official OpenTelemetry SDK and auto-instrumentation for the language,
installed with the project's own package manager and lockfile. Prefer
auto-instrumentation over hand-written spans. Set `service.name` to the
service's real name, and `deployment.environment` when the project has more
than one environment.

Show the user the diff, and wait for a yes before you write it.

## 4. Point the exporter at ObiStack

ObiStack accepts OTLP over HTTP. The exporter needs two environment
variables, read at run time:

```bash
OTEL_EXPORTER_OTLP_ENDPOINT="$OBISTACK_INGEST_URL/ingest/otel"
OTEL_EXPORTER_OTLP_HEADERS="Authorization=Bearer $OBISTACK_INGEST_KEY"
```

`OBISTACK_INGEST_URL` is the ingest address the user's workspace shows under
Connect Your Data, and `OBISTACK_INGEST_KEY` is an ingest key created there.
An ingest key can only send data, never read it, so it is the right key for
an app. Ask the user to create one and put it in their secret store or local
environment file. You never see its value.

The exporter appends `/v1/logs`, `/v1/traces` and `/v1/metrics` itself. Both
`http/protobuf` and `http/json` work; gRPC does not.

## 5. Send a test event

Before you start the app, check that the key works on its own:

```bash
obi send "obistack setup test" --service setup-check --level info
```

`obi send` reads the ingest key from `OBI_INGEST_KEY`, so ask the user to
export it in their shell first. Then start the app and exercise one request.

## 6. Prove it arrived

Events are searchable a few seconds after they are accepted.

```bash
obi search 'service="setup-check"' --from now-15m
obi search 'service="checkout-api"' --from now-15m --limit 20
```

Use the service name you set in step 3 in place of `checkout-api`. To see
every service that sent something recently:

```obiql
* | stats count() by service
```

With the MCP tools, run the same queries with `run_query` and share the
Explorer link it returns.

## When something fails

| Symptom | What to check |
|---|---|
| `obi send` says the key is refused | The key was revoked, or it is a personal access token rather than an ingest key. |
| The test event arrives but the app's data does not | The app is not reading the environment variables, or the exporter uses gRPC. Print the effective OTLP settings at start-up. |
| Data arrives with no `service` | `service.name` is not set on the resource. |
| Some services arrive and others do not | Each process needs the variables. Check the container or process manager config for the missing ones. |
| A partial install failed half way | Revert the uncommitted changes with the user's agreement, then start again at step 3 for one service at a time. |

Report what you changed, which services now send data, and the queries the
user can run to see it.
obistack-alertsTurn a postmortem, an incident write-up or a plain description of a failure into ObiStack alert rules written in ObiQL, backtested against real history before anything is saved. Use when the user asks to create, tune or review an alert, or asks how to catch a problem next time.

View raw file

# Write ObiStack alert rules

An ObiStack alert rule is an ObiQL query plus a condition: fire when the query
matches more than N events in a window. Your job is to find the query that
catches the failure the user describes, check how often it would have fired,
and only then propose the rule.

Use the ObiStack MCP tools when they are connected, and the `obi` command line
otherwise. Never invent a field name: look it up first.

## 1. Pin down the failure

From the postmortem or description, write down:

- the service, or services, involved,
- what the logs said when it went wrong (an error message, a status code, a
  missing heartbeat),
- how fast someone needed to know,
- a time when it happened, so you can check the query finds it.

One failure mode is one rule. A postmortem with three contributing causes
usually wants two or three rules, not one rule with every condition ORed
together.

## 2. Find the fields

MCP: call `get_schema`, or `search_fields` with a word from the description
(for example `status` or `payment`). Command line:

```bash
obi get query-schema -o yaml
```

Then look at real events around the time it happened:

```bash
obi search 'service="payments" level="error"' --from 2026-11-03T14:00:00Z --to 2026-11-03T15:00:00Z --limit 20
```

Group noisy messages by shape to find the one that matters:

```obiql
service="payments" level="error" | stats count() by _pattern
```

## 3. Write the query

Start narrow and widen only if you miss the incident.

| The failure | Query |
|---|---|
| A specific error | `service="payments" "card declined"` |
| Errors from one service | `service="payments" level="error"` |
| Server errors | `service="checkout-api" status>=500` |
| A service gone quiet | `service="billing-worker"`, with the condition `<` |

Some complete examples:

```obiql
service="payments" level="error" -"retrying"
```

```obiql
service="checkout-api" status>=500 | stats count() by route
```

Run the query over the incident window. It must return the events you
expected, and few you did not. With MCP, use `run_query` and show the user
the Explorer link it returns.

## 4. Choose the condition

| Field | Meaning |
|---|---|
| `conditionType` | `log_volume` (count of matches), `error_rate`, or `pattern_match` |
| `conditionOperator` | `>`, `>=`, `<`, `<=` or `==` |
| `conditionThreshold` | The number the count is compared with |
| `windowSeconds` | How far back each evaluation looks (10 to 86400) |
| `intervalSeconds` | How often the rule runs (10 to 86400) |

A short window with a low threshold pages on every blip. Prefer a window long
enough that one retry storm does not fire the rule on its own.

## 5. Backtest before you propose

MCP: call `backtest_alert` with the query and condition. Command line, with
the rule in a file:

```bash
obi api POST /v1/alerts/backtest -d @rule.json
```

where `rule.json` holds the query, the condition and `"window": "7d"` (one of
`1d`, `3d`, `7d`, `14d` or `30d`).

Read the result with the user:

- It must fire during the incident you are writing it for.
- It should fire rarely otherwise. A rule that would have fired every day last
  week will be silenced and then ignored.
- If it misses the incident, the query is too narrow. If it fires all the
  time, raise the threshold, lengthen the window, or narrow the query.

## 6. Propose the rule

MCP: call `create_alert_rule` (or `update_alert_rule` for an existing rule).
It only proposes the change. The user approves it in their client or in
ObiStack. If the approval comes back as still pending, ask the user, then
record their answer with `decide_change`. Never decide for them, and never
say a rule exists until the result says it was approved.

Command line, after the user agrees, since this creates the rule at once:

```bash
obi create alert payments-card-declines --query 'service="payments" "card declined"' --threshold 20 --window 10m --description "Card declines above normal after a provider outage"
```

To keep rules in version control, export them and apply the file:

```bash
obi get alerts --export > alerts.yaml
obi apply -f alerts.yaml --dry-run
```

## Writing descriptions that help

The rule's description is what the on-call person reads at 3am. Say what
broke, why it matters and where to look first, in plain words. Name the
service and the user impact, not the query.

## Reviewing existing rules

```bash
obi get alerts -o wide
obi get alert-health
obi describe alert payments-card-declines
```

Rules that fire often and resolve within minutes are noise: raise their
threshold or window, or delete them, with the user's agreement.
obistack-runbookWork an ObiStack incident step by step, from the firing alert to a timeline of what happened and a likely cause, narrating each query as you go. Use when an alert is firing, the user asks what is wrong with a service, or they want an incident investigated or written up.

View raw file

# Investigate an ObiStack incident

Build a timeline of what happened, one query at a time, and say what each
step showed before you take the next. The user wants to follow your
reasoning, so do not jump to a conclusion the data has not shown yet.

Use the ObiStack MCP tools when they are connected, and the `obi` command line
otherwise. Everything here only reads, except the last step, which needs the
user's agreement.

## 1. Find the incident

MCP: `list_incidents`, then `get_incident`. Command line:

```bash
obi get incidents --status open
obi describe incident 12
```

Note when it started, which alert rules fired, and whether anyone has
acknowledged it.

## 2. Read the alert that fired

MCP: `get_alert_rule` and `get_alert_events`. Command line:

```bash
obi describe alert payments-errors
obi get alert-events --alert payments-errors
```

Write down the rule's query, its condition, and when it first fired. That
query is your starting point.

## 3. See the shape of the problem

Run the rule's query over a window that starts well before the first firing,
and chart it, so you can see when it began and whether it is still going:

```obiql
service="payments" level="error" | timechart span=1m count()
```

```bash
obi search 'service="payments" level="error" | timechart span=1m count()' --from now-3h
```

Say what you see: a step change, a slow climb, a burst that has ended.

## 4. Find what changed

Look at what the errors say, grouped by shape so one noisy message does not
hide the rest:

```obiql
service="payments" level="error" | stats count() by _pattern
```

Compare it with the hour before the incident started. A pattern that is new
is a stronger lead than one that has always been there.

Then widen the search to neighbouring services over the same minutes:

```obiql
level="error" | stats count() by service
```

A deploy, a restart or a configuration change often shows up as an info
event just before the errors start:

```obiql
service="payments" ("deploy" OR "starting" OR "config")
```

## 5. Follow one request

Pick one failing event, take its `trace_id`, and read everything that request
touched:

```obiql
trace_id="4bf92f3577b34da6a3ce929d0e0e4736" | fields timestamp, service, level, message
```

Use the real trace id from the event, not this one.

## 6. Check the dashboards

MCP: `list_dashboards`, then `get_dashboard` for the service's dashboard.
Command line:

```bash
obi get dashboards
```

Latency, saturation or a dependency's error rate often moves before the
service's own errors do.

## 7. Write the timeline

Give the user a short, ordered timeline with times in UTC:

- when the first sign appeared, and what it was,
- when the alert fired,
- what changed just before, if anything,
- what is still happening now,
- your best explanation, and how sure you are.

For every claim, include the query that shows it, so the user can run it
themselves. With MCP, include the Explorer link `run_query` returns.

## 8. Update the incident, only when asked

Do not acknowledge, resolve or reassign an incident unless the user tells you
to. MCP: `set_incident_status` proposes the change for the user to approve.
Command line, which takes effect at once:

```bash
obi ack incident 12
obi resolve incident 12
```

If the cause will happen again, offer to write an alert rule that catches it
earlier, using the `obistack-alerts` skill.

Before you install

Give your agent a way to reach your workspace. Either works, and both is best:

  • Connect the MCP server, so the agent can query your data and propose changes for you to approve.
  • Install obi and run obi login, so an agent that runs commands can use it.

Install in Claude Code

Run this in a terminal to install all three skills for every project:

Shell
for skill in obistack-wizard obistack-alerts obistack-runbook; do mkdir -p ~/.claude/skills/$skill && curl -fsSL https://obistack.com/agent-skills/$skill/SKILL.md -o ~/.claude/skills/$skill/SKILL.md; done

To share them with everyone working on one repository instead, run it from the repository's root with .claude/skills in place of ~/.claude/skills, and commit the folder.

Claude Code picks a skill up when your request matches it, for example "set up ObiStack in this repo", "write an alert for the outage in this postmortem" or "investigate incident 12". You can also ask for one by name.

Install in other agents

Codex, Cursor, GitHub Copilot and other agents that support Agent Skills read the same files. Download each skill's SKILL.md into a folder with the skill's name, inside the skills folder your agent reads (see its documentation for where that is):

Shell
curl -fsSL https://obistack.com/agent-skills/obistack-wizard/SKILL.md -o SKILL.md

Swap obistack-wizard for obistack-alerts or obistack-runbook to get the others.

For an agent without skills support, paste the parts of a skill you want into its own instructions file, such as AGENTS.md, a Cursor rule, or .github/copilot-instructions.md. It then follows them on every task rather than only when one matches.

Updating

Run the install command again to get the latest version. Each skill's header carries a version, so you can see which one you have.

What the skills can see

Nothing of their own. A skill is instructions, so it reaches exactly what the agent's MCP connection or obi sign-in reaches: your workspaces, with your role and your Data Scopes. Signing the agent out, or revoking its connection, cuts the skills off with it.