Build a plugin with an AI assistant
You can build your own plugin using the create-plugin tool and an AI coding assistant that writes the plugin code from your prompts.
Don’t let the AI assistant create the plugin project itself. Always generate the scaffold with create-plugin first, then prompt the assistant to work inside it.
The scaffold also sets up your assistant. It includes AGENTS.md, CLAUDE.md, and GEMINI.md files that point the assistant to Grafana plugin instructions, including where to find the official documentation. This works out of the box with Claude Code, Gemini CLI, and assistants that read AGENTS.md, such as Codex.
You steer, so don’t let the assistant guess
Give the assistant clear prompts with guidelines and constraints, and keep it inside Grafana plugin patterns:
- Start with facts: Give it the API details, the plugin type, and hard constraints first.
- Ask it to confirm before it acts: This catches drift before it edits files.
- Tell it what not to do: For example, no invented API fields.
- Ask it to name files before editing: This makes its changes easier to review.
- Keep prompts milestone-sized: Check each milestone in your local Grafana before you start the next.
Example: Build a plugin with AI tutorial
The Build a plugin with AI tutorial shows this approach end to end. You prompt an AI coding assistant to build a data source plugin that reads from a public bike service system, and then an app plugin whose pages show the stations in a list and on a map.
If you’re building a different type of plugin, the hands-on steps won’t match yours, but the prompting patterns still apply.