Oftentimes, context needed when sending a prompt is annoying to copy/paste, but it can easily be fetched from local state. For example, the current git branch, or the name of the repo, can drastically simplify the invocation of prompts like “create a pull request”.
Ideally, we would be able to build a dictionary of dynamic information that can be fetched from vscode extensions.
Something like .cursor/rules/create-pull-request.md.template (EJS template)
description: How to create a pull request
alwaysApply: true
context: ./createPullRequestContext.js
---
Create a pull request using the create_pull_request tool. Never create a pull request from the main branch. Always create a new branch before committing changes.
git state:
org: <%= org %>
repo: <%= repo %>
branch: <%= branch %>
And then be able to define a JS module that exports a context object for rendering the template.