构建 GitHub 搜索查询
form-github-search-query
根据自然语言查询和搜索类型(issue 或 PR)生成 GitHub 搜索查询语句。此技能帮助用户创建有效的搜索查询,以在 GitHub 上找到相关的 issue 或 pull request。
- License 许可
- MIT
- 最近更新
- 2026-11-13
- Stars
- ★ 2.6k
- Forks
- 818
01 前言 Front Matter
- name
- form-github-search-query
- description
- Forms a GitHub search query based on a natural language query and the type of search (issue or PR). This skill helps users create effective search queries to find relevant issues or pull requests on GitHub.
03 SKILL.md 正文
Form GitHub Search Query
Purpose
GitHub has a specific syntax for searching issues and pull requests. This skill takes a natural language query from the user and the type of search they want to perform (issue or PR) and converts it into a properly formatted GitHub search query. This allows users to leverage GitHub's powerful search capabilities without needing to know the specific syntax.
Usage
To use this skill, provide a natural language query and specify whether you want to search for issues or pull requests. The skill will then analyze the input and generate a GitHub search query that can be used to find relevant results on GitHub.
Converting Natural Language to GitHub Search Syntax
Steps
- Identify if there's a repo mention in the query.
- Fetch labels for the repo if mentioned.
- Follow the "Tips for Forming Effective Search Queries" to convert the natural language query into GitHub search syntax.
Search Syntax Overview
- is: { possibleValues: ['issue', 'pr', 'draft', 'public', 'private', 'locked', 'unlocked'] }
- assignee: { valueDescription: 'A GitHub user name or @me' }
- author: { valueDescription: 'A GitHub user name or @me' }
- mentions: { valueDescription: 'A GitHub user name or @me' }
- team: { valueDescription: 'A GitHub user name' }
- commenter: { valueDescription: 'A GitHub user name or @me' }
- involves: { valueDescription: 'A GitHub user name or @me' }
- label: { valueDescription: 'A GitHub issue/pr label' }
- type: { possibleValues: ['pr', 'issue'] }
- state: { possibleValues: ['open', 'closed', 'merged'] }
- in: { possibleValues: ['title', 'body', 'comments'] }
- user: { valueDescription: 'A GitHub user name or @me' }
- org: { valueDescription: 'A GitHub org, without the repo name' }
- repo: { valueDescription: 'A GitHub repo, without the org name' }
- linked: { possibleValues: ['pr', 'issue'] }
- milestone: { valueDescription: 'A GitHub milestone' }
- project: { valueDescription: 'A GitHub project' }
- status: { possibleValues: ['success', 'failure', 'pending'] }
- head: { valueDescription: 'A git commit sha or branch name' }
- base: { valueDescription: 'A git commit sha or branch name' }
- comments: { valueDescription: 'A number' }
- interactions: { valueDescription: 'A number' }
- reactions: { valueDescription: 'A number' }
- draft: { possibleValues: ['true', 'false'] }
- review: { possibleValues: ['none', 'required', 'approved', 'changes_requested'] }
- reviewedBy: { valueDescription: 'A GitHub user name or @me' }
- reviewRequested: { valueDescription: 'A GitHub user name or @me' }
- userReviewRequested: { valueDescription: 'A GitHub user name or @me' }
- teamReviewRequested: { valueDescription: 'A GitHub user name' }
- created: { valueDescription: 'A date, with an optional < >' }
- updated: { valueDescription: 'A date, with an optional < >' }
- closed: { valueDescription: 'A date, with an optional < >' }
- no: { possibleValues: ['label', 'milestone', 'assignee', 'project'] }
- sort: { possibleValues: ['updated', 'updated-asc', 'interactions', 'interactions-asc', 'author-date', 'author-date-asc', 'committer-date', 'committer-date-asc', 'reactions', 'reactions-asc', 'reactions-(+1, -1, smile, tada, heart)'] }
Example Queries
- repo:microsoft/vscode is:issue state:open sort:updated-asc
- mentions:@me org:microsoft is:issue state:open sort:updated
- assignee:@me milestone:"October 2024" is:open is:issue sort:reactions
- comments:>5 org:contoso is:issue state:closed mentions:@me label:bug
- interactions:>5 repo:contoso/cli is:issue state:open
- repo:microsoft/vscode-python is:issue sort:updated -assignee:@me
- repo:contoso/cli is:issue sort:updated no:milestone
Tips for Forming Effective Search Queries
- Always try to include "repo:" or "org:" in your response.
- "repo" is often formated as "owner/name".
- If the user specifies a repo, ALWAYS fetch the labels for that repo and try to match any words in the natural language query to the label names to include them in the search query (See "Adding Labels to the Search Query" section).
- Words in inline codeblocks are likely to refer to labels. Try to match them to labels in the repo and include them in the search query.
- Always include a "sort:" parameter. If multiple sorts are possible, choose the one that the user requested.
- Always include a property with the @me value if the query includes "me" or "my".
- Go through each word of the natural language query and try to match it to a syntax component.
- Use a "-" in front of a syntax component to indicate that it should be "not-ed".
- Use the "no" syntax component to indicate that a property should be empty.
Adding Labels to the Search Query
- Choose labels based on what the user wants to search for, not based on the actual words in the query.
- The user might include info on how they want their search results to be displayed. Ignore all of that.
- Labels will be and-ed together, so don't pick a bunch of super specific labels.
- Try to pick just one label.
- Only choose labels that you're sure are relevant. Having no labels is preferable than labels that aren't relevant.
- Don't choose labels that the user has explicitly excluded.
04 同仓库更多 Skills
GitHub 议题/PR/通知内容摘要
summarize-github-issue-pr-notification
总结 GitHub 议题(issue)、拉取请求(PR)或通知的内容,提供要点和关键细节的简明概述。当被要求总结议题、PR 或通知时,始终使用该技能。
问题修复方案建议
suggest-fix-issue
给定问题的详细信息,为该问题建议修复方案。
GitHub 搜索结果汇总展示
show-github-search-result
将 GitHub 搜索查询的结果汇总为易于阅读和理解、人性化的 markdown 表格。在展示 GitHub 搜索查询结果时务必使用此技能。
创建 GitHub Pull Request
create-pull-request
从当前分支或指定分支创建 GitHub Pull Request。使用场景:发起 PR、提交代码供审查、创建草稿 PR、将分支发布为拉取请求、向仓库提议变更。
处理 PR 审查意见
address-pr-comments
处理当前 Pull Request 上的审查意见(包括 Copilot 的评论)。使用场景:回复 PR 反馈、修复审查意见、解决 PR 讨论线程、实现审查者要求的变更、处理代码审查、修复 PR 问题。
CHANGELOG.md 更新日志编写
write-changelog
为新扩展版本编写 CHANGELOG.md 条目。使用场景:编写更新日志、更新 changelog、添加发布说明、准备发布、记录里程碑变更。需要提供里程碑名称和扩展版本号。