skills/generate-gitignore-by-techstack/SKILL.md
從 github/gitignore 下載對應技術棧的 .gitignore 範本,合併並針對當前專案調整。
npx skillsauth add CloudyWing/ai-dotfiles generate-gitignore-by-techstackInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
掃描專案根目錄,識別使用的語言與工具(與 generate-editorconfig-by-techstack 採用相同偵測邏輯):
| 偵測依據 | 對應 gitignore 範本 |
| --- | --- |
| *.csproj、*.sln | VisualStudio.gitignore |
| package.json | Node.gitignore |
| *.vue | (已含於 Node) |
| *.py、pyproject.toml | Python.gitignore |
| go.mod | Go.gitignore |
| Dockerfile | community/Golang/Go.gitignore(或直接加 docker 排除段) |
| JetBrains IDE(.idea/) | JetBrains.gitignore |
| VS Code(.vscode/) | VisualStudioCode.gitignore |
若 .gitignore 已存在:
若不存在,從空白開始建立。
使用 WebFetch 從以下 URL 下載對應的官方範本(若 WebFetch 不可用,略過此步驟並告知使用者):
https://raw.githubusercontent.com/github/gitignore/main/{TemplateName}.gitignore
範例:
https://raw.githubusercontent.com/github/gitignore/main/VisualStudio.gitignorehttps://raw.githubusercontent.com/github/gitignore/main/Node.gitignorehttps://raw.githubusercontent.com/github/gitignore/main/Python.gitignore判斷分組格式:
.gitignore 已有明確的分組方式(如 ### 技術名稱、# ---、# [名稱] 等),先詢問使用者是否沿用原格式,或改用 # ===== [技術名稱] ===== 格式。# ===== [技術名稱] ===== 作為段落標頭。將各範本內容依技術棧分組,以確認的格式作為段落標頭。
去除各範本之間的重複規則。
加入以下專案慣用規則(若尚未存在):
# ===== 本機環境 =====
CONTEXT.local.md
.env
.env.*
!.env.example
若偵測到 Windows 環境,加入:
# ===== Windows =====
Thumbs.db
Desktop.ini
處理 AI 工具目錄排除規則:
.gitignore 中已有 # ===== AI 工具 =====(或語意相近的 AI 工具段落),僅在該段落內補齊缺少的規則,不重複加入已存在的項目。# ===== AI 工具 =====
.claude/*
!.claude/CLAUDE.md
!.claude/skills/
!.claude/agents/
排除整個 AI 工具目錄時使用 /*(而非 /),以便後續用 ! 指定需追蹤的共用檔案。個人設定檔(如 settings.json、本機快取)不加 ! 例外,保持被排除狀態。.github/ 目錄通常整個納入版控,無需特別排除。
.gitignore。.claude/* 是否已在檔案中):跳過,不重複加入。.claude/ 相關規則,代表 AI 工具區塊已存在):將缺少的規則合併至該段落尾端。輸出:
tools
產生或補齊 .gitattributes,統一行尾處理、二進位識別與 lock files 標記,保留既有自訂偏好。
development
產生或補齊前端 Lint 設定(Prettier + ESLint Flat Config),統一格式化與程式碼品質規則,保留既有自訂偏好。
testing
依據事實校閱報告修改技術文件:以事實層為不可違反的約束,由改檔者負責表達層的措辭與行文連貫。Use when the user asks to apply fact-check results to a document, or to edit a document based on a previously produced fact-check-report.md.
data-ai
多份資料檔整合流程。當需要將兩份以上的資料檔(如 JSON、CSV)合併、補齊闕漏欄位或去重成單一檔案時使用。以 dry-run、筆數核對與抽樣比對降低整合錯誤。