一键导入
pull-request
PR Generator - Generate standardized Pull Request based on branch diff and submit via gh or save as PR.md
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
PR Generator - Generate standardized Pull Request based on branch diff and submit via gh or save as PR.md
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Process one GitHub issue end-to-end — read the issue + referenced repo docs/code + existing comments, verify against the landed implementation/intent, and post evidence-backed findings as a comment on the issue. Covers doc-review, doc-audit, system-audit, research, and idea issue types. Use when handling a single issue (issue-sweep calls this per issue).
Sweep open GitHub issues for unprocessed human input and act on each via the issue-review skill — delete-PRs for human-approved deprecated docs, doc-update PRs for approved drifted docs, fix-PRs for approved bugs, analysis+TDD-plan comments for feature/design requests (then implement after confirmation), close issues whose PR merged, comment-only on conditional/security/needs-decision ones. The actionable signal may be a comment OR the issue body. With --autofix-green, also auto-fixes "green" issues that have no human reply yet (unambiguous + verifiable-here + low-risk + non-security) — reproduce→fix→test→PR, never auto-merge. Run manually (/agentloop:issue-sweep) or on a schedule. Designed for a doc-audit + spin-off + feature workflow.
One-command setup/update of an agentloop FLEET on a teammate's machine or cloud — asks a few defaulted questions, then generates/reconciles the two config files (deployment.json + repos.json) and installs the schedule. LOCAL = a crontab marker-block wiring fleet/driver.ts (one row per skill; the driver fans out to every covered repo). CLOUD = one claude routine per (repo×skill) via RemoteTrigger, batch-created from the same catalog. Idempotent — re-run to upgrade. This is the SCHEDULING side that `bootstrap` (repo adoption) deliberately leaves out. Interactive — never runs unattended.
Independent clean-context review of ONE open GitHub pull request — read PR diff + linked issue + verify every claim against live code/tests + run the verification gate (pre-merge) and diagnose its root-cause + detect conflicts with sibling PRs, then emit an evidence-backed merge-readiness verdict (MERGE / COMMENT / SUPERSEDE / BLOCK / CLOSE). Runs verification every time (read-only safe); --post writes one verdict comment. Never auto-merges (that gated step belongs to pr-sweep). Use /agentloop:pr-review <pr#> for a single PR; pr-sweep batches this engine across all open PRs.
Batch-review every open GitHub PR and drive it to a terminal state autonomously — fan out a clean-context pr-review per PR (verify claims against live code, run the verification gate), cluster PRs by shared issue + shared files, DEDUP-CLOSE same-issue duplicates (keep the best one, comment + close the twin), and GATED auto-merge every verified non-breaking PR (docs/tests/fixes AND features) while escalating only security / breaking changes / architecture-direction decisions to a human. Designed to run on a schedule on an independent machine so PRs get reviewed + merged without a human in the loop. Run /agentloop:pr-sweep (review+comment+dedup-close only), /agentloop:pr-sweep --merge (also auto-merge gated PRs), or /agentloop:pr-sweep --dry-run (report only).
Iterative clean-context review of a design/plan document or issue — spawn independent-perspective reviewers each round, score, and synthesize findings without carrying prior-round bias. Use to review an implementation plan, architecture doc, or design proposal before building.
| name | pull-request |
| description | PR Generator - Generate standardized Pull Request based on branch diff and submit via gh or save as PR.md |
| allowed-tools | ["Bash","Read","Write","Glob","Grep","AskUserQuestion"] |
Generate standardized Pull Requests by analyzing the diff between current branch and main branch.
CRITICAL: Before generating PR content, ALWAYS check if the project has a custom PR template:
# Check for PR template in common locations
ls -la .github/PULL_REQUEST_TEMPLATE.md 2>/dev/null || \
ls -la .github/PULL_REQUEST_TEMPLATE/ 2>/dev/null || \
ls -la docs/PULL_REQUEST_TEMPLATE.md 2>/dev/null
If a PR template exists:
If no PR template exists: Use the default template defined below.
Based on analysis of high-quality PRs, use this template:
<type>(<scope>): <description>
Types (same as Conventional Commits):
| Type | Description |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Documentation only |
style | Code style changes |
refactor | Code refactoring |
perf | Performance improvement |
test | Add or modify tests |
chore | Build process or tools |
ci | CI/CD configuration |
build | Build system changes |
Scope: Optional, indicates affected module (e.g., agentloop, blocklet, auth)
Description:
## Summary
<1-5 bullet points describing key changes>
## Motivation / Context
<Why this change is needed - the problem being solved>
## Changes
<Detailed list of what was changed, organized by area>
## Test Plan
<How to verify the changes work correctly>
- [ ] Step 1
- [ ] Step 2
---
Generated with [Claude Code](https://claude.com/claude-code)
# Get current branch name
git branch --show-current
# Get main branch (usually 'main' or 'master')
git remote show origin | grep 'HEAD branch' | cut -d' ' -f5
# Check if branch is pushed to remote
git status -sb
IMPORTANT: Analyze ALL commits from branch divergence point, not just the latest commit.
# Get the merge base (where current branch diverged from main)
git merge-base main HEAD
# View all commits since diverging from main
git log main..HEAD --oneline
# Get comprehensive diff statistics
git diff main...HEAD --stat
# Get full diff for content analysis
git diff main...HEAD
Based on the diff analysis:
Determine type: Look at the nature of changes
featfixdocstestchoreIdentify scope: Look at which module/area is most affected
Use project template if exists: If Step 0 found a PR template:
Otherwise use default template:
Display the generated PR title and body to the user, then use AskUserQuestion to determine next action:
{
"questions": [{
"question": "How would you like to proceed with this PR?",
"header": "PR Action",
"options": [
{"label": "Save as PR.md (Recommended)", "description": "Save PR content to PR.md file in project root (will overwrite if exists)"},
{"label": "Submit via gh", "description": "Create PR directly using GitHub CLI"}
],
"multiSelect": false
}]
}
Write the PR content to ./PR.md in the project root:
# PR Title
<type>(<scope>): <description>
---
## Summary
...
## Motivation / Context
...
## Changes
...
## Test Plan
...
---
Generated with [Claude Code](https://claude.com/claude-code)
Inform user that PR.md has been created (or overwritten if it existed).
which gh
If gh is not found:
GitHub CLI (gh) is not installed. Please install it:
- macOS: brew install gh
- Linux: See https://github.com/cli/cli/blob/trunk/docs/install_linux.md
- Windows: winget install --id GitHub.cli
After installation, run: gh auth login
gh auth status
If not authenticated or token lacks permissions:
GitHub CLI is not authenticated or lacks permissions. Please run:
gh auth login
Select:
- GitHub.com
- HTTPS
- Authenticate with browser (recommended)
Ensure you grant 'repo' scope for creating PRs.
git status -sb
If branch is not pushed to remote:
# Push current branch to origin
git push -u origin $(git branch --show-current)
gh pr create --base main --title "<title>" --body "$(cat <<'EOF'
<body content>
EOF
)"
Display the PR URL and summary to the user.
feat(agentloop): add PR generation skill
## Summary
- Add new `pull-request` skill for generating standardized Pull Requests
- Analyze diff between current branch and main branch
- Support both gh CLI submission and PR.md file generation
- Include comprehensive PR template based on best practices
## Motivation / Context
Creating consistent, well-documented PRs is important for code review efficiency.
This skill automates PR generation by analyzing git diff and following established patterns.
## Changes
### New Files
- `.claude/skills/pull-request/SKILL.md` - Pull Request generation skill definition
### Workflow
- Step 1: Gather branch and diff information
- Step 2: Analyze all commits since branch divergence
- Step 3: Generate PR content following template
- Step 4: Ask user for submission method
- Step 5: Execute chosen action (gh submit or save to file)
## Test Plan
- [ ] Run `/pull-request` on a feature branch with changes
- [ ] Verify PR title follows conventional commit format
- [ ] Verify summary captures all changes
- [ ] Test gh submission flow
- [ ] Test PR.md generation flow
When project has .github/PULL_REQUEST_TEMPLATE.md, fill in that template instead:
feat(test): add coverage merge and reporting support
### 关联 Issue
related: https://github.com/example/repo/issues/123
### 主要改动
1. 新增 `--coverage` 参数支持测试覆盖率收集
2. 创建 `merge-coverage.js` 脚本合并所有子包的覆盖率报告
3. 重新启用 CI 覆盖率报告功能
4. 排除编译后和自动生成的文件以获得准确的覆盖率统计
### 界面截图
N/A (无 UI 变更)
### 测试清单
- [x] 本次变更的地方已经有测试覆盖
- [ ] 本次变更的地方调整了测试覆盖
- [x] 本次变更的地方新增了测试覆盖
- [ ] 本次变更的兼容性测试覆盖了桌面端 Chrome
- [ ] 本次变更的兼容性测试覆盖了桌面端 Safari
- [ ] 本次变更的兼容性测试覆盖了移动端:ArcSphere + DID Wallet
- [ ] 本次变更有新增界面,且我检查了 light 模式下的展示效果
- [ ] 本次变更有新增界面,且我检查了 dark 模式下的展示效果
- [ ] 如果修改 domain 相关 issue, 请检查 server / service / 购买启动中 是否正常
### 检查清单
- [x] 这次变更包含 breaking change,我为 breaking change 编写了 migration script【如果不是 breaking change 可以勾选】
- [ ] 本次变更需要更新文档,并且我更新了相关文档,如果还没更新文档,请新建文档更新的 Issue 并关联上来
- [x] 本次变更中有用户输入的逻辑,用户输入的后端、前端都增加了校验、错误提示
- [ ] 本次变更中新增了修改后端数据的 API,我给这个 API 增加了 AuditLog
- [x] 本次变更中新增了修改后端数据的 API,且该接口返回的数据中不包含敏感信息
- [x] 本次变更新增了文件,对应 package.json 的 files 字段包括了这些新增的文件
- [ ] 本次变更增加了依赖,并且 core/blocklet-services 和 core/webapp 的前端依赖我放在了 devDependencies 里面
- [ ] 本次变更增加了 blocklet/sdk 的依赖,不会导致 bundle 失败
- [ ] 本次变更中有添加或更新 npm 依赖,并且没有导致同 1 个依赖出现多个版本
- [x] 本次变更我已经把 ArcBlock 的依赖升级到了最新
- [ ] (merge master 前检测) 成功 `make build`, `blocklet server init`, `blocklet server start`
- [ ] (merge master 前检测) 成功 `bn dev`, `bn dev --app-id xxx`
- [ ] (merge master 前检测) 我已阅读并理解了发布 beta 版 Server 的手册
---
Generated with [Claude Code](https://claude.com/claude-code)
.github/PULL_REQUEST_TEMPLATE.md before generating content