Skip to content

cdcd72/copilot-configs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Copilot 設定

本儲存庫用於集中管理 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:授權條款。

Hook 提示記錄設定

目前 userPromptSubmitted 事件使用 scripts/log-prompt.ps1,可透過 .github/hooks/hooks.jsonenv 控制:

  • LOG_LEVEL:記錄門檻,支援 OFFERRORWARNINFODEBUG
  • LOG_DIR:日誌輸出目錄(預設為 logs)。
  • LOG_INCLUDE_PROMPT_CONTENTtrue/false,是否寫入完整 prompt
  • LOG_INCLUDE_RAW_PAYLOADtrue/false,是否寫入 rawPayload

預設輸出檔案為 logs/prompt_logs.jsonl,每行一筆 JSON,常見欄位包含:

  • timestampUtc
  • level
  • event
  • user
  • workspace
  • promptLength
  • promptHash
  • promptPreview

LOG_LEVEL=DEBUG 時,會額外包含 debug 診斷欄位。

🔥 建議將 logs/ 加入 .gitignore,避免將提示記錄(可能含敏感內容)提交到版本庫。

快速上手

  1. 將專用代理放在 .github/agents/
  2. 將鉤子設定放在 .github/hooks/hooks.json
  3. 將可重用規範放在 .github/instructions/
  4. 將可重用提示放在 .github/prompts/
  5. skills-lock.json 管理 skills 來源;新增 skill 後同步更新 lock 檔。

維護建議

  • 新增/調整 agent、hook、instruction、prompt、skill 後,同步更新本 README 的「目前結構」與說明。
  • 保持 .github/instructions/*.mdapplyTo 範圍精準,避免規則誤套用。

貢獻

  • 歡迎透過 Issue 與 PR 提出改進或問題回報。

About

收集過往使用的 Copilot 設定。

Topics

Resources

License

Stars

Watchers

Forks

Contributors