.cursor/commands/pr.md
The user will issue this command. You will need to do two things.
Create a changeset using the CLI. The goal of changesets is to use it for generating changelogs. Individual package changelogs will later be combined into a single changelog that is published with each release.
pnpm changeset -s -m "your changeset message" (--major | --minor | --patch) pkg-name
For each package that has changes, run the CLI once and specify the appropriate version bump type (--major, --minor, or --patch) and message for that package. This will create a separate changeset file for each package, which is important for generating accurate changelogs.
Arguments:
-s or --skipPrompt: Run non-interactively; requires at least one of --major, --minor, or --patch (required for automation)-m "message" or --message "message": The changeset message (required)--major pkg-name: Packages that should have a major version bump--minor pkg-name: Packages that should have a minor version bump--patch pkg-name: Packages that should have a patch version bumpNotes:
--major or --minor for non-patch bumps--minor @mastra/core --minor mastraVersion Bump Types:
patch: Bugfixes with backward-compatible changesminor: New features with backward-compatible changesmajor: Breaking changes that are not backward-compatibleMessage guidelines:
If the changes span multiple packages (e.g. @mastra/core, @mastra/memory, mastra, so 3 packages) and each change is different from another, you MUST create multiple changeset files. Otherwise you'll mix different changes into changeset files where they don't belong. For this you must decide what logical groups exist. Example: The majority of the main feature was changed in @mastra/memory and only supporting changes were done in @mastra/core and mastra. Then @mastra/memory needs its own changeset separate from the others. You can achieve this by running the CLI multiple times and selecting the appropriate packages for each changeset.
Important: Very long changesets in one file (with multiple packages in the frontmatter) are an anti-pattern. This will lead to multiple packages having really large changelog entries. This must be avoided. If you have multiple packages likely there is one or two main packages where the majority of change lives.
Use gh cli to open a PR for the current branch in the user's browser. Do not open it directly, use the web option that opens it in the browser so the user can edit the title/description if needed.
Add a descriptive/concise title, use conventional commits in the title (e.g. "fix: title here" or "feat(pkg-name): title here").
Add a concise, humble PR description without flowery or overly verbose language. Keep it casual/friendly but get to the point. Show simple code examples before/after for fixes, or just after examples for new features. Do not add lists or headings. Keep it simple and to the point.