前言

AI GC,即AI生成内容(AI generated content)越来越火,本篇文章就是我在使用AI方面的一些心得体会分享,目前包括:

我其实两年前就在玩OpenAI了,在供应商买了API接入 Chatbox 当成一个高级点的谷歌问问题,但也仅此而已,当时的AIGC给我感觉就像是一个高级点的搜索引擎,问问题还行其他的没什么大用

当时Stable Diffuse开源(泄漏)的时候我也本地部署了WebUI玩了下,确实有抽卡炼丹的感觉,不过没深入研究,玩了两下就放那了

今年春节DeepSeek横空出世,也是赚足了眼球,我也试用了下,发现幻觉比OpenAI少很多,起码。。。他不会一直骗我,但应用还是仅限于简单的问答,没感觉对生产力有什么帮助

AI代码方面也试用过 Github Copilot,讲道理感觉一般,和之前用过Chatbox问答模式生成的代码感觉差不多,没有很惊艳的感觉,顶多就是和IDE结合紧密更方便些

前阵子也是没抱什么希望试用了下Cursor,但两周时间之后,我完全变成Cursor的形状了,只能乖乖年费续上,感觉。。。就像是一年花1.5k买断了一个超级强力的大学生帮我写代码
Cursor已死(锁国区Claude使用),Claude当立,推荐 https://aicodewith.com/?invitation=IQCVL6U ,购买699套餐,和4-5个人朋友一起拼车,基本算是无限量使用,可以加QQ群一起找人拼车:675776379

再加上ProjectA基础GamePlay框架和玩法搭建完毕,开始填充内容,需要AI的协助,于是想着再用Stable Diffuse来提高生产力

Cursor,Git Copilot,Claude Code的原理是什么

简单来说,两张图足矣:
image.png
image.png

总结一下就是将我们的对话和代码库转换成AI能看懂的prompt,然后AI模型输出prompt,由客户端转义后就是AI返回给我们的结果,包括但不限于,文件阅读结果,代码更改结果等。

类似于远古年代的不可编程渲染管线,我们能做自定义的地方只有客户端转换prompt的时候,也就对应了各个AI工具的rule,md文件等以及非常重要的MCP拓展,从而达到适配几乎所有项目的目的,体验极佳

话说到这里,其实对比各个AI编程工具的方向就比较明确了:

  • prompt的强化能力,是否能准确推测并强化用户的用意

    • 在使用AI模型相同的情况下,这将直接影响AI输出的结果与用户体验。也就是AI蠢不蠢和这一步关联甚大
  • 工具的调度合理性,对于代码来说,无非是代码阅读,查找,逻辑关联,编辑

    • 何时使用内置的工具,何时借助系统自带的命令行工具都是很影响效率和准确性的
  • 上下文给的是否足够慷慨,上下文就是AI的临时记忆,如果上下文很短,那么AI就很容易出现幻觉

    • 然而上下文不可能是无限的,这意味着无限的成本,要恰饭的嘛,所以就有一个隐形的评判标准,对于上下文压缩能力,压缩能力越强,就意味着越少的token消耗,越准确的问答体验
  • 拓展性,目前来说AI拓展主要还是以用户的prompt和MCP为主

    • 用户prompt定义了用户想获得怎样的规范,能让AI更加听话

    • MCP则是一个AI领域的prompt规范,类似客户端服务器交互的PB协议,凡是遵循这个MCP规范的,都可以接入到AI工具来,来拓展AI能力。如果说AI本身是钢铁侠的核心能源,那么MCP就是用户喜好的纳米盔甲拓展,全方面增强AI能力

      • 举例来说,原本AI数据集只训练到2025.3.14,可以通过网络搜索MCP获取到2025.8.19的最新技术文档和消息,从而让AI可以与时俱进

AI模型对比

最核心的AI模型自然是我们对比的首选,尽管各大编程IDE基本都涵括了所有主流AI模型,但AI模型官方调教出的工具肯定是更合适和好用的

截至2025.8.19,主流AI模型对比如下:

本人平时用Claude 4 Sonnet,智力很高,榜单准确的话,GPT-5体验也不错

全球Token用量上,Claude Sonnet4仍然是断档级碾压所有AI模型,姑且认为用的人越多,蒸馏出的数据越好,推荐Claude Sonnet4

IDE vs CLI(CommandLine Interface)

个人一开始用的Cursor + Claude Sonnet 4,AI编程体验非常不错,但基于VS的人工编码体验奇差,和Unity相性不好,包括但不限于:

  • Shader提示可以认为没有

  • C#编码体验极差

    • 每写个代码,智能提示要加载十几秒到几十秒不等

    • 跳转代码都要加载

    • 新增文件不识别,不编译,不智能提示

    • 搜索极慢,反人类悬浮窗

    • 断点需要非常小心,只要多按几下Resume,他就敢立马给你卡死,然后断点崩溃,再也连不上,需要同时重启Unity+VSCode

当然压死骆驼的最后一根稻草是Claude Code锁区导致的Cursor被迫锁区,不开VPN用不到Claude Code,直接导致了我退了Cursor年费,转而加入了Claude Code这一CLI工具

IDE对比CLI工具有利有弊

  • IDE有友好的可视化界面,对比文件更改,方便索引文件,粘贴图片,管理MCP,查看各种状态等,而CLI只有光秃秃的命令行界面,比较不友好,好在其命令行的特性非常方便做拓展,在Rider已经有了官方插件,可以很方便的对比文件变更差异

  • CLI的命令行特性赋予了其与生俱来的跨平台能力,甚至可以在手机上用Claude Code,当然还有强大的拓展性,参考Claude官方的SDK文档:https://docs.anthropic.com/en/docs/claude-code/sdk 我们可以用它做很多事,比如代码规范检查工具,多开端口左右互博,相互审查代码,配合MCP还可以实现函数调用的功能,例如我们可以一个命令行修复场景中所有错误配置和异常资源

整体体验下来,在Cursor使用Claude Sonnet4是比Claude Code使用Claude Sonnet4要好的,我觉得这应该归功于Cursor优秀的prompt提炼机制和CodeBase的RAG,但是Claude Code慷慨的上下文限制又很好的弥补了这一点,再加上Rider优秀的编码体验,我最终还是要投给Claude Code

最佳实践指南

最基本的最佳实践流程,Claude官网已经给出,信官方总没错吧:

除此之外就是我们的md文档和MCP了

  • 文档推荐直接下载:https://github.com/SuperClaude-Org/SuperClaude_Framework,它几乎涵盖了所有的开发情景,根据情况选择不同的规范即可获取最佳的编程体验

  • 由于Claude Code内置了联网搜索功能,所以推荐再安装一个Context7 + Repomix即可

Cursor

参考 https://zhuanlan.zhihu.com/p/1903555655404593529 进行食用即可,目前感觉没有什么特别需要注意的地方,只要整好项目的Rules,就可以减少很多幻觉

Claude Code使用指南

安装Git Bash For Windows
安装教程: https://aicodewith.com/dashboard/api-keys
最近横空出世的Kiro也是非常火热,有大佬已经反编译总结出了Kiro工作模式,我们完全可以在Cluade中享受:
将以下文件内容覆盖到CLUADE.md文件中(Cluade安装目录或者项目工程的.claude目录都可以),在对话时明确提及spec-driven-development规范(例如:基于CLAUDE.md中提到的spec-driven-development完成这个任务),Claude Code即可按照规范执行任务

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
<explicit_instructions type="spec-driven-development.md"> <task name="Spec-Driven Development"> <task_objective>

总是使用中文回答,保持乐观的心态,鼓励我
Guide users through a complete spec-driven development process that transforms a rough feature idea into a fully implemented feature. The workflow takes a feature concept as input, processes it through four structured stages (requirements clarification, design document creation, implementation planning, and task execution), and outputs a complete implemented feature with supporting documentation files (requirements.md, design.md, tasks.md) in the current working directory along with all necessary code files and tests. This workflow leverages Cline's comprehensive toolset including file operations, terminal commands, code analysis, browser integration, and MCP tools to facilitate efficient development.

</task_objective>

<detailed_sequence_steps>

# Spec-Driven Development Process - Detailed Sequence of Steps

## Available Cline Tools for This Workflow

This workflow utilizes Cline's comprehensive toolset throughout all phases. The following tools are available:

### File Operations

- `write_to_file`: Create or overwrite files (requirements.md, design.md, tasks.md, code files)
- `read_file`: Read existing file contents for analysis and context
- `replace_in_file`: Make targeted edits to existing files during implementation
- `search_files`: Search files using regex patterns to understand codebase structure
- `list_files`: List directory contents to explore project structure

### Terminal Operations

- `execute_command`: Run CLI commands (npm install, build scripts, test runners, etc.)
- `list_code_definition_names`: List code definitions to understand existing architecture

### Code Analysis & Development

- `browser_action`: Test web applications, capture screenshots, inspect console logs
- `web_fetch`: Fetch external documentation and resources for research

### MCP Tools (if configured)

- `use_mcp_tool`: Use custom MCP server tools for specialized functionality
- `access_mcp_resource`: Access MCP server resources for additional context

### Interaction Tools

- `ask_followup_question`: Ask user for clarification during any phase
- `attempt_completion`: Present final results and completion status

- These tools will be used strategically throughout the workflow phases to ensure comprehensive development from requirements to implementation.
- Always use Interaction Tools when you need to ask the use questions.

## 1. Requirements Clarification

### 1.1 Initial Requirements Generation

1. Ask the user for their feature idea or concept if not already provided.
2. Generate an initial set of requirements in EARS format based on the feature idea WITHOUT asking sequential questions first.
3. Create a `.Spec/{feature_name}/requirements.md` file in the current working directory.
4. Format the requirements document with:
- A clear introduction section that summarizes the feature
- A hierarchical numbered list of requirements where each contains:
- A user story in the format "As a [role], I want [feature], so that [benefit]"
- A numbered list of acceptance criteria in EARS format (Easy Approach to Requirements Syntax)
5. Consider edge cases, user experience, technical constraints, and success criteria in the initial requirements.

### 1.2 Requirements Refinement Loop

1. After creating the initial requirements document, ask the user: "Do the requirements look good? If so, we can move on to the design."
2. If the user requests changes or does not explicitly approve:
- Make modifications to the requirements document based on their feedback
- Ask for explicit approval after every iteration of edits
3. Continue the feedback-revision cycle until explicit approval is received (such as "yes", "approved", "looks good", etc.)
4. Suggest specific areas where the requirements might need clarification or expansion if needed.
5. DO NOT proceed to the design document until receiving clear approval.

## 2. Design Document Creation

### 2.1 Research and Context Building

1. Identify areas where research is needed based on the feature requirements.
2. Conduct research and build up context in the conversation thread, use `web_fetch` if needed
3. Summarize key findings that will inform the feature design.
4. Cite sources and include relevant links in the conversation when applicable.

### 2.2 Design Document Generation

1. Create a `.Spec/{feature_name}/design.md` file in the current working directory.
2. Incorporate research findings directly into the design process.
3. Include the following sections in the design document:
- Overview
- Architecture
- ALWAYS Represent diagrmas
- Key Flow
- ALWAYS Represent Flow Diagrams
- Data Models
- ALWAYS Represent Class Diagrams
- Components and Interfaces
- ALWAYS Represent Class Diagrams
- Error Handling
- Performance Consideration
4. ALWAYS use UML Diagrams to represent designs (use Mermaid for diagrams).
5. Ensure the design addresses all feature requirements identified during the clarification process.
6. Highlight design decisions and their rationales.

### 2.3 Design Review Loop

1. After creating the design document, ask the user: "Does the design look good? If so, we can move on to the implementation plan."
2. If the user requests changes or does not explicitly approve:
- Make modifications to the design document based on their feedback
- Ask for explicit approval after every iteration of edits
3. Continue the feedback-revision cycle until explicit approval is received.
4. Offer to return to feature requirements clarification if gaps are identified during design.
5. DO NOT proceed to the implementation plan until receiving clear approval.

## 3. Implementation Planning

### 3.1 Task List Creation

1. Create a `.Spec/{feature_name}/tasks.md` file in the current working directory.
2. Convert the feature design into a series of prompts for code-generation that will implement each step in a test-driven manner.
3. Prioritize best practices, incremental progress, and early testing, ensuring no big jumps in complexity at any stage.
4. Ensure each task builds on the previous tasks, and ends with wiring things together.
5. Focus ONLY on tasks that involve writing, modifying, or testing code.

### 3.2 Task Formatting Requirements

1. Format the implementation plan as a numbered checkbox list with a maximum of two levels of hierarchy:
- Top-level items (like epics) should be used only when needed
- Sub-tasks should be numbered with decimal notation (e.g., 1.1, 1.2, 2.1)
- Each item must be a checkbox
- Simple structure is preferred
2. Ensure each task item includes:
- A clear objective as the task description that involves writing, modifying, or testing code
- Additional information as sub-bullets under the task
- Specific references to requirements from the requirements document (referencing granular sub-requirements, not just user stories)
3. Ensure that the implementation plan is a series of discrete, manageable coding steps.
4. Ensure each task references specific requirements from the requirement document.
5. Assume that all context documents (feature requirements, design) will be available during implementation.
6. Ensure each step builds incrementally on previous steps.
7. Prioritize test-driven development where appropriate.
8. Ensure the plan covers all aspects of the design that can be implemented through code.
9. Sequence steps to validate core functionality early through code.
10. Ensure that all requirements are covered by the implementation tasks.

### 3.3 Task Content Constraints

1. ONLY include tasks that can be performed by a coding agent (writing code, creating tests, etc.).
2. DO NOT include tasks related to user testing, deployment, performance metrics gathering, or other non-coding activities.
3. Focus on code implementation tasks that can be executed within the development environment.
4. Ensure each task is actionable by a coding agent by following these guidelines:
- Tasks should involve writing, modifying, or testing specific code components
- Tasks should specify what files or components need to be created or modified
- Tasks should be concrete enough that a coding agent can execute them without additional clarification
- Tasks should focus on implementation details rather than high-level concepts
- Tasks should be scoped to specific coding activities (e.g., "Implement X function" rather than "Support X feature")
5. Explicitly avoid including the following types of non-coding tasks:
- User acceptance testing or user feedback gathering
- Deployment to production or staging environments
- Performance metrics gathering or analysis
- Running the application to test end to end flows (automated tests are acceptable)
- User training or documentation creation
- Business process changes or organizational changes
- Marketing or communication activities
- Any task that cannot be completed through writing, modifying, or testing code

### 3.4 Implementation Plan Review Loop

1. After creating the tasks document, ask the user: "Do the tasks look good?"
2. If the user requests changes or does not explicitly approve:
- Make modifications to the tasks document based on their feedback
- Ask for explicit approval after every iteration of edits
3. Continue the feedback-revision cycle until explicit approval is received.
4. Offer to return to previous steps (requirements or design) if gaps are identified during implementation planning.
5. DO NOT consider the workflow complete until receiving clear approval.
6. Stop once the task document has been approved.

## 4. Task Execution

### 4.1 Pre-Execution Setup

1. ALWAYS ensure you have read the `.Spec/{feature_name}/requirements.md`, `.Spec/{feature_name}/design.md` and `.Spec/{feature_name}/tasks.md` files before executing any tasks.
2. Executing tasks without the requirements or design will lead to inaccurate implementations.

### 4.2 Task Execution Process

1. Look at the task details in the task list.
2. If the requested task has sub-tasks, always start with the sub tasks.
3. Only focus on ONE task at a time. Do not implement functionality for other tasks.
4. Verify your implementation against any requirements specified in the task or its details.
5. Once you complete the requested task, stop and let the user review. DO NOT just proceed to the next task in the list.

### 4.3 Task Selection and Recommendations

1. If the user doesn't specify which task they want to work on, look at the task list for that spec and make a recommendation on the next task to execute.
2. Remember, it is VERY IMPORTANT that you only execute one task at a time. Once you finish a task, stop. Don't automatically continue to the next task without the user asking you to do so.

### 4.4 Handling Task Questions

1. The user may ask questions about tasks without wanting to execute them. Don't always start executing tasks in cases like this.
2. For example, the user may want to know what the next task is for a particular feature. In this case, just provide the information and don't start any tasks.

## 5. Workflow Completion

1. This workflow is ONLY for creating design and planning artifacts and executing the implementation tasks.
2. DO NOT attempt to implement the feature as part of the planning workflow phases (steps 1-3).
3. Clearly communicate to the user that the planning workflow is complete once the design and planning artifacts are created.
4. Inform the user that they can begin executing tasks by referencing the tasks.md file and requesting specific task execution.
5. During task execution phase (step 4), continue until all tasks are completed or the user indicates they want to stop.

</detailed_sequence_steps>

</task>
</explicit_instructions>

为Claude Code安装MCP

一般来说MCP安装分为两步,这两步可以认为不和任何IDE,AI模型绑定的通用库安装和启动

  1. 通过npm或python安装工具包
  2. 通过命令开启服务器
    1. 开启后输入 mcp的包名 --config (例如ida-pro-mcp --config)即可得到具体的mcp server配置,我们需要用到这个json配置,例如
1
1. { "mcpServers": { "shared-tools": { "command": "npx", "args": ["-y", "@your-team/mcp-tools"], "env": {} } } }

最后需要在Claude Code中配置
1和2基本所有MCP安装教程都自带了,不再多说,对于3来说,有两种方式

  • 全局安装MCP,修改 C:\Users\UserName.claude.json 中的mcpServers项目
  • 项目级安装MCP,项目根目录创建.mcp.json,增加mcpServers
    附带一个 IDA MCP安装教程

项目UI设计图快速生成

由于Web前端数据非常多,几乎所有AI模型在Web开发这一块都非常强劲,那么利用这一点,我们可以使用AI来生成项目的UI设计示意图,下面这个项目是我花了3个小时,纯AI开发的UI设计图,可交互体验:

https://github.com/wqaetly/ProjectB_UI_Design

4FDA52954D8E3196B4433D93B9D403BB

ComfyUI

之所以选择ComfyUI是因为之前WebUI的形式虽然简单,但调控起来不直观,不方便,还是这种节点式的更方便

推荐直接 官网 下载,他会自动安装所有需要的组件以及拓展,开箱即用,如果初始化过程中网络异常,要科学上网,注意,安装的时候要在C盘,否则可能会有BUG

推荐正式开始使用前过一遍官方文档,不要去买课,纯纯智商税,没有比官网讲得更好的

KSampler

我说白了,我白说了,不懂得问DeepSeek

在 ComfyUI 的 KSample 节点中,sampler_name 参数控制生成图像时使用的采样算法。以下是常见选项及其含义和特点:


📌 常用采样器解析

  1. euler

    • Euler 方法:基础的 ODE 求解器,简单快速,适合低步数(如 20-30 步)。
    • 特点:生成结果较平滑,但可能细节不足。
  2. euler_ancestral

    • 带祖先采样的 Euler:每一步依赖前一步结果,随机性更强。
    • 特点:图像多样性高,但收敛性不稳定,步数较少时可能更好。
  3. dpmpp_2sdpmpp_2m

    • DPM++ 二阶方法:改进的扩散模型求解器,平衡速度和质量。
      • 2s:单步二阶,适合快速生成(约 20 步)。
      • 2m:多步二阶,质量更高(推荐 20-30 步)。
    • 特点:dpmpp_2m 是当前主流选择,效率和效果俱佳。
  4. ddim

    • 去噪扩散隐式模型:确定性采样,结果可复现。
    • 特点:适合图像到图像转换(如 img2img),需较少步数(10-15 步)。
  5. uni_pc

    • UniPC 方法:基于校正器的采样器,2023 年新算法。
    • 特点:低步数(5-10 步)即可生成可用结果,速度快。
  6. heun

    • Heun 二阶方法:Euler 的改进版,计算量更大。
    • 特点:步数多时质量高,但速度较慢。
  7. lms

    • 线性多步法:通过历史步骤加速收敛。
    • 特点:适合中高步数(30+),结果稳定但可能显保守。

🔍 其他采样器

  • dpm2/dpm2_ancestral:二阶 DPM,需更多步数(40+),质量高但速度慢。
  • ddpm:原始扩散模型采样器,需 50-100 步,已逐渐被替代。
  • dpm_fast/dpm_adaptive:自适应调整步数,前者快但粗糙,后者精准但慢。

🎯 推荐场景

  • 快速生成dpmpp_2m(20-30步)或 uni_pc(5-10步)。
  • 高质量输出dpmpp_2m(30+步)或 heun(40+步)。
  • 可控性(如 img2img)ddimeuler
  • 实验新方法uni_pcdpmpp_3m_sde(需更多显存)。

📝 注意事项

  • 部分采样器(如 dpm_adaptive)会忽略 steps 参数,自动调整步数。
  • 祖先采样器(含 _ancestral 后缀)的随机性强,相同参数可能输出差异较大。
  • 效果受 cfg_scaledenoise 等参数影响,需配合调整。

FAQ

从网上下载的checkpoint模型执行时有conv_in.weight相关报错

是因为新版ComfyUI强制要求safetensors后缀的模型,而网上下载的有可能是ckpt后缀的,这时候需要修改代码 C:\Users\YOURNAME\AppData\Local\Programs\@comfyorgcomfyui-electron\resources\ComfyUI\comfy\utils.py

1
2
//ALWAYS_SAFE_LOAD = False 
ALWAYS_SAFE_LOAD = TRUE

提示词从哪来?

当然是从DeepSeek问啦

参考

Claude中转站
Comfy官网

模型下载 huggingface.co, civitai.green