Skip to content

AI-Assisted PR Notes and Code Review

Interactive Diagram

새 탭 ↗

Code built with a Context Package, now heading to a PR

Section titled “Code built with a Context Package, now heading to a PR”

In the previous article, requesting implementation via a Context Package meant the agent reported back a decision summary, changed files, a verification command, an execution result, and unresolved items. Those five things are, in effect, already a draft of a PR note. This article covers how to wire that output into an actual PR process, and where AI is allowed to help versus where a human must always remain.

Adopting AI doesn’t change the basic flow: create a branch → commit → open a PR → review → approve → merge. What changes is how much text a human has to type from scratch at each step.

PlantUML Diagram

Analyzing commit history and code diffs to produce a summary organized by changed file, function, and class is something AI can do faster and with fewer omissions than a human. Reusing the output structure from the Context Package article, a draft PR note looks like this.

## Summary
Implemented the team name duplicate-check API (POST /api/registrations/check-team-name)
## Changes
- Added: registrationController.checkTeamName, registrationRepository.findByTeamName
- Modified: registrationRoutes.ts (registered the new route)
## Verification
- Command: npm test -- --grep "team-name"
- Result: 5 passing (including existing tests)
## Open Items
- The error handler that converts a DB unique-constraint violation on
concurrent requests into a 409 is not included in this PR (needs a
separate issue)

This draft is faster than writing it from scratch, but the same principle applies as before: an empty Open Items section should raise suspicion.

The review items AI can reliably catch are generally the ones with clear rules and a single correct answer.

- Naming convention violations (camelCase vs snake_case per project rules)
- Formatting/lint rule violations
- Obviously missing error handling (an external call with no try-catch)
- Common security anti-patterns (string-concatenated queries vulnerable to
SQL injection)
- Test coverage gaps (branches with no test path)

Since these have a clear correct answer, having AI filter them out first lets the human reviewer spend more time on the question AI cannot answer: does this code actually fit our business logic?

“This code is syntactically correct and passes its tests” and “this code actually satisfies the business requirement we wanted” are two separate questions. Only someone who knows the PRD and user story built in this series’ earlier articles can judge the latter. AI can check whether a string of acceptance criteria matches the code, but it cannot judge whether those acceptance criteria were the right business decision in the first place.

AI catching a common security anti-pattern is different from confirming this change is safe under this project’s specific threat model. In particular, AI review output should never be treated as the final call in the following situations.

- Adding a new external integration (third-party API, payment, auth provider, etc.)
- Changing the permission model (roles, access control logic)
- Changing how personal data is handled
- Changing encryption/signing schemes

The team should fix a rule that changes like these are not merged without explicit approval from a security owner or a senior engineer.

Passing review doesn’t answer whether it’s safe to deploy right now. Deployment timing, rollback plans, and conflicts with other deployments are operational-context decisions that can’t be made from the code diff alone, which is all the information AI has.

[Principles for adopting an AI review tool]
1. Mark AI review comments as "suggestions," visually distinct from human
approve/reject comments.
2. A PR that AI marks as "no issues found" still cannot be merged without
at least one human reviewer's approval.
3. Changes falling into the Business/Security/Release categories require a
designated human's approval regardless of the AI review outcome.
4. When an issue the AI review tool missed is discovered later, add that
case to the team's review checklist (fix the process, don't blame the
tool).

From requirements through user stories, context packages, and test scenarios to PR; this series has followed how a single requirement transforms along an artifact chain, and at each step, distinguished what AI can draft from what a human must decide. This principle holds regardless of which tool changes next: whatever you hand to AI, build the standard to verify it against first, and keep the human gate explicit.