使用AI从0-1构建产品

如何让 AI 的回答更精准

要让 AI 的回答更精准,需要做到如下的几点:

  1. 给 AI 具体且明确的需求,不让要 AI 觉得模棱两可。
  2. 将大问题拆分成小问题,一次只解决一个小问题,并提供足够的上下文
  3. 不要将所有的要求都放入一个提示词中
  4. 对于 AI 提示词而言,最好的格式是 xml,其次是 markdown。但是 xml 格式有些难写,用 markdown 格式也够用
  5. 针对不同的任务使用不同的模型
  6. 使用不同的模型来确认和验证模型的正确性

如何通过 AI 将一个想法变成一个产品

当我们有一个想法时,不要直接让 AI 帮我们写,应该先让 AI 帮我们生成详细的产品需求文档(PRD),并让 AI 根据需求文档制定一个计划,并将需求拆分成 task 和 subtask

生成需求文档

让 AI 将我们的想法转换成需求文档,提示词模板如下:

You're a senior software engineer. We're going to build the PRD of a project
together.

VERY IMPORTANT:
- Ask one question at a time
- Each question should be based on previous answers
- Go deeper on every important detail required

IDEA:
<paste here your idea>

将提示词发送给 AI 后,AI 会询问我们相关的问题,详细的回答 AI。当你觉得需求都已经明确之后,通过如下的提示词让 AI 将其总结到 PRD 文件中:

Compile those findings into a PRD. Use markdown format. It should contain the
following sections:

- Project overview
- Core requirements
- Core features
- Core components
- App/user flow
- Techstack
- Implementation plan

AI 回答完毕之后,查看 AI 回复的需求文档,查漏补缺,完成之后将需求文档保存下来,比如保存到 docs/PRD.md 文件中

根据 PRD 生成任务列表

有了 PRD 之后,让 AI 根据 PRD 生成任务列表,提示词如下:

Based on the generated PRD, create a detailed step-by-step plan to build this project.
Then break it down into small tasks that build on each other.
Based on those tasks, break them into smaller subtasks.
Make sure the steps are small enough to be implemented in a step but big enough
to finish the project with success.
Use best practices of software development and project management, no big
complexity jumps. Wire tasks into others, creating a dependency list. There
should be no orphan tasks.

VERY IMPORTANT:
- Use markdown
- Each task and subtask should be a checklist item
- Provide context enough per task so a developer should be able to implement it
- Each task should have a number id
- Each task should list dependent task ids

将 AI 的回复保存到 docs/todo.md 文件中

让 AI 根据 PRD 和 TODO 完成任务

You're a senior software engineer. Study @docs/specs.md and implement what's
still missing in @docs/todo.md. Implement each task each time and respect task
and subtask dependencies. Once finished a task, check it in the list and move
to the next.

如何选择大模型

  • 如果目标是头脑风暴: 选择 thinking 模型
  • 如果目标是编程,选择专为编程而生的模型。

参考链接

使用 Hugo 构建
主题 StackJimmy 设计