add-datasource
Use for the implementation workflow that adds gcx CLI support for a datasource type not registered in internal/datasources/providers — query client, command…
Reference for porting a Grafana Cloud product from the legacy grafana-cloud-cli into a gcx provider — adapter, schema/example registration, CRUD redirect commands. HUMAN-DRIVEN — this skill is outside the integrate-with-gcx v1 autonomous workflow and must not be run end to end
$ npx -y skills add grafana/gcx --skill migrate-provider --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/migrate-providerContext preview
The summary Claude sees to decide when to auto-load this skill.
Reference for porting a Grafana Cloud product from the legacy grafana-cloud-cli into a gcx provider — adapter, schema/example registration, CRUD redirect commands. HUMAN-DRIVEN — this skill is outside the integrate-with-gcx v1 autonomous workflow and must not be run end to end
name: migrate-provider description: >- Reference for porting a Grafana Cloud product from the legacy grafana-cloud-cli into a gcx provider — adapter, schema/example registration, CRUD redirect commands. HUMAN-DRIVEN — this skill is outside the integrate-with-gcx v1 autonomous workflow and must not be run end to end unattended because its non-registration steps have not been fully audited. Use when a human is deliberately driving a port and says "migrate provider", "port from gcx", "port oncall", "port k6". Not for building providers from scratch — use /add-provider. Recheck present-day placement before porting.
Port an existing `grafana-cloud-cli` resource client into this repository's gcx provider system — core adapter, schema/example registration, CRUD redirect commands, and ancillary subcommands.
> **Read this before the recipe. A human drives this skill; it is not covered by > the integrate-with-gcx v1 workflow.** In these instructions, "legacy CLI" > means `grafana-cloud-cli`, whose binary was also named `gcx`; "gcx" means this > repository's `bin/gcx`. Use `bin/gcx` for the build under review, and name the > legacy binary's own path explicitly. > > Of the recipe's mechanical steps, only the registration flow > (`providers.Register()` + `TypedRegistrations()`, and the `TypedCRUD` > `Descriptor`/`Aliases` fields) has been checked against current code. Treat the > rest as unaudited and verify as you go.
**Before starting:** read `gcx-provider-recipe.md` front to back for the mechanical steps, subject to the caveat above. This skill wraps it with workflow discipline and orchestration.
**Canonical reference:** the `incidents_*.go` files in `internal/providers/irm/` — the first full port (adapter + schema + commands + ancillary). Start there for patterns.
**When NOT to use**: Building a provider from scratch for a product without a legacy CLI client — use `/add-provider` instead.
One-directional, so the two skills cannot bounce a port back and forth:
existed; it does not prove that the provider tier is still the right home. Check current `/apis` CRUD coverage and inventory the non-CRUD operations. A human confirms provider-tier placement before Phases 0-4 continue.
above: it tells the user a port needs a human to drive and stops. Reach this skill by invoking it deliberately.
the ported command surface (`self-review.md` T7 — released names are frozen, and a port is where a legacy name most often gets carried in), and the diff-triggered review before requesting human review (`self-review.md`). Contract worksheets and the general readiness workflow do not apply to a port; the placement recheck above is still required.
`.claude/skills/integrate-with-gcx/references/self-review.md`, which carries T7 and the trigger table.
Before invoking this skill, ensure:
1. **Current gcx binary built** — `bin/gcx --version` must succeed. 2. **Grafana context configured** — `bin/gcx config view` must show a working context with server URL and token. 3. **Provider directory exists** — create `internal/providers/{name}` before starting the port. 4. **Live API access** — smoke tests (Phase 4) require a real Grafana instance. Verify connectivity: `bin/gcx --context=<ctx> resources list-types`.
Phase 0: Requirements Gathering (autonomous)
→ context bundle (legacy source + compliance + pattern ref)
↓ [no gate — feeds Phase 1]
Phase 1: Design Discovery (interactive, 1A–1D)
→ ADR in docs/adrs/{provider}/
↓ [user approval gate]
Phase 2: Spec Planning
→ spec.md + plan.md + tasks.md
↓ [user approval gate]
Phase 3: Build
→ agent team (Core + Commands)
→ code files
↓ [GCX_AGENT_MODE=false mise run all gate]
Phase 4: Verification (4A–4E)
→ GCX_AGENT_MODE=false mise run all + smoke tests + adapter smoke
→ comparison report + recipe update
↓ [user approval gate]| Phase | Agent Strategy | Receives | Produces | Gate | |-------|---------------|----------|----------|------| | 0: Requirements | Lead (autonomous) | legacy source + compliance docs | Context bundle | None (feeds Phase 1) | | 1: Design | Lead (interactive) | Context bundle | ADR | User approves ADR | | 2: Spec Planning | Lead (or `/plan-spec`) | ADR + context bundle | spec.md, plan.md, tasks.md | User approves spec package | | 3: Build | Agent team (Core + Commands) or `/build-spec` | Spec package | Provider code | `GCX_AGENT_MODE=false mise run all` passes | | 4: Verify | Subagent | Comparison report template + spec ACs | Comparison report + recipe update | User approves report |
Phases are **strictly sequential**. Each phase is separated by a gate that **must pass** before the next phase begins. Gates are not optional.
> **Small-provider shortcut:** For providers with 3 or fewer subcommands, > Phase 1 stages 1B–1D may be collapsed into a single proposal. Document > this choice in the ADR.
---
Phase 0 is fully autonomous — no user interaction required. The output is a context bundle, not a design proposal.
Read the grafana-cloud-cli source for the target provider. Identify every subcommand, API endpoint, type definition, and auth mechanism.
Read the following project compliance documents and record which rules apply to the target pro
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
Use for the implementation workflow that adds gcx CLI support for a datasource type not registered in internal/datasources/providers — query client, command…
Use for the implementation workflow once a capability is already classified as a Grafana Cloud product provider (SLO, OnCall, Synthetic Monitoring, k6, ML,…
Regenerate the gcx marketing bento-box slide (slide.html) with verified commands from the current codebase. Builds a fresh binary and reflects against the…
Guides a contributor and their coding agent through adding or extending a capability in the grafana/gcx codebase: deciding whether a new command is needed and…
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".