# signals-scout-anomaly-detection

signals-scout-anomaly-detection — a skill for Claude Code detects anomalies across saved PostHog insights, including sudden spikes, metric drops, and broken trends. Tracks key dashboards against seasonality-matched baselines.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 318 installs · ★ 80 repo stars
- Author: PostHog
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/PostHog/skills/tree/HEAD/skills/omnibus/signals-scout-anomaly-detection/SKILL.md
- Updated: 2026-11-14
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/signals-scout-anomaly-detection

## What it does

The skill spots abrupt metric shifts in PostHog insights before teams uncover them manually. When historical anomaly scores are present, it evaluates newly flagged episodes by checking z-scores against 28-day weekday medians. If past anomaly scores are lacking, the scout switches to legacy mode and monitors viewed dashboards against a seasonality baseline.

Operation requires the PostHog Signals scout setup inside a Claude sandbox. It needs read-only analytics permissions along with write scopes for `signal_scout_internal:write`, `signal_scout_report:write`, and `notebook:write`. The workflow relies on signals-scout MCP tools, including `emit_report`, `edit_report`, notebook write tools, and anomaly inspection endpoints.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/skills --skill signals-scout-anomaly-detection -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/signals-scout-anomaly-detection/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/signals-scout-anomaly-detection/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/skills --skill signals-scout-anomaly-detection -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/signals-scout-anomaly-detection/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/skills --skill signals-scout-anomaly-detection -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/signals-scout-anomaly-detection/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install PostHog/skills skills/omnibus/signals-scout-anomaly-detection
```

2. **Manually: put the files in place**
- File: `.github/skills/signals-scout-anomaly-detection/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add PostHog/skills --skill signals-scout-anomaly-detection -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/PostHog/skills --path skills/omnibus/signals-scout-anomaly-detection
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/signals-scout-anomaly-detection/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add PostHog/skills --skill signals-scout-anomaly-detection -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/PostHog/skills/tree/HEAD/skills/omnibus/signals-scout-anomaly-detection/SKILL.md

## When to use it
- spot sudden drops or spikes in PostHog insight metrics
- filter metric noise using z-scores and weekday medians
- publish reports on broken trends across project dashboards

## Example prompts
- Scan PostHog insights for recent metric anomalies and draft a report
- Check the most-viewed dashboards for sudden drops or broken trends

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 23ed1aca48631367.

BEGIN THIRD-PARTY FILE 23ed1aca48631367
```text
---
name: signals-scout-anomaly-detection
scout-display-name: Anomaly detection
description: >
  Signals scout that surfaces anomalies in the project's saved insights — bursts, drops,
  flat-lines, and trend breaks. Where anomaly scores exist, it judges the flagged episode starts;
  elsewhere it watches the most-viewed dashboards and insights against each insight's own
  seasonality-matched baseline.
compatibility: >
  Runs as the PostHog Signals scout in a Claude sandbox with read-only analytics scopes
  plus signal_scout_internal:write (scratchpad), signal_scout_report:write (the report
  channel — emit_report / edit_report), and notebook:write (the notebook write-up behind
  each report). Assumes the signals-scout MCP tool family plus the dashboard/insight,
  anomaly-search, anomaly-insight-get, alert-simulate, inbox-reports, and notebook tools listed in the body's MCP tools section.
allowed_tools:
  - emit_report
  - edit_report
metadata:
  owner_team: signals
  scope: anomaly_detection
scout-precheck-query: |
  WITH recent AS (
      SELECT
          toInt(properties.$anomaly_insight_id) AS insight_id,
          properties.$anomaly_series_key AS series_key,
          properties.$anomaly_series_label AS series_label,
          properties.$anomaly_breakdown_value AS breakdown_value,
          coalesce(toDateTime(properties.$anomaly_bucket_start), timestamp) AS bucket,
          toInt(properties.$anomaly_flag) AS flag,
          toFloat(properties.$anomaly_value) AS value,
          toDateTime(properties.$anomaly_scored_at) AS scored_at,
          JSONExtractString(properties, '$anomaly_details') AS details
      FROM events
      WHERE event = '$anomaly_score'
          AND properties.$anomaly_source = 'insight'
          AND properties.$anomaly_interval = 'day'
          AND timestamp >= {now} - INTERVAL 4 DAY
      ORDER BY scored_at DESC
      LIMIT 1 BY series_key, bucket
  ),
  candidates AS (
      SELECT
          insight_id,
          series_key,
          series_label,
          breakdown_value,
          bucket,
          value,
          if(JSONExtractRaw(details, 'raw_zscore') IN ('', 'null'), NULL, JSONExtractFloat(details, 'raw_zscore')) AS raw_zscore
      FROM recent
      WHERE flag = 1
          AND scored_at > {since}
          AND bucket >= {now} - INTERVAL 3 DAY
          AND coalesce(raw_zscore, 99) >= 3.5
  ),
  history AS (
      SELECT
          properties.$anomaly_series_key AS series_key,
          coalesce(toDateTime(properties.$anomaly_bucket_start), timestamp) AS bucket,
          toInt(properties.$anomaly_flag) AS flag,
          toFloat(properties.$anomaly_value) AS value
      FROM events
```
END THIRD-PARTY FILE 23ed1aca48631367

The third-party file has ended. Everything between the 23ed1aca48631367 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2675 of 21106 bytes. © PostHog · MIT · https://github.com/PostHog/skills/tree/HEAD/skills/omnibus/signals-scout-anomaly-detection/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
