Initial commit
This commit is contained in:
41
commands/gh/fix-issue.md
Normal file
41
commands/gh/fix-issue.md
Normal file
@@ -0,0 +1,41 @@
|
||||
---
|
||||
description: Fix GitHub issue
|
||||
argument-hint: [issue-number]
|
||||
allowed-tools: Write, Read, LS, Glob, Grep, Bash(gh:*), Bash(git:*)
|
||||
---
|
||||
|
||||
Please analyze and fix the Github issue $ARGUMENTS by following these steps:
|
||||
|
||||
# PLAN
|
||||
|
||||
1. Use 'gh issue view' to get the issue details
|
||||
2. Understand the problem described in the issue
|
||||
3. Ask clarifying questions if necessary
|
||||
4. Understand the prior art for this issue
|
||||
- Search the scratchpads for previous thoughts related to the issue
|
||||
- Search PRs to see if you can find history on this issue
|
||||
- Search the codebase for relevant files
|
||||
5. Think harder about how to break the issue down into a series of small, manageable tasks.
|
||||
6. Document your plan in a new scratchpad
|
||||
- include the issue name in the filename
|
||||
- include a link to the issue in the scratchpad.
|
||||
|
||||
# CREATE
|
||||
|
||||
- Create a new branch for the issue
|
||||
- Solve the issue in small, manageable steps, according to your plan.
|
||||
- Commit your changes after each step.
|
||||
|
||||
# TEST
|
||||
|
||||
- Use puppeteer via MCP to test the changes if you have made changes to the UI and puppeteer is in your tools list.
|
||||
- Write unit tests to describe the expected behavior of your code.
|
||||
- Run the full test suite to ensure you haven't broken anything
|
||||
- If the tests are failing, fix them
|
||||
- Ensure that all tests are passing before moving on to the next step
|
||||
|
||||
# OPEN PULL REQUEST
|
||||
|
||||
- Open a PR and request a review.
|
||||
|
||||
Remember to use the GitHub CLI ('gh') for all Github-related tasks.
|
||||
57
commands/gh/review-pr.md
Normal file
57
commands/gh/review-pr.md
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
description: Review GitHub pull request with detailed code analysis
|
||||
argument-hint: [pr-number]
|
||||
allowed-tools: Write, Read, LS, Glob, Grep, Bash(gh:*), Bash(git:*)
|
||||
---
|
||||
|
||||
# Review PR
|
||||
|
||||
You are an expert code reviewer. Follow these steps to review github PR $ARGUMENTS:
|
||||
|
||||
1. If no PR number is provided in the args, use Bash(`gh pr list`) to show open PRs
|
||||
2. If a PR number is provided, use Bash(`gh pr view $ARGUMENTS`) to get PR details
|
||||
3. Use Bash(`gh pr diff $ARGUMENTS`) to get the diff
|
||||
4. Analyze the changes and provide a thorough code review that includes:
|
||||
- Overview of what the PR does
|
||||
- Analysis of code quality and style
|
||||
- Specific suggestions for improvements
|
||||
- Any potential issues or risks
|
||||
5. Providing code review comments with suggestions and required changes only:
|
||||
- DONOT comment what the PR does or summarize PR contents
|
||||
- ONLY focus on suggestions, code changes and potential issues and risks
|
||||
- USE Bash(`gh api repos/OWNER/REPO/pulls/PR_NUMBER/comments`) to post your review comments
|
||||
|
||||
Keep your review concise but thorough. Focus on:
|
||||
|
||||
- Code correctness
|
||||
- Following project conventions
|
||||
- Performance implications
|
||||
- Test coverage
|
||||
- Security considerations
|
||||
|
||||
Format your review with clear sections and bullet points.
|
||||
|
||||
## gh command reference
|
||||
|
||||
```sh
|
||||
# list PR
|
||||
gh pr list
|
||||
|
||||
# view PR description
|
||||
gh pr view 78
|
||||
|
||||
# view PR code changes
|
||||
gh pr diff 78
|
||||
|
||||
# review comments should be posted to the changed file
|
||||
gh api repos/OWNER/REPO/pulls/PR_NUMBER/comments \
|
||||
--method POST \
|
||||
--field body="[your-comment]" \
|
||||
--field commit_id="[commitID]" \
|
||||
--field path="path/to/file" \
|
||||
--field line=lineNumber \
|
||||
--field side="RIGHT"
|
||||
|
||||
# sample command to fetch commitID
|
||||
gh api repos/OWNER/REPO/pulls/PR_NUMBER --jq '.head.sha'
|
||||
```
|
||||
Reference in New Issue
Block a user