Project Structure Guide
Language: English | 繁體中文
Version: 1.1.0
Last Updated: 2026-03-04
Applicability: Claude Code Skills
Purpose
This skill provides guidance on structuring projects according to language and framework conventions. It helps create consistent, maintainable directory layouts.
[Physical Binding]
Reality Check
Before confirming the project structure is valid, you MUST:
- Run the validator:
uds check --standard project-structure
- IF exit_code != 0:
- Read the error message (e.g., "Missing required directories").
- Report the violation to the user.
- Suggest specific commands (
mkdir ...) to fix it.
- RETRY validation after fixes are applied.
Trigger
Use this skill when:
- Creating a new project
- Reorganizing existing project structure
- Adding new modules or features
- Setting up build configuration
- Creating .gitignore files
- Deciding where to place a file (code, docs, config, asset)
- Choosing between utils/, helpers/, shared/, lib/, or internal/
- Placing development artifacts (brainstorms, RFCs, POCs, investigations)
Supported Languages
| Language |
Frameworks/Patterns |
| Node.js |
Express, NestJS, Next.js |
| Python |
Django, Flask, FastAPI |
| Java |
Spring Boot, Maven, Gradle |
| .NET |
ASP.NET Core, Console |
| Go |
Standard layout, cmd/pkg |
| Rust |
Binary, Library, Workspace |
| Kotlin |
Gradle, Android, Multiplatform |
| PHP |
Laravel, Symfony, PSR-4 |
| Ruby |
Rails, Gem, Sinatra |
| Swift |
SPM, iOS App, Vapor |
Common Structure Patterns
Standard Directories
project-root/
├── src/ # Source code
├── tests/ # Test files
├── docs/ # Documentation
├── tools/ # Build/deployment scripts
├── examples/ # Usage examples
├── config/ # Configuration files
└── .github/ # GitHub configuration
Build Output (Always gitignore)
dist/ # Distribution output
build/ # Compiled artifacts
out/ # Output directory
bin/ # Binary executables
Language-Specific Guidelines
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
Quick Actions
Create Project Structure
When asked to create a project:
- Ask for language/framework
- Generate appropriate directory structure
- Create essential config files
- Generate .gitignore
Review Structure
When reviewing existing structure:
- Check language conventions
- Verify gitignore patterns
- Suggest improvements
- Identify misplaced files
Rules
- Follow language conventions - Each language has established patterns
- Separate concerns - Keep source, tests, docs separate
- Gitignore build outputs - Never commit dist/, build/, out/
- Consistent naming - Use language-appropriate casing
- Config at root - Place config files at project root
- Disambiguate directories - utils/ (stateless, generic), helpers/ (layer-bound), shared/ (cross-module), lib/ (wrapped deps)
- Working docs in docs/working/ - Brainstorms, RFCs, POCs, investigations go in docs/working/ with lifecycle management
- Generated code separated - Place in src/generated/{type}/, never mix with hand-written code
Next Steps Guidance | 下一步引導
After /project-structure completes, the AI assistant should suggest:
專案結構已建立或審查完成。建議下一步 / Project structure created or reviewed. Suggested next steps:
- 執行
/sdd 開始規格驅動開發,將專案結構納入正式規格 ⭐ Recommended / 推薦 — 確保結構決策有規格追蹤 / Ensures structure decisions are tracked in specs
- 執行
/docs 產生專案文件(README、ARCHITECTURE.md 等) — 讓結構決策有文件記錄 / Document structure decisions
- 執行
/ai-friendly-architecture 設定 AI 上下文配置 — 讓 AI 助手更好地理解專案結構 / Help AI assistants understand the project structure
Related Standards
1---2name: project-structure-guide3scope: universal4description: |5 Guide for organizing project directories following language-specific best practices.6 Use when: creating projects, reorganizing structure, adding modules, setting up builds, deciding file placement.7 Not for: structuring specifically for AI navigation — use /ai-friendly-architecture; restructuring existing code in place — use /refactor.8 Keywords: project, structure, directory, layout, gitignore, scaffold, file placement, utils, helpers, shared, where to put.9---1011# Project Structure Guide1213> **Language**: English | [繁體中文](../../locales/zh-TW/skills/project-structure-guide/SKILL.md)1415**Version**: 1.1.016**Last Updated**: 2026-03-0417**Applicability**: Claude Code Skills1819---2021## Purpose2223This skill provides guidance on structuring projects according to language and framework conventions. It helps create consistent, maintainable directory layouts.2425# [Physical Binding]26## Reality Check27Before confirming the project structure is valid, you MUST:281. Run the validator: `uds check --standard project-structure`292. IF exit_code != 0:30 - Read the error message (e.g., "Missing required directories").31 - Report the violation to the user.32 - Suggest specific commands (`mkdir ...`) to fix it.33 - RETRY validation after fixes are applied.3435## Trigger3637Use this skill when:38- Creating a new project39- Reorganizing existing project structure40- Adding new modules or features41- Setting up build configuration42- Creating .gitignore files43- Deciding where to place a file (code, docs, config, asset)44- Choosing between utils/, helpers/, shared/, lib/, or internal/45- Placing development artifacts (brainstorms, RFCs, POCs, investigations)4647## Supported Languages4849| Language | Frameworks/Patterns |50|----------|---------------------|51| Node.js | Express, NestJS, Next.js |52| Python | Django, Flask, FastAPI |53| Java | Spring Boot, Maven, Gradle |54| .NET | ASP.NET Core, Console |55| Go | Standard layout, cmd/pkg |56| Rust | Binary, Library, Workspace |57| Kotlin | Gradle, Android, Multiplatform |58| PHP | Laravel, Symfony, PSR-4 |59| Ruby | Rails, Gem, Sinatra |60| Swift | SPM, iOS App, Vapor |6162## Common Structure Patterns6364### Standard Directories6566```67project-root/68├── src/ # Source code69├── tests/ # Test files70├── docs/ # Documentation71├── tools/ # Build/deployment scripts72├── examples/ # Usage examples73├── config/ # Configuration files74└── .github/ # GitHub configuration75```7677### Build Output (Always gitignore)7879```80dist/ # Distribution output81build/ # Compiled artifacts82out/ # Output directory83bin/ # Binary executables84```8586## Language-Specific Guidelines8788### Node.js8990```91project/92├── src/93│ ├── index.js94│ ├── routes/95│ ├── controllers/96│ ├── services/97│ └── models/98├── tests/99├── package.json100└── .gitignore101```102103### Python104105```106project/107├── src/108│ └── package_name/109│ ├── __init__.py110│ └── main.py111├── tests/112├── pyproject.toml113└── .gitignore114```115116### Go117118```119project/120├── cmd/121│ └── appname/122│ └── main.go123├── internal/124├── pkg/125├── go.mod126└── .gitignore127```128129## Quick Actions130131### Create Project Structure132133When asked to create a project:1341. Ask for language/framework1352. Generate appropriate directory structure1363. Create essential config files1374. Generate .gitignore138139### Review Structure140141When reviewing existing structure:1421. Check language conventions1432. Verify gitignore patterns1443. Suggest improvements1454. Identify misplaced files146147## Rules1481491. **Follow language conventions** - Each language has established patterns1502. **Separate concerns** - Keep source, tests, docs separate1513. **Gitignore build outputs** - Never commit dist/, build/, out/1524. **Consistent naming** - Use language-appropriate casing1535. **Config at root** - Place config files at project root1546. **Disambiguate directories** - utils/ (stateless, generic), helpers/ (layer-bound), shared/ (cross-module), lib/ (wrapped deps)1557. **Working docs in docs/working/** - Brainstorms, RFCs, POCs, investigations go in docs/working/ with lifecycle management1568. **Generated code separated** - Place in src/generated/{type}/, never mix with hand-written code157158## Next Steps Guidance | 下一步引導159160After `/project-structure` completes, the AI assistant should suggest:161162> **專案結構已建立或審查完成。建議下一步 / Project structure created or reviewed. Suggested next steps:**163> - 執行 `/sdd` 開始規格驅動開發,將專案結構納入正式規格 ⭐ **Recommended / 推薦** — 確保結構決策有規格追蹤 / Ensures structure decisions are tracked in specs164> - 執行 `/docs` 產生專案文件(README、ARCHITECTURE.md 等) — 讓結構決策有文件記錄 / Document structure decisions165> - 執行 `/ai-friendly-architecture` 設定 AI 上下文配置 — 讓 AI 助手更好地理解專案結構 / Help AI assistants understand the project structure166167---168169## Related Standards170171- [Language-specific patterns](./language-patterns.md) — concrete directory layouts per language (Node.js/TypeScript, Python, Go, and others). Read it when laying out a project in a specific language.172- [Core: Project Structure](../../core/project-structure.md)173- [Core: Documentation Structure](../../core/documentation-structure.md)174- [Guide: File Placement Decision Guide](../../core/guides/file-placement-guide.md)175- [AI: Project Structure Options](../../ai/options/project-structure/)