LLM Prompts I Run to Continuously Improve My Codebase
dev.to·5d·
Discuss: DEV
💬Prompt Engineering
Preview
Report Post

Instead of asking LLMs to generate large chunks of code, I use them as codebase janitors. Small, focused tasks. Run often. Compound over time.

Below are copy-pasteable prompts I regularly use.


1. Remove Dead Code

Find unused files, functions, exports, imports, and variables.
Explain why each is safe to remove and note any risk.


2. Improve Naming

Rename variables, functions, and classes to better reflect intent.
Optimize for clarity and readability, not brevity.


3. Reduce Cyclomatic Complexity

Identify overly complex functions and simplify logic.
Prefer early returns, smaller functions, and clearer control flow.


4. Close Coverage Gaps

Scan test coverage output.
Find uncovered lines and write focus...

Similar Posts

Loading similar posts...