mcpField
S
solid-java

solid-java

github.com/fusengineDevelopment3444 installsUpdated 2w ago
Repository

About solid-java

solid-java is a Java 25+ development skill for applying modular architecture and SOLID principles. It guides coding agents with mandatory reuse checks, structural rules, and references and templates for common components.

Key features

  1. 01Feature-based module structure
  2. 02Mandatory DRY checks before coding
  3. 03SOLID principle references
  4. 04Templates for modules and layers
  5. 05Code size and documentation rules

Use cases

  1. 01Structuring a new Java feature
  2. 02Checking shared code before adding logic
  3. 03Scaffolding services and repositories

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/fusengine/agents --skill solid-java

After installing, type/solid-javain Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
architecture-patterns.md
dependency-inversion.md
interface-segregation.md
liskov-substitution.md
open-closed.md
single-responsibility.md
solid-principles.md
references/templates/
error.md
interface.md
module.md
repository.md
service.md
test.md

Details

From the project README
SOLID Java enforces a modular architecture for Java 25+ (current LTS): every feature lives under `modules/[feature]/` (controllers, services, repositories, interfaces, models/DTOs) with shared code in `modules/core/`, interfaces live only in `modules/[feature]/interfaces/`, controllers stay under 50 lines and delegate to services, records are used for DTOs and sealed types for restricted hierarchies, and every public method carries Javadoc.

Before writing any new code it requires a DRY check against modules/core/services and modules/core/interfaces. See solid-principles.md for the overview, the per-principle references for SRP/OCP/LSP/ISP/DIP detail, and the templates for module/service/interface/repository/error/test scaffolding.

SOLID Java - Modular Architecture

Agent Workflow (MANDATORY)

Before ANY implementation, spawn 3 agents in parallel, one Agent call each with a name:

  1. fuse-ai-pilot:explore-codebase - Analyze existing architecture
  2. fuse-ai-pilot:research-expert - Verify Java docs via Context7
  3. fuse-ai-pilot:sniper - Post-implementation validation

DRY - Reuse Before Creating (MANDATORY)

Before writing ANY new code:

  1. Grep the codebase for similar interfaces, services, or logic
  2. Check shared locations: modules/core/services/, modules/core/interfaces/
  3. If similar code exists -> extend/reuse instead of duplicate
  4. If code will be used by 2+ features -> create it in modules/core/

Architecture (Modules MANDATORY)

LayerLocationMax Lines
Controllersmodules/[feature]/controllers/50
Servicesmodules/[feature]/services/100
Repositoriesmodules/[feature]/repositories/100
Interfacesmodules/[feature]/interfaces/30
Models/DTOsmodules/[feature]/models/50
Sharedmodules/core/{services,interfaces,models}/-

NEVER use flat src/ structure - always modules/[feature]/


Critical Rules (MANDATORY)

RuleValue
File limit100 lines (split at 90)
Controllers< 50 lines, delegate to services
Interfacesmodules/[feature]/interfaces/ ONLY
JavadocEvery public method documented
RecordsUse for DTOs (Java 16+)
SealedUse for restricted hierarchies (Java 17+)

Reference Guide

Concepts
TopicReferenceWhen to consult
SOLID Overviewsolid-principles.mdQuick reference
SRPsingle-responsibility.mdFat classes
OCPopen-closed.mdAdding providers
LSPliskov-substitution.mdContracts
ISPinterface-segregation.mdFat interfaces
DIPdependency-inversion.mdInjection
Architecturearchitecture-patterns.mdModular patterns
Templates
TemplateWhen to use
module.mdFeature module structure
service.mdBusiness logic service
interface.mdContract definition
repository.mdData access layer
error.mdCustom exceptions
test.mdUnit tests with mocks

Forbidden

Anti-PatternFix
Files > 100 linesSplit at 90
Interfaces in impl filesMove to interfaces/ directory
new ConcreteClass() in servicesUse dependency injection
Flat src/ structureUse modules/[feature]/
God classesSplit by responsibility

Comments

Markdown supported