AIToday
Zenn AI/MLPublished: Oct 30, 2026, 19:01 JST

Emuni engineer 後藤勇人 turns an AI-refactor rollback into doc-first review rules

Send on LINE
Emuni engineer 後藤勇人 turns an AI-refactor rollback into doc-first review rules

3 Key Points

  1. What happened

    After an AI-assisted refactor changed behavior beyond the intended scope and had to be rolled back, Emuni engineer Hayato Goto rebuilt the workflow around spot requirement/requirement definitions, design docs, and function comments, packaged as the skills maintain-design-docs and add-function-comments.

  2. Why it matters

    Because design diffs are reviewed before code and AI review runs before human review, Goto says it is now easier to trace what changed in his own implementations and in other people's pull requests.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

Context & Analysis

The starting point is a concrete failure: changes were split across several pull requests, and once integrated, behavior shifted in areas that were supposed to stay put. Goto judged the blast radius wide enough that reverting and restarting from specification cleanup was better than iterating on fixes. His diagnosis is that neither the feature he wanted to change nor the behavior he wanted to keep was traceable within the implementation diff, and that a regression test rewritten to match the new implementation can pass while no longer protecting the old behavior.

The rebuild moves the traceability upstream. Specifications are written out from the existing implementation, with a glossary fixing what business terms mean, and each kind of detail is assigned a single home document so a change does not require editing the same specification in several places. Requirements and requirements-as-conditions are kept as separate documents, and if a PBI or issue already carries purpose, scope, acceptance conditions and behaviors to preserve, that is used directly rather than duplicated.

The two skills encode the routine. maintain-design-docs separates pre-implementation design work from post-implementation reconciliation, classifies each candidate document as needing update, conditional or review-only, and requires a stated reason for documents left untouched, so a reader can tell "checked and unchanged" from "not yet looked at." add-function-comments limits edits to comments and docstrings, checking responsibilities, arguments, return values, exceptions and side effects against callers and tests. Goto notes that comments matching code still cannot by themselves prove a change was intended, which is why he reads the before-and-after design and code himself, including spots AI review did not flag.

FAQ
What exactly broke during the AI-assisted refactor?
After merging changes split across multiple pull requests, behavior changed in places that were not meant to be touched, and the team judged it better to revert once and redo the specification work rather than layer on fixes.
What does the maintain-design-docs skill do?
It works from agreed requirements to produce a pre-implementation design diff, then after implementation reconciles frontend and backend diffs against the related design docs, choosing among design-first, frontend-sync and backend-sync modes.
Does Goto claim measurable review-time savings?
No. He says defect counts and review-time reduction rates were not measured, and that what he describes is his own sense during review; manual operation checks and regression tests are still needed.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Next articleTrakkr: only 40% of AI-cited stats backed by research