Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:47:06 +08:00
commit 036d836556
15 changed files with 722 additions and 0 deletions

21
commands/pr/create.md Normal file
View File

@@ -0,0 +1,21 @@
---
allowed-tools: Bash(gh pr:*), Bash(git add:*), Bash(git status:*), Bash(git commit:*)
description: Create a Pull Request
---
## Context
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`
- Current git status: !`git status`
- Current git diff (staged and unstaged changes): !`git diff HEAD`
- Existing Pull Requests: !`gh pr list`
## Your task
Create a Pull Request based on the code changes.
1. Create a new branch based on the code changes
2. Generate commit information
3. Push the code to the remote repository
4. Create a Pull Request. If an upstream branch exists, create the Pull Request based on the upstream branch; otherwise, create it based on the origin branch

34
commands/pr/review.md Normal file
View File

@@ -0,0 +1,34 @@
---
allowed-tools: Bash(gh pr:*), Bash(git branch:*), Bash(git log:*)
description: Review Pull Request
---
## Context
- Current PR status: !`gh pr view $ARGUMENTS --json state -q '.state'`
- Current PR diff: !`gh pr diff $ARGUMENTS`
- Current PR files changed: !`gh pr view $ARGUMENTS --json files -q '.files[].path'`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`
## Your task
You are an experienced code review expert. Please use `gh` to help me review the code changes submitted in the following Pull Request (PR) #$ARGUMENTS, and output the following structure:
1. **Change Summary**: Briefly describe the main changes in this PR.
2. **Potential Risks**: Point out possible issues that may be introduced, such as performance, maintainability, security, etc.
3. **Optimization Suggestions**: Provide reasonable improvement directions, skip if none.
4. **Compliance Check**: Whether it conforms to the current project's code style, naming conventions, module boundary division, etc.
Please output using chinese in structured Markdown format and use bullet lists as much as possible, then ask me if you need pushing the review comments.
# Optional Parameter Description
- `$LANGUAGE`: Code language (e.g., Python, PHP, TypeScript)
- `$SCOPE`: Review scope (e.g., focus only on performance, security, default is all)
Please adjust the focus based on parameters:
- When `$SCOPE=performance`, please pay special attention to loops, I/O, database calls, etc.
- When `$SCOPE=security`, please pay special attention to input validation, permission boundaries, SQL injection, etc.
- When `$SCOPE=style`, please pay special attention to code style, naming conventions, etc.