> ## Documentation Index
> Fetch the complete documentation index at: https://tinyanalytics.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# TinyAnalytics Agent Skills for AI Coding Agents

> Install five open-source Agent Skills so Claude Code, Cursor, or Codex can set up TinyAnalytics, prove tracking works, and build dashboards.

**TinyAnalytics Agent Skills** are five open-source instruction packs that teach an AI coding agent to run TinyAnalytics end to end—register, create the site, install the tracking script, prove real data arrives, then instrument events, answer questions from the data, and build goals, funnels, and dashboards. You state the intent; the agent does the analytics work.

Install them into your agent with one command:

```bash theme={null}
npx -y skills add tinyanalytics/agent-skills -y
```

The skills live in the public [tinyanalytics/agent-skills](https://github.com/tinyanalytics/agent-skills) repository and are MIT-licensed.

<Note>
  Agent Skills tell an agent **how to work with TinyAnalytics**. They are not the
  same as the [TinyAnalytics MCP server](/docs/api-reference/mcp-server), which gives an
  agent a live connection to your analytics data, or [Ask AI](/docs/ai-analytics-assistant),
  which answers questions inside the dashboard. The comparison below shows which to reach for.
</Note>

## What is an Agent Skill?

An Agent Skill is a Markdown file that an AI coding agent loads when a task matches its trigger, giving the agent step-by-step procedure, exact request bodies, and explicit failure handling for that task. TinyAnalytics publishes five, each scoped to one job so an agent loads only what the current task needs.

## Which skills are included?

| Skill                           | What the agent does with it                                                                                                                                                                                                                      |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `tinyanalytics-setup`           | The orchestrator: obtains a working API key, reuses or creates the site, installs the snippet the way your framework expects, then verifies                                                                                                      |
| `verify-tinyanalytics-tracking` | Polls your site's overview for a real pageview and walks a diagnostic ladder—served HTML, site ID, script load, CSP, ad blocker—when it stays at zero                                                                                            |
| `tinyanalytics-events`          | Instruments client-side [custom events](/docs/custom-event-tracking), [revenue](/docs/revenue-analytics) on events, [user identity and traits](/docs/user-identification-analytics), and [B2B account tracking](/docs/b2b-account-analytics) through the browser API |
| `tinyanalytics-insights`        | Answers questions from your data: overview totals, time series with comparisons, breakdowns across **17 dimensions**, acquisition, live visitors, ad-hoc funnels, and guarded [custom SQL](/docs/sql-analytics-query-builder)                         |
| `tinyanalytics-dashboards`      | Builds the measurement layer: [goals](/docs/conversion-goal-tracking) by path, event, revenue, or scroll; saved [funnels](/docs/funnel-analytics); SQL-card [dashboards](/docs/custom-analytics-dashboards); and [annotations](/docs/analytics-annotations)          |

Each skill declares when to skip itself, so an agent asked to instrument checkout reaches for `tinyanalytics-events` rather than re-running setup.

## How do I install the Agent Skills?

**Prerequisites:** Node.js (for `npx`) and an agent that supports skills—Claude Code, Cursor, and Codex all work, along with the other targets the [`skills`](https://github.com/vercel-labs/skills) CLI supports.

<Steps>
  <Step title="Add the skills to your project">
    Run the install command from your project root:

    ```bash theme={null}
    npx -y skills add tinyanalytics/agent-skills -y
    ```

    Keep both non-interactive flags. Without them the CLI opens a picker, which stalls an agent-driven install that has no one to answer it.
  </Step>

  <Step title="Ask for what you want">
    Describe the outcome in your own words and let the matching skill trigger:

    ```text theme={null}
    Set up TinyAnalytics on this project and show me the first pageview.
    ```

    Other phrasings that match: *"add analytics to my site"*, *"is tracking working?"*, *"track signups"*, *"what were our top pages last week?"*, or *"build a signup funnel"*.
  </Step>

  <Step title="Answer the agent's account question">
    The setup skill asks which email to register with rather than inventing one, and hands you the generated password and login URL afterward. If the response says a verification link was emailed, click it.
  </Step>
</Steps>

## Verify

<Check>
  Ask your agent to list the skills available in the current project. The
  installation is complete when all five TinyAnalytics skills appear and a
  request such as “is tracking working?” selects the verification skill.
</Check>

## How does the agent get an API key?

The setup skill works down an access ladder instead of assuming you already have a key:

1. **A key already in your project's `.env` or environment** — it verifies the key still works and uses it.
2. **No key** — a single headless registration call creates the user, organization, site, and API key together, so setup never requires the web UI.
3. **Registration disabled on the instance** — the agent asks you to sign up and mint a key yourself from [Settings → Account](/docs/tinyanalytics-account-settings), then paste it in.

The key the agent creates or receives carries [its owner's access](/docs/api-reference/api-authentication), exactly like a key you make by hand.

<Warning>
  The skills require the key to go into a gitignored `.env` and be read back as an
  environment variable—never into chat output, a commit, a log, or any other file.
  Review the agent's diff before committing, as you would for any generated code.
</Warning>

## How do the skills stay current?

Every skill fetches [`dash.tinyanalytics.io/setup.md`](https://dash.tinyanalytics.io/setup.md) at run time and treats that page as the source of truth for endpoints, request bodies, and response shapes. Where an installed skill disagrees with the fetched page, the fetched page wins—so an old install still calls current endpoints. If the page is unreachable, the skill stops and tells you rather than guessing an endpoint from memory.

Documented endpoints are additive-only, and anything scheduled for deprecation is dated in [`dash.tinyanalytics.io/llms.txt`](https://dash.tinyanalytics.io/llms.txt) first. To pick up new skills, re-run the install command.

The same flow is written for people at [`dash.tinyanalytics.io/setup.md`](https://dash.tinyanalytics.io/setup.md) if you would rather follow it yourself.

## Do the skills prove tracking actually works?

Yes. The verification skill reports success **only on observed data**—it polls your site's overview endpoint until a real pageview appears, and never reports "verified" from the fact that a snippet was added. When the count stays at zero, it works through the served HTML, the site ID, whether the script loaded, your Content Security Policy, and ad blockers, reporting each finding as it goes. You can also [verify the installation yourself](/docs/verify-tinyanalytics-installation).

## Agent Skills, MCP server, or Ask AI?

All four surfaces use AI with TinyAnalytics, and they answer different questions:

| You want to                                                            | Use                                                        |
| ---------------------------------------------------------------------- | ---------------------------------------------------------- |
| Have a coding agent install and operate TinyAnalytics in your codebase | **Agent Skills**, on this page                             |
| Give an agent a live connection to your analytics data                 | [The TinyAnalytics MCP server](/docs/api-reference/mcp-server)  |
| Ask about your own analytics inside the dashboard                      | [Ask AI](/docs/ai-analytics-assistant)                          |
| Give an assistant these documentation pages as context                 | [Use docs with AI](/docs/resources/tinyanalytics-docs-ai-tools) |

Agent Skills and the MCP server work well together: the skills supply the procedure, and the MCP server can supply the connection. The setup skill writes its steps as outcomes, so an agent already connected over MCP can reach them with MCP tools instead of raw HTTP calls.

## Related

<Columns cols={2}>
  <Card title="MCP server" icon="plug" href="/docs/api-reference/mcp-server">
    Connect an AI agent to your analytics data.
  </Card>

  <Card title="Use docs with AI" icon="wand-magic-sparkles" href="/docs/resources/tinyanalytics-docs-ai-tools">
    Give an assistant these pages as context.
  </Card>

  <Card title="Quickstart" icon="rocket" href="/docs/tinyanalytics-quickstart">
    Install TinyAnalytics yourself in a few minutes.
  </Card>

  <Card title="API keys" icon="key" href="/docs/api-reference/api-authentication">
    Understand what a key can reach.
  </Card>

  <Card title="Verify installation" icon="circle-check" href="/docs/verify-tinyanalytics-installation">
    Confirm your first pageview by hand.
  </Card>

  <Card title="Ask AI" icon="comments" href="/docs/ai-analytics-assistant">
    Ask questions inside the dashboard.
  </Card>
</Columns>


## Related topics

- [Bot and AI Crawler Analytics](/docs/bot-ai-crawler-analytics.md)
- [Use TinyAnalytics Documentation with AI Tools](/docs/resources/tinyanalytics-docs-ai-tools.md)
- [How Analytics Bot Detection Works](/docs/resources/analytics-bot-detection.md)
