github-skill-importer
Github Skill Importer (從 GitHub 導入技能 SOP)
- License 许可
- MIT
- 最近更新
- 2026-04-16
- Stars
- ★ 52
- Forks
- 13
01 前言 Front Matter
- name
- github-skill-importer
- description
- Github Skill Importer (從 GitHub 導入技能 SOP)
03 SKILL.md 正文
Github Skill Importer (從 GitHub 導入技能 SOP)
此技能定義了如何從外部 GitHub Repository 尋找、驗證並抓取 AI 技能,將其導入至 SKILLS_All-in-one 平台的標準作業流程。
? 第一階段:搜尋與定位 (Discovery)
當使用者提供一個 GitHub URL 時,請執行以下步驟:
- 進入技能根目錄:在 Repo 中尋找名為
skills/或.claude/skills/(或其他可能的技能存放路徑) 的資料夾。 - 辨識 Repo 型態:
- 多技能型:若存在
skills/等資料夾,每個子資料夾代表一個獨立技能。 - 單一技能型:若 Repo 根目錄直接包含
SKILL.md且無skills/資料夾,則將整個 Repo 視為一個完整技能。
- 多技能型:若存在
- 定位目標:根據使用者的需求或 Repo 型態,定位到正確的技能目錄。
✅ 第二階段:格式驗證 (Validation)
在導入之前,必須確認該目錄符合 「正確的技能形式」:
- 必要檔案:目錄內必須包含
SKILL.md。 - 元數據檢查:
SKILL.md的頂部必須包含 YAML Frontmatter,例如:--- name: skill-name description: brief description --- - 結構檢查:檢查是否有
references/、scripts/或examples/等輔助資料夾,這些也應一併導入。
? 第三階段:下載與存放 (Import)
- 建立暫存區:在
@public\SKILLS\Uncategorized\下建立與 Repo 中相同的資料夾名稱。 - 抓取檔案:使用
web_fetch讀取並使用write_file寫入所有相關檔案。- 路徑:
@public\SKILLS\Uncategorized\{FolderName}\SKILL.md - 路徑:
@public\SKILLS\Uncategorized\{FolderName}\references\**(若有)
- 路徑:
?️ 第四階段:銜接上架流程 (Onboarding)
完成導入後,請立即切換至 Skill Onboarding Guide (技能上架 SOP) 執行後續動作:
- 分類 (Classification):
- 優先從
@src/types/skill.ts中的SkillCategory選擇最合適的現有分類。 - 嚴禁隨意建立新分類。只有在現有分類完全不適用時,才應在
@src/types/skill.ts中新增定義後再使用。
- 優先從
- 資料庫同步:更新
database/init_skills.sql。 - 前端同步:更新
src/data/skills.ts。 - 清單同步:執行
npm run prebuild更新skills-manifest.json。
⚠️ 常見問題與教訓 (Lessons Learned)
在執行導入任務時,請務必注意以下曾發生的錯誤,以確保資料完整性:
1. 遺漏深層子目錄 (Missing Subdirectories)
- 問題:僅抓取根目錄的
SKILL.md,忽略了references/、scripts/或services/等關鍵參考資料。 - 對策:在定位技能後,必須遞迴掃描該目錄下的所有子資料夾。若
SKILL.md中有提到其他檔案連結,需優先補齊。
2. 中文編碼損壞 (Encoding Corruption)
- 問題:在 Windows 環境下使用 PowerShell 的
Set-Content或>重導向符號處理包含中文的檔案時,會導致編碼轉為 ANSI/UTF-16,使繁體中文變成亂碼 (?)。 - 對策:嚴禁使用 PowerShell 原生命令修改檔案內容。請統一使用
write_file工具或 Node.js 腳本並明確指定utf8編碼寫入。
3. 抓取後未寫入 (Silent Write Failure)
- 問題:使用
web_fetch獲取內容後,因流程中斷或遺漏步驟而未執行write_file,導致本地出現空資料夾。 - 對策:每抓取一個檔案,應立即執行對應的寫入指令,並在完成後使用
ls -R或dir /s驗證檔案是否確實存在於磁碟。
4. 清單未包含深層檔案 (Manifest Sync)
- 問題:
skills-manifest.json可能未掃描到過深層級的檔案,導致前端顯示異常。 - 對策:完成檔案寫入後,務必執行
npm run prebuild觸發generate-manifest.js重新掃描,並隨機抽查json內容。
5. 遺漏配置文件 (Missing skill.json)
- 問題:部分 Repo(如
claude-starter)將自動啟用的元數據放在skill.json中,若未抓取會導致技能功能不完整。 - 對策:導入時必須同時抓取同目錄下的
skill.json。核心原則:使用者透過此平台下載的 SKILL 必須是完全體,嚴禁出現功能缺失或檔案不全的狀況。
6. 誤判技能路徑 (Skill Path Misidentification)
- 問題:習慣性尋找
skills/資料夾,而忽略了有些 Repo 本身就是一個單一技能。 - 對策:若根目錄存在
SKILL.md,應優先判斷該 Repo 是否為單一技能專案。在此情況下,抓取根目錄下的所有相關檔案(如references/,scripts/等)進行導入。
7. 分類不一致 (Category Inconsistency)
- 問題:新增技能時使用了未在系統定義的分類名稱,導致前端顯示異常或型別錯誤。
- 對策:所有分類必須對齊
@src/types/skill.ts中的SkillCategory。若需新增分類,必須先修改該型別定義檔案。
? 技巧:如何有效獲取 GitHub 內容
- 使用
web_fetch抓取目錄清單時,請觀察檔案結構。 - 如果是大型 Repo,優先尋找
README.md中提到的技能目錄。 - 確保抓取原始內容 (Raw Content) 以避免 HTML 標籤干擾。
04 同仓库更多 Skills
what-if-oracle
Run structured What-If scenario analysis with multi-branch possibility exploration. Use this skill when the user asks speculative questions like "what if...", "what would happen if...", "what are the possibilities", "explore scenarios", "scenario analysis", "possibility space", "what could go wrong", "best case / worst case", "risk analysis", "contingency planning", "strategic options", or any question about uncertain futures. Also trigger when the user faces a fork-in-the-road decision, wants to stress-test an idea, or needs to think through consequences before committing.
venue-templates
Access comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
the-fool
Use when challenging ideas, plans, decisions, or proposals using structured critical reasoning. Invoke to play devil's advocate, run a pre-mortem, red team, or audit evidence and assumptions.
scientific-writing
Core skill for the deep research and writing tool. Write scientific manuscripts in full paragraphs (never bullet points). Use two-stage process with (1) section outlines with key points using research-lookup then (2) convert to flowing prose. IMRAD structure, citations (APA/AMA/Vancouver), figures/tables, reporting guidelines (CONSORT/STROBE/PRISMA), for research papers and journal submissions.
scientific-brainstorming
Creative research ideation and exploration. Use for open-ended brainstorming sessions, exploring interdisciplinary connections, challenging assumptions, or identifying research gaps. Best for early-stage research planning when you do not have specific observations yet. For formulating testable hypotheses from data use hypothesis-generation.
research-lookup
Look up current research information using the Parallel Chat API (primary) or Perplexity sonar-pro-search (academic paper searches). Automatically routes queries to the best backend. Use for finding papers, gathering research data, and verifying scientific information.