fetch-issues

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Fetch Issues

获取 Issues

When this applies

适用场景

Use this when the user wants to see the open issues in their tracker. It reports what the tracker returns without changing any issue.
For one known issue, read just that issue — on GitHub,
gh issue view <number>
— instead of fetching the whole list.
当用户希望查看其 Issue 跟踪系统中的未关闭 Issue 时使用。 本 skill 只报告跟踪系统的返回结果,不修改任何 Issue。
对于一个已知 Issue,只读取该 Issue——在 GitHub 上使用
gh issue view <number>
——而不要获取整个列表。

Preconditions

前置条件

  1. Resolve the tracker and target before fetching anything:
    • If the user explicitly names a repository or project for this run, use it.
    • Otherwise, read
      docs/agents/issue-tracker.md
      : its Backend, Location, and Reading sections.
    • If the config is missing, doesn't identify a target, or is ambiguous, ask the user. Do not guess from a directory name or silently substitute a Git remote.
  2. Confirm the backend is reachable:
    • GitHub: run
      command -v gh
      ; if it is missing, direct the user to https://cli.github.com/ and stop. Then run
      gh auth status
      ; if it fails, preserve the useful part of the error, tell the user to run
      gh auth login
      , and stop.
    • Local markdown: confirm the recorded Location exists.
    • Other backends: use the method in the Reading section's "List open issues" line. If the config has no Reading section, ask how to list issues rather than guessing. If the recorded tool isn't available — a CLI not installed, an MCP server not connected — say so and stop.
  1. 在获取任何内容前,先确定 Issue 跟踪系统和目标:
    • 如果用户明确指定了本次运行所使用的仓库或项目,则使用该仓库或项目。
    • 否则,读取
      docs/agents/issue-tracker.md
      :其中的 Backend、Location 和 Reading 部分。
    • 如果配置缺失、未标识目标或存在歧义,则询问用户。不要根据目录名进行猜测,也不要擅自替换为 Git 远程仓库。
  2. 确认后端可以访问:
    • **GitHub:**运行
      command -v gh
      ;如果该命令不存在,引导用户访问 https://cli.github.com/ 并停止。然后运行
      gh auth status
      ;如果失败,保留错误中有用的部分,告诉用户运行
      gh auth login
      ,然后停止。
    • **本地 Markdown:**确认记录的 Location 存在。
    • **其他后端:**使用 Reading 部分中“List open issues”一行所记录的方法。如果配置中没有 Reading 部分,应询问用户如何列出 Issue,而不是进行猜测。如果记录的工具不可用——例如 CLI 未安装或 MCP 服务器未连接——应说明情况并停止。

Fetch the issues

获取 Issue

GitHub. Request the fields needed for a complete report and set an explicit limit, so the GitHub CLI's small default doesn't silently omit open issues:
bash
gh issue list \
  --repo <owner>/<repo> \
  --state open \
  --limit 1000 \
  --json number,title,body,labels,author,createdAt,url
If the command returns exactly 1,000 issues, state that the result may have reached the requested limit rather than claiming it is the complete set; offer to continue with paginated GitHub API requests.
Local markdown. Read, in full, every intent file the Reading section counts as open.
Other backends. Run the recorded method and request complete bodies. If the tool pages or caps its results, say where the result stopped rather than calling it complete.
For every backend: don't add label, assignee, milestone, search, or author filters unless the user requests them. If the fetch fails, report its error and stop. Do not turn an authentication, authorization, network, or missing-target failure into an empty result.
GitHub。 请求完整报告所需的字段,并设置明确的限制,以免 GitHub CLI 的较小默认值在无提示的情况下遗漏未关闭的 Issue:
bash
gh issue list \
  --repo <owner>/<repo> \
  --state open \
  --limit 1000 \
  --json number,title,body,labels,author,createdAt,url
如果命令返回恰好 1,000 个 Issue,应说明结果可能已达到请求的限制,而不能声称它是完整集合;并提议继续使用分页的 GitHub API 请求。
本地 Markdown。 完整读取所有被 Reading 部分视为未关闭 Issue 的 intent 文件。
其他后端。 运行记录的方法并请求完整正文。如果工具对结果分页或设有限制,应说明结果在何处停止,而不能将其称为完整结果。
对于所有后端:除非用户要求,否则不要添加 label、assignee、milestone、search 或 author 筛选器。如果获取失败,应报告错误并停止。不要将认证、授权、网络或目标缺失失败转换为空结果。

Present the result

呈现结果

If there are no open issues, say so and name the tracker and target that were checked.
Otherwise, report the total returned and render every issue using this shape, where
<reference>
is the tracker's own form —
#<number>
on GitHub, a key such as
PROJ-123
on Jira, a file path for local markdown:
markdown
undefined
如果没有未关闭的 Issue,应说明这一点,并指明已检查的 Issue 跟踪系统和目标。
否则,报告返回的 Issue 总数,并使用以下格式呈现每个 Issue,其中
<reference>
采用 Issue 跟踪系统自身的形式——GitHub 上为
#<number>
,Jira 上为
PROJ-123
之类的键,本地 Markdown 中为文件路径:
markdown
undefined

<reference> — <title>

<reference> — <title>

  • URL: <url or file path>
  • Labels: <comma-separated labels, or None>
  • Author: <login or name, or Unknown>
  • Created: <creation time in an unambiguous date format, or Unknown>
  • URL: <url or file path>
  • Labels: <comma-separated labels, or None>
  • Author: <login or name, or Unknown>
  • Created: <creation time in an unambiguous date format, or Unknown>

Body

Body

<complete body, or No body provided.>

Keep each issue body complete. Do not silently trim it, replace it with an
ellipsis, or summarize it unless the user explicitly asks for a summary. If
the complete result cannot fit in one response, stop only between issues,
state how many of the returned issues were displayed, and continue from the
next issue in the following response.
<complete body, or No body provided.>

每个 Issue 的正文必须保持完整。除非用户明确要求摘要,否则不要擅自删减正文、用省略号替换正文或总结正文。如果完整结果无法在一次响应中容纳,只能在 Issue 之间停止,说明已显示多少个返回的 Issue,并在下一次响应中从下一个 Issue 继续。

What NOT to do

不要做什么

  • Don't guess the tracker or target when neither the user nor the tracker config identifies it.
  • Don't apply GitHub commands to a backend that isn't GitHub, or invent a command for a tracker whose Reading section is missing.
  • Don't rely on a tool's default page size or limit and call the result complete.
  • Don't omit, shorten, or paraphrase issue bodies without the user's request.
  • Don't hide command failures by reporting that there are no open issues.
  • Don't create, edit, close, label, assign, or otherwise mutate issues; this skill is read-only.
  • 当用户和 Issue 跟踪系统配置都未标识跟踪系统或目标时,不要进行猜测。
  • 不要对非 GitHub 后端使用 GitHub 命令,也不要为缺少 Reading 部分的 Issue 跟踪系统编造命令。
  • 不要依赖工具的默认页面大小或限制,并将结果称为完整结果。
  • 未经用户要求,不要遗漏、缩短或转述 Issue 正文。
  • 不要通过报告“没有未关闭的 Issue”来隐藏命令失败。
  • 不要创建、编辑、关闭、标记、分配或以其他方式变更 Issue;此 skill 是只读的。