create-pr
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreate PR
创建PR
A skill for creating pull requests with automatic bilingual documentation updates. This skill ensures that both English and Chinese documentation stay in sync when code changes are submitted.
这是一项可自动更新双语文档的拉取请求创建技能。提交代码变更时,该技能可确保英文和中文文档保持同步。
When This Skill Activates
何时激活此技能
This skill activates when you:
- Ask to create a pull request or PR
- Say "submit my changes" or "push and create PR"
- Mention "make a PR" or "open a pull request"
- Want to submit code for review
当你进行以下操作时,此技能会激活:
- 请求创建拉取请求(PR)
- 说出“提交我的变更”或“推送并创建PR”
- 提及“发起PR”或“打开拉取请求”
- 希望提交代码以供审核
PR Creation Workflow
PR创建工作流
Step 1: Analyze Changes
步骤1:分析变更
Examine all changes in the current branch:
bash
git status
git diff
git log --oneline main..HEADIdentify:
- Modified files: What was changed?
- New files: What was added?
- Deleted files: What was removed?
- Impact area: Which skills or features are affected?
检查当前分支中的所有变更:
bash
git status
git diff
git log --oneline main..HEAD识别以下内容:
- 已修改文件:哪些内容被更改?
- 新增文件:添加了什么?
- 已删除文件:移除了什么?
- 影响范围:哪些技能或功能受到影响?
Step 2: Determine Documentation Updates
步骤2:确定文档更新需求
Check for Skill Changes
检查技能变更
First, detect if any skills were changed:
bash
undefined首先,检测是否有技能发生变更:
bash
undefinedCheck if skills/ directory has changes
检查skills/目录是否有变更
git diff --name-only main..HEAD | grep "^skills/"
undefinedgit diff --name-only main..HEAD | grep "^skills/"
undefinedDecision Matrix
决策矩阵
| Change Type | Documentation Action |
|---|---|
| New skill added | Add to skills table in both EN and CN README |
| Skill description changed | Update description in skills table |
| Skill removed | Remove from skills table |
| Skill hooks changed | Update Auto-Trigger column in skills table |
| Internal skill logic only | Skip README update |
| Bug fix with no user impact | Skip README update |
| 变更类型 | 文档操作 |
|---|---|
| 新增技能 | 在英文和中文README的技能表格中添加 |
| 技能描述变更 | 更新技能表格中的描述 |
| 移除技能 | 从技能表格中移除 |
| 技能钩子变更 | 更新技能表格中的自动触发列 |
| 仅技能内部逻辑变更 | 跳过README更新 |
| 无用户影响的Bug修复 | 跳过README更新 |
Auto-Trigger Changes Require Update
自动触发变更需更新文档
If a skill's front matter was modified, the Auto-Trigger column in the Skills Catalog must be updated:
metadata.hooksbash
undefined如果技能的前置元数据被修改,必须更新技能目录中的自动触发列:
metadata.hooksbash
undefinedCheck if hooks were modified
检查钩子是否被修改
git diff main..HEAD -- skills/*/SKILL.md | grep -E "^+.*metadata:|^+.*hooks:|^+.*trigger:"
If hooks changed → Update README.md and README.zh-CN.md Auto-Trigger column.git diff main..HEAD -- skills/*/SKILL.md | grep -E "^+.*metadata:|^+.*hooks:|^+.*trigger:"
若钩子发生变更 → 更新README.md和README.zh-CN.md中的自动触发列。Step 3: Draft Commit Message
步骤3:编写提交信息
Use the format:
commit-helper<type>(<scope>): <subject>
<body>
<footer>Types:
- : New skill or feature
feat - : Bug fix or correction
fix - : Documentation only changes
docs - : Code refactoring
refactor - : Maintenance tasks
chore
使用格式:
commit-helper<类型>(<范围>): <主题>
<正文>
<页脚>类型说明:
- : 新增技能或功能
feat - : Bug修复或修正
fix - : 仅文档变更
docs - : 代码重构
refactor - : 维护任务
chore
Step 4: Create the Pull Request
步骤4:创建拉取请求
Run the following sequence:
bash
undefined执行以下操作序列:
bash
undefined1. Stage and commit changes
1. 暂存并提交变更
git add .
git commit -m "commit message"
git add .
git commit -m "提交信息"
2. Push to remote
2. 推送到远程仓库
git push -u origin <branch-name>
git push -u origin <分支名称>
3: Create PR using gh CLI
3: 使用gh CLI创建PR
gh pr create
--title "PR title"
--body "PR description"
--title "PR title"
--body "PR description"
undefinedgh pr create
--title "PR标题"
--body "PR描述"
--title "PR标题"
--body "PR描述"
undefinedStep 5: Update Documentation (If Required)
步骤5:更新文档(如有需要)
After creating the PR, update both README files:
README.md (English):
- Add new skills to appropriate category table
- Update project structure if needed
- Keep language switch link at top
README.zh-CN.md (Chinese):
- Mirror all English changes
- Translate skill descriptions
- Maintain same structure and formatting
创建PR后,更新两个README文件:
README.md(英文):
- 将新技能添加到对应类别的表格中
- 必要时更新项目结构
- 保留顶部的语言切换链接
README.zh-CN.md(中文):
- 镜像所有英文变更
- 翻译技能描述
- 保持相同的结构和格式
Step 6: Update Changelog (Optional)
步骤6:更新变更日志(可选)
For significant changes, add to CHANGELOG.md:
markdown
undefined对于重大变更,添加到CHANGELOG.md:
markdown
undefined[Version] - YYYY-MM-DD
[版本号] - YYYY-MM-DD
Added
新增
- New skill: skill-name
- 新技能:skill-name
Fixed
修复
- Fixed issue in skill-name
- 修复skill-name中的问题
Changed
变更
- Updated skill-name with new features
undefined- 为skill-name更新新功能
undefinedDocumentation Update Guidelines
文档更新指南
Skills Catalog Update Template
技能目录更新模板
When adding or modifying skills, use this format for the Skills Catalog:
English (README.md):
markdown
undefined添加或修改技能时,使用以下格式更新技能目录:
英文(README.md):
markdown
undefinedCategory Name
类别名称
| Skill | Description | Auto-Trigger |
|---|---|---|
| skill-name | Brief description | Manual / Auto / Background / (keyword: "...") |
**Chinese (README.zh-CN.md):**
```markdown| Skill | Description | Auto-Trigger |
|---|---|---|
| skill-name | 简短描述 | Manual / Auto / Background / (keyword: "...") |
**中文(README.zh-CN.md):**
```markdown类别名称
类别名称
| 技能 | 描述 | 自动触发 |
|---|---|---|
| skill-name | 简短描述 | 手动 / 自动 / 后台 / (关键词:"...") |
undefined| 技能 | 描述 | 自动触发 |
|---|---|---|
| skill-name | 简短描述 | 手动 / 自动 / 后台 / (关键词:"...") |
undefinedAuto-Trigger Column Values
自动触发列取值
| Value | Meaning | Example |
|---|---|---|
| User must invoke | Most development skills |
| Triggers automatically after any skill | session-logger |
| Runs non-blocking after related skill | self-improving-agent |
| Only triggers when skills are modified | create-pr |
| Activates on specific keyword | prd-planner (keyword: "PRD") |
| 取值 | 含义 | 示例 |
|---|---|---|
| 需用户手动调用 | 大多数开发技能 |
| 任意技能执行后自动触发 | session-logger |
| 相关技能执行后非阻塞运行 | self-improving-agent |
| 仅在技能被修改时触发 | create-pr |
| 特定关键词触发 | prd-planner (keyword: "PRD") |
When to Update README
何时更新README
Always update when:
- Adding a new skill
- Removing a skill
- Changing skill names or descriptions
- Restructuring the skills directory
Consider updating when:
- Adding significant features to existing skills
- Changing installation instructions
- Modifying project structure
Skip updating when:
- Internal code refactoring with no user impact
- Minor typo fixes
- Test file changes
必须更新的情况:
- 添加新技能
- 移除技能
- 修改技能名称或描述
- 重构技能目录结构
建议更新的情况:
- 为现有技能添加重大功能
- 修改安装说明
- 调整项目结构
无需更新的情况:
- 无用户影响的内部代码重构
- 轻微拼写错误修复
- 测试文件变更
Bilingual Update Format
双语更新格式
When adding a new skill to the skills table:
English (README.md):
markdown
| **[skill-name](./skills/skill-name/)** | Brief skill description |Chinese (README.zh-CN.md):
markdown
| **[skill-name](./skills/skill-name/)** | 技能简短描述 |在技能表格中添加新技能时:
英文(README.md):
markdown
| **[skill-name](./skills/skill-name/)** | Brief skill description |中文(README.zh-CN.md):
markdown
| **[skill-name](./skills/skill-name/)** | 技能简短描述 |Language Switch Link
语言切换链接
Both README files must have the language switch at the top:
README.md:
markdown
English | [简体中文](./README.zh-CN.md)README.zh-CN.md:
markdown
[English](./README.md) | 简体中文两个README文件顶部必须包含语言切换链接:
README.md:
markdown
English | [简体中文](./README.zh-CN.md)README.zh-CN.md:
markdown
[English](./README.md) | 简体中文PR Description Template
PR描述模板
When creating a PR, use this template:
markdown
undefined创建PR时,使用以下模板:
markdown
undefinedSummary
摘要
<Brief description of what this PR does>
<本PR的简要说明>
Changes
变更内容
- New skill added
- Existing skill modified
- Documentation updated
- Tests added/updated
- 新增技能
- 修改现有技能
- 更新文档
- 添加/更新测试
Skills Affected
受影响的技能
- : Description of change
skill-name
- : 变更说明
skill-name
Documentation
文档情况
- README.md updated
- README.zh-CN.md updated
- CHANGELOG.md updated (if applicable)
- README.md已更新
- README.zh-CN.md已更新
- CHANGELOG.md已更新(如适用)
Test Plan
测试计划
- Skill tested in Claude Code
- Documentation links verified
- Bilingual translations checked
🤖 Generated with Claude Code
undefinedCommon Scenarios
常见场景
Scenario 1: Adding a New Skill
场景1:添加新技能
bash
undefinedbash
undefined1. Create skill files
1. 创建技能文件
mkdir -p skills/new-skill
touch skills/new-skill/SKILL.md
touch skills/new-skill/README.md
mkdir -p skills/new-skill
touch skills/new-skill/SKILL.md
touch skills/new-skill/README.md
2. Create symlink
2. 创建符号链接
ln -s ~/path/to/agent-playbook/skills/new-skill/SKILL.md ~/.claude/skills/new-skill.md
ln -s ~/path/to/agent-playbook/skills/new-skill/SKILL.md ~/.claude/skills/new-skill.md
3. Update README.md (add to skills table)
3. 更新README.md(添加到技能表格)
4. Update README.zh-CN.md (add to skills table with translation)
4. 更新README.zh-CN.md(添加到技能表格并翻译)
5. Commit and push
5. 提交并推送
git add skills/new-skill/ README.md README.zh-CN.md
git commit -m "feat: add new-skill for ..."
git push -u origin feature/add-new-skill
git add skills/new-skill/ README.md README.zh-CN.md
git commit -m "feat: add new-skill for ..."
git push -u origin feature/add-new-skill
6. Create PR
6. 创建PR
gh pr create --title "feat: add new-skill" --body "..."
undefinedgh pr create --title "feat: add new-skill" --body "..."
undefinedScenario 2: Modifying an Existing Skill
场景2:修改现有技能
bash
undefinedbash
undefined1. Make changes to skill
1. 修改技能内容
vim skills/existing-skill/SKILL.md
vim skills/existing-skill/SKILL.md
2. Check if description changed
2. 检查描述是否变更
git diff skills/existing-skill/SKILL.md
git diff skills/existing-skill/SKILL.md
3. If description changed, update README files
3. 若描述变更,更新README文件
4. Commit, push, create PR
4. 提交、推送并创建PR
undefinedundefinedScenario 3: Bug Fix Only
场景3:仅修复Bug
bash
undefinedbash
undefined1. Fix the bug
1. 修复Bug
vim skills/some-skill/SKILL.md
vim skills/some-skill/SKILL.md
2. Commit and push (no README update needed)
2. 提交并推送(无需更新README)
git add skills/some-skill/SKILL.md
git commit -m "fix: correct typo in some-skill"
git push
git add skills/some-skill/SKILL.md
git commit -m "fix: correct typo in some-skill"
git push
3. Create PR
3. 创建PR
gh pr create --title "fix: correct typo in some-skill"
undefinedgh pr create --title "fix: correct typo in some-skill"
undefinedVerification Checklist
验证清单
Before creating the PR, verify:
- All changes are committed
- Branch is pushed to remote
- Commit messages follow Conventional Commits
- README.md is updated if needed
- README.zh-CN.md is updated if needed
- Language switch links are present in both READMEs
- New skills have symlinks created
- PR title is clear and descriptive
- PR description includes summary and changes
创建PR前,请验证以下内容:
- 所有变更已提交
- 分支已推送到远程仓库
- 提交信息符合约定式提交规范
- 必要时已更新README.md
- 必要时已更新README.zh-CN.md
- 两个README文件中均存在语言切换链接
- 新技能已创建符号链接
- PR标题清晰且具有描述性
- PR描述包含摘要和变更内容
Quick Reference
快速参考
| Command | Purpose |
|---|---|
| Check current state |
| See unstaged changes |
| See branch commits |
| Stage all changes |
| Commit with message |
| Push to remote |
| Create pull request |
| 命令 | 用途 |
|---|---|
| 检查当前状态 |
| 查看未暂存的变更 |
| 查看分支提交记录 |
| 暂存所有变更 |
| 提交并添加信息 |
| 推送到远程分支 |
| 创建拉取请求 |
Tips
小贴士
- Commit first, PR later: Always commit changes before creating PR
- Small PRs: Keep PRs focused on a single change
- Clear titles: Use Conventional Commits in PR titles
- Bilingual sync: Always update both README files together
- Test skills: Verify skills work before submitting PR
- 先提交,再创建PR:创建PR前务必先提交变更
- 小PR原则:每个PR聚焦于单一变更
- 清晰标题:PR标题使用约定式提交规范
- 双语同步:始终同时更新两个README文件
- 测试技能:提交PR前验证技能可正常工作