Detect and analyze FSD layer structure in a project
View on GitHubjhlee0409/claude-plugins
fsd-architect
January 23, 2026
Select agents to install to:
npx add-skill https://github.com/jhlee0409/claude-plugins/blob/main/plugins/fsd-architect/skills/layer-detector/SKILL.md -a claude-code --skill layer-detectorInstallation paths:
.claude/skills/layer-detector/# Layer Detector Skill
FSD 레이어 구조를 감지하고 분석합니다.
## WHEN TO USE
This skill is invoked by:
- `/fsdarch:init` - Initial project setup
- `/fsdarch:analyze` - Project analysis
## EXECUTION INSTRUCTIONS
### Step 1: Find Source Directory
**Action:** Determine the source directory path
```
1. Check if srcDir is passed as parameter
→ If yes, use it directly
2. If no parameter, read .fsd-architect.json
→ Use Read tool to get srcDir field
→ Default to "src/" if not specified
3. Verify directory exists:
→ Use Glob: "{srcDir}/"
→ If no match, return error E101
```
**Glob command:**
```bash
Glob: "src/"
# Or if config specifies different path:
Glob: "{config.srcDir}/"
```
### Step 2: Detect Layers
**Action:** Scan for FSD layer directories
**Standard FSD layers (in hierarchy order):**
```
1. shared (lowest - utilities, ui kit, api clients)
2. entities (domain models and business entities)
3. features (user interactions and business logic)
4. widgets (composite UI blocks)
5. pages (route-level compositions) → "views" in Next.js
6. app (highest - app initialization) → "core" in Next.js
```
**Glob commands to execute (in parallel):**
For standard projects:
```bash
Glob: "{srcDir}/app/"
Glob: "{srcDir}/pages/"
Glob: "{srcDir}/widgets/"
Glob: "{srcDir}/features/"
Glob: "{srcDir}/entities/"
Glob: "{srcDir}/shared/"
```
For Next.js projects (layer aliases):
```bash
Glob: "{srcDir}/core/" # app → core
Glob: "{srcDir}/views/" # pages → views
Glob: "{srcDir}/widgets/"
Glob: "{srcDir}/features/"
Glob: "{srcDir}/entities/"
Glob: "{srcDir}/shared/"
```
**Layer alias mapping (user-configurable):**
```typescript
// Layer aliases are stored in .fsd-architect.json
// Users can customize these during /fsdarch:init
interface LayerAliases {
app: string; // 'app', 'core', '_app', 'application', etc.
pages: string; // 'pages', 'views', '_pages', 'screens', etc.
}
// Common presets:
const LAYER_ALIAS_PRESETS = {
standard: { app: 'app', pa