/import-dashboards
Imports existing Grafana dashboards as Go builder code via gcx. Use when the user wants to convert live dashboards to builder code, migrate dashboards to code, or reverse-engineer a dashboard from a Grafana instance. Triggers on "import dashboard", "convert to code", "dashboard
$ npx -y skills add grafana/gcx --skill import-dashboards --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/import-dashboards
Context preview
The summary Claude sees to decide when to auto-load this skill.
Imports existing Grafana dashboards as Go builder code via gcx. Use when the user wants to convert live dashboards to builder code, migrate dashboards to code, or reverse-engineer a dashboard from a Grafana instance. Triggers on "import dashboard", "convert to code", "dashboard
SKILL.md
import-dashboards.SKILL.mdname: import-dashboards
description: >
Imports existing Grafana dashboards as Go builder code via gcx. Use when
the user wants to convert live dashboards to builder code, migrate
dashboards to code, or reverse-engineer a dashboard from a Grafana
instance. Triggers on
"import dashboard", "convert to code", "dashboard as code", "export dashboard".
For pulling dashboards as YAML/JSON resource files rather than Go code,
use manage-dashboards instead.
Import Dashboards as Code
Import existing dashboards from a Grafana instance and convert them to Go builder code using `gcx dev import`.
Prerequisites
1. gcx installed and configured with a Grafana connection (`gcx config check` should show a valid context) 2. The target Grafana instance must be reachable
Import Commands
Import All Dashboards
gcx dev import dashboards
Writes Go files to `imported/` (default). Each dashboard becomes a function returning `*resource.ManifestBuilder`.
Import a Specific Dashboard
gcx dev import dashboards/my-dashboard-uid
Import to a Custom Directory
gcx dev import dashboards --path src/grafana
Import Multiple Resource Types
gcx dev import dashboards folders
How It Works
Grafana Instance
│
▼
gcx dev import dashboards/foo
│
├── 1. Fetches resource via K8s API (/apis endpoint)
├── 2. Detects the resource API version
├── 3. Runs version-specific converter (JSON → SDK builder code)
├── 4. Wraps in resource.NewManifestBuilder()
└── 5. Writes to imported/<snake_case_name>.goThe converter produces Go code using the grafana-foundation-sdk builder pattern — the same pattern used by `dev generate` and `dev scaffold`.
Output Format
Each imported file looks like:
package dashboards
import (
"github.com/grafana/grafana-foundation-sdk/go/dashboardv2beta1"
"github.com/grafana/grafana-foundation-sdk/go/resource"
)
func MyDashboard() *resource.ManifestBuilder {
// ... builder code generated from the live dashboard
}Workflow: Import → Edit → Push
# 1. Import from Grafana
gcx dev import dashboards --path internal/dashboards
# 2. Review and edit the generated code
# (fix up builder calls, add variables, etc.)
# 3. Render manifests from the builders. In a gcx-scaffolded project,
# `go run .` writes JSON manifests to ./resources
go run .
# 4. Push back to Grafana
gcx resources push
Common Issues
| Issue | Fix | |-------|-----| | "no converter found" | The resource's API version has no converter; the error message names the unsupported version | | Auth error (401/403) | Run `gcx config check` to verify credentials | | Empty import | The selector matched no resources; check UID with `gcx resources get dashboards` | | Build fails with `undefined: cog` (or another lowercase SDK identifier) | Older gcx versions omit SDK imports from generated files. Add the missing import `github.com/grafana/grafana-foundation-sdk/go/<pkg>` for each undefined identifier — `variants` is nested at `go/cog/variants`. Newer gcx emits complete imports | | Imported code doesn't compile for other reasons | Complex dashboards can produce converter output that needs manual fixup: build, read the first error, fix, repeat |
Read more
name: import-dashboards description: > Imports existing Grafana dashboards as Go builder code via gcx. Use when the user wants to convert live dashboards to builder code, migrate dashboards to code, or reverse-engineer a dashboard from a Grafana instance. Triggers on "import dashboard", "convert to code", "dashboard as code", "export dashboard". For pulling dashboards as YAML/JSON resource files rather than Go code, use manage-dashboards instead.
Import Dashboards as Code
Import existing dashboards from a Grafana instance and convert them to Go builder code using `gcx dev import`.
Prerequisites
1. gcx installed and configured with a Grafana connection (`gcx config check` should show a valid context) 2. The target Grafana instance must be reachable
Import Commands
Import All Dashboards
gcx dev import dashboards
Writes Go files to `imported/` (default). Each dashboard becomes a function returning `*resource.ManifestBuilder`.
Import a Specific Dashboard
gcx dev import dashboards/my-dashboard-uid
Import to a Custom Directory
gcx dev import dashboards --path src/grafana
Import Multiple Resource Types
gcx dev import dashboards folders
How It Works
Grafana Instance
│
▼
gcx dev import dashboards/foo
│
├── 1. Fetches resource via K8s API (/apis endpoint)
├── 2. Detects the resource API version
├── 3. Runs version-specific converter (JSON → SDK builder code)
├── 4. Wraps in resource.NewManifestBuilder()
└── 5. Writes to imported/<snake_case_name>.goThe converter produces Go code using the grafana-foundation-sdk builder pattern — the same pattern used by `dev generate` and `dev scaffold`.
Output Format
Each imported file looks like:
package dashboards
import (
"github.com/grafana/grafana-foundation-sdk/go/dashboardv2beta1"
"github.com/grafana/grafana-foundation-sdk/go/resource"
)
func MyDashboard() *resource.ManifestBuilder {
// ... builder code generated from the live dashboard
}Workflow: Import → Edit → Push
# 1. Import from Grafana gcx dev import dashboards --path internal/dashboards # 2. Review and edit the generated code # (fix up builder calls, add variables, etc.) # 3. Render manifests from the builders. In a gcx-scaffolded project, # `go run .` writes JSON manifests to ./resources go run . # 4. Push back to Grafana gcx resources push
Common Issues
| Issue | Fix | |-------|-----| | "no converter found" | The resource's API version has no converter; the error message names the unsupported version | | Auth error (401/403) | Run `gcx config check` to verify credentials | | Empty import | The selector matched no resources; check UID with `gcx resources get dashboards` | | Build fails with `undefined: cog` (or another lowercase SDK identifier) | Older gcx versions omit SDK imports from generated files. Add the missing import `github.com/grafana/grafana-foundation-sdk/go/<pkg>` for each undefined identifier — `variants` is nested at `go/cog/variants`. Newer gcx emits complete imports | | Imported code doesn't compile for other reasons | Complex dashboards can produce converter output that needs manual fixup: build, read the first error, fix, repeat |
Grafana — in your terminal and your agentic coding environment. gcx works with Grafana Cloud, Enterprise, and OSS (Grafana 12+). See the compatibility matrix for details. Query production. Investigate alerts. Let the Assistant root-cause issues.
Repo: grafana/gcx
Other skills on gcx.
- /add-datasource
Use when adding a new datasource type to gcx (e.g., Elasticsearch, CloudWatch, InfluxDB), or when the user says "add datasource", "new datasource type", or "integrate [datasource]".
Open skill - /add-provider
Use when adding a new Grafana Cloud product provider to gcx (SLO, OnCall, Synthetic Monitoring, k6, ML, etc.), or when the user says "add provider", "new provider", or "integrate [product]".
Open skill - /generate-slide
Regenerate the gcx marketing bento-box slide (slide.html) with verified commands from the current codebase. Builds a fresh binary and reflects against the actual command tree. Use when the user says "regenerate slide", "update slide", "generate slide", or "/generate-slide".
Open skill - /migrate-provider
Use when porting a Grafana Cloud product from grafana-cloud-cli (gcx) to gcx, when a bead task references gcx provider migration, or when user says "migrate provider", "port from gcx", "port oncall", "port k6". Not for building providers from scratch — use /add-provider for that.
Open skill - /release
Tag and release a new gcx version. Use when the user wants to cut a release, tag a version, run the release process, or says "release patch/minor/major".
Open skill - /agento11y-instrument
Sets up and instruments a developer's own LLM app or agent to send generations and agentic workflow to Grafana Agent Observability (the Agent Observability SDKs) — greenfield setup, fixing broken instrumentation, or filling gaps in existing instrumentation. Uses gcx for the
Open skill

