File contents 專案結構指南
Language : English | 繁體中文
版本 :1.1.0
最後更新 :2026-03-04
適用性 :Claude Code Skills
目的
此技能提供根據語言和框架慣例建構專案的指引,協助建立一致、可維護的目錄佈局。
觸發時機
在以下情況使用此技能:
建立新專案
重組現有專案結構
新增模組或功能
設定建構配置
建立 .gitignore 檔案
決定檔案的放置位置(程式碼、文件、設定、資源)
在 utils/、helpers/、shared/、lib/ 或 internal/ 之間做選擇
放置開發中間產物(腦力激盪、RFC、POC、技術調查)
支援的語言
語言
框架/模式
Node.js
Express、NestJS、Next.js
Python
Django、Flask、FastAPI
Java
Spring Boot、Maven、Gradle
.NET
ASP.NET Core、Console
Go
標準佈局、cmd/pkg
Rust
Binary、Library、Workspace
Kotlin
Gradle、Android、Multiplatform
PHP
Laravel、Symfony、PSR-4
Ruby
Rails、Gem、Sinatra
Swift
SPM、iOS App、Vapor
常見結構模式
標準目錄
project-root/
├── src/ # 原始碼
├── tests/ # 測試檔案
├── docs/ # 文件
├── tools/ # 建構/部署腳本
├── examples/ # 使用範例
├── config/ # 配置檔案
└── .github/ # GitHub 配置
建構輸出(始終 gitignore)
dist/ # 發佈輸出
build/ # 編譯產物
out/ # 輸出目錄
bin/ # 二進位執行檔
語言特定指南
Node.js
project/
├── src/
│ ├── index.js
│ ├── routes/
│ ├── controllers/
│ ├── services/
│ └── models/
├── tests/
├── package.json
└── .gitignore
Python
project/
├── src/
│ └── package_name/
│ ├── __init__.py
│ └── main.py
├── tests/
├── pyproject.toml
└── .gitignore
Go
project/
├── cmd/
│ └── appname/
│ └── main.go
├── internal/
├── pkg/
├── go.mod
└── .gitignore
快速操作
建立專案結構
當被要求建立專案時:
詢問語言/框架
生成適當的目錄結構
建立必要的配置檔案
生成 .gitignore
審查結構
審查現有結構時:
檢查語言慣例
驗證 gitignore 模式
建議改進
識別放錯位置的檔案
規則
遵循語言慣例 - 每種語言都有既定模式
分離關注點 - 將原始碼、測試、文件分開
Gitignore 建構輸出 - 永不提交 dist/、build/、out/
一致命名 - 使用語言適當的命名風格
配置在根目錄 - 將配置檔案放在專案根目錄
辨析目錄術語 - utils/(無狀態、通用)、helpers/(層級綁定)、shared/(跨模組)、lib/(包裝依賴)
工作文件放 docs/working/ - 腦力激盪、RFC、POC、技術調查放在 docs/working/ 並進行生命週期管理
生成碼分離 - 放在 src/generated/{type}/,永不與手寫程式碼混合
相關標準
1 --- 2 name: project-structure-guide-2 3 description: 專案結構指南 4 --- 5 6 # 專案結構指南 7 8 > **Language**: [English](../../../../skills/project-structure-guide/SKILL.md) | 繁體中文 9 10 **版本**:1.1.0 11 **最後更新**:2026-03-04 12 **適用性**:Claude Code Skills 13 14 --- 15 16 ## 目的 17 18 此技能提供根據語言和框架慣例建構專案的指引,協助建立一致、可維護的目錄佈局。 19 20 ## 觸發時機 21 22 在以下情況使用此技能: 23 - 建立新專案 24 - 重組現有專案結構 25 - 新增模組或功能 26 - 設定建構配置 27 - 建立 .gitignore 檔案 28 - 決定檔案的放置位置(程式碼、文件、設定、資源) 29 - 在 utils/、helpers/、shared/、lib/ 或 internal/ 之間做選擇 30 - 放置開發中間產物(腦力激盪、RFC、POC、技術調查) 31 32 ## 支援的語言 33 34 | 語言 | 框架/模式 | 35 |------|-----------| 36 | Node.js | Express、NestJS、Next.js | 37 | Python | Django、Flask、FastAPI | 38 | Java | Spring Boot、Maven、Gradle | 39 | .NET | ASP.NET Core、Console | 40 | Go | 標準佈局、cmd/pkg | 41 | Rust | Binary、Library、Workspace | 42 | Kotlin | Gradle、Android、Multiplatform | 43 | PHP | Laravel、Symfony、PSR-4 | 44 | Ruby | Rails、Gem、Sinatra | 45 | Swift | SPM、iOS App、Vapor | 46 47 ## 常見結構模式 48 49 ### 標準目錄 50 51 ``` 52 project-root/ 53 ├── src/ # 原始碼 54 ├── tests/ # 測試檔案 55 ├── docs/ # 文件 56 ├── tools/ # 建構/部署腳本 57 ├── examples/ # 使用範例 58 ├── config/ # 配置檔案 59 └── .github/ # GitHub 配置 60 ``` 61 62 ### 建構輸出(始終 gitignore) 63 64 ``` 65 dist/ # 發佈輸出 66 build/ # 編譯產物 67 out/ # 輸出目錄 68 bin/ # 二進位執行檔 69 ``` 70 71 ## 語言特定指南 72 73 ### Node.js 74 75 ``` 76 project/ 77 ├── src/ 78 │ ├── index.js 79 │ ├── routes/ 80 │ ├── controllers/ 81 │ ├── services/ 82 │ └── models/ 83 ├── tests/ 84 ├── package.json 85 └── .gitignore 86 ``` 87 88 ### Python 89 90 ``` 91 project/ 92 ├── src/ 93 │ └── package_name/ 94 │ ├── __init__.py 95 │ └── main.py 96 ├── tests/ 97 ├── pyproject.toml 98 └── .gitignore 99 ``` 100 101 ### Go 102 103 ``` 104 project/ 105 ├── cmd/ 106 │ └── appname/ 107 │ └── main.go 108 ├── internal/ 109 ├── pkg/ 110 ├── go.mod 111 └── .gitignore 112 ``` 113 114 ## 快速操作 115 116 ### 建立專案結構 117 118 當被要求建立專案時: 119 1. 詢問語言/框架 120 2. 生成適當的目錄結構 121 3. 建立必要的配置檔案 122 4. 生成 .gitignore 123 124 ### 審查結構 125 126 審查現有結構時: 127 1. 檢查語言慣例 128 2. 驗證 gitignore 模式 129 3. 建議改進 130 4. 識別放錯位置的檔案 131 132 ## 規則 133 134 1. **遵循語言慣例** - 每種語言都有既定模式 135 2. **分離關注點** - 將原始碼、測試、文件分開 136 3. **Gitignore 建構輸出** - 永不提交 dist/、build/、out/ 137 4. **一致命名** - 使用語言適當的命名風格 138 5. **配置在根目錄** - 將配置檔案放在專案根目錄 139 6. **辨析目錄術語** - utils/(無狀態、通用)、helpers/(層級綁定)、shared/(跨模組)、lib/(包裝依賴) 140 7. **工作文件放 docs/working/** - 腦力激盪、RFC、POC、技術調查放在 docs/working/ 並進行生命週期管理 141 8. **生成碼分離** - 放在 src/generated/{type}/,永不與手寫程式碼混合 142 143 ## 相關標準 144 145 - [核心:專案結構](../../core/project-structure.md) 146 - [核心:文件結構](../../core/documentation-structure.md) 147 - [指南:檔案歸檔決策指南](../../core/guides/file-placement-guide.md) 148 - [AI:專案結構選項](../../../../options/project-structure/)
AsiaOstrich/universal-dev-standards/tree/main/.gemini/skills/project-structure-guide commit 3e0d654adc
Frequently asked questions How do I install the Project Structure Guide skill? Run npx skillmds@latest add asiaostrich/project-structure-guide-2 in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Project Structure Guide skill do? 專案結構指南 It is listed under Coding & Dev Tools on SkillMD.
Is Project Structure Guide safe to use? This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Project Structure Guide? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Project Structure Guide free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Project Structure Guide? AsiaOstrich (@asiaostrich) published this skill. Their other Agent Skills are listed on their SkillMD profile.