GitHub 解决方案研究
英文名称: GitHub Solution Research
类型: 数据分析 |
原作者: Jia-Ethan |
发布者/贡献者: HAOSkill GitHub 同步 |
协同共创极客: 无 |
配置完整度: 90%
Skill 描述
通过搜索 GitHub 上的开源项目、问题、PR、代码和示例,找到并适配解决具体工程问题的现有方案。
Skill 内容
--- name: github-solution-research description: Use when a concrete engineering problem, bug, integration failure, dependency issue, unclear API usage, implementation blocker, or tool/capability need may already have a proven solution in GitHub open-source projects, issues, pull requests, discussions, code, examples, or release notes. Use it to find suitable repositories, report project basics including Stars when a repo-level solution applies, and adapt the existing solution with minimal local changes. --- # GitHub Solution Research Use GitHub as problem-solving evidence and an implementation source. The goal is to find open-source projects and GitHub evidence that already solve the user's specific engineering problem, report the relevant project information, then translate the existing solution into a local fix, implementation path, or verification plan. This skill is for concrete problems first. For general tool or architecture selection, use it only after the local goal has been framed as a specific capability, blocker, workflow, or integration need. ## When to Use - Runtime, build, test, deploy, package, SDK, API, dependency, framework, or integration errors. - A feature implementation is blocked by an unclear edge case, missing usage pattern, or uncertain API behavior. - A local issue resembles something that maintainers or other open-source users may have resolved in issues, PRs, examples, code, or release notes. - The user asks whether GitHub/open-source projects can solve the same problem. - Mature implementation examples or reusable projects would reduce uncertainty for one concrete capability. - The answer should compare suitable GitHub repositories and explain how to use one with local adaptation. Do not use for tiny edits, copy changes, local-only refactors where the codebase already dictates the answer, or requests that explicitly forbid web/GitHub research. Do not inspect private repositories unless the user explicitly scopes and authorizes that access. ## Default Workflow 1. **Frame the problem locally first.** Capture the goal, actual symptom, error signature, reproduction path, versions, runtime, dependency/framework names, recent changes, constraints, and attempted fixes. If a discoverable fact is missing, inspect local files/logs before asking. 2. **Choose the evidence mode.** For errors/regressions, search issues, PRs, releases, and code first. For capability or tool needs, search repository candidates first. For feature implementation, use both repository candidates and issue/PR/code evidence. 3. **Evaluate subagent usefulness.** Before substantial GitHub research, decide whether conditional subagent work would improve breadth, evidence quality, or review coverage. If not using subagents, state the reason briefly when reporting the search path. 4. **Create targeted searches.** Prefer exact error text, package/API names, version numbers, framework + symptom, file names, config keys, stack trace fragments, failing command names, or capability + framework/runtime/API names. 5. **Find suitable GitHub projects when relevant.** Prefer high-fit, high-Star, active, non-archived repositories with clear licenses and real examples. Lower the Star threshold when the high-Star set is too broad or misses the exact problem. 6. **Search GitHub evidence surfaces.** Use issues, PRs, discussions, code, examples, release notes, and official project docs within relevant open-source repos. Repository search is required when a project itself may solve the problem. 7. **Rank by problem fit first, with Stars as a strong maturity signal.** A high-Star repository is a strong candidate for inspection, but maintainer-confirmed issues, merged PRs, released fixes, official examples, and exact matching code beat popular adjacent projects. Use [research-rubric.md](references/research-rubric.md) when ranking matters. 8. **Deep-read the strongest projects and evidence.** Use [extraction-playbook.md](references/extraction-playbook.md) to extract project basics, reusable surfaces, root cause or implementation pattern, version constraints, risks, adaptation boundaries, and verification steps. 9. **Translate to local work with minimal adaptation.** Prefer the existing GitHub solution's public workflow, API, or architecture. Adapt only the parts required by the user's local interfaces, configuration, data/auth model, deployment target, or language/runtime. 10. **If evidence is weak, say so.** Do not stretch weak matches into a confident recommendation. Mark the recommendation as first-principles or local-only when GitHub evidence is insufficient. ## Subagent / Parallel Research Guidance Subagents are conditional research aids, not a default requirement. The controller remains responsible for problem framing, scope control, evidence ranking, local adaptation, and final verification. Use subagents when at least one of these applies: - The problem spans 2+ independent ecosystems, frameworks, languages, tools, deployment surfaces, or GitHub communities. - Repository discovery needs broad candidate coverage across multiple query families. - Issue, PR, discussion, code, release, and example evidence can be split cleanly by project, version, or search surface. - A final recommendation benefits from independent evidence review, risk review, or candidate rejection review. Do not use subagents when any of these applies: - The task is a narrow error with one obvious package, repository, API, or maintainer surface. - Local repository context, logs, config, or reproduction details must be understood before external research can be scoped safely. - GitHub rate limits, authorization boundaries, private repositories, secrets, production data, or sensitive logs would make delegation risky. - Subagents would mostly duplicate the same searches or edit the same local files. When using subagents, the controller must: - Define each subagent's query family, repository scope, evidence surface, constraints, allowed write scope, and expected output. - Require direct links, verified metadata, problem-fit rationale, risk notes, and explicit rejection reasons. - Keep subagents read-only unless a separate implementation phase has a narrow allowed write scope. - Merge and deduplicate results before ranking; do not count repeated reports of the same issue, PR, code path, or repository as independent evidence. - Directly verify the strongest claims with `gh`, source reads, tests, logs, real requests, or official docs before finalizing. ## GitHub CLI First Use the GitHub CLI (`gh`) as the default search and inspection surface. Prefer `gh search repos`, `gh search issues`, `gh search prs`, `gh search code`, `gh repo view`, `gh issue view`, `gh pr view`, and `gh api` before browser scraping or custom scripts. Do not add or rely on bundled search scripts for this skill. Use these short command templates as starting points, then adjust the query, repo, fields, and limits to the local problem: ```bash gh search repos "<query>" --archived=false --sort stars --order desc --limit 10 --json fullName,url,description,stargazersCount,forksCount,language,license,pushedAt,isArchived,openIssuesCount gh search issues "<query>" --repo owner/repo --sort updated --order desc --limit 10 --json title,url,state,updatedAt,commentsCount,repository,body gh search prs "<query>" --repo owner/repo --merged --sort updated --order desc --limit 10 --json title,url,state,updatedAt,commentsCount,repository,body gh search code "<query>" --repo owner/repo --limit 10 --json path,url,repository,sha gh repo view owner/repo --json nameWithOwner,url,description,stargazerCount,forkCount,licenseInfo,primaryLanguage,pushedAt,repositoryTopics,homepageUrl gh api -X GET search/repositories -f q='<query> archived:false' -f sort=stars -f order=desc ``` Only run `gh auth status` when a command fails with 403, 429, a private repository authorization error, or an explicit `gh` not-authenticated message. If GitHub returns 403/429, inspect the emitted rate-limit or authorization context before retrying, reducing breadth, or switching endpoints. Do not paste or persist tokens, cookies, private repository contents, or credentials in prompts, files, logs, or memory. ## Search Strategy - Start narrow: exact error string, exception class, CLI output, package + method name, config key, or stack trace fragment. - Add constraints: package/framework version, language, platform, deployment target, bundler, database, auth provider, or runtime. - Search surfaces in this order when relevant: issues/PRs/discussions, merged fixes, release notes/changelog, examples/templates, source code, then repository-level candidates. - For implementation blockers without an error, search for the desired capability plus framework/runtime/API names. - For public platform data needs such as trends, hot lists, topic search, or engagement metrics, do not start with visual browser scraping. First look for reusable public endpoints, open-source crawlers, archived datasets, and API field evidence; then verify the chosen source with a minimal real request and clearly separate anonymous hot-list data from logged-in search/topic data. - For reusable project discovery, search repositories sorted by Stars, then deep-read only candidates that match the local problem. Record Stars, forks, language, license, activity, and basic content. - Demote matches that are old, version-mismatched, archived, unresolved, speculative, or based only on user guesses. - Use Stars/forks only as supporting maturity context and tie-breakers among similarly fitting repositories. They do not override problem fit, maintainer-confirmed evidence, merged PRs, release notes, official examples, or reproducible code. - For security, auth, payments, infrastructure, or production operations, cross-check open-source findings against current official docs or repositories when facts may have changed. ## Evidence Standard For each serious evidence item, identify: - exact match: same error, behavior, API, version, environment, or workflow; - evidence strength: maintainer confirmation, merged PR, released fix, reproducible code example, test fixture, or repeated independent reports; - applicability: what conditions must match locally for the solution to apply; - implementation value: patch, config, API usage, dependency version, workflow, test, or operational pattern worth adapting; - project basics when a repository is a candidate: name, URL, Stars, forks, language, license, activity, basic content, fit rationale, and adaptation cost; - risk: stale version, unresolved issue, unsafe workaround, license concern, security/privacy impact, deployment mismatch, or overbroad change. ## Output Contract When this skill materially affects the answer, include: - local problem profile: goal, symptom/error, versions/environment, and local constraints; - search path: queries or discovery methods used, GitHub surfaces searched, and whether subagents were used or skipped; - subagent trace when subagents were used: each subagent's scope, evidence surfaces, key findings, rejected candidates, deduplication results, and which claims the controller directly verified; - project candidates when a GitHub project itself is relevant: repo link, Stars, forks, language, license, activity, basic content, match rationale, and how it can be used locally; - key evidence: links to issues, PRs, code, examples, releases, or repos, with match rationale; - recommended solution: what to reuse directly, what to adapt locally, what to avoid copying, and why it fits; - rejected or risky options: why they do not apply or need caution; - verification standard: test, build, reproduction command, real request, or manual check required to confirm the fix; - confidence label when evidence is weak or no strong GitHub solution was found. When repository-level solutions are relevant, include a compact project table. For pure issue/PR/code fixes, the table is optional, but include repository context if it affects trust or applicability. Do not answer with only links, Stars, or popularity rankings. Do not write "common GitHub pattern" without linked evidence. Do not let external examples override local constraints. For website, SaaS, landing-page, theme, or frontend-template candidate research, include both the repository URL and the live preview/demo URL for every serious candidate. If no preview is available or verified, state that explicitly and downgrade the candidate. ## Safety Boundaries - Prefer reading patterns and reusing existing public interfaces over copying code. If code reuse is necessary, check the license and keep attribution/obligation risks visible. - Avoid large rewrites of an existing GitHub solution. Keep its proven flow intact and make only the local adaptations required for the user's problem. - Avoid large verbatim excerpts from repositories, READMEs, issues, PRs, or documentation. - Do not save GitHub tokens, cookies, private repository contents, or credentials in outputs, logs, skills, or memory. - Do not pass tokens, cookies, private repository contents, sensitive logs, secrets, production data, or credentials to subagents. - If network access is unavailable, state that GitHub research could not be performed and mark the recommendation as local-only.
补充内容
--- name: github-solution-research description: Use when a concrete engineering problem, bug, integration failure, dependency issue, unclear API usage, implementation blocker, or tool/capability need may already have a proven solution in GitHub open-source projects, issues, pull requests, discussions, code, examples, or release notes. Use it to find suitable repositories, report project basics including Stars when a repo-level solution applies, and adapt the existing solution with minimal local changes. --- # GitHub Solution Research Use GitHub as problem-solving evidence and an implementation source. The goal is to find open-source projects and GitHub evidence that already solve the user's specific engineering problem, report the relevant project information, then translate the existing solution into a local fix, implementation path, or verification plan. This skill is for concrete problems first. For general tool or architecture selection, use it only after the local goal has been framed as a specific capability, blocker, workflow, or integration need. ## When to Use - Runtime, build, test, deploy, package, SDK, API, dependency, framework, or integration errors. - A feature implementation is blocked by an unclear edge case, missing usage pattern, or uncertain API behavior. - A local issue resembles something that maintainers or other open-source users may have resolved in issues, PRs, examples, code, or release notes. - The user asks whether GitHub/open-source projects can solve the same problem. - Mature implementation examples or reusable projects would reduce uncertainty for one concrete capability. - The answer should compare suitable GitHub repositories and explain how to use one with local adaptation. Do not use for tiny edits, copy changes, local-only refactors where the codebase already dictates the answer, or requests that explicitly forbid web/GitHub research. Do not inspect private repositories unless the user explicitly scopes and authorizes that access. ## Default Workflow 1. **Frame the problem locally first.** Capture the goal, actual symptom, error signature, reproduction path, versions, runtime, dependency/framework names, recent changes, constraints, and attempted fixes. If a discoverable fact is missing, inspect local files/logs before asking. 2. **Choose the evidence mode.** For errors/regressions, search issues, PRs, releases, and code first. For capability or tool needs, search repository candidates first. For feature implementation, use both repository candidates and issue/PR/code evidence. 3. **Evaluate subagent usefulness.** Before substantial GitHub research, decide whether conditional subagent work would improve breadth, evidence quality, or review coverage. If not using subagents, state the reason briefly when reporting the search path. 4. **Create targeted searches.** Prefer exact error text, package/API names, version numbers, framework + symptom, file names, config keys, stack trace fragments, failing command names, or capability + framework/runtime/API names. 5. **Find suitable GitHub projects when relevant.** Prefer high-fit, high-Star, active, non-archived repositories with clear licenses and real examples. Lower the Star threshold when the high-Star set is too broad or misses the exact problem. 6. **Search GitHub evidence surfaces.** Use issues, PRs, discussions, code, examples, release notes, and official project docs within relevant open-source repos. Repository search is required when a project itself may solve the problem. 7. **Rank by problem fit first, with Stars as a strong maturity signal.** A high-Star repository is a strong candidate for inspection, but maintainer-confirmed issues, merged PRs, released fixes, official examples, and exact matching code beat popular adjacent projects. Use [research-rubric.md](references/research-rubric.md) when ranking matters. 8. **Deep-read the strongest projects and evidence.** Use [extraction-playbook.md](references/extraction-playbook.md) to extract project basics, reusable surfaces, root cause or implementation pattern, version constraints, risks, adaptation boundaries, and verification steps. 9. **Translate to local work with minimal adaptation.** Prefer the existing GitHub solution's public workflow, API, or architecture. Adapt only the parts required by the user's local interfaces, configuration, data/auth model, deployment target, or language/runtime. 10. **If evidence is weak, say so.** Do not stretch weak matches into a confident recommendation. Mark the recommendation as first-principles or local-only when GitHub evidence is insufficient. ## Subagent / Parallel Research Guidance Subagents are conditional research aids, not a default requirement. The controller remains responsible for problem framing, scope control, evidence ranking, local adaptation, and final verification. Use subagents when at least one of these applies: - The problem spans 2+ independent ecosystems, frameworks, languages, tools, deployment surfaces, or GitHub communities. - Repository discovery needs broad candidate coverage across multiple query families. - Issue, PR, discussion, code, release, and example evidence can be split cleanly by project, version, or search surface. - A final recommendation benefits from independent evidence review, risk review, or candidate rejection review. Do not use subagents when any of these applies: - The task is a narrow error with one obvious package, repository, API, or maintainer surface. - Local repository context, logs, config, or reproduction details must be understood before external research can be scoped safely. - GitHub rate limits, authorization boundaries, private repositories, secrets, production data, or sensitive logs would make delegation risky. - Subagents would mostly duplicate the same searches or edit the same local files. When using subagents, the controller must: - Define each subagent's query family, repository scope, evidence surface, constraints, allowed write scope, and expected output. - Require direct links, verified metadata, problem-fit rationale, risk notes, and explicit rejection reasons. - Keep subagents read-only unless a separate implementation phase has a narrow allowed write scope. - Merge and deduplicate results before ranking; do not count repeated reports of the same issue, PR, code path, or repository as independent evidence. - Directly verify the strongest claims with `gh`, source reads, tests, logs, real requests, or official docs before finalizing. ## GitHub CLI First Use the GitHub CLI (`gh`) as the default search and inspection surface. Prefer `gh search repos`, `gh search issues`, `gh search prs`, `gh search code`, `gh repo view`, `gh issue view`, `gh pr view`, and `gh api` before browser scraping or custom scripts. Do not add or rely on bundled search scripts for this skill. Use these short command templates as starting points, then adjust the query, repo, fields, and limits to the local problem: ```bash gh search repos "<query>" --archived=false --sort stars --order desc --limit 10 --json fullName,url,description,stargazersCount,forksCount,language,license,pushedAt,isArchived,openIssuesCount gh search issues "<query>" --repo owner/repo --sort updated --order desc --limit 10 --json title,url,state,updatedAt,commentsCount,repository,body gh search prs "<query>" --repo owner/repo --merged --sort updated --order desc --limit 10 --json title,url,state,updatedAt,commentsCount,repository,body gh search code "<query>" --repo owner/repo --limit 10 --json path,url,repository,sha gh repo view owner/repo --json nameWithOwner,url,description,stargazerCount,forkCount,licenseInfo,primaryLanguage,pushedAt,repositoryTopics,homepageUrl gh api -X GET search/repositories -f q='<query> archived:false' -f sort=stars -f order=desc ``` Only run `gh auth status` when a command fails with 403, 429, a private repository authorization error, or an explicit `gh` not-authenticated message. If GitHub returns 403/429, inspect the emitted rate-limit or authorization context before retrying, reducing breadth, or switching endpoints. Do not paste or persist tokens, cookies, private repository contents, or credentials in prompts, files, logs, or memory. ## Search Strategy - Start narrow: exact error string, exception class, CLI output, package + method name, config key, or stack trace fragment. - Add constraints: package/framework version, language, platform, deployment target, bundler, database, auth provider, or runtime. - Search surfaces in this order when relevant: issues/PRs/discussions, merged fixes, release notes/changelog, examples/templates, source code, then repository-level candidates. - For implementation blockers without an error, search for the desired capability plus framework/runtime/API names. - For public platform data needs such as trends, hot lists, topic search, or engagement metrics, do not start with visual browser scraping. First look for reusable public endpoints, open-source crawlers, archived datasets, and API field evidence; then verify the chosen source with a minimal real request and clearly separate anonymous hot-list data from logged-in search/topic data. - For reusable project discovery, search repositories sorted by Stars, then deep-read only candidates that match the local problem. Record Stars, forks, language, license, activity, and basic content. - Demote matches that are old, version-mismatched, archived, unresolved, speculative, or based only on user guesses. - Use Stars/forks only as supporting maturity context and tie-breakers among similarly fitting repositories. They do not override problem fit, maintainer-confirmed evidence, merged PRs, release notes, official examples, or reproducible code. - For security, auth, payments, infrastructure, or production operations, cross-check open-source findings against current official docs or repositories when facts may have changed. ## Evidence Standard For each serious evidence item, identify: - exact match: same error, behavior, API, version, environment, or workflow; - evidence strength: maintainer confirmation, merged PR, released fix, reproducible code example, test fixture, or repeated independent reports; - applicability: what conditions must match locally for the solution to apply; - implementation value: patch, config, API usage, dependency version, workflow, test, or operational pattern worth adapting; - project basics when a repository is a candidate: name, URL, Stars, forks, language, license, activity, basic content, fit rationale, and adaptation cost; - risk: stale version, unresolved issue, unsafe workaround, license concern, security/privacy impact, deployment mismatch, or overbroad change. ## Output Contract When this skill materially affects the answer, include: - local problem profile: goal, symptom/error, versions/environment, and local constraints; - search path: queries or discovery methods used, GitHub surfaces searched, and whether subagents were used or skipped; - subagent trace when subagents were used: each subagent's scope, evidence surfaces, key findings, rejected candidates, deduplication results, and which claims the controller directly verified; - project candidates when a GitHub project itself is relevant: repo link, Stars, forks, language, license, activity, basic content, match rationale, and how it can be used locally; - key evidence: links to issues, PRs, code, examples, releases, or repos, with match rationale; - recommended solution: what to reuse directly, what to adapt locally, what to avoid copying, and why it fits; - rejected or risky options: why they do not apply or need caution; - verification standard: test, build, reproduction command, real request, or manual check required to confirm the fix; - confidence label when evidence is weak or no strong GitHub solution was found. When repository-level solutions are relevant, include a compact project table. For pure issue/PR/code fixes, the table is optional, but include repository context if it affects trust or applicability. Do not answer with only links, Stars, or popularity rankings. Do not write "common GitHub pattern" without linked evidence. Do not let external examples override local constraints. For website, SaaS, landing-page, theme, or frontend-template candidate research, include both the repository URL and the live preview/demo URL for every serious candidate. If no preview is available or verified, state that explicitly and downgrade the candidate. ## Safety Boundaries - Prefer reading patterns and reusing existing public interfaces over copying code. If code reuse is necessary, check the license and keep attribution/obligation risks visible. - Avoid large rewrites of an existing GitHub solution. Keep its proven flow intact and make only the local adaptations required for the user's problem. - Avoid large verbatim excerpts from repositories, READMEs, issues, PRs, or documentation. - Do not save GitHub tokens, cookies, private repository contents, or credentials in outputs, logs, skills, or memory. - Do not pass tokens, cookies, private repository contents, sensitive logs, secrets, production data, or credentials to subagents. - If network access is unavailable, state that GitHub research could not be performed and mark the recommendation as local-only.
使用指南与最佳实践
# GitHub 解决方案研究
将 GitHub 作为解决问题的证据和实施来源。目标是找到已经解决了用户特定工程问题的开源项目和 GitHub 证据,报告相关项目信息,然后将现有解决方案转化为本地修复、实施路径或验证计划。
此技能首先针对具体问题。对于通用工具或架构选择,只有在本地目标被定义为特定能力、阻碍、工作流或集成需求之后才使用它。
## 何时使用
- 运行时、构建、测试、部署、打包、SDK、API、依赖、框架或集成错误。
- 功能实现因不明确的边缘情况、缺失的使用模式或不确定的 API 行为而受阻。
- 本地问题类似于维护者或其他开源用户可能在问题、PR、示例、代码或发布说明中已解决的问题。
- 用户询问 GitHub/开源项目是否能解决相同问题。
- 成熟的实现示例或可复用项目可以减少某个具体能力的不确定性。
- 答案应比较合适的 GitHub 仓库,并解释如何通过本地适配来使用其中一个。
不要用于微小的编辑、文案修改、仅限本地的重构(代码库已指明答案的情况),或明确禁止网络/GitHub 研究的请求。不要检查私有仓库,除非用户明确指定并授权访问。
## 默认工作流
1. **首先在本地定义问题。** 捕获目标、实际症状、错误特征、复现路径、版本、运行时、依赖/框架名称、最近更改、约束和已尝试的修复。如果缺少可发现的事实,在询问之前先检查本地文件/日志。
2. **选择证据模式。** 对于错误/回归,首先搜索 issues、PRs、releases 和代码。对于能力或工具需求,首先搜索候选仓库。对于功能实现,同时使用候选仓库和 issue/PR/代码证据。
3. **评估子代理的实用性。** 在进行大量 GitHub 研究之前,决定有条件的子代理工作是否能提高广度、证据质量或审查覆盖率。如果不使用子代理,在报告搜索路径时简要说明原因。
4. **创建有针对性的搜索。** 优先使用精确的错误文本、包/API 名称、版本号、框架+症状、文件名、配置键、堆栈跟踪片段、失败的命令名称或能力+框架/运行时/API 名称。
5. **在相关时找到合适的 GitHub 项目。** 优先选择高匹配度、高 Star、活跃、未归档、具有清晰许可证和真实示例的仓库。当高 Star 集合过于宽泛或未能命中确切问题时,降低 Star 阈值。
6. **搜索 GitHub 证据面。** 在相关的开源仓库中使用 issues、PRs、讨论、代码、示例、发布说明和官方项目文档。当项目本身可能解决问题时,需要进行仓库搜索。
7. **首先按问题匹配度排序,Star 作为重要的成熟度信号。** 高 Star 仓库是检查的有力候选,但维护者确认的 issues、合并的 PR、已发布的修复、官方示例和精确匹配的代码优于流行的相邻项目。当排序很重要时,使用 [research-rubric.md](references/research-rubric.md)。
8. **深度阅读最强的项目和证据。** 使用 [extraction-playbook.md](references/extraction-playbook.md) 提取项目基础信息、可复用面、根本原因或实现模式、版本约束、风险、适配边界和验证步骤。
9. **以最小适配转化为本地工作。** 优先采用现有 GitHub 解决方案的公共工作流、API 或架构。仅适配用户本地接口、配置、数据/认证模型、部署目标或语言/运行时所需的部分。
10. **如果证据薄弱,请说明。** 不要将弱匹配强行转化为自信的推荐。当 GitHub 证据不足时,将推荐标记为基于第一原则或仅限本地。
## 子代理/并行研究指导
子代理是有条件的研究辅助手段,不是默认要求。控制器仍然负责问题定义、范围控制、证据排序、本地适配和最终验证。
当至少满足以下条件之一时,使用子代理:
- 问题跨越 2 个或更多独立的生态系统、框架、语言、工具、部署面或 GitHub 社区。
- 仓库发现需要跨多个查询系列的广泛候选覆盖。
- Issue、PR、讨论、代码、发布和示例证据可以按项目、版本或搜索面清晰地拆分。
- 最终推荐受益于独立的证据审查、风险审查或候选拒绝审查。
当满足以下任何条件时,不要使用子代理:
- 任务是一个狭窄的错误,只有一个明显的包、仓库、API 或维护者面。
- 在安全地确定外部研究范围之前,必须先了解本地仓库上下文、日志、配置或复现细节。
- GitHub 速率限制、授权边界、私有仓库、机密、生产数据或敏感日志会使委派变得有风险。
- 子代理主要会重复相同的搜索或编辑相同的本地文件。
当使用子代理时,控制器必须:
- 定义每个子代理的查询系列、仓库范围、证据面、约束、允许的写入范围和预期输出。
- 要求直接链接、验证的元数据、问题匹配理由、风险说明和明确的拒绝原因。
- 保持子代理为只读,除非单独的实施阶段有狭窄的允许写入范围。
- 在排序前合并和去重结果;不要将同一 issue、PR、代码路径或仓库的重复报告视为独立证据。
- 在最终确定之前,使用 `gh`、源码读取、测试、日志、真实请求或官方文档直接验证最强的声明。
## GitHub CLI 优先
使用 GitHub CLI (`gh`) 作为默认搜索和检查面。优先使用 `gh search repos`、`gh search issues`、`gh search prs`、`gh search code`、`gh repo view`、`gh issue view`、`gh pr view` 和 `gh api`,而不是浏览器抓取或自定义脚本。不要为此技能添加或依赖捆绑的搜索脚本。
使用以下简短命令模板作为起点,然后根据本地问题调整查询、仓库、字段和限制:
```bash
gh search repos "<query>" --archived=false --sort stars --order desc --limit 10 --json fullName,url,description,stargazersCount,forksCount,language,license,pushedAt,isArchived,openIssuesCount
gh search issues "<query>" --repo owner/repo --sort updated --order desc --limit 10 --json title,url,state,updatedAt,commentsCount,repository,body
gh search prs "<query>" --repo owner/repo --merged --sort updated --order desc --limit 10 --json title,url,state,updatedAt,commentsCount,repository,body
gh search code "<query>" --repo owner/repo --limit 10 --json path,url,repository,sha
gh repo view owner/repo --json nameWithOwner,url,description,stargazerCount,forkCount,licenseInfo,primaryLanguage,pushedAt,repositoryTopics,homepageUrl
gh api -X GET search/repositories -f q='<query> archived:false' -f sort=stars -f order=desc
```
仅在命令因 403、429、私有仓库授权错误或明确的 `gh` 未认证消息而失败时运行 `gh auth status`。如果 GitHub 返回 403/429,在重试、减少广度或切换端点之前,检查发出的速率限制或授权上下文。不要在提示、文件、日志或内存中粘贴或持久化令牌、cookies、私有仓库内容或凭据。
## 搜索策略
- 从窄开始:精确的错误字符串、异常类、CLI 输出、包+方法名、配置键或堆栈跟踪片段。
- 添加约束:包/框架版本、语言、平台、部署目标、打包工具、数据库、认证提供者或运行时。
- 按此顺序搜索相关面:issues/PRs/讨论、已合并的修复、发布说明/变更日志、示例/模板、源代码,然后是仓库级候选。
- 对于没有错误的实现阻碍,搜索所需能力加上框架/运行时/API 名称。
- 对于公共平台数据需求,如趋势、热门列表、主题搜索或参与度指标,不要从可视化浏览器抓取开始。首先寻找可复用的公共端点、开源爬虫、存档数据集和 API 字段证据;然后通过最小的真实请求验证所选来源,并清晰地区分匿名热门列表数据和登录后的搜索/主题数据。
- 对于可复用项目的发现,按 Star 排序搜索仓库,然后仅深度阅读与本地问题匹配的候选。记录 Star、fork、语言、许可证、活动和基本内容。
- 降低老旧、版本不匹配、已归档、未解决、推测性或仅基于用户猜测的匹配的优先级。
- 仅将 Star/fork 用作支持的成熟度上下文和相似匹配仓库之间的决胜因素。它们不能覆盖问题匹配度、维护者确认的证据、合并的 PR、发布说明、官方示例或可复现的代码。
- 对于安全、认证、支付、基础设施或生产运维,当事实可能已发生变化时,将开源发现与当前官方文档或仓库进行交叉检查。
## 证据标准
对于每个重要的证据项,确定:
- 精确匹配:相同的错误、行为、API、版本、环境或工作流;
- 证据强度:维护者确认、合并的 PR、已发布的修复、可复现的代码示例、测试夹具或重复的独立报告;
- 适用性:本地必须满足哪些条件才能使解决方案适用;
- 实施价值:值得适配的补丁、配置、API 使用、依赖版本、工作流、测试或操作模式;
- 当仓库是候选时的项目基础信息:名称、URL、Star、fork、语言、许可证、活动、基本内容、匹配理由和适配成本;
- 风险:过时的版本、未解决的问题、不安全的变通方案、许可证问题、安全/隐私影响、部署不匹配或过于宽泛的更改。
## 输出契约
当此技能对答案产生实质性影响时,包括:
- 本地问题概况:目标、症状/错误、版本/环境和本地约束;
- 搜索路径:使用的查询或发现方法、搜索的 GitHub 面,以及是否使用或跳过了子代理;
- 子代理跟踪(当使用了子代理时):每个子代理的范围、证据面、关键发现、被拒绝的候选、去重结果,以及控制器直接验证了哪些声明;
- 项目候选(当 GitHub 项目本身相关时):仓库链接、Star、fork、语言、许可证、活动、基本内容、匹配理由以及如何在本地使用;
- 关键证据:指向 issues、PRs、代码、示例、发布或仓库的链接,附带匹配理由;
- 推荐解决方案:哪些可以直接复用,哪些需要本地适配,哪些应避免复制,以及为什么它合适;
- 被拒绝或有风险的选项:为什么它们不适用或需要谨慎;
- 验证标准:确认修复所需的测试、构建、复现命令、真实请求或手动检查;
- 置信度标签(当证据薄弱或未找到强 GitHub 解决方案时)。
当仓库级解决方案相关时,包含一个紧凑的项目表格。对于纯粹的 issue/PR/代码修复,表格是可选的,但如果它影响信任度或适用性,则包含仓库上下文。
不要仅用链接、Star 或流行度排名来回答。不要在没有链接证据的情况下写“常见的 GitHub 模式”。不要让外部示例覆盖本地约束。
对于网站、SaaS、着陆页、主题或前端模板候选研究,为每个重要候选同时包含仓库 URL 和实时预览/演示 URL。如果没有可用的或已验证的预览,请明确说明并降低该候选的优先级。
## 安全边界
- 优先阅读模式并复用现有公共接口,而不是复制代码。如果代码复用是必要的,检查许可证并保持归属/义务风险可见。
- 避免对现有 GitHub 解决方案进行大规模重写。保持其经过验证的流程不变,仅进行用户问题所需的本地适配。
- 避免从仓库、README、issues、PRs 或文档中大量逐字摘录。
- 不要在输出、日志、技能或内存中保存 GitHub 令牌、cookies、私有仓库内容或凭据。
- 不要将令牌、cookies、私有仓库内容、敏感日志、机密、生产数据或凭据传递给子代理。
- 如果网络访问不可用,说明无法执行 GitHub 研究,并将推荐标记为仅限本地。