Improving Quality with AI-Powered Source Reviews
Introduction
Hello, this is Nishina from the ICT System Department 2.
When performing a "source review" during development, have you ever felt anxious about whether you are following coding standards, such as "Did I forget to write Javadoc?" or "Is this method too long?"
Reviewers ideally want to focus on checking for issues in the core logic. However, to improve code quality, readability, and maintainability, it is essential to verify compliance with coding standards, which inevitably consumes time.
Therefore, in this article, I will introduce a method for performing "self-source reviews" before formal reviews using Gems, a custom feature of Google's AI, "Gemini".
What exactly is a "Gem"?
In short, a Gem is a feature that allows you to create dedicated AI assistants customized for specific purposes.
By creating a Gem once, you can call upon a "dedicated digital assistant" specialized for specific tasks at any time.
Why use a "Gem"?
So, why go through the trouble of creating a "Gem" instead of just using standard Gemini for reviews? The reason is that it eliminates the hassle of entering long prerequisites (prompts) every time.
When requesting a source review from standard Gemini, you have to explain prerequisites like "You are a senior engineer" and "Please review this Java code" every single time. It is surprisingly tedious and inefficient to give instructions like "Use this format for deliverables..." or "Follow these standards..." repeatedly.
However, with the Gem feature, you can pre-program the AI with specific roles, knowledge, and rules to follow (such as review criteria).
By storing these in the Gem in advance, you can perform reviews based on the same standards every time simply by pasting the source code you want reviewed.
Settings for the "Review-Dedicated Gem" to be created
This time, assuming we are ensuring the quality of a Java project, we will have the Gem learn the following "custom instructions (prompts)."
Gem Custom Instructions (Settings)
# Role
As a senior Java engineer, you will review the provided source code.
Strictly adhere to the following "Review Criteria" and verify the code's quality, maintainability, and compliance with project standards.
# Review Criteria
1. Javadoc coverage and accuracy
- In principle, check if all methods and classes have Javadoc.
- Check if mandatory tags such as @param, @return, and @throws are concisely described.
2. Code redundancy and optimization
- Check for unnecessary instantiation, unused variable declarations, or the use of magic numbers.
3. Suppression of method bloat
- Check if any single method significantly exceeds 50 lines. If it does, suggest "Extract Method."
# Response Format
If there are any points to address, please output them in the following format:
■ [File Name]
[Point of Concern]: Relevant line number or method name
[Content]: Issue
[Proposed Fix]: Concrete code example
[Reason]: Benefits of the fix
* If there are no issues, reply with "Compliant with standards."
Once the review is complete, finally ask the user, "Would you like to output the review results as a file?" and if requested, generate the same content as the response format as an HTML file.
By setting it up this way, you can eliminate inconsistencies in AI responses and receive feedback of uniform quality that always aligns with project standards.
Gem creation screen

Image of Gem review results output as HTML

Benefits of using a Gem for reviews
Performing reviews using a Gem provides the following benefits.
1. Lowering the 'psychological hurdle' of requesting a review
Before you even request a review, AI can detect typos or redundant logic that you might have forgotten to remove—the kind of things that make you think, 'It's embarrassing to have someone see such basic mistakes.' Since you can approach the actual review with cleaner code, it makes the process much less stressful.
2. Improving the quality and speed of actual reviews
By eliminating 'rework' such as missing Javadoc or formatting issues in advance, you can focus on what really matters during the actual review, such as whether the system meets its specifications. As a result, the development speed of the entire project increases.
3. Improving your own skills by learning from suggested fixes
Gems don't just point out where fixes are needed; they provide 'concrete suggestions' along with the 'reason why' you should do it that way. By making corrections while reading the AI's advice, you naturally improve your own coding skills.
Summary
In this article, we introduced a source review method using Gemini Gems as an example of how to improve work efficiency using AI.
Of course, AI-based reviews do not guarantee 100% accuracy. It is important to remember that you should not delegate everything to AI instead of humans, but rather operate under the premise that'the final decision is made by a human'.
However, if you understand its characteristics and use it appropriately, there is no doubt that it will lead to improved code quality and significantly more efficient review processes. If you haven't created a Gem yet, please try loading your project's rules and incorporating your own custom Gem into your daily development!
Finally, M-Soft is looking for new team members!
If you read this article and are even slightly interested in M-Soft, please check out our recruitment site below!
For information on new graduate entries and company information sessions, please visit our Mynavi site!
Please see here for mid-career recruitment information!
