Skip to content

Docs: Build a plugin with AI #2601

Open
urbiz-grafana wants to merge 22 commits into
mainfrom
urbiz-ai-tutorial
Open

Docs: Build a plugin with AI #2601
urbiz-grafana wants to merge 22 commits into
mainfrom
urbiz-ai-tutorial

Conversation

@urbiz-grafana
Copy link
Copy Markdown
Contributor

@urbiz-grafana urbiz-grafana commented Apr 29, 2026

Co-authored-by: Copilot <copilot@github.com>
@urbiz-grafana urbiz-grafana self-assigned this Apr 29, 2026
@urbiz-grafana urbiz-grafana requested a review from a team as a code owner April 29, 2026 15:50
Copilot AI review requested due to automatic review settings April 29, 2026 15:50
@urbiz-grafana urbiz-grafana added the type/docs Changes only affect the documentation label Apr 29, 2026
@urbiz-grafana urbiz-grafana requested a review from jackw April 29, 2026 15:50
@urbiz-grafana urbiz-grafana added the no-changelog Don't include in changelog and version calculations label Apr 29, 2026
@urbiz-grafana urbiz-grafana marked this pull request as draft April 29, 2026 15:50
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Hello! 👋 This repository uses Auto for releasing packages using PR labels.

✨ This PR can be merged. It will not be considered when calculating future versions of the npm packages and will not appear in the changelogs.

@urbiz-grafana urbiz-grafana moved this from 📬 Triage to 🧑‍💻 In development in Grafana Catalog Team Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new tutorial that guides readers through building a Grafana data source plugin and app plugin by using structured prompts with an AI coding assistant.

Changes:

  • Introduces a step-by-step workflow for scaffolding and iteratively implementing a data source plugin (with Go backend).
  • Adds structured prompt templates for building an app plugin (list view, map view) that consumes the data source.
  • Includes verification steps and troubleshooting guidance for frontend/backend iteration.

Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated
@urbiz-grafana urbiz-grafana marked this pull request as ready for review May 14, 2026 11:51
@urbiz-grafana urbiz-grafana requested a review from a team as a code owner May 14, 2026 11:51
@urbiz-grafana urbiz-grafana moved this from 🧑‍💻 In development to 🔬 In review in Grafana Catalog Team May 14, 2026
Comment on lines +351 to +353
- [Build a data source plugin](./build-a-data-source-plugin.md)
- [Build a data source plugin backend component](./build-a-data-source-backend-plugin.md)
- [Build an app plugin](./build-an-app-plugin.md)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These probably don't make sense as next steps? Maybe better to point towards more conceptual information to depend understanding


## Troubleshooting

### The data source shows no data right after scaffolding
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should display a constant? But you do need to issue a query?

Comment on lines +44 to +58
### Useful tips to work with AI tools

:::important
**Do not let AI bootstrap the plugin. Make sure you're using `create-plugin`.**
:::

When working with AI, you're steering the wheel! Do not to let your AI tool guess. Instead, give it clear prompts with guidelines and constraints, keep it inside Grafana plugin patterns, and verify each milestone in Grafana before moving on.

These patterns help keep the AI useful:

- **Start with facts**: Give the API contract, plugin type, and hard constraints first.
- **Ask for a short plan**: This helps catch drift before the AI edits files.
- **Tell it what not to do**: For example, no invented API fields and no direct app-to-API calls.
- **Ask it to name files before editing**: This makes review easier.
- **Keep prompts milestone-sized**: One milestone for the data source, one for the list page, one for the map page.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this be better in a concepts section or broader than a tutorial?

Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated

Before you begin, make sure to:

- Install Grafana v10.0 or later.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is required since grafana is being provided by the dev environment?

But as a general rule, we shouldnt recommend end of life versions of Grafana. We should promote people using latest major

- Do not call the Bicing API directly from the browser
- Do not invent extra endpoints or fields
- Keep the query model simple and typed
- Tell me which files you plan to change before editing them
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implies plan mode but not called out

Comment thread docusaurus/docs/tutorials/build-ai-plugin.md Outdated

## 3. Create the app plugin scaffold

:::important
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have to keep repeating this?

1. Click **Save & Test**. If everything works, you see live station data. If there's any errors, run them by your tool until they're fixed.
1. Go back to **Explore** and run both query types.

As a suggestion, you can check that:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This section feels weird


### Verify the app plugin

In your Grafana instance, go to **Connections** > **Apps** and check the app plugin has been scaffolded.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a place in Grafana

@github-project-automation github-project-automation Bot moved this from 🔬 In review to 🧑‍💻 In development in Grafana Catalog Team May 15, 2026
urbiz-grafana and others added 2 commits May 15, 2026 15:48
Co-authored-by: David Harris <david.harris@grafana.com>
Co-authored-by: David Harris <david.harris@grafana.com>
Verify that the scaffold loads:

1. Go to **Connections** > **Data sources**.
1. Add your new data source.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should already be provisioned as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog Don't include in changelog and version calculations type/docs Changes only affect the documentation

Projects

Status: 🧑‍💻 In development

Development

Successfully merging this pull request may close these issues.

3 participants