Replace repeated literals with names that carry meaning
For newer developers cleaning up magic values without altering behavior.
Works with
- Codex
- GitHub Copilot
- DeepSeek
The prompt55 words · 1 blank
What you fill in
- Code with magic values
[source_code]ExamplePaste a short function containing repeated strings or numbers
How to use it
- 1Open it in PromptVault. Find it in Coding, or search for “Replace repeated literals with names that carry meaning”.
- 2Fill in the blank. code with magic values — the only things the prompt cannot know.
- 3Copy and paste it into GitHub Copilot. It also works with Codex and DeepSeek.
About this prompt
“Replace repeated literals with names that carry meaning” is a beginner coding prompt. For newer developers cleaning up magic values without altering behavior. It is 55 words long and written to get a usable answer on the first message, in Codex, GitHub Copilot and DeepSeek or any other chat assistant. Good for: refactoring, rewrite, beginner friendly and quick win. Like every prompt in PromptVault, it was written and edited in-house, and it works offline once the app is installed.
