Conetxt: https://github.com/Azure/typespec-azure/pull/5358#discussion_r3904215300 After https://github.com/Azure/typespec-azure/issues/5274 done, extract the common helper functions for migrated rule PRs.
Conetxt: #5358 (comment)
After #5274 done, extract the common helper functions for migrated rule PRs.