From fuse-solid
Multi-language SOLID detection rules. Project type detection, interface locations, file size limits per language.
How this skill is triggered — by the user, by Claude, or both
Slash command
/fuse-solid:solid-detectionThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Detect project type from configuration files:
Detect project type from configuration files:
# Next.js (priority over React)
[ -f "package.json" ] && grep -q '"next"' package.json
# React (no "next" in package.json)
[ -f "package.json" ] && grep -q '"react"' package.json && ! grep -q '"next"' package.json
# Generic TypeScript (no react/next, has .ts files)
[ -f "package.json" ] && ! grep -q '"react"' package.json && ! grep -q '"next"' package.json
[ -f "tsconfig.json" ] || [ -f "bun.lockb" ] || [ -f "bunfig.toml" ]
# Laravel
[ -f "composer.json" ] && grep -q '"laravel' composer.json
# Swift
[ -f "Package.swift" ] || ls *.xcodeproj
# Java
[ -f "pom.xml" ] || [ -f "build.gradle" ] || [ -f "build.gradle.kts" ]
# Go
[ -f "go.mod" ]
# Ruby
[ -f "Gemfile" ] && [ -f "Rakefile" ]
# Rust
[ -f "Cargo.toml" ]
# Python
[ -f "pyproject.toml" ] || [ -f "requirements.txt" ]
Priority order: Next.js > React > Generic TS > Laravel > Swift > Java > Go > Ruby > Rust > Python
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | modules/[feature]/src/interfaces/ |
| Shared interfaces | modules/cores/interfaces/ |
| Forbidden | Interfaces in components/, app/ |
| SOLID skill | solid-nextjs |
Pattern detection:
^(export )?(interface|type) \w+
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | modules/[feature]/src/interfaces/ |
| Shared interfaces | modules/cores/interfaces/ |
| Forbidden | Interfaces in components/ files |
| SOLID skill | solid-react |
Pattern detection:
^(export )?(interface|type) \w+
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | modules/[feature]/src/interfaces/ |
| Shared interfaces | modules/cores/interfaces/ |
| Structure | Modular MANDATORY |
| Forbidden | Interfaces in service/lib files |
| SOLID skill | solid-generic |
Pattern detection:
^(export )?(interface|type) \w+
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | FuseCore/[Module]/App/Contracts/ |
| Shared interfaces | FuseCore/Core/App/Contracts/ |
| Structure | FuseCore Modular MANDATORY |
| Forbidden | Interfaces outside Contracts/ |
| SOLID skill | solid-php |
Pattern detection:
^interface \w+
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | Features/[Feature]/Protocols/ |
| Shared interfaces | Core/Protocols/ |
| Structure | Features Modular MANDATORY |
| Forbidden | Protocols outside Protocols/ |
| SOLID skill | solid-swift |
Pattern detection:
^protocol \w+
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | modules/[feature]/interfaces/ |
| Shared interfaces | modules/core/interfaces/ |
| Structure | Modular MANDATORY |
| Forbidden | Interfaces in impl files |
| SOLID skill | solid-java |
Pattern detection:
^(public )?(interface) \w+
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | internal/modules/[feature]/ports/ |
| Shared interfaces | internal/core/ports/ |
| Structure | Modular MANDATORY |
| Forbidden | Interfaces in impl files |
| SOLID skill | solid-go |
Pattern detection:
^type \w+ interface \{
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | app/modules/[feature]/contracts/ |
| Shared interfaces | app/modules/core/contracts/ |
| Structure | Modular MANDATORY |
| Forbidden | Contracts in model files |
| SOLID skill | solid-ruby |
Pattern detection:
^module \w+Contract
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | src/modules/[feature]/traits.rs |
| Shared interfaces | src/core/traits.rs |
| Structure | Modular MANDATORY |
| Forbidden | Traits in impl files |
| SOLID skill | solid-rust |
Pattern detection:
^pub trait \w+
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | src/interfaces/ |
| Forbidden | ABC outside interfaces/ |
Pattern detection:
class \w+\(.*ABC.*\)
Exclude from count:
//, /* */, #, """)# TypeScript/Go/Rust/Swift
grep -v '^\s*$\|^\s*//\|^\s*/\*\|^\s*\*' file
# PHP
grep -v '^\s*$\|^\s*//\|^\s*#\|^\s*/\*\|^\s*\*' file
# Python
grep -v '^\s*$\|^\s*#\|^\s*"""' file
| Severity | Action |
|---|---|
| Interface in wrong location | BLOCK (exit 2) |
| File over limit | WARNING (exit 0) |
| Missing documentation | WARNING |
| Project Type | SOLID Skill | Skill Path |
|---|---|---|
nextjs | solid-nextjs | nextjs-expert/skills/solid-nextjs/ |
react | solid-react | react-expert/skills/solid-react/ |
generic | solid-generic | solid/skills/solid-generic/ |
laravel | solid-php | laravel-expert/skills/solid-php/ |
swift | solid-swift | swift-apple-expert/skills/solid-swift/ |
java | solid-java | solid/skills/solid-java/ |
go | solid-go | solid/skills/solid-go/ |
ruby | solid-ruby | solid/skills/solid-ruby/ |
rust | solid-rust | solid/skills/solid-rust/ |
python | (no skill yet) | - |
Set by detect-project.sh:
SOLID_PROJECT_TYPE=nextjs|react|generic|laravel|swift|java|go|ruby|rust|python|unknown
SOLID_FILE_LIMIT=100|150
SOLID_INTERFACE_DIR=path/to/interfaces
SOLID_STRUCTURE=modular
npx claudepluginhub fusengine/agents --plugin fuse-solidScans project files to detect languages, loads language-specific safety rules, and checks code against antipatterns to prevent bugs and vulnerabilities.
Code quality validation with linters, SOLID principles, DRY detection, error detection, and architecture compliance across all languages.
SOLID principles for generic TypeScript, Bun, and Node.js projects. Files < 100 lines, interfaces separated, JSDoc mandatory. Use for CLI tools, libraries, scripts, hooks, and non-framework TypeScript code.