A Modular Semantic Kernel Agent for Automated Code Review and Refactoring Feedback
Semih Yazıcı
Boyner
https://orcid.org/0009-0006-4503-0256
Seza Dursun
Boyner
https://orcid.org/0000-0003-1389-072X
Bahar Önel
Boyner
https://orcid.org/0009-0007-4597-6591
Tülin Işıkkent
Boyner
https://orcid.org/0009-0005-5775-0093
Sedat Çelik
Boyner
https://orcid.org/0009-0003-0335-6440
Erem Karalar
Boyner
https://orcid.org/0000-0001-6289-9275
Mert Alacan
Boyner
https://orcid.org/0000-0003-3893-6309
DOI: https://doi.org/10.56038/oprd.v7i1.739
Keywords: Code Review, Semantic Kernel, Plugin Orchestration, Refactoring, Large Language Models, Agentic AI, Retrieval-Augmented Generation, Prompt Engineering
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
Microsoft. Semantic Kernel Documentation. https://learn.microsoft.com/en-us/semantic-kernel
OpenAI. Function Calling and Tool Use. https://platform.openai.com/docs/guides/function-calling
LangChain. Agents and Tool Use in LLM Applications. https://docs.langchain.com/docs/components/agents/
GitHub Copilot. “Your AI Pair Programmer.” https://github.com/features/copilot
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.3246537
Jain, A., et al. (2022). "CodeBERT: A Pre-Trained Model for Programming and Natural Languages." EMNLP Findings.
Li, X., et al. (2023). "RefactorGPT: Code Refactoring via LLM Agents." arXiv preprint arXiv:2307.09771.
Fernandes, P., et al. (2023). "Improving Code Review Quality with AI Agents: A Modular Pipeline." ACM Transactions on Software Engineering and Methodology.
Kim, H., et al. (2023). "AI-Augmented Refactoring for Legacy Systems: An Empirical Study." SoftwareX, 21, 101322. DOI: https://doi.org/10.1016/j.softx.2023.101322
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.
Chen, M., et al., “Evaluating Large Language Models Trained on Code,” arXiv:2107.03374, 2021
