// Generate comprehensive project structure documentation with intelligent tree representation, meaningful comments, and utility dependency analysis. Use when user asks to document project structure or create architecture overview.
| name | project-structure |
| description | Generate comprehensive project structure documentation with intelligent tree representation, meaningful comments, and utility dependency analysis. Use when user asks to document project structure or create architecture overview. |
| allowed-tools | Bash, Read, Write, Glob, Grep |
Generate PROJECT-STRUCTURE.md with comprehensive tree representation, meaningful comments, and utility dependency analysis.
Important: All file operations should be relative to the git repository root. Always determine the git root first:
GIT_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
Then reference files as $GIT_ROOT/PROJECT-STRUCTURE.md, $GIT_ROOT/package.json, etc.
Detect package manager and read production dependencies:
# Check for package managers (use $GIT_ROOT for all paths)
test -f "$GIT_ROOT/package.json" && echo "node_found"
test -f "$GIT_ROOT/pyproject.toml" && echo "python_toml_found"
test -f "$GIT_ROOT/requirements.txt" && echo "python_requirements_found"
test -f "$GIT_ROOT/Cargo.toml" && echo "rust_found"
test -f "$GIT_ROOT/go.mod" && echo "go_found"
Gather all files (respecting .gitignore):
# Change to git root first, then gather files
cd "$GIT_ROOT"
# Get tracked files
git ls-files
# Get untracked files (respects .gitignore)
git ls-files --others --exclude-standard
Build directory tree structure with root files:
โโโ for items with siblings belowโโโ for last item in directoryโ for vertical continuationpackage.json # Node.js dependencies and scripts
README.md # Project overview and setup instructions
src/ # Source: React components (45), utilities (12). Entry App.tsx
โโโ components/ # UI components: Button, Card, Form. Design system, accessibility. 15 modules
โ โโโ Button/ # Button component: primary/secondary variants. Tests, Storybook stories
โ โโโ Form/ # Form inputs: Input, Select, Checkbox. Validation, error handling
โโโ utils/ # Utilities: formatting, validation, data transformation. 12 helpers
Generate telegraphic comments for directories and root files:
Purpose: key items. Tech/patterns. Countscomponents/ โ "UI components: Button, Card, Form, Modal. Design system, accessibility, tests, stories. 15 modules"components/Button/ โ "Button component: primary/secondary/tertiary variants, loading states. ARIA accessibility, tests, Storybook stories"Analyze utility dependencies:
Write PROJECT-STRUCTURE.md:
File Format:
# Project Structure
*Generated on [current date and time] with the project-structure skill*
[FULL RECURSIVE tree showing ALL directories and files at ALL nesting levels with inline comments]
## Utility Dependencies
**Note:** Before implementing custom utilities, check if functionality exists in these libraries.
[Dependency analysis by category - ONLY if meaningful production dependencies exist]
File Location:
$GIT_ROOT/PROJECT-STRUCTURE.mdUse Write tool:
CRITICAL Tree Requirements:
components/ # UI components: Button, Card. Design system. 15 modules)package.json # Node.js dependencies and scripts)See examples.md for complete example outputs.
File Structure (PROJECT-STRUCTURE.md):
# Project Structure header (level 1, since it's the main document title)*Generated on [date and time] with the project-structure skill*## Utility Dependencies section (level 2, ONLY if meaningful production dependencies exist)File Notes:
$GIT_ROOT/PROJECT-STRUCTURE.mdRead reference materials as needed using progressive disclosure and generate the project structure documentation.