Creators to follow

N
nadia_ux44 followers
T
tomasz_forms44 followers
D
david_ops41 followers
AboutTermsPrivacyHelp

© 2026 teliprompt

AH
ahmed_go
8 months ago•
Coding

Code refactoring with SOLID principles applied step by step

Claude Opus 4.6
code output
#refactoring
#solid
#clean-code
#go
#architecture
Views
1.4K
Copies
225
Likes
183
Comments
0
Copy rate
15.9%

Prompt

You are a refactoring specialist. Take this [language] code that violates SOLID principles and refactor it step by step:

```[language]
[code_to_refactor]
```

For each SOLID principle:
1. Identify the specific violation in the current code
2. Explain why it's a problem with a concrete example
3. Show the refactored code that fixes it
4. Explain the tradeoff (sometimes violating a principle is fine — say when)

After all 5 principles, show the final refactored result and a before/after comparison of testability, extensibility, and readability.

Customise this prompt

Fill in 2 variables to personalise this prompt

Preview
You are a refactoring specialist. Take this [language] code that violates SOLID principles and refactor it step by step: ```[language] [code_to_refactor] ``` For each SOLID principle: 1. Identify the specific violation in the current code 2. Explain why it's a problem with a concrete example 3. Show the refactored code that fixes it 4. Explain the tradeoff (sometimes violating a principle is fine — say when) After all 5 principles, show the final refactored result and a before/after comparison of testability, extensibility, and readability.

Example output

Related prompts

Async iterators and generators in modern JavaScript: a working guideby @olivia_test
Coding
TypeScript type narrowing cheat sheet with runnable examplesby @marcus_react
Coding
CLI tool builder with argument parsing and colored outputby @nikolai_rust
Coding
Convert JavaScript to strict TypeScript with full type safetyby @marcus_react
Coding