Refactor with invariants
Improve maintainability while explicitly preserving behavior and public contracts.
Copy-ready prompt
Refactor [CODE OR MODULE] for clarity and testability. Before editing, state the behavioral invariants and public contracts that must remain unchanged. Reduce nesting and duplication only where it makes the control flow clearer. Keep the diff scoped, preserve compatibility, and add characterization tests for any behavior that is not already covered. Return the patch plan, implementation, and verification results.
Related prompts
Textapp/auto-code
Ship a repository featureGive a coding agent a bounded feature task with verification and a clean handoff.
#agent#repository#implementation#tests
Textapp/auto-code
Fix failing CITurn a failing check into a reproducible, tested repair instead of a speculative patch.
#agent#ci#debugging#regression
Textapp/auto-reasoning
Production incident responderGuide an operations agent through evidence gathering, mitigation, repair, and verification.
#agent#operations#incident#production