Agent skill
solid-detection
Multi-language SOLID detection rules. Project type detection, interface locations, file size limits per language.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/solid-detection
SKILL.md
SOLID Detection Skill
Project Detection
Detect project type from configuration files:
# Next.js
[ -f "package.json" ] && grep -q '"next"' package.json
# Laravel
[ -f "composer.json" ] && grep -q '"laravel' composer.json
# Swift
[ -f "Package.swift" ] || ls *.xcodeproj
# Go
[ -f "go.mod" ]
# Rust
[ -f "Cargo.toml" ]
# Python
[ -f "pyproject.toml" ] || [ -f "requirements.txt" ]
Language Rules
Next.js / TypeScript
| Rule | Value |
|---|---|
| File limit | 150 lines |
| Interface location | modules/cores/interfaces/ |
| Forbidden | Interfaces in components/, app/ |
Pattern detection:
^(export )?(interface|type) \w+
Laravel / PHP
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | app/Contracts/ |
| Forbidden | Interfaces outside Contracts |
Pattern detection:
^interface \w+
Swift
| Rule | Value |
|---|---|
| File limit | 150 lines |
| Interface location | Protocols/ |
| Forbidden | Protocols outside Protocols/ |
Pattern detection:
^protocol \w+
Go
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | internal/interfaces/ |
| Forbidden | Interfaces outside interfaces/ |
Pattern detection:
^type \w+ interface \{
Python
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | src/interfaces/ |
| Forbidden | ABC outside interfaces/ |
Pattern detection:
class \w+\(.*ABC.*\)
Rust
| Rule | Value |
|---|---|
| File limit | 100 lines |
| Interface location | src/traits/ |
| Forbidden | Traits outside traits/ |
Pattern detection:
^pub trait \w+
Line Counting
Exclude from count:
- Blank lines
- Comments (
//,/* */,#,""") - Import statements (optional)
# 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
Validation Actions
| Severity | Action |
|---|---|
| Interface in wrong location | BLOCK (exit 2) |
| File over limit | WARNING (exit 0) |
| Missing documentation | WARNING |
Environment Variables
Set by detect-project.sh:
SOLID_PROJECT_TYPE=nextjs|laravel|swift|go|rust|python|unknown
SOLID_FILE_LIMIT=100|150
SOLID_INTERFACE_DIR=path/to/interfaces
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?