OpenCoze
返回模板库

使用 Copilot SDK 自动化 GitHub Issue 归档

DevelopmentCoze更新于 2026-03-25

在 GitHub 仓库中,当新 Issue 创建时,自动调用 Copilot SDK 生成摘要、建议标签并在 Issue 下评论,提升开发者的工作效率。

System Prompt
Generate a concise summary and a list of suggested labels for GitHub issue {issue_id} in repository {repo_name}. Issue title: {issue_title}. Issue body: {issue_body}. Output JSON with fields: summary, labels, comment. If the SDK fails, output a fallback comment explaining the issue.

变量清单(在目标 AI 工具中填写)

此处仅展示模板里的占位变量,不是在本站输入。请复制 Prompt 后,在 Coze / Dify / ChatGPT 中替换这些变量。

{issue_id}

GitHub Issue 的唯一编号

填写建议:替换为你的真实业务内容。

{repo_name}

仓库名称,例如 owner/repo

填写建议:替换为你的真实业务内容。

{issue_title}

Issue 的标题

填写建议:替换为你的真实业务内容。

{issue_body}

Issue 的正文内容

填写建议:替换为你的真实业务内容。

快捷变量填充器(可选)

可在浏览器本地填写变量,自动生成可直接运行的 Prompt。

{issue_id}

GitHub Issue 的唯一编号

{repo_name}

仓库名称,例如 owner/repo

{issue_title}

Issue 的标题

{issue_body}

Issue 的正文内容

生成结果预览

未填: 4
Generate a concise summary and a list of suggested labels for GitHub issue {issue_id} in repository {repo_name}. Issue title: {issue_title}. Issue body: {issue_body}. Output JSON with fields: summary, labels, comment. If the SDK fails, output a fallback comment explaining the issue.

通用使用说明

适用场景

需要快速产出 Development 相关内容,并希望用结构化 Prompt 提升稳定性。

解决问题

减少从零写 Prompt 的时间,降低输出质量不稳定、漏条件、漏格式的问题。

使用步骤

  1. 点击“复制模板 Prompt”。
  2. 将 Prompt 粘贴到你的 AI 工具(如 Coze / Dify / ChatGPT)。
  3. 按上方变量清单替换 {变量名}
  4. 运行并根据结果微调约束条件。

不适用场景

需要实时联网数据、外部数据库写入或多工具自动编排时,应使用完整工作流(Agent/Automation)版本。

成功案例

输入:
issue_id: 1234 repo_name: octocat/Hello-World issue_title: "Bug: Unexpected crash on launch" issue_body: "When launching the app, it crashes with error code 0xDEADBEEF. Steps to reproduce: 1. Open app 2. Click on Settings 3. Crash."
输出:
{ "summary": "App crashes on Settings page with error 0xDEADBEEF.", "labels": ["bug", "high-priority"], "comment": "Issue 1234: The app crashes on the Settings page. Suggested labels: bug, high-priority." }

边界情况

输入:
issue_id: 5678 repo_name: octocat/Hello-World issue_title: "Feature: Add dark mode" issue_body: "Users request dark mode. Implement by adding CSS variables."
修复建议:
Ensure Copilot SDK endpoint is reachable and retry after a short delay. If persistent, fall back to keyword-based summary.

下一步推荐

继续浏览同类模板,并搭配相关工具提升效果。

继续使用 / 最近浏览

还没有最近浏览记录。

工作流步骤

  1. 1. 通过 GitHub Webhook 或 API 触发,获取 issue_id、repo_name、issue_title、issue_body。

  2. 2. 调用 Copilot SDK 的 issue 处理接口,传入上述变量,获取 JSON 响应。

  3. 3. 解析响应,提取 summary、labels、comment。

  4. 4. 使用 GitHub API 更新 Issue:添加 labels 并在 Issue 下评论 comment。

  5. 5. 将响应缓存到 Redis 或文件系统,供后续查询。

  6. 6. 若 SDK 调用失败,执行步骤 4 的 fallback 逻辑,使用关键字匹配生成简短评论。

约束条件

  • Issue body exceeds 4000 characters, truncate to 4000 chars before sending to SDK
  • Network timeout when calling Copilot SDK, trigger fallback logic
  • Missing or invalid GitHub token, abort operation and log error

同类内容继续浏览

Development

推荐配套工具

这些工具可与当前模板组合使用。

Coze

官网链接

低代码 Agent/Workflow 平台,适合快速搭建自动化流程。

访问

OpenAI

官网链接

通用大模型能力,适合内容生成、分析和开发场景。

访问