-
Notifications
You must be signed in to change notification settings - Fork 39
LLMs: Scaffolding agents.md for datasource plugins #2322
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Hello! 👋 This repository uses Auto for releasing packages using PR labels. ✨ This PR can be merged but will not trigger a new release. To trigger a new release add the |
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Outdated
Show resolved
Hide resolved
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Outdated
Show resolved
Hide resolved
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Outdated
Show resolved
Hide resolved
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Show resolved
Hide resolved
|
We should probably add CLAUDE.md file pointing to Agents.md like this: https://github.com/grafana/plugin-tools/blob/3aed54e7d9d26d14dfbaa229806c3377391ccfcc/CLAUDE.md?plain=1 |
andresmgot
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bunch of comments here 👍
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Outdated
Show resolved
Hide resolved
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Show resolved
Hide resolved
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Show resolved
Hide resolved
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Show resolved
Hide resolved
packages/create-plugin/templates/datasource/.config/AGENTS/tasks/support-template-variables.md
Outdated
Show resolved
Hide resolved
c3a2832 to
c843c5a
Compare
|
@andresmgot currently the agent will only pickup |
| @@ -0,0 +1,307 @@ | |||
| # Add Support for Template & Query Variables | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we are better off pointing the agent to fetch the information from our documentation site instead of leaving here possibly stale instructions that will backfire.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked the same thing but apparently external URLs don't work well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We did try that but it won't pick that information up unless you ask is specifically in the prompt to go and fetch the content of a URL. But agree with you it would be nice to have it digest that information instead. Then there are differences in how you should provide information to a LLM and to a human so it is hard to optimise the docs for both.
But I'm happy to revisit this topic if we can find a way to get the agent to digest URLs as well (without being asked about it explicitly).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless you ask is specifically in the prompt to go and fetch the content of a URL
this should be ok IMO. the user (dev) will see the system trying to fetch an official grafana docs and it'll likely just let it do it, and the model will only try to fetch it when it feels necessary to complement the information
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but the question is how you do that in the agent.md file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On other words. How should we specify the references in the agent.md file to make the agent actually try to read the URLs. I have not found a way to make that happen. It just reads the URL and potential information about it but never tries to fetch the content of the URL.
| @@ -0,0 +1,307 @@ | |||
| # Add Support for Template & Query Variables | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I asked the same thing but apparently external URLs don't work well.
| File: `src/datasource.ts` | ||
|
|
||
| ```ts | ||
| export class DataSource extends DataSourceApi<MyQuery> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if the LLM will get confused if the datasource extends DataSourceWithBackend?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good feedback! I will test that scenario. We could add another example if needed.
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Outdated
Show resolved
Hide resolved
There are definitively more commands: For comparing it to the frontend, I guess it should list at least |
Nice, we should probably include them in the README.md then as well. Do you see any problems with adding those to the readme? reloadPlugin sounds interesting as well. Alternatively provide information about the |
Sounds good to me |
| You must **NOT**: | ||
|
|
||
| - Change plugin ID or plugin type in `plugin.json` | ||
| - Modify anything inside `.config/*` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - Modify anything inside `.config/*` | |
| - Modify anything inside `.config/*` | |
| - Remove or modify the scaffolded packages in package.json and go.mod | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had this "packages being removed from package.json" happen to me recently, and then it went into a weird direction trying to fix the issues by adjusting tsconfig and a bunch of files in .config folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But for some scenarios we need the agent to update the dependencies? I wonder if we can rewrite this to something like:
Change any scaffolded dependencies in package.json or go.mod unless you have explicit approval to do so.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change any scaffolded dependencies in package.json or go.mod unless you have explicit approval to do so.
Is it not the case for any command by default?
Maybe:
Change any scaffolded dependencies in package.json or go.mod unless you are explicit being asked to do so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think the following line need to be more explicit:
Modify anything inside .config/*
->
Never modify files in .config/ without explicit user approval
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think the star .config/* <-- is causing issues here
jackw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 🚀
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Outdated
Show resolved
Hide resolved
packages/create-plugin/templates/datasource/.config/AGENTS/instructions.md
Outdated
Show resolved
Hide resolved
|
|
||
| ## Boundaries | ||
|
|
||
| You must **NOT**: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the LLm will quickly forget the you must not title and start doing the things below like a list of things they can do.
you will have to put "do not" or "must not" in every line.
What this PR does / why we need it:
It will add an agents.md file that cover the fundamentals of datasource plugins (with and without backend). We are following the convention where we put generic information below
.configfolder (which should not be modified by the developer). Then we reference that file from the projectAGENTS.mdwhere the developers of the plugin can add more plugin specific details.Output from cursor agent after scaffolding a datasource with frontend only and asking the question "What are your instructions and what kind of repository is this? Do you have an specific tasks that you can perform?":
Output from cursor agent after scaffolding a datasource with backend and asking the question "What are your instructions and what kind of repository is this? Do you have an specific tasks that you can perform?":
Which issue(s) this PR fixes:
Fixes https://github.com/grafana/grafana-community-team/issues/674
Special notes for your reviewer: