跪拜 Guibai
← All articles
Frontend · AI Programming

From Copilot to WorkBuddy: The Three Pillars for Trusting AI to Write Code

By 工程小白菜 ·
Read original on juejin.cn ↗ Google Translate ↗ Alt translation

Unattended AI work becomes safe only when knowledge is treated as data, review is separated from the writer by code, and merge authority stays human. Teams that skip any of these three end up with the Copilot-era failures: review becomes the bottleneck and cross-project lessons never consolidate.

Summary

AI code only reaches a human merge button when the writer and the reviewer are different. A frontend engineer's setup replaces Copilot's chat-and-review loop with an autonomous WorkBuddy: a single markdown prompt file defines role, conventions, red lines, and workflow, while a separate git repo (ai-harness) holds team knowledge and acceptance gates. Work flows from requirement conversation to fix/feat branch, through local tsc/build and red-line regex gates, then to an independent read-only AI review in CI that comments back until no red-line issues remain. Accumulation flows from the same conversations into personal memory and a team knowledge base, so conventions and lessons are auto-loaded on the next session.

The system auto-discovers projects by .git and package.json, so switching projects needs no reconfiguration. Permissions are deliberately narrow: AI pushes branches and creates repos, but merging to main stays human, and production accounts are out of reach. A four-round CI review went from 18 comments (2 high) to 2. The author's central claim is that AI coding's bottleneck isn't generation but the engineering around it: sedimentation, acceptance, and scaling. Five projects have been fully developed this way, and the entire loop keeps the merge button in human hands.

Takeaways
— A single markdown prompt file (the "expert package") defines the AI's role, conventions, red lines, and workflow, with no code.
— Local gates (tsc/build and red-line regex) run immediately on changes; LLM semantic review only runs on push to CI.
— A separate, read-only AI review session sees only team rules and the code diff, enforcing athlete/referee separation.
— AI can push fix/feat branches and create GitLab repos, but merging to develop or main requires explicit human approval.
— The knowledge base records not just current conventions but historical decisions (e.g., deprecated domain names) with replacement info.
— A single CI review iteration went from 18 comments (2 high) to 2 over four rounds, with high issues cleared.
— New projects are auto-created from team templates, including Git remote setup and a generated CLAUDE.md.
Conclusions

The bottleneck in AI coding is not generation but the engineering around it: sedimentation, acceptance, and scaling. Generation capability is similar across providers; what differs is the built system.

Making knowledge data (commit-able, auto-loaded) is what turns an AI from a per-project autocomplete into a persistent team member; chat history alone isn't enough.

The athlete/referee split enforces independence through permission and context separation, not through prompting—a practical pattern for trusting AI output.

The permission model (push allowed, merge not) is a concrete answer to the autonomy question: define boundaries, then let the AI act freely within them.

Concepts & terms
WorkBuddy
An AI agent that runs across projects and sessions, loads team knowledge, writes code, runs verification gates, and iterates on fixes until a human approves the merge.
Gate (门禁)
A set of automated checks (tsc, build, red-line regex) that must pass before code is accepted; used to enforce quality and security rules.
Red lines (红线)
Explicit non-negotiable rules written into the agent's prompt, such as routing all requests through a common wrapper or asking when business requirements are ambiguous.
Athlete/referee separation
A principle where the AI that writes code is different from the AI that reviews it, enforced by independent sessions and read-only permissions.
Source: juejin.cn ↗ Google Translate ↗ Backup ↗