本儲存庫用於集中管理 GitHub Copilot 的自訂設定,包含 agents、instructions、prompts 與 skills。
.
├─ .agents/
│ └─ skills/
│ ├─ doc-coauthoring/SKILL.md
│ └─ find-skills/SKILL.md
├─ .github/
│ ├─ agents/
│ │ └─ code-review.agent.md
│ ├─ hooks/
│ │ └─ hooks.json
│ ├─ instructions/
│ │ └─ (None yet)
│ ├─ prompts/
│ │ └─ gitignore.prompt.md
│ └─ workflows/
│ └─ copilot-setup-steps.yml
├─ scripts/
│ └─ log-prompt.ps1
├─ skills-lock.json
├─ README.md
└─ LICENSE
-
.github/agents/:自訂 agent 定義。code-review.agent.md:通用程式碼審查代理,聚焦安全性、效能、架構與測試品質。
-
.github/instructions/:跨任務共用實作規範。(None yet):目前尚無共用實作規範。
-
.github/hooks/:GitHub Copilot Hooks 設定。hooks.json:目前註冊userPromptSubmitted事件,執行scripts/log-prompt.ps1進行提示記錄。
-
.github/prompts/:可重用 prompt 範本。gitignore.prompt.md:協助建立/調整.gitignore規則。
-
.github/workflows/:GitHub Actions 工作流程。copilot-setup-steps.yml:定義 Copilot agent 啟動前的環境準備步驟(含字型安裝)。
-
scripts/:本機腳本。log-prompt.ps1:接收 hook payload,寫入logs/prompt_logs.jsonl,支援等級門檻與敏感欄位開關。
-
.agents/skills/:Agent Skills 定義(由 Copilot 在對應情境自動載入)。doc-coauthoring/SKILL.md:協助撰寫與共同編輯文件、提案、技術規格與決策文件。find-skills/SKILL.md:協助搜尋、挑選與安裝可用 skills(npx skills find/add/check/update)。
-
根目錄檔案:
skills-lock.json:鎖定 skills 來源與 hash,確保技能版本一致。README.md:本儲存庫導覽與維護說明。LICENSE:授權條款。
目前 userPromptSubmitted 事件使用 scripts/log-prompt.ps1,可透過 .github/hooks/hooks.json 的 env 控制:
LOG_LEVEL:記錄門檻,支援OFF、ERROR、WARN、INFO、DEBUG。LOG_DIR:日誌輸出目錄(預設為logs)。LOG_INCLUDE_PROMPT_CONTENT:true/false,是否寫入完整prompt。LOG_INCLUDE_RAW_PAYLOAD:true/false,是否寫入rawPayload。
預設輸出檔案為 logs/prompt_logs.jsonl,每行一筆 JSON,常見欄位包含:
timestampUtcleveleventuserworkspacepromptLengthpromptHashpromptPreview
在 LOG_LEVEL=DEBUG 時,會額外包含 debug 診斷欄位。
🔥 建議將
logs/加入.gitignore,避免將提示記錄(可能含敏感內容)提交到版本庫。
- 將專用代理放在
.github/agents/。 - 將鉤子設定放在
.github/hooks/hooks.json。 - 將可重用規範放在
.github/instructions/。 - 將可重用提示放在
.github/prompts/。 - 以
skills-lock.json管理 skills 來源;新增 skill 後同步更新 lock 檔。
- 新增/調整 agent、hook、instruction、prompt、skill 後,同步更新本 README 的「目前結構」與說明。
- 保持
.github/instructions/*.md的applyTo範圍精準,避免規則誤套用。
- 歡迎透過 Issue 與 PR 提出改進或問題回報。