agentleFS
MongoDBKnown publishermongodb/leafygreen-ui/.cursor/rules/generate-pull-request-details.mdc

leafygreen-ui / rules

Cursor rule273 starsChanged 7 months agoApache-2.0View on GitHub

This rule can be used to generate pull request title and description. This rule depends on the `@Branch (Diff with Main Branch)` being included in the context to generate better pull request details.

  • Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.

    Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository3 other files it gives its agents.

The file

We split this generate-pull-request-details.mdc into the rules it gives an agent

2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    If you detect that a net-new directory has been created directly under packages/, tools/, chat/, or charts/, then you must use the "For new …

    line 23
  2. Distinctive:

    Do not include both checklists in your final output.

    line 36

≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
generate-pull-request-details.mdc
---
description: This rule can be used to generate pull request title and description. This rule depends on the `@Branch (Diff with Main Branch)` being included in the context to generate better pull request details.
alwaysApply: false
manual: true
---

Act as an expert software engineer preparing a pull request. Your task is to generate a PR title and a detailed PR description based on my current branch's diff with the main branch.

First, follow these instructions to generate the **PR Title**:

- The final title must be in the format: `[JIRA-ID] type(scope): concise summary of the main change`.
- To find the `JIRA-ID`, inspect the content of any changed files located in the `.changeset/` directory. Extract the Jira ticket code (e.g., `LG-1337`). If you find multiple ticket codes, separate them with a `|` character (e.g., `[LG-1337|LG-4567]`). If no ticket code is found, omit the `[JIRA-ID]` portion entirely.
- The `type` (e.g., `feat`, `fix`, `chore`) must follow the Conventional Commits standard based on the most significant change you analyze.
- The `scope` should be the most relevant area or component affected (e.g., `button`, `api`, `auth`).
- The summary should be a concise, lowercase description of the main change.

---

Next, use the following template **exactly** to generate the **PR Description**.

**IMPORTANT CHECKLIST LOGIC:** You must choose **only one** of the two checklists provided below. To decide which one to use, analyze the file paths in the staged git changes.

1. If you detect that a **net-new directory** has been created directly under `packages/`, `tools/`, `chat/`, or `charts/`, then you **must** use the "For new components" checklist.
```markdown
- [ ] I have added my new package to the global tsconfig
- [ ] I have added my new package to the Table of Contents on the global README
- [ ] I have verified the Live Example will look as intended on the design website.
```
2. Otherwise, use the "For bug fixes, new features & breaking changes" checklist.
```markdown
- [ ] I have added stories/tests that prove my fix is effective or that my feature works
- [ ] I have added necessary documentation (if appropriate)
- [ ] I have run `pnpm changeset` and documented my changes
```

Do not include both checklists in your final output.

```markdown
## ✍️ Proposed changes

[Generate a **brief and clear** description of the big picture changes and why they are being made. If it fixes a bug or implements a feature, concisely explain the problem being solved.]

🎟️ _Jira ticket:_ [Generate a link here using the TICKET-ID(s) you found, like `[LG-1234](https://jira.mongodb.org/browse/LG-1234)`]

## ✅ Checklist

[INSERT THE CORRECT CHECKLIST HERE BASED ON THE LOGIC ABOVE]

## 🧪 How to test changes

[Generate **concise, specific, and actionable** testing steps based on the changes made. For bug fixes, include simple steps to reproduce the issue. For features, provide clear steps to verify the new functionality.]
```

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.