Code Quality Until A Grade
A prompt-only loop designed to iteratively improve code quality and maintainability until a specified quality gate passes. The agent analyzes the codebase, i…
This loop is republished with attribution. Full credit and the original content belong to the source linked above.
AI Skill Market Insights
Real data. Real impact.
Emerging
Developers
Kickoff Prompt
Copy this prompt and run it with your agent to start the loop.
Start the "Code Quality Until A Grade" loop.
Goal: Improve maintainability
Max iterations: 10
Between iterations run: quality gate
Exit when: Quality gate passes
Analyze the entire codebase for maintainability issues. Run the quality gate check and review the results. Identify the lowest-scoring components based on code complexity, duplication, and style violations. For each identified issue, apply concrete improvements focusing on reducing cognitive complexity, eliminating code duplication, and aligning with project conventions. After every set of changes, re-run the quality gate check. Stop when the quality gate passes or after 10 iterations. Prioritize changes that have the highest impact on overall code health.
Self-pace this loop. After each iteration, run `quality gate` and evaluate the output, and only continue if the exit condition is not met (Quality gate passes). Stop when the exit condition passes or 10 iterations are reached. Give a short status update each pass.