准备工作
开发环境
目前开发环境全部安装在WSL2中,用windows开vscode连接使用。
好处非常多,比如开发环境就和生产环境类似、和宿主机隔离不会搞的电脑都开不了机。我本来想说也不会碰到稀奇古怪的环境问题,但是对于ai来说环境问题都是小事。
坏处也是有的,我没装图形化界面,开发个APP不知道怎么验证,只能打包出来放到windows看
Agent
我选择了Claude Code和Codex
具体来说,Claude Code 和 MiniMax 组合使用,Claude模型听说很厉害但是太贵买不起,所以找了国产的MiniMax替换,这家便宜量大,最便宜的coding plan套餐只要29/月,MiniMax-2.5写代码我觉得确实不错,就是设计能力太差了。Codex 当然是和自家模型配合使用,我在小黄鱼上找的Codex Team拼车,几块钱一个月,奥特曼真是大善人,现在GPT-5.4模型我觉得非常厉害了,不管是代码还是设计。
安装
现在安装真是太方便了,只要先安装一个Claude Code才配好模型密钥,用它来安装一切,和它说我要装xx,给个网址,它哐哐一顿下载安装
开始Vibe
Vibe Design
截至2026/3/22,我在小红书上看到过许多vibe coding的作品,绝大部分是些 TodoList、闹钟、记账本之类的APP。我个人觉得这些APP简单到不需要Design。如果想搞一个小众一点的/复杂一点的应用那就得先做好Design了,不然需求都拆不明白。Design我推荐vscode Pencil插件,它是真牛批,"给我生成一个xx风格的xxAPP,包含XX功能、XX功能"就能给你生成出大概页面了,然后继续Vibe,用自然语言让他改设计图

初始化工程
Design完了就要考虑怎么实现。可以继续问ai,我这项目前端要用xx技术栈、后端要用xx技术栈、数据库要xx,你帮我初始化工程。现在ai会在当前目录下给前端生成个目录,给后端生成个目录,然后就在这个目录下完成前后端开发,我觉得没有必要分目录,因为反正是要ai实现所有,前后端在一起,都放进ai的上下文,生成质量更高。下图是我最后生成的目录

因为同时使用Claude Code 和 Codex,所以有.agents和.claude目录。 .specify目录是spec-kit这个工作流初始化产物,里面包含宪法、执行脚本、各种文档的模板。app就是app代码目录。backend就是后端目录。design放Pencil设计图。specs放spec-kit分析需求后产生的各种产物
Vibe Coding
虽然叫Vibe Coding,但是我建议还是用spec-kit这种SDD(Specification-Driven Development)工作流生成详细的文档,然后再写代码。整体流程是:分析设计图做功能拆解=》使用SDD创建文档=》定好前后端契约=》实现前端页面并且mock测试通过=》实现后端并单元测试通过=》端到端集成测试和验收
上述流程写进ai要读取的宪法文件中,比如codex会去读取AGENTS.md,claude code会去读取CLAUDE.md,为了能兼容各种agent,建议只在.specify/memory/constitution.md中写宪法内容,AGENTS.md和CLAUDE.md引用它
下面是我的部分宪法文件
## Delivery Workflow
All implementation work MUST follow this order for each feature module:
1. Design analysis and feature split
2. SDD creation or update
3. Contract and data-model definition in the current feature's `specs/<feature>/`
directory
4. Flutter mock-based implementation and interaction validation
5. Spring Boot implementation against the approved contract
6. End-to-end integration and acceptance verification
For stages 4 through 6, the agent MUST actively look for safe parallelization
opportunities. Independent frontend, backend, contract-test, data-model, and validation
tasks SHOULD be split across multiple sub-agents with explicit ownership boundaries.
If the work is kept serial, the agent MUST have a concrete reason, such as a tight
dependency chain, a shared-file conflict risk, or insufficient task granularity.
The workflow MUST create two mandatory git checkpoints for each feature and one
mandatory branch merge:
1. A documentation checkpoint immediately after the `spec-kit` artifact set passes the
consistency, completeness, and closed-loop review gates
2. An implementation checkpoint immediately after end-to-end integration and acceptance
verification pass for the implemented feature slice
3. A merge of the validated feature branch into `master` immediately after the
implementation checkpoint is created
When the user says "now start the next requirement" or otherwise asks to begin the next
feature, the agent MUST autonomously carry the feature through all six workflow stages,
the documentation checkpoint, the implementation checkpoint, and the merge into
master without requiring additional step-by-step prompts from the user.
When the user says "自动完成设计图中还没实现的所有功能" or otherwise requests
automatic completion of every still-unimplemented design-backed feature, the agent
MUST treat that as authorization to loop Delivery Workflow rounds continuously. After
one feature round reaches its documentation checkpoint, implementation checkpoint, and
merge obligations, the agent MUST immediately return to design inspection, confirm
whether any implementable unfinished functionality remains, and if so launch the next
Delivery Workflow round without waiting for another prompt. The loop only ends when
the design can no longer yield an implementable unfinished feature slice or the user
explicitly stops, pauses, reprioritizes, or changes scope.
If work starts out of order, the agent MUST remind the user that the agreed workflow has
been bypassed and call out the missing prerequisite artifact or validation step.
宪法文件随时可以补充,比如每次改完宪法文件,都让它自己commit一次,你就可以让它自己把规则加进去。我想让ai自动完成所有需求,所以我加了个自动完成设计图中还没实现的所有功能的规则。还有很多可以加的,比如一个复杂需求可以开几个并行的子agent执行,这些都可以写进宪法文件
结语
最早ChatGPT出来的时候,我用它看论文,只会胡说八道,用它来写代码,一些片段写的还可以。再后来DeepSeek出来的时候,写代码能力我觉得比我好了,虽然读取不了代码上下文,通过和它聊天也可以给你重构建议。现在LLM越来越强了,我觉得Agent完全能取代绝大部分程序员了,因为写代码本质上还是种体力劳动,人不可能比得过机器的。织布机出现后,不愿转型的织布工人下岗,愿意转型的成了织布机技术员,管理各种织布机生产活动。那未来程序员出路是啥?大抵是和织布机技术员一样,监督各种Agent生产。