Identifying and Repairing Energy Smells with Agent Skills
Mohammadjavad Mehditabar, Saurabhsingh Rajput, Tushar Sharma
Abstract
Energy smells are inefficient implementations that waste energy. Once code reaches production, these smells become costlier and riskier to fix, so energy efficiency checks should shift left, i.e., move earlier in the development lifecycle, to where code is written. Existing energy smell tools rely on fixed static rules and do not measure energy savings, whereas LLM-based optimizers mostly target execution time and rarely ground their changes in concrete smell definitions. To address both limitations, we present DR. GREENS, an agent skill that detects and repairs energy smells in Python code within the developer's coding environment. The skill grounds the coding agent in our taxonomy of 12 energy smells and 65 root causes, augmented with repair guidance drawn from 230 measured cases. The skill also encapsulates a static analyzer and an independent verifier to confirm behavior preservation and energy saving for each attempted repair. We evaluated DR. GREENS in 18 sessions on three open-source repositories, with two models and three skill configurations. Of the 258 measured repairs, 68.6% saved energy, with a median saving of 24.9%. Compared with a baseline skill that lacks the taxonomy, the full skill found more energy smells with verified savings in all three repositories with both models. DR. GREENS helps developers detect energy hotspots and fix them reliably without altering program behavior, which makes energy-efficient development more feasible.
Create a lesson
Related papers
SkillBridge: Cost-Aware Diagnosis and Repair of Cross-OS Compatibility Defects in Agent Skills
Shared title terminology · Anjie Xu, Zixing Wang, Yifeng Cai et al.
Synapse: Optimizing Natural-Language Agent Skills through Program Repair
Shared title terminology · Lijuan Li, Zhenpeng Chen, Chenxi Zhang et al.
Safe Personal RSI: Evaluating and Repairing Personal-Agent Updates
Shared title terminology · Jiapeng Pei, Yuhang Yao, Sitan Liu et al.
Re-Reading Is Not Free: Token Traces and Cache-Aware Energy Estimation for LLM Agents in Software Engineering
Shared title terminology · Tina Vartziotis, Ketevan Peranidze, Rodopi Kosteli et al.
GHA-SmellFix: Taking Action with Agentic LLMs for Detecting and Refactoring GitHub Actions Workflow Smells
Shared title terminology · Anderson Uchôa, Jhefferson Souza, Emanuel Ávila et al.
Markdown Is Not a Firewall: four coding agents, one rules file, four boundaries
Shared title terminology · Sandeep Dhuri