A Modular Semantic Kernel Agent for Automated Code Review and Refactoring Feedback
Abstract
In modern software development, maintaining clean, efficient, and reliable code is critical to team productivity and product quality. This paper introduces a modular Large Language Model (LLM)-based agent, designed using Microsoft’s Semantic Kernel framework, for automated code review and refactoring feedback. The agent leverages plugin-based function orchestration, Retrieval-Augmented Generation (RAG), and dynamic prompt engineering to analyze source code across multiple dimensions; including readability, efficiency, security, and adherence to best practices. Integrated into CI/CD pipelines and broader SDLC workflows, the system provides contextual insights, the system provides contextual insights, suggests specific improvements, and explains reasoning for each recommendation. Evaluation results across real-world open-source repositories demonstrate the agent’s effectiveness in reducing human review time while improving refactor quality. The modular design ensures adaptability to various programming languages and enterprise development environments. This research highlights the potential of agentic LLM systems to augment software engineering workflows with intelligent, transparent, and developer-aligned feedback mechanisms.
Keywords: Code Review, Semantic Kernel, Plugin Orchestration, Refactoring, Large Language Models, Agentic AI, Retrieval-Augmented Generation, Prompt Engineering
References
- 1.Microsoft. Semantic Kernel Documentation. https://learn.microsoft.com/en-us/semantic-kernelLink
- 2.OpenAI. Function Calling and Tool Use. https://platform.openai.com/docs/guides/function-callingLink
- 3.LangChain. Agents and Tool Use in LLM Applications. https://docs.langchain.com/docs/components/agents/Link
- 4.GitHub Copilot. “Your AI Pair Programmer.” https://github.com/features/copilotLink
- 5.Raza, M., & Rasool, G. (2023). "LLM-Guided Software Development: Opportunities and Threats." IEEE Software, 40(3), 27–35. https://doi.org/10.1109/MS.2023.3246537DOI
- 6.Jain, A., et al. (2022). "CodeBERT: A Pre-Trained Model for Programming and Natural Languages." EMNLP Findings.
- 7.Li, X., et al. (2023). "RefactorGPT: Code Refactoring via LLM Agents." arXiv preprint arXiv:2307.09771.
- 8.Fernandes, P., et al. (2023). "Improving Code Review Quality with AI Agents: A Modular Pipeline." ACM Transactions on Software Engineering and Methodology.
- 9.Kim, H., et al. (2023). "AI-Augmented Refactoring for Legacy Systems: An Empirical Study." SoftwareX, 21, 101322.
- 10.Wang, Z., et al. (2023). "Human-AI Co-Pilot Systems in Software Engineering: Design Principles and Case Studies." ICSE '23: Proceedings of the 45th International Conference on Software Engineering, 185–196.
- 11.Chen, M., et al., “Evaluating Large Language Models Trained on Code,” arXiv:2107.03374, 2021
Yazıcı, S., Dursun, S., Önel, B., Işıkkent, T., Çelik, S., Karalar, E., Alacan, M. (2025). A Modular Semantic Kernel Agent for Automated Code Review and Refactoring Feedback. *Orclever Proceedings of Research and Development*, 7(1), 43-54. https://doi.org/10.56038/oprd.v7i1.739
Bibliographic Info