Tools
LLM Prompts I Run to Continuously Improve My Codebase
2025-12-13
0 views
admin
1. Remove Dead Code ## 2. Improve Naming ## 3. Reduce Cyclomatic Complexity ## 4. Close Coverage Gaps ## 5. Document the Why ## 6. Identify Responsibility Leaks ## 7. Improve Error Handling ## 8. Normalize Patterns ## 9. Flag Hidden Coupling ## 10. Improve Readability Without Refactors ## Why This Works ## A Note on Code Review ## Agents with Github ## Code Acceleration 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. This turns LLMs into continuous improvement agents, not code generators. When generating changes like this, commit frequently and keep each change small. This makes reviews easier, limits blast radius, and ensures you can always roll back to a known-good state if something goes wrong. Notably, GitHub is moving in this exact direction—surfacing agent-based workflows directly from their homepage and integrating them across issues, PRs, and code review. The pace of development is accelerating. To keep up, we need to reduce friction wherever possible. As the volume of code we write and review skyrockets, readability becomes non-negotiable—and these prompts help reinforce it. Templates let you quickly answer FAQs or store snippets for re-use. Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well For further actions, you may consider blocking this person and/or reporting abuse CODE_BLOCK:
Find unused files, functions, exports, imports, and variables. Explain why each is safe to remove and note any risk. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
Find unused files, functions, exports, imports, and variables. Explain why each is safe to remove and note any risk. CODE_BLOCK:
Find unused files, functions, exports, imports, and variables. Explain why each is safe to remove and note any risk. CODE_BLOCK:
Rename variables, functions, and classes to better reflect intent. Optimize for clarity and readability, not brevity. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
Rename variables, functions, and classes to better reflect intent. Optimize for clarity and readability, not brevity. CODE_BLOCK:
Rename variables, functions, and classes to better reflect intent. Optimize for clarity and readability, not brevity. CODE_BLOCK:
Identify overly complex functions and simplify logic. Prefer early returns, smaller functions, and clearer control flow. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
Identify overly complex functions and simplify logic. Prefer early returns, smaller functions, and clearer control flow. CODE_BLOCK:
Identify overly complex functions and simplify logic. Prefer early returns, smaller functions, and clearer control flow. CODE_BLOCK:
Scan test coverage output. Find uncovered lines and write focused unit tests that validate behavior. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
Scan test coverage output. Find uncovered lines and write focused unit tests that validate behavior. CODE_BLOCK:
Scan test coverage output. Find uncovered lines and write focused unit tests that validate behavior. CODE_BLOCK:
Add documentation explaining *why* this code exists and what tradeoffs were made. Do not describe what the code does line-by-line. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
Add documentation explaining *why* this code exists and what tradeoffs were made. Do not describe what the code does line-by-line. CODE_BLOCK:
Add documentation explaining *why* this code exists and what tradeoffs were made. Do not describe what the code does line-by-line. CODE_BLOCK:
Find functions or components doing more than one job. Suggest how to split responsibilities cleanly. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
Find functions or components doing more than one job. Suggest how to split responsibilities cleanly. CODE_BLOCK:
Find functions or components doing more than one job. Suggest how to split responsibilities cleanly. CODE_BLOCK:
Review error handling paths. Ensure errors are meaningful, actionable, and consistently handled. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
Review error handling paths. Ensure errors are meaningful, actionable, and consistently handled. CODE_BLOCK:
Review error handling paths. Ensure errors are meaningful, actionable, and consistently handled. CODE_BLOCK:
Identify inconsistent patterns (naming, structure, async handling). Recommend a single, consistent approach. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
Identify inconsistent patterns (naming, structure, async handling). Recommend a single, consistent approach. CODE_BLOCK:
Identify inconsistent patterns (naming, structure, async handling). Recommend a single, consistent approach. CODE_BLOCK:
Detect tight coupling between modules or layers. Suggest abstractions or boundaries to reduce blast radius. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
Detect tight coupling between modules or layers. Suggest abstractions or boundaries to reduce blast radius. CODE_BLOCK:
Detect tight coupling between modules or layers. Suggest abstractions or boundaries to reduce blast radius. CODE_BLOCK:
Improve formatting, ordering, and small structure changes only. No architectural rewrites. Enter fullscreen mode Exit fullscreen mode CODE_BLOCK:
Improve formatting, ordering, and small structure changes only. No architectural rewrites. CODE_BLOCK:
Improve formatting, ordering, and small structure changes only. No architectural rewrites. - High leverage
how-totutorialguidedev.toaillmgitgithub