format all the agent code