بنقرة واحدة
gh-issue-to-spec
把 GitHub Issue 轉成結構化技術規格文件。當用戶說「issue 轉 spec」「寫規格」「gh issue to spec」時使用。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
把 GitHub Issue 轉成結構化技術規格文件。當用戶說「issue 轉 spec」「寫規格」「gh issue to spec」時使用。
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Generate self-contained HTML architecture diagrams (inline SVG, dark theme, no JS) for blogs/READMEs. Triggers on system architecture, microservices, cloud/AWS/GCP, K8s, network topology, data flow diagrams. Use `drawio` instead when the output needs to be editable.
Generate draw.io diagrams (.drawio files) with optional PNG/SVG/PDF export. Triggers on diagram/flowchart/ER/sequence/class/network/architecture/wireframe/mockup/UI sketch requests.
使用 Gemini Nano Banana 2 產生圖片。當用戶說「產圖」「生成圖片」「generate image」「畫一張圖」時使用。
Resume/CV optimization. Analyze a resume, reposition strengths, and produce an optimized PDF tailored to a target role.
Virtual expert roundtable. Multiple thinkers analyze a document with different frameworks, then synthesize consensus/disagreements/blind spots.
Vendor proposal evaluation. Analyze technical architecture, pricing, and market benchmarks from a proposal PDF/Doc. Output evaluation report + comparison.
| name | gh-issue-to-spec |
| description | 把 GitHub Issue 轉成結構化技術規格文件。當用戶說「issue 轉 spec」「寫規格」「gh issue to spec」時使用。 |
| argument-hint | [Issue URL 或 #number,如 'https://github.com/org/repo/issues/42' 或 '#42'] |
| allowed-tools | Bash(gh*), Bash(git*), Read, Write, Grep, Glob |
| author | Maki |
| version | 1.0.0 |
| tags | ["github","spec","documentation","development"] |
| required_env | [] |
讀取 GitHub Issue(含 comments、linked PRs、labels),自動產出結構化的技術規格文件,可直接用於開發。
gh auth status
需要安裝並登入 GitHub CLI:
1. 安裝:brew install gh
2. 登入:gh auth login
根據 $ARGUMENTS 判斷:
git remote 推斷 owner/repo# 取得 Issue 本體
gh issue view {number} --repo {owner}/{repo} --json title,body,labels,assignees,milestone,state,createdAt,comments
# 取得關聯的 PR
gh pr list --repo {owner}/{repo} --search "#{number}" --json number,title,state,url
# 取得 Issue timeline(誰做了什麼)
gh api repos/{owner}/{repo}/issues/{number}/timeline --paginate
從 Issue body + comments 中提取:
| 要素 | 來源 | 備註 |
|---|---|---|
| 問題描述 | Issue body | 原始需求 |
| 接受標準 | body 中的 checklist / "Acceptance Criteria" | 常見格式 |
| 技術討論 | comments | 設計決策、替代方案 |
| 約束條件 | labels + comments | 如 breaking-change、performance |
| 關聯 PR | linked PRs | 可能已有部分實作 |
# 讀取 README 取得專案概要
gh api repos/{owner}/{repo}/readme --jq '.content' | base64 -d | head -50
# 讀取技術棧線索
gh api repos/{owner}/{repo}/languages
# Spec: {Issue Title}
> Source: {Issue URL}
> Author: {Issue Author} | Created: {Date} | Labels: {Labels}
## 1. 問題陳述
{從 Issue body 提煉的問題描述,2-3 句}
## 2. 目標
{要達成什麼,用可驗證的語句}
## 3. 接受標準
- [ ] {從 Issue 提取或推斷的驗收條件}
- [ ] {每條都是可測試的}
## 4. 技術方案
### 4.1 方案概述
{基於 Issue 討論的技術方案}
### 4.2 影響範圍
- 需要修改的檔案/模組
- 需要新增的檔案/模組
- 可能影響的既有功能
### 4.3 替代方案
{如果 comments 中有討論過的替代方案,列出}
## 5. 約束與風險
- {從 labels 和 comments 中提取的約束}
- {潛在風險}
## 6. 測試計畫
- [ ] {Unit test 項目}
- [ ] {Integration test 項目}
- [ ] {Edge case}
## 7. 參考
- Issue: {URL}
- Related PRs: {URLs}
- {其他 comments 中提到的參考資料}
docs/specs/issue-{number}-{slug}.mdbug → 加入 root cause 分析段落breaking-change → 加入 migration plan 段落