# scaffold-project

Creates a new Go project that manages Grafana dashboards and resources as code, using the gcx scaffold command.

Skill by Grafana Labs. Category: Shipping and ops.

## Install

Project (for this project only):

```sh
npx skills add grafana/gcx --skill scaffold-project
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

Global (for every project on this machine):

```sh
npx skills add grafana/gcx --skill scaffold-project -g
```

Works with: Claude Code, Codex CLI, Cursor, Antigravity, Copilot CLI, opencode.

## Tags

- Runs on your computer: It runs as a program on your machine, with your access.

## Security audits

- Gen Agent Trust Hub: Pass
- Socket: Pass
- Snyk: Pass

Installs: 18. Installs counted by skills.sh. [Open on skills.sh](https://www.skills.sh/site/grafana.gcx/scaffold-project)

## Source

[Open the source](https://github.com/grafana/gcx/tree/HEAD/claude-plugin/skills/scaffold-project). Checked 2026-10-10. This summary may contain AI-generated text, so it can be wrong. Check the source before you rely on it.

## SKILL.md

````markdown
---
name: scaffold-project
description: >
  Scaffolds a new Go project for managing Grafana resources as code via
  gcx dev scaffold. Use when the user wants to create a new Grafana
  resources-as-code project, start a new dashboards-as-code repo, scaffold
  a gcx project, or asks "how do I get started with gcx". Triggers on
  phrases like "new project", "scaffold", "bootstrap", "create project",
  "get started".
---

# Scaffold a gcx Project

Scaffold a new Go project for managing Grafana resources as code using
`gcx dev scaffold`.

## Prerequisites

Verify gcx is installed:

```bash
gcx --version
```

If missing, see the `setup-gcx` skill.

## Scaffolding

### Interactive Mode (recommended for first-time users)

```bash
gcx dev scaffold
```

Prompts for:
- **Project name** - becomes the directory name (kebab-cased)
- **Go module path** - e.g. `github.com/myorg/my-dashboards`

### Non-Interactive Mode

```bash
gcx dev scaffold --project my-dashboards --go-module-path github.com/myorg/my-dashboards
```

## What Gets Generated

```
my-dashboards/
├── .github/workflows/deploy.yaml   # CI/CD workflow for gcx push
├── .gitignore
├── go.mod
├── main.go                         # Entrypoint — registers all resources
├── internal/
│   └── dashboards/
│       ├── all.go                  # Registry function returning all manifests
│       └── sample.go              # Example dashboard using foundation-sdk builders
└── README.md
```

## Next Steps After Scaffolding

1. `cd my-dashboards && go mod tidy`
2. Configure gcx: `gcx config set stacks.default.grafana.server <URL>`, `gcx config set stacks.default.grafana.token <TOKEN>`, and `gcx config set contexts.default.stack default`
3. Edit `internal/dashboards/sample.go` or generate new stubs with `gcx dev generate`
4. Push to Grafana: `gcx resources push`

## Common Issues

| Issue | Fix |
|-------|-----|
| `go mod tidy` fails | Ensure your Go toolchain meets the version required by the generated `go.mod` |
| Project name has spaces | Names are auto-kebab-cased; spaces become hyphens |
| Want to add alert rules | Create `internal/alerts/` and use `gcx dev generate alerts/my-rule.go` |
````

- Previous: [agento11y-test-starter](https://syn4pse.dev/terminal/agento11y-test-starter.md)
- Next: [slo-optimize](https://syn4pse.dev/terminal/slo-optimize.md)
- [Terminal](https://syn4pse.dev/terminal.md)
- [Suggest a change](mailto:terminal@syn4pse.dev?subject=Terminal%20suggestion)
