Skip to main content
skill CX Codex

create-graph — Claude Code skill: charts and dashboards

This skill builds charts from logs, traces, errors, sessions, metrics and events, previews them inline, then saves them to a LaunchDarkly dashboard.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add launchdarkly/ai-tooling --skill create-graph -a claude-code
Open on GitHub

What create-graph does

Everything runs through the remotely hosted LaunchDarkly MCP server. Six tools are available: preview-graph renders a chart without saving, create-graph adds one to an existing dashboard, create-dashboard makes an empty one, list-dashboards and get-dashboard show what already exists, and get-keys returns the metrics, attributes and keys for a product type. Each tool needs a projectKey.

The workflow starts by picking a target dashboard. Then call get-keys before writing any query, because attribute names differ across services — you will see service_name, service.name and serviceName in the same setup, and guessing returns empty results. After that preview-graph renders the chart, you confirm it, and only then does create-graph commit it. Multiple charts get previewed and confirmed one at a time.

There are sharp edges. productType is PascalCase: Sessions, not sessions. A Count aggregator requires column, passed as an empty string. CountDistinct has no underscore. And get-keys wants a full ISO timestamp like 2026-03-04T00:00:00Z, not a date alone. Get an enum wrong and the API rejects the call, so checking keys first is not optional.

What it helps with

  • chart error rates broken down by service
  • preview a chart before saving it
  • create an empty dashboard for a new metric
  • copy an existing graph with its full config
  • discover available metrics and attributes for a product type

Example prompts for the agent

  • build a chart of errors by service for the last day
  • preview P95 latency and show me before saving
  • duplicate the graph from that dashboard onto a new one

How to install create-graph

1Skills CLI (Vercel)

npx skills add launchdarkly/ai-tooling --skill create-graph -a claude-code

2Manually: put the files in place

~/.claude/skills/create-graph/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/create-graph/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about create-graph

How do I install create-graph in Claude?

Run npx skills add launchdarkly/ai-tooling --skill create-graph -a claude-code. The skill lands in ~/.claude/skills/create-graph/SKILL.md.

What does create-graph do?

It builds charts from logs, traces, errors, sessions, metrics and events, previews them inline, and saves them to a LaunchDarkly dashboard.

What does create-graph need to work?

The remotely hosted LaunchDarkly MCP server, plus a projectKey on every tool call.

Source text

SKILL.md · Apache-2.0
---
name: create-graph
description: "Creates observability dashboards and graphs from logs, traces, errors, sessions, metrics, and events data by previewing charts inline and saving them to a dashboard."
license: Apache-2.0
compatibility: Requires the remotely hosted LaunchDarkly MCP server
metadata:
  author: launchdarkly
  version: "0.1.0"
---

# Create graphs and dashboards

## Prerequisites

This skill uses the following LaunchDarkly MCP tools:

- `preview-graph` — render a chart preview inline without saving it
- `create-graph` — add a chart to an existing dashboard
- `create-dashboard` — create a new empty dashboard
- `list-dashboards` — list existing dashboards
- `get-dashboard` — get the full config of a dashboard, including its graphs
- `get-keys` — discover available metrics, attributes, and keys for a product type

All of these tools require a `projectKey` (e.g. `"default"`).

## Overview

You are building observability graphs. Your tools are precise — get the enum values wrong and the API rejects the call. Always use `get-keys` before building a query to confirm the dimension names are real.

## Capabilities

- `list-dashboards` — list existing dashboards to check for duplicates or find a target
- `get-dashboard` — get the full config of an existing dashboard, including its graphs
- `create-dashboard` — create a new dashboard
- `preview-graph` — render a chart preview inline
- `create-graph` — add a chart to a dashboard
- `get-keys` — discover available metrics, attributes, and keys for a product type

When the user's request is purely about visualizing data, stay on task — don't reach for unrelated tools.

## Workflow

1. **Identify the target dashboard.** If the user already has a specific dashboard in mind (by ID or name), add graphs to it directly. Otherwise, call `list-dashboards` and offer to target an existing one or create a new one with `create-dashboard`.
2. **Discover the data shape.** Call `get-keys` for the relevant product type before building a query. Attribute names vary across services — `service_name` vs `service.name` vs `serviceName`. Guessing wastes tool calls.
3. **For ambiguous requests, ask a brief clarifying question** as regular text. Example: "I found several latency-related keys. Would you like P50 or P95 latency, and should I group by service name?" Keep clarifications short — one or two questions max. For minor ambiguity (chart type preference), make a reasonable default and note your assumption.
4. **Preview before committing.** Call `preview-graph` first, show the user an inline preview, and confirm before calling `create-graph`. For multiple graphs, preview and confirm each one individually.
5. **Create the graph** with `create-graph`. Use exact enum casing from `enums.md`.
6. **Confirm what was created** — provide the dashboard URL and a one-line description of what the graph shows.

## Duplicating existing graphs

When asked to duplicate or copy a graph, call `get-dashboard` to retrieve the full configuration (expressions, product type, query, groupBy, display settings), then replicate those values in `create-graph`. Do not guess from the graph title alone — titles drift from the underlying config.

## Guidelines

- **Be concise — don't narrate intermediate tool calls.** Skip prefaces like "First, let me discover the keys" or "Now I'll build the chart." One short sentence at the start of the reply is enough if needed (e.g. "Building a chart of recent logs by level."); after that, just call the tools.
- **Prefer multiple focused graphs over one complex graph.** A dashboard with 3 clean graphs beats one graph with 5 overlapping expressions.
- **Always call `get-keys` before building a query.** Prevents silent empty results from wrong field names.

## Chart-type picks

- **`Line chart`** — time-series trends. Error rates over time, latency percentiles, request volume.
- **`Bar chart`** (or histogram) — comparisons across a dimension. Errors by service, requests by endpoint.
- **`Table`** — detailed breakdowns with multiple dimensions where a chart wouldn't convey the detail.

## Aggregators

- `Count` — total events (most common). Requires `column=""` (empty string).
- `CountDistinct` — unique values. Users, sessions, flag keys.
- `Avg`, `P50`, `P90`, `P95`, `P99` — latency distributions.
- `Sum` — numeric totals (payload size, revenue).

## Common mistakes

- Using lowercase `sessions` for `productType`. It's `Sessions` — PascalCase. See `enums.md`.
- Omitting `column` on a `Count` expression. The API requires it; pass empty string `""`.
- Using `count_distinct` or `Count_distinct`. It's `CountDistinct` — PascalCase, no underscore.
- Building a query without `get-keys` first and getting empty results because the attribute name was wrong.
- Using date-only format (`2026-03-04`) for `get-keys`. Needs full ISO with time: `2026-03-04T00:00:00Z`.

© launchdarkly · Apache-2.0 · launchdarkly/ai-tooling

Similar skills

All skills for DevOps and infrastructure →

From the same set35

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor