layer-detector

Analyze FSD layer structure and enumerate slices, segments, and public APIs.

4|Updated Jan 13, 2026
One-click install
npx skills add https://github.com/jhlee0409/claude-plugins --skill layer-detector
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: layer-detector
Source: https://github.com/jhlee0409/claude-plugins/tree/main/plugins/fsd-architect/skills/layer-detector
Command: npx skills add https://github.com/jhlee0409/claude-plugins --skill layer-detector

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Detects and analyzes FSD layer structure in a project to validate architecture and slice organization.

Core Features & Use Cases

  • Detect standard and sliced layers (app/core/pages, features, entities, widgets, shared) and their existence.
  • Enumerate slices within each sliced layer and detect segments (ui, model, api, etc.) plus custom ones.
  • Identify public API presence (index.ts/tsx/js) and count files per slice for architecture auditing.
  • Supports Next.js style aliasing (core/views) through user-configurable layer aliases and configurable path mappings.
  • Provide a summarized layer map for architectural decisions.

Quick Start

Run the layer-detector skill against a repository with a typical src layout. If a source directory is not provided, initialize with /fsdarch:init --src <path>, then run /fsdarch:analyze to produce the layer map. You can also specify a srcDir parameter to target a specific folder, for example: /fsdarch:analyze --srcDir src/.

Frequently Asked Questions about layer-detector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I analyze FSD layer structure and slice organization in my codebase?

Layer detection works by enumerating standard and sliced layers like app, features, entities, widgets, and shared, then identifying segments, public API files, and export patterns to reveal your project's slice organization and architectural compliance.

Can I detect FSD slices in a Next.js project using path aliases?

Yes, FSD slice detection supports Next.js style aliasing by applying user-configurable layer aliases and path mappings to accurately identify layers like core/views and their underlying segments within your aliased project structure.

How do I audit public API presence across FSD slices?

To audit public API presence, the detector identifies index.ts, index.tsx, and index.js files within each slice, counts files per segment, and surfaces export patterns to validate architectural boundaries and reveal structural inconsistencies.

What is the best way to map FSD layers and segments for architectural auditing?

The best way to map FSD layers for auditing is to run an analysis command against your repository's src directory, which produces a summarized layer map showing slice existence, segment organization, and file counts for architectural decisions.

Does the FSD layer detector work with custom segments outside of ui, model, and api?

Yes, the FSD layer detector works with custom segments by enumerating not only standard segments like ui, model, and api but also discovering and mapping custom segment folders within each slice to support flexible architectural patterns.