跪拜 Guibai
← All articles
Frontend · JavaScript · AI Programming

AI Refactored a Colleague's Three-Year Codebase in 20 Minutes—and Nearly Torched a Team

By kyriewen ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

AI tools collapse the time-cost of large-scale code changes from weeks to minutes, which also collapses the social signal that effort equals respect. Teams that don't deliberately rebuild communication norms around this new speed will accumulate interpersonal debt faster than technical debt.

Summary

A weekend experiment with Codex turned a monolithic, untyped JavaScript form engine into six clean TypeScript modules. The technical result was objectively better: clear boundaries, full types, passing tests, and new features that were suddenly trivial to add. But the PR landed like a bomb. The original author saw three years of work replaced in twenty minutes by a tool, and the team lead flagged the real failure—zero communication before a change that rewrote someone else's domain.

The core problem wasn't the code quality. AI's speed collapsed the normal cost of refactoring from weeks to hours, erasing the implicit signal that serious effort signals respect. When changing someone else's work becomes nearly free, the psychological barrier between "should I" and "I did" disappears, and the human contract that holds teams together starts to fray.

The resolution required killing the giant PR, splitting the work into small, reviewed chunks, and spending a week on what AI did in minutes. The code ended up in the same place, but the team survived.

Takeaways
AI-driven refactoring can produce technically superior code in a fraction of the manual time, but the speed itself can feel like a verdict on the original author's competence.
Submitting a massive, AI-generated PR without prior discussion treats code as a pure technical artifact and ignores that every line represents someone's time, judgment, and professional identity.
The original author's objections were practical, not just emotional: they would inherit maintenance of a codebase they didn't design and had no chance to shape.
Breaking AI-generated changes into small, reviewed PRs and involving the original author in the design process turned a team rupture into a successful modernization.
AI amplifies individual execution power, which also amplifies the consequences of skipping communication—the damage scales with the speed of the change.
Conclusions

AI doesn't just accelerate coding; it removes the natural braking mechanism that manual effort provides. When a refactor takes two weeks, you think twice before starting. When it takes twenty minutes, impulse wins.

The phrase 'efficiency violence' captures something real: a tool that makes someone else's years of work look replaceable in minutes carries an implicit judgement, whether intended or not.

Code ownership in teams is partly a social contract. AI tools that let anyone rewrite anyone else's module instantly threaten that contract unless new norms are explicitly built.

The fix wasn't technical—it was procedural. Small PRs, co-review, and a slower pace produced the same code outcome but preserved the relationship, which is the harder and more valuable asset.

AI-era collaboration needs explicit rules—like discussing refactors with original authors first and never using AI output to ambush a colleague in review—that were previously enforced by sheer effort cost.

Concepts & terms
Efficiency violence
The phenomenon where AI-driven speed makes a colleague's long-term work appear trivially replaceable, inflicting psychological harm even when no harm is intended.
AI-era collaboration trap
The breakdown of team norms that occurs when AI reduces the cost of changing others' code to near zero, removing the effort-based signal of respect that previously regulated such changes.
Form engine
A configurable system for generating dynamic forms with field dependencies, validation rules, and nested structures, common in enterprise admin backends.
From the discussion

The core objection is that touching code outside one's own scope—especially with AI—is reckless and professionally insulting. The speed of the change is seen as a liability, not a virtue, because the original author alone bears the maintenance burden and understands the business logic. A minority view suggests AI could handle the review and testing, but the dominant stance treats unsolicited refactoring as a direct threat to job security and a violation of ownership.

Unsolicited refactoring of another developer's module is a breach of professional boundaries, regardless of the tool used.
AI-generated changes are untrustworthy because the outsider cannot know all the business logic, making thorough review impossible.
Speed of change is a liability when the person who made the change won't be responsible for future maintenance and bug fixes.
Refactoring someone else's code can be perceived as a direct threat to their job security, triggering a visceral defensive reaction.
Some argue that AI could also be used to handle the code review and test execution that the refactoring demands.
The act is seen as driven by personal aesthetic preference ('code cleanliness obsession') rather than business necessity, which fuels resentment.
Featured comments
胖虎家的扛把子 2 likes

Don't touch code that isn't part of your own business!!! Whether you or AI slip a landmine in there, it's hard to pin the blame.

kyriewen

Exactly, good intentions end up causing trouble.

用户238183588344 2 likes

Take this story with a grain of salt. A large module someone else owns—there's no way an outsider can know all the business logic, let alone review every line of code and pass every test case. Laughable.

kyriewen

Just hand the code review and test-case running to AI, no?

准时摸鱼

The main reason Xiao Zhang has a problem with you is that you might have threatened his job. Threatening someone's livelihood is like killing their parents...

kyriewen

Never daring to do that again.

See top comments, translated →
Source: juejin.cn ↗ Google Translate ↗ Backup ↗