Back to Skills

boundary-checker

verified

Check FSD import boundary rules and detect violations

View on GitHub

Marketplace

local-plugins

jhlee0409/claude-plugins

Plugin

fsd-architect

Repository

jhlee0409/claude-plugins
2stars

plugins/fsd-architect/skills/boundary-checker/SKILL.md

Last Verified

January 23, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/jhlee0409/claude-plugins/blob/main/plugins/fsd-architect/skills/boundary-checker/SKILL.md -a claude-code --skill boundary-checker

Installation paths:

Claude
.claude/skills/boundary-checker/
Powered by add-skill CLI

Instructions

# Boundary Checker Skill

FSD Import 경계 규칙을 검사하고 위반 사항을 감지합니다.

## EXECUTION INSTRUCTIONS

### Step 1: Load Layer Map

1. Use layer-detector skill to get current layer map
2. Build layer hierarchy for validation

### Step 2: Collect Import Statements

For each file in the project:

1. Read file content
2. Extract import statements using regex:
   ```regex
   import\s+.*?\s+from\s+['"]([^'"]+)['"]
   ```
   **SECURITY NOTE:** Use non-greedy `.*?` instead of greedy `.*` to prevent ReDoS
   (Regular Expression Denial of Service) attacks from maliciously crafted import statements.

   **Alternative safer patterns:**
   ```regex
   # More specific pattern (recommended for production)
   import\s+(?:\{[^}]*\}|[^'"]+)\s+from\s+['"]([^'"]+)['"]

   # Or use multiple specific patterns:
   import\s+\{[^}]*\}\s+from\s+['"]([^'"]+)['"]   # Named imports
   import\s+\w+\s+from\s+['"]([^'"]+)['"]         # Default imports
   import\s+\*\s+as\s+\w+\s+from\s+['"]([^'"]+)['"]  # Namespace imports
   ```
3. Categorize imports:
   - Absolute (alias): `@entities/user`
   - Relative: `../model/types`
   - External: `react`, `lodash`

### Step 3: Resolve Import Paths

For each import:

1. If alias, resolve using config aliases
2. If relative, resolve from current file path
3. Determine target layer and slice

### Step 4: Check Layer Hierarchy

```
Layer Hierarchy (top to bottom):
  app (6)
  pages (5)
  widgets (4)
  features (3)
  entities (2)
  shared (1)
```

**Rule: Lower number cannot import from higher number**

For each import:
1. Get source layer rank
2. Get target layer rank
3. If source rank < target rank → VIOLATION

### Step 5: Check Cross-Slice Imports

For sliced layers (pages, widgets, features, entities):

**Rule: Slices in the same layer cannot import from each other**

For each import within a sliced layer:
1. Get source slice
2. Get target slice
3. If source ≠ target and same layer → VIOLATION

**Exception: `@x/` cross-reference pattern is allowed.**

The @x/ pattern e

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
9433 chars