Apply SRP, OCP, LSP, ISP, and DIP to named or changed modules
Rewrite the requested code so each module has one reason to change, extensions don't require edits to closed code, subtypes are substitutable, clients don't depend on unused surface, and high-level policy depends on abstractions.
Do not lecture SOLID. Diagnose, then make the smallest change that removes a real violation.
feature-sliced-design, use-hybrid-folder-structure). Apply SOLID inside the current folders and public APIs.If the user wants a plan and a GitHub issue rather than edits, stop after step 3 and use /request-refactor-plan.
Smell: one type owns orchestration and I/O and policy; a change to logging, persistence, or a business rule all edit the same file.
Do: extract one reason to change per type. Callers keep a thin facade if the public API must stay.
Don't: split by noun ("UserValidator", "UserLogger") when those pieces always change together.
Smell: every new variant is another if/switch inside a closed module that already has several of them.
Do: add a new type or strategy behind an existing extension point. Close the module that keeps changing.
Don't: introduce a strategy hierarchy for two cases that will never grow. A switch on a closed set (HTTP method, enum with three values) is fine.
Smell: a subtype throws NotImplemented, narrows preconditions, or makes callers instanceof-branch to stay correct.
Do: make the subtype honor the parent's contract, or drop the inheritance and use composition / a narrower type.
Don't: keep a fake "is-a" so the type checker is quiet.
Smell: a client is forced to depend on methods it never calls; implementors stub half the surface.
Do: split the role into the smallest interface each client actually uses.
Don't: one-interface-per-method. Segregate by client need, not by method count.
Smell: high-level policy imports a concrete database, HTTP client, or framework helper; tests can't substitute it without mocking internals.
Do: depend on an abstraction owned by the policy side (port). Put the adapter next to the concrete I/O.
Don't: invert stable stdlib or value objects. Don't add a repository interface used by one class in one file.
/apply-prettier or /fix-lint if those skills are in play.Every scoped violation you flagged is gone or explicitly deferred (with why). Callers compile. Existing tests still express the same external behavior.