Skip to content

feat(create-plugin): add AI authoring assistance to panel-docs codemod - #2843

Closed
sunker wants to merge 1 commit into
eriksundell/panel-docs-codemodfrom
eriksundell/panel-docs-codemod-with-ai
Closed

sunker wants to merge 1 commit into
eriksundell/panel-docs-codemodfrom
eriksundell/panel-docs-codemod-with-ai

Conversation

@sunker

@sunker sunker commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Adds AI authoring assistance to the panel-docs codemod: a conventions file the coding agent reads automatically, plus one bootstrap-plugin-docs skill for the initial fill.

The shape changed substantially from the first draft of this PR (four slash-command skills behind a required --agentLoop flag), after looking at what comparable tooling actually ships. Three findings drove it:

  1. Conventions belong in always-loaded context, not in skills. Vercel's published evals found an auto-invoked skill scored no better than no docs at all (53% vs 53% baseline), because the skill was never invoked in 56% of cases, while always-loaded context scored 100%. Next.js states the same split as policy: context for lookups, skills for workflows.
  2. Nobody ships per-agent skill fan-out. Of the tools surveyed (Nx, Next.js, Astro, Expo, React Router, Prisma, Supabase, Stripe, shadcn, Angular, Svelte), none hand-write parallel per-agent skill directories, and none ask which agent at scaffold time except Angular.
  3. This repo already has the right pattern. templates/common/ scaffolds root AGENTS.md/CLAUDE.md/GEMINI.md pointers into .config/AGENTS/, with topic files like e2e-testing.md. This PR follows that rather than inventing a parallel convention.

Changes

  • write-plugin-docs, review-plugin-docs and validate-plugin-docs are gone. The first two were conventions, the third wrapped npm run docs:validate. All three fold into the authoring guide.
  • bootstrap-plugin-docs stays: it is a genuine multi-step workflow.
  • The guide lands at .config/AGENTS/plugin-docs.md, next to e2e-testing.md, reached by a pointer line appended to .config/AGENTS/instructions.md.
  • --agentLoop is replaced by --no-agents (defaults on).

Two things worth reviewing closely

The guide cannot live inside docsPath. It was at docs/AGENTS.md. Anything inside docsPath is validated as a publishable page, so npm run docs:validate failed on it with 8 errors. Moving it out fixes that, and the instructions.md pointer is also what makes it reachable from Claude Code, which never reads AGENTS.md.

The skill is written whole to both .claude/skills/ and .agents/skills/, not shimmed. The one-line @import shim pattern used by the existing build-plugin and validate-plugin skills does not work in Claude Code: the docs confirm @imports are unsupported in SKILL.md, and a SKILL.md whose first line isn't --- is treated as literal content, so such a skill registers no description and cannot be invoked. Duplication is deliberate: Context writes string content so symlinking isn't available, and these are committed team-shared files, so detecting the scaffolder's own agent would give their teammates the wrong answer. .agents/ covers Codex, Cursor, Copilot, Gemini CLI and Amp, so there is no separate .codex/ copy.

Which issue(s) this PR fixes:

N/A

Special notes for your reviewer:

Stacked on #2834, which must merge first.

Verified end to end against a scratch panel plugin: both skill copies are byte-identical and spec-valid (frontmatter present, name matches directory), every @-import in the instructions chain resolves, no {{placeholders}} leak, --no-agents writes the docs stubs and nothing else, and plugin-docs-cli validate --strict reports ✓ Documentation is valid.

Separately: the existing build-plugin and validate-plugin skills in templates/common/ are broken in Claude Code for the same reason described above. Out of scope here since fixing them changes what every new plugin gets.

@sunker sunker added the preview Opts the PR into pkg.pr.new preview publishing label Aug 21, 2026
@pkg-pr-new

pkg-pr-new Bot commented Aug 21, 2026

Copy link
Copy Markdown

Open in StackBlitz

@grafana/create-plugin

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/create-plugin@ec5252f -D

@grafana/eslint-config

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/eslint-config@ec5252f -D

@grafana/eslint-plugin-plugins

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/eslint-plugin-plugins@ec5252f -D

@grafana/plugin-docs-cli

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/plugin-docs-cli@ec5252f -D

@grafana/plugin-docs-parser

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/plugin-docs-parser@ec5252f -D

@grafana/plugin-e2e

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/plugin-e2e@ec5252f -D

@grafana/plugin-meta-extractor

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/plugin-meta-extractor@ec5252f -D

@grafana/plugin-types-bundler

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/plugin-types-bundler@ec5252f -D

@grafana/react-detect

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/react-detect@ec5252f -D

@grafana/sign-plugin

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/sign-plugin@ec5252f -D

@grafana/tsconfig

npm i https://pkg.pr.new/grafana/plugin-tools/@grafana/tsconfig@ec5252f -D

commit: ec5252f

@grafana-catalog-project-bot grafana-catalog-project-bot Bot moved this from 📬 Triage to 🧑‍💻 In development in Grafana Catalog Team Aug 21, 2026
@sunker
sunker force-pushed the eriksundell/panel-docs-codemod-with-ai branch 2 times, most recently from 0f6471e to f059bc2 Compare September 9, 2026 11:39
@sunker
sunker force-pushed the eriksundell/panel-docs-codemod-with-ai branch from f059bc2 to 7a1b0e7 Compare September 9, 2026 11:47
@sunker

sunker commented Sep 9, 2026

Copy link
Copy Markdown
Contributor Author

closing in favour of #2834

@sunker sunker closed this Sep 9, 2026
@github-project-automation github-project-automation Bot moved this from 🧑‍💻 In development to 🚀 Shipped in Grafana Catalog Team Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Opts the PR into pkg.pr.new preview publishing

Projects

Status: 🚀 Shipped

Development

Successfully merging this pull request may close these issues.

1 participant