--- Cursor Command: prsummary.md --- Agent Prompt: Pull Request Generation
Your task is to review the current branch against main, generate a focused Markdown Pull Request summary, and then use the GitHub CLI to create the PR.
- Review the changes on the current Git branch compared to the
mainbranch to understand the technical scope of the work.
- Write a clear and concise Pull Request summary in Markdown format.
- Crucially, the summary must NOT include the following sections:
## Commits,## Changes Summary,## Files Modified, or## Branch. - Focus Areas for the Summary:
- Technical Changes: Describe what was done technically (e.g., refactoring, new service implementation, state management changes).
- Relevant Codebase Changes: Point the reviewer directly to the most important files or modules to review (e.g., "The core logic is in
src/services/auth.jsand component usage is insrc/pages/Login.tsx"). - Steps to Test: Provide a clear, numbered list of steps for the reviewer to easily test and verify the changes.
- Include a short, professional "Proof of Life" statement at the end of the summary to indicate readiness for review. Use a relevant emoji.
- After the summary is drafted and saved to a markdown file in a temporary directory, execute the following command to create the pull request:
- Command:
gh pr create --body-file <path-to-markdown-file> --assignee @me --draft - Note: Save the summary to
/tmp/pr_summary_<timestamp>.mdto avoid overwriting any existing files. Replace<path-to-markdown-file>with the actual path. Ensure the assignee is set to the user running the agent (@me). The--draftflag creates the PR as a draft.
- Command:
Title: [A descriptive, concise title, e.g., "feat(shopify): Implement caching for API requests"]
- Brief, human-readable summary of what was built or changed.
- e.g., "Added smart caching to the dashboard to make it load faster."
- Explain the problem that was solved and how it was solved.
- Include context about what changed and why it matters.
- Use natural, conversational language that sounds human.
- e.g., "The dashboard was slow because it kept making the same API calls. Now it remembers responses and only fetches new data when needed, cutting load times from 3.2s to 1.1s and reducing server requests by 70%."
- e.g., "Users had to manually navigate to the same documents repeatedly. Now the dashboard shows quick-access buttons for their most-visited documents, saving time and clicks."
-
Briefly describe the main architectural or implementation changes. Use bullet points.
-
Include before/after code examples where helpful to illustrate the changes.
-
For new features that didn't exist before, just show the "after" without a "before" section.
-
e.g., "Introduced a new
useCachinghook to manage data fetching and local storage persistence." -
e.g., "Migrated the user profile state from Redux to the React Context API for simpler management."
-
e.g., "Before: Manual API calls on every component mount. After: Smart caching with localStorage persistence and automatic cache invalidation."
-
e.g., "Before: Complex Redux store with multiple reducers. After: Simple React Context with
useReducerfor cleaner state management." -
Use markdown code blocks for before/after code examples:
-
e.g., "Before: Manual API calls on every component mount"
-
```javascript
-
// Before: Redundant API calls
-
useEffect(() => {
-
- fetchData(); // Called on every mount*
-
}, []);
-
```
-
"After: Smart caching with localStorage persistence"
-
```javascript
-
// After: Cached with automatic invalidation
-
const {data, loading} = useCaching('users', fetchData, {
-
- ttl: 300000, // 5 minutes*
-
- persist: true*
-
});
-
```
-
For new features, just show the implementation:
-
e.g., "New Navigation Tracking: Automatically tracks user navigation patterns"
-
```javascript
-
// New feature: Navigation tracking
-
const {frequentlyVisited, navigateUrl} = useNavigationTracker();
-
// Shows buttons for recently visited documents
-
```
- Specifically call out the most relevant files/directories for the reviewer.
- e.g.,
src/hooks/useCaching.ts: Contains the core logic for the new caching mechanism. - e.g.,
src/components/Profile/UserInfo.jsx: Shows the new state consumption pattern.
- List the necessary setup (e.g., "Checkout the branch and run
npm install"). - *List steps to reproduce/verify the change (e.g., "Navigate to
/dashboardand check the browser console. The API should only be called once per
--- End Command ---