OtisDocs

Auto instrumentation

Agent skills

Set up the Otis skills in your coding agent, and use them to instrument your app with the Otis SDK.

The Otis skills let your coding agent instrument your app with the Otis SDK. Your agent chooses what to measure, adds the code, and checks that data arrives. The skills run in your own agent, in your own repository. They get your project's data and their instructions from the Otis MCP server. MCP (Model Context Protocol) is the standard way coding agents connect to outside tools.

This page covers setup and the instrumentation steps. Coding agents is the full reference for the skills. It also covers how to ask Otis about your product from your agent.

Setting up agent skills

The skills work in Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, and other agents that support the Agent Skills format. Use one install method for each agent.

The plugin installs the skills and the Otis MCP server together:

claude plugin marketplace add runotis/agent-skills
claude plugin install otis@otis

Then start Claude Code and run /mcp to sign in to Otis.

The plugin installs the skills and the Otis MCP server together:

codex plugin marketplace add runotis/agent-skills
codex plugin add otis@otis

Then sign in to Otis:

codex mcp login otis

Install the skills with the skills CLI. Run the command from the root of your repository, and name your agent with -a:

npx skills add runotis/agent-skills -a cursor

Use -a github-copilot for GitHub Copilot and -a gemini-cli for Gemini CLI.

Then connect your agent to the Otis MCP server at https://app.runotis.com/mcp. MCP server gives the command for each agent.

The first time your agent connects, it opens a browser window for you to sign in. Use the account you use for the Otis app. There are no API keys to create, and no secrets are written to your repository. If you belong to more than one Otis team, the sign-in page asks you to choose one.

Instrumenting your app

Four skills cover instrumentation. Each one is a multi-step workflow that tells your agent which steps to take. Your agent reads and writes code and runs your tests. It calls the Otis MCP server for your project's state and for the reference docs.

A typical run looks like this:

otis-analyze      → profile the codebase and recommend what to measure
otis-instrument   → add the SDK and instrumentation, run tests, open a pull request
# merge the pull request and deploy
otis-verify       → check the instrumentation and confirm data is arriving

To run a skill, describe the task to your agent, such as "instrument this app with Otis". Coding agents covers how to call a skill by name.

You can run otis-status at any point. It only reads.

Analyze the codebase

otis-analyze reads your entry points, frameworks, deployment setup, and authentication. It detects existing telemetry, analytics SDKs, consent tools, and feature-flag platforms, and it maps the main workflows your users follow. Then it recommends the Otis measurements that fit your product. It saves the profile and the recommendations to your Otis project.

You can run otis-analyze again after your code changes. It refreshes the profile and the recommendations. Measurements you have already kept, skipped, or instrumented keep their status.

Add instrumentation

otis-instrument works through the measurements you approve. If your project has no analysis yet, it first analyzes the codebase, as otis-analyze does, so you can start with otis-instrument. If you haven't reviewed the recommendations in the Otis app, it asks you to keep or skip each one. Then it does the following:

  • Installs @runotis/sdk if your app doesn't have it. If your environment file has no Otis API key, it creates one. Creating a key requires admin access to the Otis project.
  • Initializes the SDK following the integration guide for your runtime.
  • Wraps your AI framework calls with wrap(), and adds traced() and events where each measurement needs them. It passes user and session context from your authentication code.
  • Connects your feature-flag platform, if you use one, so that Otis records flag values.
  • Records what it instrumented in your Otis project, so that Otis knows which data to expect.
  • Adds a short Otis section to your repository's agent instructions file.
  • Runs your type-check, lint, and test scripts, and fixes failures that its changes caused.
  • Opens a single pull request with all the changes.

The Otis section is for any coding agent that later edits this code without running an Otis skill. Mistakes in instrumentation fail silently: the build still passes, but Otis gets no data, or data it cannot tie to a user or session. The section tells the agent that the repository is instrumented, to check with the Otis MCP server before changing that code, and to run otis-verify afterwards.

The skill writes the section into each of AGENTS.md, CLAUDE.md, and GEMINI.md that exists at the root of your repository, because agents differ in which of these files they read. If none of them exists, it creates AGENTS.md. If one of them is a symbolic link, it edits the file the link points to. The section sits between <!-- otis:begin --> and <!-- otis:end --> markers. A later run replaces the text between the markers and changes nothing else in the file.

Verify the instrumentation

After you deploy, Otis checks automatically that data is arriving and marks each working measurement as verified. otis-verify shows you the details:

  • It runs your checks again and reviews the instrumentation for common mistakes. Examples include AI calls that are not wrapped, missing user or session context, and serverless handlers that exit before data is sent.
  • It reports whether data reached Otis in the last 24 hours, for each environment.
  • For each measurement, it reports whether the expected events are arriving and whether they carry user and session context.

It suggests fixes for any issues it finds.

Check progress

otis-status shows the status of each measurement, any open pull request, and whether the SDK is installed. A measurement is recommended, approved, skipped, in progress, instrumented, or verified.

  • Coding agents covers every skill, how to ask Otis about your product, and how the skills stay current.
  • MCP server covers the server the skills use, and how to follow the same workflows in an agent that doesn't support skills.
  • Onboarding covers where these steps fit in setting up a project.

On this page