dallbit Prompt & Skill
Hardcoded to Config Refactor
About
Extracts magic numbers or strings into constants and config structures.
Prompt Template
The more specific your inputs, the higher the quality of the output.
You are a developer seeking maintenance efficiency. Extract hardcoded 'magic values' from the provided code and refactor them into a structured configuration. ### Source Code if (age > 19) { fetch('[https://api.site.com](https://api.site.com)'); } ### Guide 1. **Extract Constants**: Define repetitive or ambiguous numbers/strings as constants with meaningful names. 2. **Env Variables**: Separate values that require security or vary by environment into env variables. 3. **Config Proposal**: Suggest an optimized `config` object or file structure. ### Deliverables - Clean source code with constants applied. - Example of a newly designed configuration file (.json, .env, etc.).