一键导入
pr-writing
Use when creating PRs, writing commit messages, managing branches, or preparing code for merge
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when creating PRs, writing commit messages, managing branches, or preparing code for merge
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Execute safe Git workflows — branching, committing, resolving conflicts, and managing PRs
Use when controlling AI spend, token budgets, model routing, or workflow efficiency before scaling usage
Use when handling incidents, outages, severe regressions, or operational emergencies before attempting broad fixes
Use when investigating latency, throughput, resource saturation, or performance regressions before changing implementation details
Use when reviewing code, preparing a PR for review, or processing review feedback
Use when diagnosing bugs, test failures, or unexpected behavior before attempting any fix
| name | pr-writing |
| description | Use when creating PRs, writing commit messages, managing branches, or preparing code for merge |
Announce at start: "Following the pr-writing skill for this submission."
Use Conventional Commits format:
<type>(<scope>): <description>
[Optional body with context]
[Optional footer with references]
| Type | When | Example |
|---|---|---|
feat | New functionality | feat(auth): add password reset flow |
fix | Bug fixes | fix(api): handle null user in profile endpoint |
refactor | Code changes (no behavior change) | refactor(db): extract query builder |
test | Adding/modifying tests | test(auth): add edge cases for token expiry |
docs | Documentation changes | docs: update API reference |
chore | Maintenance | chore(deps): update express to 4.19 |
## Summary
[One paragraph: what this PR does and why]
## Changes
- [Key change 1]
- [Key change 2]
## Testing
- [ ] Unit tests added/updated
- [ ] Integration tests pass
- [ ] Manually tested: [scenarios]
## Evidence
[Test output, screenshots, or other proof]
## Risks and Rollback
- Risk: [What could go wrong]
- Rollback: [How to undo]
| Rule | Rationale |
|---|---|
| Human is always the author | Humans are accountable; AI is a tool |
| Never set AI as commit co-author | AI should not appear in git authorship |
| Never include "Generated with [AI tool]" in PR descriptions | Unless the PR directly relates to that tool |
| Note AI usage in PR body if significant | Transparency for reviewers |
<type>/<short-description>
| Branch | Purpose |
|---|---|
feat/user-auth | New feature |
fix/login-null-check | Bug fix |
refactor/api-layer | Code cleanup |
chore/deps-update | Maintenance |
| Scenario | Action |
|---|---|
| Multiple iteration commits | Squash into one logical commit |
| Failed experiments | Drop entirely |
| Independent fixes | Keep separate |
| WIP "save work" commits | Squash |
| When | Invoke |
|---|---|
| PR needs tests | testing |
| PR needs code review | code-review |
| PR has security implications | secure-coding |
For principles, rationale, anti-patterns, and examples:
guides/git-workflows-ai/git-workflows-ai.md