Skip to content

feature: /idd-ask skill — query GitHub issues knowledge base (mirror /spectra-ask) #72

Description

@kiki830621

Problem

Original text (user invocation of /idd-issue 2026-05-11):
「我發現需要一個 /idd-ask 有點像是 /spectra-ask 的功能」

目前 IDD plugin 有 14 個 skill(idd-all、idd-close、idd-comment、idd-config、idd-diagnose、idd-edit、idd-implement、idd-issue、idd-list、idd-plan、idd-report、idd-update、idd-verify、idd-all-chain),但沒有一個 skill 是純粹回答「issue 知識庫」的查詢問題

相對地,Spectra 有 /spectra-ask:grounded 在 openspec/ 文件之上,純查詢、不改任何 state。它的價值是「我想知道之前怎麼決定的,但不想自己 grep」。

IDD 的對應知識庫是 GitHub issues + comments + linked PRs(diagnoses、decisions、closing summaries 都沉澱在這裡)。目前要查歷史只能:

  • gh issue list --search "..."(沒語意搜尋、不會跨 comment)
  • 手動翻 issue body 找 diagnosis comment
  • /idd-list 但那是 triage view,不是知識回答

Type

feature

Expected

新 skill /idd-ask <question> 行為類似 /spectra-ask

  1. 接收問題(自然語言,中英混雜 OK;無 question 時 infer from conversation context)
  2. 決定要不要搜(greeting / meta-tool 問題不搜)
  3. 搜尋 issue 知識庫(建議 gh issue list --search + gh search issues + 抓 top-N issue 的 body & comments;或建 local cache + embedding 搜尋,類似 spectra vector_not_compiled 但用 issue corpus)
  4. 讀取命中的 issue(含 comments)
  5. 回答,grounded 在 issue 內容:
    • 第一行 blockquote 引用使用者原問題(同 spectra-ask 規矩)
    • 答案只引用 issue / comment 內容,不腦補
  6. ### Referenced Issues 區段:列出 #N (title) — issue URL,方便人工 follow-up

關鍵設計約束:

  • 只讀(不 create / edit / comment / close)— 跟 /idd-list 區隔(list 是 triage、ask 是 QA)
  • 不觸發 /idd-diagnose — 即使問題長得像 bug report
  • source priority 類比 spectra:closed-with-PR issue > open issue > orphaned comment(已關 + 已 ship 的是 ground truth;open 是「進行中、可能還會變」)
  • 跨 repo:尊重 walked-up config + --target flag(同其他 idd-* skill);可選 --target group:<label> 在 group 內搜

Actual

目前查 IDD 歷史只能手動 gh issue list + gh issue view,沒有 skill 層提供 grounded、引用化的回答。三個月後回來看 kiki830621/2026-winstonPsychQuant/* 的 issue history,AI 沒辦法快速幫 user 還原當時的 decision rationale。

Impact

  • 個人 workflow:減少手動 grep issue archive 的時間,特別是「上次某個 bug 怎麼修的」「為什麼 X 做法被否決」這類問題
  • AI 互動品質:AI 答 IDD 相關問題時可以強制 grounded 在實際 issue 紀錄,不會 hallucinate
  • Skill ecosystem completeness:補上 IDD 對應 spectra-ask 的 query-only skill,七種 process skill(issue/diagnose/plan/implement/verify/close/update)+ 一個 read-only ask,mental model 對稱

設計提示(不限制實作)

可考慮的搜尋後端:

  1. MVPgh issue list --search + gh issue view --comments + LLM-side ranking(純 gh CLI,零基礎建設成本)
  2. Phase 2:local issue corpus cache(.claude/.idd/issue-cache/<repo>/<num>.md)+ embedding 搜尋(同 spectra 的方向)
  3. Phase 3:跨 repo group search(一個 query 掃 primary + tracking repos)

可能踩到的設計坑(讓實作者注意):

  • comment 數一多 issue body 會超過 LLM context — 需要 chunk + 摘要 / per-comment relevance scoring
  • closed issue 的 closing summary 是最高訊息密度,要特別 weight
  • /idd-list 的 boundary 模糊 — /idd-list 是「列出有什麼 issue」,/idd-ask 是「回答某個問題」;UI 提示要明確區分

Out of scope

  • 不做:跨 GitHub org 搜尋(單 repo / group 已涵蓋大宗)
  • 不做:write side(這是專門的 query skill)
  • 不做:取代 /idd-list(兩者並存)

Current Status

Phase: closed
Last updated: 2026-07-06 by /idd-diagnose (via /idd-all batch drain)

Key Decisions

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions