github-pr-description
它能做什么
这项技能读取你分支的提交和修改,撰写完整的拉取请求描述,并用 GitHub 命令行工具创建拉取请求。适合希望获得清晰描述、又不想手写的开发者。
适用场景
- ✓当你准备好开启拉取请求,并希望有一份清晰的描述的时候。
- ✓当你的分支有多次提交,需要向审阅者解释清楚的时候。
- ✓当你希望描述涵盖改了什么、为什么改,以及如何测试的时候。
技能链接
https://github.com/tailcallhq/forgecode/blob/main/crates/forge_repo/src/skills/github-pr-description/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“你能为我的分支写一份拉取请求描述,并开启这个拉取请求吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体检查分支,读取提交信息和差异,选择变更类型,然后撰写描述。接着它用 GitHub 工具创建拉取请求。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Create PR Description
Generate comprehensive pull request descriptions and create PRs using GitHub CLI.
Workflow
1. Verify Prerequisites
Check that there are changes to create a PR for:
# Get current branch
git branch --show-current
# Verify branch is not main/master
# Verify there are commits ahead of main
git log origin/main..HEAD --oneline
If on main/master or no commits ahead, inform the user there's nothing to create a PR for.
2. Analyze Changes
Gather context about the changes:
# Get commit messages
git log origin/main..HEAD --pretty=format:"%s"
# Get diff summary (files changed)
git diff origin/main..HEAD --stat
# Get actual code changes (sample key files if diff is large)
git diff origin/main..HEAD
For large diffs: Focus on the most meaningful changes. Sample key files rather than reading everything.
3. Determine Change Type
Classify the PR into one of these categories:
- fix: Bug fixes, error corrections, resolving issues
- feature: New functionality, capabilities, or enhancements
- performance: Speed improvements, optimization, efficiency gains
- refactor: Code restructuring without changing behavior
- docs: Documentation changes
- test: Test additions or improvements
- chore: Maintenance tasks, dependencies, configuration
Base this on:
- Commit messages (keywords like "fix", "add", "optimize", "refactor")
- Nature of code changes (new files = feature, test fixes = fix, etc.)
- Scope of changes
4. Generate Description
Create a comprehensive description with this structure:
## Summary
[One sentence explaining what this PR does and why it matters]
## Context
[Background information, related issues, previous work, or the problem being solved]
## Changes
[High-level description of what changed]
### Key Implementation Details
[Technical details that help reviewers understand the approach, especially for complex changes]
## Use Cases
[Concrete examples of how this will be used - helps reviewers understand practical value]
## Testing
[How to test the changes - step-by-step instructions]
## Links
- Related issues: #123, #456
- Documentation: URL (if applicable)
- Original implementation: URL (if applicable)
Description Guidelines
Essential Elements:
- Summary: One clear sentence explaining the change and its value
- Context: Why this change was needed, what problem it solves
- Changes: What was actually changed at a high level
- Testing: How reviewers can verify the changes
Optional but Recommended:
- Implementation Details: For complex changes, explain the technical approach
- Use Cases: Concrete examples of how the feature will be used
- Links: Related issues, documentation, papers, or original implementations
- Known Issues: Any limitations or known problems
What to Avoid:
- Empty descriptions or just issue links
- Placeholder text like "Fixes #(issue)"
- File-by-file breakdowns (unless necessary)
- Low-level implementation details (keep it high-level)
- Boilerplate statements
- Personal checklists as the main description
Description Examples
Example 1: Feature Addition
## Summary
Add semantic code search to enable searching codebase by concepts and behavior rather than exact string matching.
## Context
Currently, users can only search using exact string matching, which makes it difficult to find code based on functionality or behavior. This has been a recurring request in issues #123 and #456.
## Changes
- Implemented semantic search using vector embeddings
- Integrated with existing search interface
- Added support for multiple concurrent queries with result aggregation
- Configurable search scope (entire codebase or specific directories)
### Key Implementation Details
Uses OpenAI embeddings for code representation and cosine similarity for matching. Index is built incrementally to support large codebases. Search results are reranked based on code context and usage patterns.
## Use Cases
- Find authentication flow without knowing exact function names
- Locate retry logic across the codebase
- Search for "database connection" patterns
## Testing
```bash
# Run the search service
npm run search:dev
# Test semantic queries
curl -X POST http://localhost:3000/search \
-H "Content-Type: application/json" \
-d '{"query": "user authentication"}'
Links
- Related issues: #123, #456
- Documentation: /docs/semantic
常见问题
如果我在主分支上怎么办?
技能会停止运行,因为从主分支开启拉取请求没有意义。
它如何处理较大的修改?
它重点关注最重要的修改,而不是逐行阅读。
它需要 GitHub CLI 吗?
需要。它使用 gh 命令行工具创建拉取请求。
详情
作者的原始描述
Generate and create pull request descriptions automatically using GitHub CLI. Use when the user asks to create a PR, generate a PR description, make a pull request, or submit changes for review. Analyzes git diff and commit history to create comprehensive, meaningful PR descriptions that explain what changed, why it matters, and how to test it.
repo: tailcallhq/forgecode
热度
- GitHub 星标
- 7.6k
- 排名
- #13118
- 许可证
- Apache-2.0
- 更新时间
- 2026/11/1
评论
- …
同一仓库的更多技能
create-agent
7.6k教你的智能体为 Forge 编程应用创建或修改自定义智能体,这些智能体以 markdown 文件保存,顶部为设置。
create-command
7.6k教你的智能体为 Forge 编程应用创建可复用的命令,以按顺序执行的 markdown 步骤编写。
create-github-issue
7.6k帮你的智能体提交一个遵循代码仓库自身议题模板的 GitHub 议题,并填写正确的字段和标签。
create-plan
7.6k帮你的智能体在修改任何代码之前,为一项复杂任务编写详细的实施计划,包括步骤、风险和备选方案。