evizi-kit 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +506 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/agent/.agent/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/agent/.agent/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/agent/.agent/skills/skill-creator/SKILL.md +485 -0
- package/kits/agent/.agent/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/agent/.agent/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/agent/.agent/skills/skill-creator/agents/grader.md +223 -0
- package/kits/agent/.agent/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/agent/.agent/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/agent/.agent/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/agent/.agent/skills/skill-creator/references/schemas.md +430 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/agent/.agent/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/agent/manifest.json +10 -0
- package/kits/claude/.claude/agents/code-pusher.md +46 -0
- package/kits/claude/.claude/agents/feature-document-updater.md +37 -0
- package/kits/claude/.claude/agents/self-reviewer.md +32 -0
- package/kits/claude/.claude/agents/web-auto-agentic-workflow-initializer.md +42 -0
- package/kits/claude/.claude/agents/web-auto-assisted-fix-and-runner.md +36 -0
- package/kits/claude/.claude/agents/web-auto-chrome-devtools-selector-extractor.md +36 -0
- package/kits/claude/.claude/agents/web-auto-coder.md +33 -0
- package/kits/claude/.claude/agents/web-auto-fe-selector-extractor.md +31 -0
- package/kits/claude/.claude/agents/web-auto-fix-and-runner.md +35 -0
- package/kits/claude/.claude/agents/web-auto-lessons-learned-extractor.md +34 -0
- package/kits/claude/.claude/agents/web-auto-playwright-mcp-selector-extractor.md +37 -0
- package/kits/claude/.claude/agents/web-auto-source-instructions-updater.md +43 -0
- package/kits/claude/.claude/agents/web-auto-test-cases-generator.md +29 -0
- package/kits/claude/.claude/agents/web-auto-ticket-designer.md +35 -0
- package/kits/claude/.claude/agents/web-auto-ticket-playbook-planner.md +36 -0
- package/kits/claude/.claude/agents/web-auto.md +382 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/claude/.claude/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/claude/.claude/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/claude/.claude/skills/skill-creator/SKILL.md +485 -0
- package/kits/claude/.claude/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/claude/.claude/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/claude/.claude/skills/skill-creator/agents/grader.md +223 -0
- package/kits/claude/.claude/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/claude/.claude/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/claude/.claude/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/claude/.claude/skills/skill-creator/references/schemas.md +430 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/claude/.claude/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/claude/manifest.json +10 -0
- package/kits/cursor/.cursor/agents/code-pusher.agent.md +43 -0
- package/kits/cursor/.cursor/agents/feature-document-updater.agent.md +34 -0
- package/kits/cursor/.cursor/agents/self-reviewer.agent.md +29 -0
- package/kits/cursor/.cursor/agents/web-auto-agentic-workflow-initializer.agent.md +37 -0
- package/kits/cursor/.cursor/agents/web-auto-assisted-fix-and-runner.agent.md +33 -0
- package/kits/cursor/.cursor/agents/web-auto-chrome-devtools-selector-extractor.agent.md +31 -0
- package/kits/cursor/.cursor/agents/web-auto-coder.agent.md +30 -0
- package/kits/cursor/.cursor/agents/web-auto-fe-selector-extractor.agent.md +28 -0
- package/kits/cursor/.cursor/agents/web-auto-fix-and-runner.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-lessons-learned-extractor.agent.md +31 -0
- package/kits/cursor/.cursor/agents/web-auto-playwright-mcp-selector-extractor.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-source-instructions-updater.agent.md +40 -0
- package/kits/cursor/.cursor/agents/web-auto-test-cases-generator.agent.md +26 -0
- package/kits/cursor/.cursor/agents/web-auto-ticket-designer.agent.md +32 -0
- package/kits/cursor/.cursor/agents/web-auto-ticket-playbook-planner.agent.md +33 -0
- package/kits/cursor/.cursor/agents/web-auto.agent.md +379 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/SKILL.md +292 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/cursor/.cursor/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +26 -0
- package/kits/cursor/.cursor/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/cursor/.cursor/skills/skill-creator/SKILL.md +485 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/cursor/.cursor/skills/skill-creator/agents/grader.md +223 -0
- package/kits/cursor/.cursor/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/cursor/.cursor/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/cursor/.cursor/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/cursor/.cursor/skills/skill-creator/references/schemas.md +430 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/cursor/.cursor/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/cursor/manifest.json +10 -0
- package/kits/github/.github/agents/code-pusher.agent.md +45 -0
- package/kits/github/.github/agents/feature-document-updater.agent.md +36 -0
- package/kits/github/.github/agents/self-reviewer.agent.md +31 -0
- package/kits/github/.github/agents/web-auto-agentic-workflow-initializer.agent.md +39 -0
- package/kits/github/.github/agents/web-auto-assisted-fix-and-runner.agent.md +35 -0
- package/kits/github/.github/agents/web-auto-chrome-devtools-selector-extractor.agent.md +33 -0
- package/kits/github/.github/agents/web-auto-coder.agent.md +32 -0
- package/kits/github/.github/agents/web-auto-fe-selector-extractor.agent.md +30 -0
- package/kits/github/.github/agents/web-auto-fix-and-runner.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-lessons-learned-extractor.agent.md +33 -0
- package/kits/github/.github/agents/web-auto-playwright-mcp-selector-extractor.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-source-instructions-updater.agent.md +42 -0
- package/kits/github/.github/agents/web-auto-test-cases-generator.agent.md +28 -0
- package/kits/github/.github/agents/web-auto-ticket-designer.agent.md +34 -0
- package/kits/github/.github/agents/web-auto-ticket-playbook-creator.agent.md +35 -0
- package/kits/github/.github/agents/web-auto.agent.md +382 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/SKILL.md +310 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/references/claude-code-subagent-configuration.md +158 -0
- package/kits/github/.github/skills/claude-code-subagent-creator/templates/subagent-profile.template.md +37 -0
- package/kits/github/.github/skills/skill-creator/LICENSE.txt +202 -0
- package/kits/github/.github/skills/skill-creator/SKILL.md +485 -0
- package/kits/github/.github/skills/skill-creator/agents/analyzer.md +274 -0
- package/kits/github/.github/skills/skill-creator/agents/comparator.md +202 -0
- package/kits/github/.github/skills/skill-creator/agents/grader.md +223 -0
- package/kits/github/.github/skills/skill-creator/assets/eval_review.html +146 -0
- package/kits/github/.github/skills/skill-creator/eval-viewer/generate_review.py +471 -0
- package/kits/github/.github/skills/skill-creator/eval-viewer/viewer.html +1325 -0
- package/kits/github/.github/skills/skill-creator/references/schemas.md +430 -0
- package/kits/github/.github/skills/skill-creator/scripts/__init__.py +0 -0
- package/kits/github/.github/skills/skill-creator/scripts/aggregate_benchmark.py +401 -0
- package/kits/github/.github/skills/skill-creator/scripts/generate_report.py +326 -0
- package/kits/github/.github/skills/skill-creator/scripts/improve_description.py +247 -0
- package/kits/github/.github/skills/skill-creator/scripts/package_skill.py +136 -0
- package/kits/github/.github/skills/skill-creator/scripts/quick_validate.py +103 -0
- package/kits/github/.github/skills/skill-creator/scripts/run_eval.py +310 -0
- package/kits/github/.github/skills/skill-creator/scripts/run_loop.py +328 -0
- package/kits/github/.github/skills/skill-creator/scripts/utils.py +47 -0
- package/kits/github/manifest.json +10 -0
- package/kits/shared/docs/ai-code-review.md +440 -0
- package/kits/shared/docs/increase-unit-test-coverage.md +77 -0
- package/kits/shared/docs/pr-review-agent.md +501 -0
- package/kits/shared/docs/self-review-agent.md +246 -0
- package/kits/shared/docs/web-auto-agentic-workflow.md +506 -0
- package/kits/shared/manifest.json +11 -0
- package/kits/shared/skills/fix-automation-tests/SKILL.md +280 -0
- package/kits/shared/skills/fix-automation-tests/scripts/fetch_pr_changes.py +300 -0
- package/kits/shared/skills/fix-automation-tests/templates/impact-report.template.md +42 -0
- package/kits/shared/skills/increase-unit-test-coverage/SKILL.md +117 -0
- package/kits/shared/skills/increase-unit-test-coverage/scripts/filter_low_coverage.py +447 -0
- package/kits/shared/skills/pr-review/SKILL.md +200 -0
- package/kits/shared/skills/pr-review/references/automation.md +62 -0
- package/kits/shared/skills/pr-review/references/backend.md +95 -0
- package/kits/shared/skills/pr-review/references/frontend.md +103 -0
- package/kits/shared/skills/pr-review/references/mobile.md +108 -0
- package/kits/shared/skills/pr-review/references/output-schema.md +130 -0
- package/kits/shared/skills/pr-review/scripts/post-review.py +1395 -0
- package/kits/shared/skills/push-code/SKILL.md +176 -0
- package/kits/shared/skills/self-review/SKILL.md +234 -0
- package/kits/shared/skills/self-review/evals/evals.json +23 -0
- package/kits/shared/skills/self-review/references/automation.md +62 -0
- package/kits/shared/skills/self-review/references/backend.md +95 -0
- package/kits/shared/skills/self-review/references/frontend.md +103 -0
- package/kits/shared/skills/self-review/references/mobile.md +108 -0
- package/kits/shared/skills/self-review/templates/issues.template.md +72 -0
- package/kits/shared/skills/update-feature-document/SKILL.md +156 -0
- package/kits/shared/skills/update-feature-document/templates/delta.template.yaml +58 -0
- package/kits/shared/skills/update-feature-document/templates/feature.template.md +25 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/SKILL.md +130 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/references/resolve-api-error.md +108 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/references/resolve-selector.md +60 -0
- package/kits/shared/skills/web-auto-assisted-fix-and-run/templates/issues-resolution-report-append.template.md +54 -0
- package/kits/shared/skills/web-auto-chrome-devtools-mcp-extract-selectors/SKILL.md +284 -0
- package/kits/shared/skills/web-auto-coding/SKILL.md +152 -0
- package/kits/shared/skills/web-auto-extract-lessons-learned/SKILL.md +168 -0
- package/kits/shared/skills/web-auto-extract-lessons-learned/templates/lessons-learned.template.md +115 -0
- package/kits/shared/skills/web-auto-fe-extract-selectors/SKILL.md +282 -0
- package/kits/shared/skills/web-auto-fe-extract-selectors/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-fix-and-run-test/SKILL.md +183 -0
- package/kits/shared/skills/web-auto-fix-and-run-test/templates/issues-resolution-report.template.md +77 -0
- package/kits/shared/skills/web-auto-generate-best-practices/SKILL.md +123 -0
- package/kits/shared/skills/web-auto-generate-instructions/SKILL.md +200 -0
- package/kits/shared/skills/web-auto-generate-instructions/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-generate-instructions/references/analysis-guide.md +145 -0
- package/kits/shared/skills/web-auto-generate-instructions/templates/web-auto-instructions.template.md +184 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/SKILL.md +181 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/evals/evals.json +57 -0
- package/kits/shared/skills/web-auto-generate-project-blueprint/templates/web-auto-project-blueprint.template.md +161 -0
- package/kits/shared/skills/web-auto-playwright-mcp-extract-selectors/SKILL.md +293 -0
- package/kits/shared/skills/web-auto-test-cases/SKILL.md +138 -0
- package/kits/shared/skills/web-auto-test-cases/evals/evals.json +129 -0
- package/kits/shared/skills/web-auto-test-cases/templates/test-cases.template.md +53 -0
- package/kits/shared/skills/web-auto-ticket-design/SKILL.md +199 -0
- package/kits/shared/skills/web-auto-ticket-design/templates/ticket-design.template.md +138 -0
- package/kits/shared/skills/web-auto-ticket-playbook/SKILL.md +218 -0
- package/kits/shared/skills/web-auto-ticket-playbook/evals/evals.json +23 -0
- package/kits/shared/skills/web-auto-ticket-playbook/templates/ticket-playbook.template.md +148 -0
- package/kits/shared/skills/web-auto-update-source-instructions/SKILL.md +156 -0
- package/kits/shared/skills/web-auto-update-source-instructions/evals/evals.json +22 -0
- package/kits/shared/skills/workspace-ai-nav-creator/SKILL.md +168 -0
- package/kits/shared/skills/workspace-ai-nav-creator/templates/agents-md.template.md +112 -0
- package/kits/shared/skills/workspace-ai-nav-creator/templates/claude-md.template.md +86 -0
- package/package.json +16 -0
|
@@ -0,0 +1,501 @@
|
|
|
1
|
+
# PR Review Skill
|
|
2
|
+
|
|
3
|
+
## 1. Overview
|
|
4
|
+
|
|
5
|
+
The **PR Review Skill** enables AI agents to automatically review pull request code changes and create inline comments directly on Git platforms. When a user requests a PR review, the AI agent invokes this skill to fetch PR code, analyze it against project standards, and post structured feedback.
|
|
6
|
+
|
|
7
|
+
### Key Capabilities
|
|
8
|
+
|
|
9
|
+
- **Automated PR Review**: Fetch and review pull request code automatically
|
|
10
|
+
- **Multi-Platform Support**: Create inline comments on GitHub, Gitea, GitLab, and Bitbucket
|
|
11
|
+
- **Quality Assurance**: Identify bugs, security issues, and code standard violations
|
|
12
|
+
- **Notification Integration**: Send review results to Google Chat
|
|
13
|
+
|
|
14
|
+
### How It Works
|
|
15
|
+
|
|
16
|
+
When a user asks the AI agent to review a PR (e.g., "Review PR #42"), the agent:
|
|
17
|
+
1. Recognizes the request and invokes the `pr-review` skill
|
|
18
|
+
2. The skill handles the entire PR review workflow
|
|
19
|
+
3. Returns results to the user
|
|
20
|
+
|
|
21
|
+
## 2. Components
|
|
22
|
+
|
|
23
|
+
| Component | File | Description |
|
|
24
|
+
|-----------|------|-------------|
|
|
25
|
+
| **PR Review Skill** | `.cursor/skills/pr-review/SKILL.md` or `.github/skills/pr-review/SKILL.md` | Skill definition and workflow for PR review process |
|
|
26
|
+
| **Configuration File** | `.cursor/project.config.json` or `.github/project.config.json` | Project settings, platform config, and notification settings |
|
|
27
|
+
| **Unified Dispatcher** | `scripts/post-review.py` | Single script with all platform logic embedded - transforms standard output and posts to Git platforms |
|
|
28
|
+
| **Frontend Checklist** | `references/frontend.md` | 100+ checks for React, Vue, Angular, etc. |
|
|
29
|
+
| **Backend Checklist** | `references/backend.md` | 70+ checks for API, database, security |
|
|
30
|
+
| **Mobile Checklist** | `references/mobile.md` | 110+ checks for iOS and Android |
|
|
31
|
+
| **Automation Checklist** | `references/automation.md` | 40+ checks for E2E tests |
|
|
32
|
+
|
|
33
|
+
> **Note:** All file paths under `references/` and `scripts/` are relative to the skill directory (`.cursor/skills/pr-review/` or `.github/skills/pr-review/`).
|
|
34
|
+
|
|
35
|
+
## 3. Setup Guide
|
|
36
|
+
|
|
37
|
+
### Step 1: Create Configuration File
|
|
38
|
+
|
|
39
|
+
Create `.cursor/project.config.json` (or `.github/project.config.json`) and customize:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{
|
|
43
|
+
"baseBranch": "main",
|
|
44
|
+
"platform": "github",
|
|
45
|
+
"platformConfig": {
|
|
46
|
+
"github": {
|
|
47
|
+
"apiUrl": "https://api.github.com",
|
|
48
|
+
"owner": "your-org",
|
|
49
|
+
"repo": "your-repo"
|
|
50
|
+
},
|
|
51
|
+
"gitea": {
|
|
52
|
+
"apiUrl": "https://gitea.example.com/api/v1",
|
|
53
|
+
"owner": "your-org",
|
|
54
|
+
"repo": "your-repo"
|
|
55
|
+
},
|
|
56
|
+
"gitlab": {
|
|
57
|
+
"apiUrl": "https://gitlab.com/api/v4",
|
|
58
|
+
"projectId": "your-project-id"
|
|
59
|
+
},
|
|
60
|
+
"bitbucket": {
|
|
61
|
+
"apiUrl": "https://api.bitbucket.org/2.0",
|
|
62
|
+
"workspace": "your-workspace",
|
|
63
|
+
"repoSlug": "your-repo"
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"enableCommentPosting": true,
|
|
67
|
+
"enableNotification": true
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Configuration Options:**
|
|
72
|
+
|
|
73
|
+
- `enableCommentPosting` (boolean, default: `true`) - Controls whether inline comments should be posted to the git platform
|
|
74
|
+
- `enableNotification` (boolean, default: `false`) - Controls whether Google Chat notifications should be sent
|
|
75
|
+
|
|
76
|
+
**Operation Modes:**
|
|
77
|
+
|
|
78
|
+
The script supports flexible operation modes based on your configuration and token availability:
|
|
79
|
+
|
|
80
|
+
1. **Full Mode** - Posts inline comments + sends notification
|
|
81
|
+
- Config: `enableCommentPosting: true`, `enableNotification: true`
|
|
82
|
+
- Requires: Platform token configured
|
|
83
|
+
- Use case: Production environment with full features
|
|
84
|
+
|
|
85
|
+
2. **Comment-Only Mode** - Posts inline comments, no notification
|
|
86
|
+
- Config: `enableCommentPosting: true`, `enableNotification: false`
|
|
87
|
+
- Requires: Platform token configured
|
|
88
|
+
- Use case: CI/CD without notification spam
|
|
89
|
+
|
|
90
|
+
3. **Notification-Only Mode** - Skips inline comments, only sends notification
|
|
91
|
+
- Config: `enableCommentPosting: false`, `enableNotification: true`
|
|
92
|
+
- OR: `enableCommentPosting: true` (but no token), `enableNotification: true`
|
|
93
|
+
- No platform token needed
|
|
94
|
+
- Use case: Testing, environments without git tokens, or notification-only setups
|
|
95
|
+
|
|
96
|
+
### Step 2: Set Environment Variables
|
|
97
|
+
|
|
98
|
+
The script uses standardized environment variable names. Configure based on your operation mode:
|
|
99
|
+
|
|
100
|
+
**For Comment Posting (Required if `enableCommentPosting: true`):**
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# GitHub
|
|
104
|
+
export GITHUB_TOKEN="your-github-token"
|
|
105
|
+
|
|
106
|
+
# GitLab
|
|
107
|
+
export GITLAB_TOKEN="your-gitlab-token"
|
|
108
|
+
|
|
109
|
+
# Gitea
|
|
110
|
+
export GITEA_TOKEN="your-gitea-token"
|
|
111
|
+
|
|
112
|
+
# Bitbucket
|
|
113
|
+
export BITBUCKET_TOKEN="your-bitbucket-token"
|
|
114
|
+
export BITBUCKET_USERNAME="your-bitbucket-username"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**For Notifications (Required if `enableNotification: true`):**
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
# Google Chat notifications
|
|
121
|
+
export GOOGLE_CHAT_WEBHOOK_URL="your-webhook-url"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**Token Requirements by Mode:**
|
|
125
|
+
|
|
126
|
+
| Mode | Platform Token | Webhook URL |
|
|
127
|
+
|------|----------------|-------------|
|
|
128
|
+
| Full Mode | ✅ Required | ✅ Required |
|
|
129
|
+
| Comment-Only Mode | ✅ Required | ❌ Not needed |
|
|
130
|
+
| Notification-Only Mode | ❌ Optional | ✅ Required |
|
|
131
|
+
|
|
132
|
+
**Tip:** If you only want notifications without posting comments, you can skip the platform token entirely by setting `enableCommentPosting: false` in your config.
|
|
133
|
+
|
|
134
|
+
### Step 3: Verify Git Setup
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
git remote -v
|
|
138
|
+
git fetch origin
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
## 4. How to Use
|
|
142
|
+
|
|
143
|
+
### Basic Workflow
|
|
144
|
+
|
|
145
|
+
1. **User prompts the AI agent** with a PR review request (e.g., "Review PR #42")
|
|
146
|
+
2. **AI agent recognizes the intent** and invokes the `pr-review` skill with the PR number
|
|
147
|
+
3. **Skill executes the review workflow:**
|
|
148
|
+
- Fetches the PR code using Git commands
|
|
149
|
+
- Compares PR branch with base branch
|
|
150
|
+
- Detects tech stack and loads domain-specific checklist
|
|
151
|
+
- Analyzes code changes against the checklist
|
|
152
|
+
- Generates standard review output JSON (saves to `review.json` in project root)
|
|
153
|
+
- **Shows preview and asks for confirmation** (if `requireConfirmation: true`)
|
|
154
|
+
- Calls `python post-review.py` (if user confirms or auto-post enabled)
|
|
155
|
+
- Returns to the previous branch (cleanup)
|
|
156
|
+
4. **post-review.py handles posting:**
|
|
157
|
+
- Reads platform from `project.config.json`
|
|
158
|
+
- Transforms standard review to platform-specific format
|
|
159
|
+
- Posts inline comments to Git platform via API
|
|
160
|
+
- Sends Google Chat notification (if `enableNotification` is true)
|
|
161
|
+
- Cleans up by deleting `review.json` after successful posting
|
|
162
|
+
5. **AI agent returns results** to the user
|
|
163
|
+
|
|
164
|
+
### Trigger Examples
|
|
165
|
+
|
|
166
|
+
The AI agent will invoke the `pr-review` skill when it detects prompts like:
|
|
167
|
+
|
|
168
|
+
```
|
|
169
|
+
Review PR #42
|
|
170
|
+
Please review pull request 123
|
|
171
|
+
Can you check PR number 15?
|
|
172
|
+
Review the changes in pull request #8
|
|
173
|
+
Check this PR for issues: #99
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Git Commands Executed by Skill
|
|
177
|
+
|
|
178
|
+
The skill executes these Git commands internally:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# Fetch the PR branch
|
|
182
|
+
git fetch origin pull/[PR_NUMBER]/head:pr-[PR_NUMBER]
|
|
183
|
+
|
|
184
|
+
# Checkout the PR branch
|
|
185
|
+
git checkout pr-[PR_NUMBER]
|
|
186
|
+
|
|
187
|
+
# Get list of changed files compared to base branch
|
|
188
|
+
git diff ${BASE_BRANCH} --name-only
|
|
189
|
+
|
|
190
|
+
# Get detailed line-by-line differences with 3 lines of context
|
|
191
|
+
git diff ${BASE_BRANCH} --unified=3
|
|
192
|
+
|
|
193
|
+
# After review is complete, return to previous branch
|
|
194
|
+
git checkout -
|
|
195
|
+
|
|
196
|
+
# Optionally delete the PR branch to clean up local workspace
|
|
197
|
+
git branch -D pr-[PR_NUMBER]
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
Where `${BASE_BRANCH}` is read from `project.config.json` (e.g., `main`).
|
|
201
|
+
|
|
202
|
+
**Note:** The `git checkout -` command returns you to the branch you were working on before the PR review started, ensuring your local workspace is restored to its original state.
|
|
203
|
+
|
|
204
|
+
## 5. Confirmation Workflow
|
|
205
|
+
|
|
206
|
+
### Interactive Mode (Default)
|
|
207
|
+
|
|
208
|
+
When `requireConfirmation: true`, the skill shows a summary before posting:
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
📊 PR #42 Review Summary
|
|
212
|
+
|
|
213
|
+
Found:
|
|
214
|
+
- 2 Critical Issues ❌
|
|
215
|
+
- 1 Warning ⚠️
|
|
216
|
+
- 0 Suggestions 💡
|
|
217
|
+
|
|
218
|
+
📝 Full review saved to: review.json
|
|
219
|
+
📋 Review Status: REQUEST_CHANGES
|
|
220
|
+
🎯 Platform: GitHub | Files: 5 | Total Comments: 3
|
|
221
|
+
|
|
222
|
+
Do you want to post these 3 comments to GitHub? (yes/no)
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
**User Options:**
|
|
226
|
+
- `yes` → Posts comments immediately
|
|
227
|
+
- `no` → Saves review.json, doesn't post (user can manually post later)
|
|
228
|
+
|
|
229
|
+
### Notification-Only Mode Examples
|
|
230
|
+
|
|
231
|
+
When running in notification-only mode (no git token configured or `enableCommentPosting: false`):
|
|
232
|
+
|
|
233
|
+
**Example 1: Testing without posting to PR**
|
|
234
|
+
```json
|
|
235
|
+
{
|
|
236
|
+
"platform": "github",
|
|
237
|
+
"enableCommentPosting": false,
|
|
238
|
+
"enableNotification": true
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
Result: Review is generated, notification sent to Google Chat, but no comments posted to GitHub PR.
|
|
242
|
+
|
|
243
|
+
**Example 2: Environment without git access**
|
|
244
|
+
```json
|
|
245
|
+
{
|
|
246
|
+
"platform": "github",
|
|
247
|
+
"enableCommentPosting": true, // Would post if token available
|
|
248
|
+
"enableNotification": true
|
|
249
|
+
}
|
|
250
|
+
```
|
|
251
|
+
With no `GITHUB_TOKEN` set: Script skips comment posting automatically, sends notification only.
|
|
252
|
+
|
|
253
|
+
**Example 3: Dry run for testing**
|
|
254
|
+
```bash
|
|
255
|
+
python post-review.py --dry-run
|
|
256
|
+
```
|
|
257
|
+
Result: Shows transformed output for all platforms, doesn't post anything.
|
|
258
|
+
|
|
259
|
+
## 6. Standard Review Output Format
|
|
260
|
+
|
|
261
|
+
The PR Review Skill generates a **standard JSON format** that is platform-agnostic. The unified dispatcher script then transforms this standard output to the platform-specific API format.
|
|
262
|
+
|
|
263
|
+
### Standard Output Schema
|
|
264
|
+
|
|
265
|
+
```json
|
|
266
|
+
{
|
|
267
|
+
"prNumber": 42,
|
|
268
|
+
"status": "REQUEST_CHANGES",
|
|
269
|
+
"summary": "Found 2 critical issues and 1 warning.",
|
|
270
|
+
"statistics": {
|
|
271
|
+
"filesReviewed": 5,
|
|
272
|
+
"totalComments": 3,
|
|
273
|
+
"criticalCount": 2,
|
|
274
|
+
"warningCount": 1,
|
|
275
|
+
"suggestionCount": 0
|
|
276
|
+
},
|
|
277
|
+
"comments": [
|
|
278
|
+
{
|
|
279
|
+
"path": "src/utils/api.ts",
|
|
280
|
+
"line": 15,
|
|
281
|
+
"category": "Security",
|
|
282
|
+
"severity": "critical",
|
|
283
|
+
"title": "Hardcoded API Key",
|
|
284
|
+
"body": "API keys should never be committed to the repository.",
|
|
285
|
+
"recommendation": "Use environment variables instead",
|
|
286
|
+
"codeSnippet": "const API_KEY = process.env.API_KEY;"
|
|
287
|
+
}
|
|
288
|
+
],
|
|
289
|
+
"metadata": {
|
|
290
|
+
"reviewedAt": "2026-02-03T15:30:00Z",
|
|
291
|
+
"baseBranch": "main",
|
|
292
|
+
"sourceBranch": "feature/new-feature",
|
|
293
|
+
"commitSha": "abc123def456"
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
### Comment Categories & Severity
|
|
299
|
+
|
|
300
|
+
| Category | Severity | Description |
|
|
301
|
+
|----------|----------|-------------|
|
|
302
|
+
| `Security` | critical | Vulnerabilities, secrets, injection risks |
|
|
303
|
+
| `Bug` | critical | Runtime errors, crashes, logic flaws |
|
|
304
|
+
| `Pattern` | warning | Violations of project coding standards |
|
|
305
|
+
| `Type` | warning | Type safety issues |
|
|
306
|
+
| `Performance` | warning | Inefficient code patterns |
|
|
307
|
+
| `Readability` | suggestion | Code clarity improvements |
|
|
308
|
+
| `Naming` | suggestion | Naming convention violations |
|
|
309
|
+
|
|
310
|
+
### Review Status Values
|
|
311
|
+
|
|
312
|
+
| Status | When to Use |
|
|
313
|
+
|--------|-------------|
|
|
314
|
+
| `APPROVE` | No issues found, code looks good |
|
|
315
|
+
| `REQUEST_CHANGES` | Critical issues or bugs found |
|
|
316
|
+
| `COMMENT` | Only minor suggestions or warnings |
|
|
317
|
+
|
|
318
|
+
## 7. Platform Transformation
|
|
319
|
+
|
|
320
|
+
The unified dispatcher (`post-review.py`) contains embedded logic for all platforms, transforming the standard review output to each platform's specific API format.
|
|
321
|
+
|
|
322
|
+
### Architecture
|
|
323
|
+
|
|
324
|
+
```
|
|
325
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
326
|
+
│ Standard Review Output (JSON) │
|
|
327
|
+
│ - prNumber, status, summary, statistics, comments[] │
|
|
328
|
+
└─────────────────────────────────────────────────────────────┘
|
|
329
|
+
│
|
|
330
|
+
▼
|
|
331
|
+
┌─────────────────────────────────────────────────────────────┐
|
|
332
|
+
│ post-review.py (Unified Dispatcher) │
|
|
333
|
+
│ ┌───────────────────────────────────────────────────────┐ │
|
|
334
|
+
│ │ 1. Reads platform from project.config.json │ │
|
|
335
|
+
│ │ 2. Reads standard environment variables │ │
|
|
336
|
+
│ │ (GITHUB_TOKEN, GITLAB_TOKEN, etc.) │ │
|
|
337
|
+
│ │ 3. Transforms to platform-specific format │ │
|
|
338
|
+
│ │ 4. Posts to API using embedded platform logic │ │
|
|
339
|
+
│ │ 5. Sends Google Chat notification (if enabled) │ │
|
|
340
|
+
│ └───────────────────────────────────────────────────────┘ │
|
|
341
|
+
│ │
|
|
342
|
+
│ Embedded Platform Handlers: │
|
|
343
|
+
│ ┌──────────────┬──────────────┬──────────────┬──────────┐ │
|
|
344
|
+
│ │ GitHub │ Gitea │ GitLab │ Bitbucket│ │
|
|
345
|
+
│ ├──────────────┼──────────────┼──────────────┼──────────┤ │
|
|
346
|
+
│ │ line → line │ line → │ line → │ line → │ │
|
|
347
|
+
│ │ side: RIGHT │ new_position │ position. │ inline.to│ │
|
|
348
|
+
│ │ event: │ event: │ new_line │ content. │ │
|
|
349
|
+
│ │ APPROVE │ APPROVED │ + SHA values │ raw │ │
|
|
350
|
+
│ └──────────────┴──────────────┴──────────────┴──────────┘ │
|
|
351
|
+
└─────────────────────────────────────────────────────────────┘
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
### Platform API Differences
|
|
355
|
+
|
|
356
|
+
| Feature | GitHub | Gitea | GitLab | Bitbucket |
|
|
357
|
+
|---------|--------|-------|--------|-----------|
|
|
358
|
+
| **Approval event** | `APPROVE` | `APPROVED` | Separate `/approve` endpoint | Separate `/approve` endpoint |
|
|
359
|
+
| **Line field** | `line` | `new_position` | `position.new_line` | `inline.to` |
|
|
360
|
+
| **Single review** | ✅ Yes | ✅ Yes | ❌ No (separate discussions) | ❌ No (separate comments) |
|
|
361
|
+
| **Requires SHA** | ❌ No | ❌ No | ✅ Yes (base, head, start) | ❌ No |
|
|
362
|
+
|
|
363
|
+
### Usage
|
|
364
|
+
|
|
365
|
+
```bash
|
|
366
|
+
# Post review (reads review.json from project root, platform from config)
|
|
367
|
+
python {PR_REVIEW_SKILL_PATH}/scripts/post-review.py
|
|
368
|
+
|
|
369
|
+
# Dry run mode (transform only, do not post)
|
|
370
|
+
python {PR_REVIEW_SKILL_PATH}/scripts/post-review.py --dry-run
|
|
371
|
+
```
|
|
372
|
+
|
|
373
|
+
Where `{PR_REVIEW_SKILL_PATH}` is the absolute path to the pr-review skill folder (e.g., `.cursor/skills/pr-review` or `.github/skills/pr-review`).
|
|
374
|
+
|
|
375
|
+
**Note:** The script automatically:
|
|
376
|
+
- Reads `review.json` from the project root
|
|
377
|
+
- Detects platform from `project.config.json` (searches `.github/` or `.cursor/`)
|
|
378
|
+
- Uses standard environment variable names (GITHUB_TOKEN, GITLAB_TOKEN, etc.)
|
|
379
|
+
- Posts comments if `enableCommentPosting` is `true` and platform token is available
|
|
380
|
+
- Sends notification if `enableNotification` is `true` in config
|
|
381
|
+
- Supports notification-only mode when no git token is configured
|
|
382
|
+
- Deletes `review.json` file after successful posting or notification (file cleanup)
|
|
383
|
+
- Outputs JSON to stdout, errors to stderr (optimized for AI usage)
|
|
384
|
+
|
|
385
|
+
**Git Cleanup:** After the review workflow completes, the skill automatically returns to your previous branch using `git checkout -`, restoring your workspace to its original state.
|
|
386
|
+
|
|
387
|
+
## 8. Tech Stack Detection & Checklists
|
|
388
|
+
|
|
389
|
+
The PR review skill automatically detects the project type and applies the appropriate checklist (same as self-review):
|
|
390
|
+
|
|
391
|
+
### Detection Logic
|
|
392
|
+
|
|
393
|
+
| Tech Stack | File Extensions | Checklist Applied |
|
|
394
|
+
|------------|----------------|-------------------|
|
|
395
|
+
| **Frontend** | `.tsx`, `.jsx`, `.vue`, `.css`, `package.json` | `references/frontend.md` (100+ checks) |
|
|
396
|
+
| **Backend** | `.java`, `.go`, `.py` (API), `.sql` | `references/backend.md` (70+ checks) |
|
|
397
|
+
| **Mobile** | `.swift`, `.kt`, `Podfile`, `AndroidManifest.xml` | `references/mobile.md` (110+ checks) |
|
|
398
|
+
| **Automation** | `.spec.ts`, `Selenium`, `Test.java` | `references/automation.md` (40+ checks) |
|
|
399
|
+
|
|
400
|
+
### Checklist Highlights
|
|
401
|
+
|
|
402
|
+
**Frontend** - Performance, State Management, Accessibility, Security, SEO, Testing
|
|
403
|
+
**Backend** - API Design, Database, Security (OWASP), Performance, Observability, Testing
|
|
404
|
+
**Mobile** - Threading, Lifecycle, Memory, Security, Networking, Platform-Specific
|
|
405
|
+
**Automation** - Stability, Selectors, Isolation, Error Handling, CI Readiness
|
|
406
|
+
|
|
407
|
+
### Severity Classification
|
|
408
|
+
|
|
409
|
+
| Severity | Review Status | Description |
|
|
410
|
+
|----------|---------------|-------------|
|
|
411
|
+
| **critical** | `REQUEST_CHANGES` | Bugs, security vulnerabilities, breaking changes |
|
|
412
|
+
| **warning** | `COMMENT` | Code quality, maintainability, performance issues |
|
|
413
|
+
| **suggestion** | `COMMENT` | Best practices, patterns, optimizations |
|
|
414
|
+
|
|
415
|
+
## 9. Architecture Diagram
|
|
416
|
+
|
|
417
|
+
```
|
|
418
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
419
|
+
│ User Request │
|
|
420
|
+
│ "Review PR #42" │
|
|
421
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
422
|
+
│
|
|
423
|
+
▼
|
|
424
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
425
|
+
│ AI Agent (Cursor/Copilot/Claude/etc) │
|
|
426
|
+
│ ┌───────────────────────────────────────────────────────────────────┐ │
|
|
427
|
+
│ │ 1. Parse user request to extract PR number │ │
|
|
428
|
+
│ │ 2. Recognize intent: PR review request │ │
|
|
429
|
+
│ │ 3. Invoke pr-review skill with PR number parameter │ │
|
|
430
|
+
│ └───────────────────────────────────────────────────────────────────┘ │
|
|
431
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
432
|
+
│
|
|
433
|
+
▼
|
|
434
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
435
|
+
│ pr-review Skill │
|
|
436
|
+
│ ┌───────────────────────────────────────────────────────────────────┐ │
|
|
437
|
+
│ │ 1. Read configuration from project.config.json │ │
|
|
438
|
+
│ │ 2. Fetch PR code: git fetch origin pull/42/head:pr-42 │ │
|
|
439
|
+
│ │ 3. Checkout PR: git checkout pr-42 │ │
|
|
440
|
+
│ │ 4. Get diff: git diff main --unified=3 │ │
|
|
441
|
+
│ │ 5. Detect tech stack and load domain-specific checklist │ │
|
|
442
|
+
│ │ 6. Analyze code changes against checklist + project standards │ │
|
|
443
|
+
│ │ 7. Generate STANDARD review output JSON (save to review.json) │ │
|
|
444
|
+
│ │ 8. Show preview and ask for confirmation (if required) │ │
|
|
445
|
+
│ │ 9. Call: python post-review.py (if confirmed/auto) │ │
|
|
446
|
+
│ │ 10. Cleanup: git checkout - (return to previous branch) │ │
|
|
447
|
+
│ └───────────────────────────────────────────────────────────────────┘ │
|
|
448
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
449
|
+
│
|
|
450
|
+
▼
|
|
451
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
452
|
+
│ post-review.py (Unified Dispatcher) │
|
|
453
|
+
│ ┌───────────────────────────────────────────────────────────────────┐ │
|
|
454
|
+
│ │ 1. Read project.config.json │ │
|
|
455
|
+
│ │ 2. Detect platform (github, gitea, gitlab, bitbucket) │ │
|
|
456
|
+
│ │ 3. Read standard env vars (GITHUB_TOKEN, GITLAB_TOKEN, etc.) │ │
|
|
457
|
+
│ │ 4. Transform using embedded platform logic → POST to API │ │
|
|
458
|
+
│ │ 5. Check enableNotification → Send Google Chat notification │ │
|
|
459
|
+
│ │ 6. Cleanup: Delete review.json file after successful posting │ │
|
|
460
|
+
│ └───────────────────────────────────────────────────────────────────┘ │
|
|
461
|
+
│ │
|
|
462
|
+
│ ┌───────────────────────────────────────────────────────────────────┐ │
|
|
463
|
+
│ │ Embedded Platform Handlers: │ │
|
|
464
|
+
│ │ - post_github_review() → GitHub Reviews API │ │
|
|
465
|
+
│ │ - post_gitea_review() → Gitea Reviews API │ │
|
|
466
|
+
│ │ - post_gitlab_review() → GitLab Discussions API │ │
|
|
467
|
+
│ │ - post_bitbucket_review() → Bitbucket Comments API │ │
|
|
468
|
+
│ └───────────────────────────────────────────────────────────────────┘ │
|
|
469
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
470
|
+
│
|
|
471
|
+
▼
|
|
472
|
+
┌─────────────────────────────────────────────────────────────────────────┐
|
|
473
|
+
│ Return Results to AI Agent │
|
|
474
|
+
│ AI Agent communicates outcome to user │
|
|
475
|
+
└─────────────────────────────────────────────────────────────────────────┘
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
## 10. References
|
|
479
|
+
|
|
480
|
+
| Resource | Possible Locations |
|
|
481
|
+
|----------|-------------------|
|
|
482
|
+
| **Skill Definition** | `.cursor/skills/pr-review/SKILL.md` or `.github/skills/pr-review/SKILL.md` |
|
|
483
|
+
| **Configuration File** | `.cursor/project.config.json` or `.github/project.config.json` |
|
|
484
|
+
| **Unified Dispatcher** | `{SKILL_PATH}/scripts/post-review.py` |
|
|
485
|
+
| **Frontend Checklist** | `{SKILL_PATH}/references/frontend.md` |
|
|
486
|
+
| **Backend Checklist** | `{SKILL_PATH}/references/backend.md` |
|
|
487
|
+
| **Mobile Checklist** | `{SKILL_PATH}/references/mobile.md` |
|
|
488
|
+
| **Automation Checklist** | `{SKILL_PATH}/references/automation.md` |
|
|
489
|
+
|
|
490
|
+
> **Note:** `{SKILL_PATH}` refers to `.cursor/skills/pr-review/` or `.github/skills/pr-review/` depending on your project setup.
|
|
491
|
+
|
|
492
|
+
## 11. Skill Invocation
|
|
493
|
+
|
|
494
|
+
The AI agent automatically invokes this skill when it detects PR review requests in the user's prompt. The skill is registered in the agent's skill registry and can be triggered by patterns like:
|
|
495
|
+
|
|
496
|
+
- "Review PR #[number]"
|
|
497
|
+
- "Check pull request [number]"
|
|
498
|
+
- "Analyze PR [number]"
|
|
499
|
+
- "Review pull request #[number]"
|
|
500
|
+
|
|
501
|
+
No manual skill invocation is required - the AI agent handles skill selection based on user intent.
|