一键导入
create-pr
Validate tests and docs, then create a GitHub PR with conventional commit formatting
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Validate tests and docs, then create a GitHub PR with conventional commit formatting
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Fetch unresolved PR review comments, validate them, plan fixes, implement, push, and resolve threads
Review code changes for performance, tree-shaking, bundle size, API ergonomics, and TypeScript best practices
基于 SOC 职业分类
| name | create-pr |
| description | Validate tests and docs, then create a GitHub PR with conventional commit formatting |
| disable-model-invocation | true |
| argument-hint | ["base branch"] |
Validate that all tests and documentation pass, then create a well-formatted GitHub PR for the current branch.
Current branch:
!git branch --show-current
Repository:
!git remote get-url origin 2>&1
Commits on this branch (vs main):
!git log --oneline main..HEAD 2>&1 || git log --oneline origin/main..HEAD 2>&1 || echo "Could not determine commits"
Changed files (vs main):
!git diff --stat main..HEAD 2>&1 || git diff --stat origin/main..HEAD 2>&1 || echo "Could not determine changes"
Existing open PR for this branch:
!gh pr view --json number,title,url,state 2>&1 || echo "NO_EXISTING_PR"
$ARGUMENTS
If $ARGUMENTS specifies a base branch, use that instead of the default branch.
Follow these steps in strict order. Do NOT skip ahead.
main. If it is, stop and tell the user to create a feature branch first.Signed-off-by: line:git log main..HEAD --format="%h %s" --no-merges | while read hash rest; do
if ! git log -1 --format="%b" "$hash" | grep -q "^Signed-off-by:"; then
echo "MISSING DCO: $hash $rest"
fi
done
If any commits are missing DCO sign-off, report them and stop. Instruct the user to fix with:
git rebase main --exec "git commit --amend --signoff --no-edit"
Do NOT create the PR until all commits have DCO sign-off.
Examine the commit history and changed files to determine which libs/* packages were modified. This determines which workspaces need building, testing, and which scopes to use in the PR title.
Build each affected package:
npm run build -w libs/<package>
If a build fails, report the error and stop. Do NOT create the PR.
Run tests for each affected package:
npm test -w libs/<package>
If any test fails, report the error and stop. Do NOT create the PR.
npm run typecheck
If the typecheck fails on files within libs/ (ignore pre-existing errors in node_modules), report the error and stop. Do NOT create the PR.
Build the documentation to catch TSDoc errors, broken {@includeCode} references, and missing documentation:
npm run build -w docs
Review the output for warnings and errors. If there are documentation errors related to the changed packages, report them and stop. Do NOT create the PR.
Search for related open issues in the repository:
gh issue list --state open --json number,title --limit 50
Also check the commit messages and branch name for issue references (e.g., #123, issue-123, fixes-123).
Present any potentially related issues to the user and ask which (if any) should be referenced in the PR.
Follow conventional commit format. The title must be under 70 characters.
Pattern: <type>(<scope>): <short description>
Types:
feat - New feature or public API additionfix - Bug fixrefactor - Code change that neither fixes a bug nor adds a featuredocs - Documentation only changestest - Adding or correcting testschore - Maintenance, tooling, or dependency updatesbuild - Changes that affect the build systemperf - Performance improvementScope: The package name without the libs/ prefix (e.g., cmcd, iso-bmff, utils). If multiple packages are affected, use the primary package or omit the scope.
Examples:
feat(cmcd): add CmcdReporter classfix(iso-bmff): handle non-zero byteOffset in parsePsshListrefactor(utils): rename RequestType to ResponseTypefeat: add throughput measurement libraryUse this template:
## Summary
<1-4 bullet points describing what changed and why>
## Packages Changed
| Package | Version | Change Type |
|---------|---------|-------------|
| @svta/cml-<name> | x.x.x | feat/fix/etc |
## Test Plan
- [ ] <specific test scenarios that validate the changes>
Refs: <issue references>
Refs footer rules:
Fixes #N if the PR fully resolves an issue (this auto-closes the issue on merge)Refs #N if the PR is related but does not fully resolve the issueRefs: #12, #34, Fixes #56Refs: line entirely if there are no related issuesShow the user the complete PR title and description. Ask for approval or revisions. The user may:
Do NOT create the PR until the user explicitly approves.
git push -u origin <branch-name>
gh pr create --base <base-branch> --title "<title>" --body "$(cat <<'EOF'
<description>
EOF
)"
-u to set up tracking if not already configured.git commit -s and include Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> in the message body. If you need to fix issues discovered during validation (Steps 2-5), commit the fixes with these requirements before proceeding.