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

15
commands/commit/create.md Normal file
View File

@@ -0,0 +1,15 @@
---
allowed-tools: Bash(git add:*), Bash(git status:*), Bash(git commit:*)
description: Create a git commit
---
## Context
- Current git status: !`git status`
- Current git diff (staged and unstaged changes): !`git diff HEAD`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`
## Your task
Based on the above changes, create a single git commit.

59
commands/mr/create.md Normal file
View File

@@ -0,0 +1,59 @@
---
allowed-tools: Bash(glab mr:*), Bash(git add:*), Bash(git status:*), Bash(git commit:*)
description: Create a Merge 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 Merge Requests: !`glab mr list`
## Your task
You are a senior engineer. Please create a branch, generate commits, and create a Merge Request (MR) using `glab` based on code changes.
Required description document structure:
## Title
Concisely describe the core content of this MR (e.g., "Fix parameter validation error in user registration API")
## Background
Explain why this change is needed, which may include:
- Issues / bugs encountered
- New requirements / business scenarios
- Existing limitations in the current code
## Changes
List the main modifications in this MR using bullet points:
- ✏️ Which modules or files were modified
- 🧠 New logic or optimization points introduced
- ❌ Content deleted or refactored
## Test Plan
Describe what tests you performed to verify the correctness of the changes:
- ✅ Unit tests (covering which functionalities)
- 👀 Manual verification (which pages or interfaces)
- 🧪 Whether CI/CD pipeline passes
## Risk & Impact
List potential risk points and whether additional attention is needed:
- Which users or functionalities will be affected
- Whether database migration / cache clearing / configuration changes are needed
- Rollback strategy (if applicable)
## Additional Notes (Optional)
- Whether this MR depends on other PRs / MRs
- Whether documentation changes are included

32
commands/mr/review.md Normal file
View File

@@ -0,0 +1,32 @@
---
allowed-tools: Bash(glab mr:*), Bash(git branch:*), Bash(git log:*)
description: Review Merge Request
---
## Context
- Current MR status: !`glab mr view $ARGUMENTS --output json | jq -r '.state'`
- Current MR diff: !`glab mr diff $ARGUMENTS`
- Current branch: !`git branch --show-current`
- Recent commits: !`git log --oneline -10`
## Your task
You are an experienced code review expert. Please use `glab` to help me review the code changes submitted in the following Merge Request (MR) #$ARGUMENTS, and output the following structure:
1. **Change Summary**: Briefly describe the main changes in this MR.
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.

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.