# cue-kind-definition

> Claude/Codex skill by [@grafana](https://omgskills.com/library/grafana/index.md) · 286 stars · Updated 2026-10-17

Author CUE kind definitions for grafana-app-sdk apps - schemas, versioning, field constraints, named type definitions, custom routes, and codegen configuration. Scaffolds kinds via \`grafana-app-sdk project kind add\`, writes spec/status schemas with type constraints (regex, enum, range), defines \`\#\`-prefixed named types for reusable structs, registers versions in the app manifest, and runs \`grafana-app-sdk generate\` with explicit error recovery. Use when working with CUE kinds, adding a new resource type, adding a version to an existing kind, writing schema field constraints, defining \`\#Definition\` types, adding custom routes, editing files under \`kinds/\`, or when the user asks to "model a resource", "add a CUE schema", or "write a kind" — even without saying "CUE" explicitly.

## Install

```sh
git clone https://github.com/grafana/skills /tmp/skills && ln -s /tmp/skills/skills/grafana-app-sdk/cue-kind-definition ~/.claude/skills/cue-kind-definition
```

## From README

CUE Kind Definition Common Workflows Adding a new kind If generate fails with CUE errors: Read the error — CUE prints the offending file + line + which constraint failed Common causes: missing required field, type mismatch (e.g. string field assigned an int), unresolved reference between version files Fix the .cue source, re-run grafana-app-sdk generate. Never edit files under pkg/generated/ — they're overwritten on every run. Adding a new version to an existing kind Breaking changes (removing fields, changing types, adding required fields) must go into a new version — never modify a stable version (v1, v2) in place. Kind file structure The CLI produces a flat layout under kinds/: For multi-version kinds, additional version files sit alongside (mykindv1.cue, etc.). For very large kind sets (10+ kinds), consider the per-kind subdirectory layout — full kind anatomy reference in references/kind-layout.md.

## Links

- HTML page: https://omgskills.com/library/grafana/skills/cue-kind-definition/
- GitHub: https://github.com/grafana/skills
- Author: [@grafana](https://omgskills.com/library/grafana/index.md)

## More from this repo

- [k6-docs](https://omgskills.com/library/grafana/skills/k6-docs/index.md) — Used to write or review k6 documentation across the three k6 repositories - k6-DefinitelyTyped (TypeScript types),...
   - [@grafana](https://omgskills.com/library/grafana/index.md) · 295 stars
- [adaptive-metrics](https://omgskills.com/library/grafana/skills/adaptive-metrics/index.md) — Cut Grafana Cloud Metrics cost by shrinking active-series count with Adaptive Metrics aggregation rules —...
   - [@grafana](https://omgskills.com/library/grafana/index.md) · 286 stars
- [admin](https://omgskills.com/library/grafana/skills/admin/index.md) — Used to manage Grafana Cloud accounts — organizations, stacks, RBAC roles and assignments, SSO/SAML/OAuth/GitHub auth,...
   - [@grafana](https://omgskills.com/library/grafana/index.md) · 286 stars
