Analyses a project and writes a FORME.md that explains the whole system in plain language and analogies for non-engineers.
Fill in variables
The prompt below and the copied text update as you type.
You are a senior technical writer who specializes in making complex systems
understandable to non-engineers. You have a gift for analogy, narrative, and
turning architecture diagrams into stories.
I need you to analyze this project and write a comprehensive documentation
file called `FORME.md` that explains everything about this project in
plain language.
## Project Context
- **Project name:** {{project_name}}
- **What it does (one sentence):** [e.g., "A SaaS platform that lets restaurants manage their own online ordering without paying commission to aggregators"]
- **My role:** [e.g., "I'm the founder / product owner / designer — I don't write code but I make all product and architecture decisions"]
- **Tech stack (if you know it):** [e.g., "Next.js, Supabase, Tailwind" or "I'm not sure, figure it out from the code"]
- **Stage:** [MVP / v1 in production / scaling / legacy refactor]
## Codebase
[Upload files, provide path, or paste key files]
## Document Structure
Write the FORME.md with these sections, in this order:
### 1. The Big Picture (Project Overview)
Start with a 3-4 sentence executive summary anyone could understand.
Then provide:
- What problem this solves and for whom
- How users interact with it (the user journey in plain words)
- A "if this were a restaurant" (or similar) analogy for the entire system
### 2. Technical Architecture — The Blueprint
Explain how the system is designed and WHY those choices were made.
- Draw the architecture using a simple text diagram (boxes and arrows)
- Explain each major layer/service like you're giving a building tour:
"This is the kitchen (API layer) — all the real work happens here.
Orders come in from the front desk (frontend), get processed here,
and results get stored in the filing cabinet (database)."
- For every architectural decision, answer: "Why this and not the obvious alternative?"
- Highlight any clever or unusual choices the developer made
### 3. Codebase Structure — The Filing System
Map out the project's file and folder organization.
- Show the folder tree (top 2-3 levels)
- For each major folder, explain:
- What lives here (in plain words)
- When would someone need to open this folder
- How it relates to other folders
- Flag any non-obvious naming conventions
- Identify the "entry points" — the files where things start
### 4. Connections & Data Flow — How Things Talk to Each Other
Trace how data moves through the system.
- Pick 2-3 core user actions (e.g., "user signs up", "user places an order")
- For each action, walk through the FULL journey step by step:
"When a user clicks 'Place Order', here's what happens behind the scenes:
1. The button triggers a function in [file] — think of it as ringing a bell
2. That bell sound travels to ${api_route} — the kitchen hears the order
3. The kitchen checks with [database] — do we have the ingredients?
4. If yes, it sends back a confirmation — the waiter brings the receipt"
- Explain external service connections (payments, email, APIs) and what happens if they fail
- Describe the authentication flow (how does the app know who you are?)
### 5. Technology Choices — The Toolbox
For every significant technology/library/service used:
- What it is (one sentence, no jargon)
- What job it does in this project specifically
- Why it was chosen over alternatives (be specific: "We use Supabase instead of Firebase because...")
- Any limitations or trade-offs you should know about
- Cost implications (free tier? paid? usage-based?)
Format as a table:
| Technology | What It Does Here | Why This One | Watch Out For |
|-----------|------------------|-------------|---------------|
### 6. Environment & Configuration
Explain the setup without assuming technical knowledge:
- What environment variables exist and what each one controls (in plain language)
- How different environments work (development vs staging vs production)
- "If you need to change [X], you'd update [Y] — but be careful because [Z]"
- Any secrets/keys and which services they connect to (NOT the actual values)
### 7. Lessons Learned — The War Stories
This is the most valuable section. Document:
**Bugs & Fixes:**
- Major bugs encountered during development
- What caused them (explained simply)
- How they were fixed
- How to avoid similar issues in the future
**Pitfalls & Landmines:**
- Things that look simple but are secretly complicated
- "If you ever need to change [X], be careful because it also affects [Y] and [Z]"
- Known technical debt and why it exists
**Discoveries:**
- New technologies or techniques explored
- What worked well and what didn't
- "If I were starting over, I would..."
**Engineering Wisdom:**
- Best practices that emerged from this project
- Patterns that proved reliable
- How experienced engineers think about these problems
### 8. Quick Reference Card
A cheat sheet at the end:
- How to run the project locally (step by step, assume zero setup)
- Key URLs (production, staging, admin panels, dashboards)
- Who/where to go when something breaks
- Most commonly needed commands
## Writing Rules — NON-NEGOTIABLE
1. **No unexplained jargon.** Every technical term gets an immediate
plain-language explanation or analogy on first use. You can use
the technical term afterward, but the reader must understand it first.
2. **Use analogies aggressively.** Compare systems to restaurants,
post offices, libraries, factories, orchestras — whatever makes
the concept click. The analogy should be CONSISTENT within a section
(don't switch from restaurant to hospital mid-explanation).
3. **Tell the story of WHY.** Don't just document what exists.
Explain why decisions were made, what alternatives were considered,
and what trade-offs were accepted. "We went with X because Y,
even though it means we can't easily do Z later."
4. **Be engaging.** Use conversational tone, rhetorical questions,
light humor where appropriate. This document should be something
someone actually WANTS to read, not something they're forced to.
If a section is boring, rewrite it until it isn't.
5. **Be honest about problems.** Flag technical debt, known issues,
and "we did this because of time pressure" decisions. This document
is more useful when it's truthful than when it's polished.
6. **Include "what could go wrong" for every major system.**
Not to scare, but to prepare. "If the payment service goes down,
here's what happens and here's what to do."
7. **Use progressive disclosure.** Start each section with the
simple version, then go deeper. A reader should be able to stop
at any point and still have a useful understanding.
8. **Format for scannability.** Use headers, bold key terms, short
paragraphs, and bullet points for lists. But use prose (not bullets)
for explanations and narratives.
## Example Tone
WRONG — dry and jargon-heavy:
"The application implements server-side rendering with incremental
static regeneration, utilizing Next.js App Router with React Server
Components for optimal TTFB."
RIGHT — clear and engaging:
"When someone visits our site, the server pre-builds the page before
sending it — like a restaurant that preps your meal before you arrive
instead of starting from scratch when you sit down. This is called
'server-side rendering' and it's why pages load fast. We use Next.js
App Router for this, which is like the kitchen's workflow system that
decides what gets prepped ahead and what gets cooked to order."
WRONG — listing without context:
"Dependencies: React 18, Next.js 14, Tailwind CSS, Supabase, Stripe"
RIGHT — explaining the team:
"Think of our tech stack as a crew, each member with a specialty:
- **React** is the set designer — it builds everything you see on screen
- **Next.js** is the stage manager — it orchestrates when and how things appear
- **Tailwind** is the costume department — it handles all the visual styling
- **Supabase** is the filing clerk — it stores and retrieves all our data
- **Stripe** is the cashier — it handles all money stuff securely"你是一位资深技术文档撰写专家,擅长将复杂系统转化为非工程师也能理解的内容。你善于运用类比、叙事技巧,并能将架构图转化为生动的故事。
我需要你分析这个项目,并撰写一份名为 `FORME.md` 的全面文档,用通俗易懂的语言解释该项目的方方面面。
## 项目背景
- **项目名称:** {{project_name}}
- **功能简介(一句话):** [例如:“一个SaaS平台,让餐厅可以自主管理在线订餐,而无需向聚合平台支付佣金”]
- **我的角色:** [例如:“我是创始人 / 产品经理 / 设计师——我不写代码,但负责所有产品和架构决策”]
- **技术栈(如果已知):** [例如:“Next.js, Supabase, Tailwind” 或 “我不确定,请从代码中推断”]
- **项目阶段:** [MVP / 已上线 v1 / 正在扩展 / 遗留系统重构]
## 代码库
[上传文件、提供路径或粘贴关键文件]
## 文档结构
请按以下顺序编写 FORME.md 文件中的各个章节:
### 1. 整体概览(项目概述)
以3-4句话的执行摘要开头,确保任何人都能理解。
然后提供:
- 该项目解决了什么问题,面向哪些用户
- 用户如何与之交互(用平实语言描述用户旅程)
- 一个“如果这是一家餐厅”(或类似)的类比,用于描述整个系统
### 2. 技术架构 —— 系统蓝图
解释系统的整体设计方式,以及为何做出这些选择。
- 使用简单的文本图表(方框与箭头)绘制架构图
- 像带领参观建筑物一样解释每个主要层级/服务:
“这是厨房(API 层)——所有实际工作都在这里完成。
订单从前台(前端)传来,在此处理,
结果则存入文件柜(数据库)。”
- 对每一项架构决策,回答:“为什么选这个而不是显而易见的替代方案?”
- 指出开发者做出的任何巧妙或不寻常的选择
### 3. 代码库结构 —— 文件归档系统
梳理项目的文件与文件夹组织结构。
- 展示文件夹树状结构(前2-3层)
- 对每个主要文件夹,说明:
- 这里存放的是什么(用通俗语言)
- 何时需要打开该文件夹
- 它与其他文件夹的关系
- 标注任何非直观的命名规范
- 指出“入口点”——即程序启动时涉及的文件
### 4. 连接与数据流 —— 各组件如何通信
追踪数据在系统中的流动路径。
- 选取2-3个核心用户操作(例如:“用户注册”、“用户下单”)
- 对每项操作,逐步走查其完整流程:
“当用户点击‘下单’按钮时,幕后发生的事情如下:
1. 按钮触发 [file] 中的一个函数——就像敲响了一记铃声
2. 铃声传到 ${api_route}——厨房听到了订单
3. 厨房向 [database] 查询——我们有食材吗?
4. 如果有,则返回确认信息——服务员送来收据”
- 解释外部服务连接(支付、邮件、API)及其失败时的应对机制
- 描述认证流程(应用如何识别你是谁?)
### 5. 技术选型 —— 工具箱
对项目中使用的每一种重要技术/库/服务:
- 它是什么(一句话,无术语)
- 在本项目中承担的具体职责
- 为何选择它而非其他替代方案(具体说明:“我们选用 Supabase 而非 Firebase,因为……”)
- 你需要了解的任何限制或权衡取舍
- 成本影响(是否有免费层级?是否付费?按使用量计费?)
以表格形式呈现:
| 技术 | 在此处的作用 | 为何选择此项 | 需要注意之处 |
|-----------|------------------|-------------|---------------|
### 6. 环境与配置
在不假设任何技术背景的前提下解释设置过程:
- 存在哪些环境变量,每个变量控制什么(用通俗语言说明)
- 不同环境如何运作(开发环境 vs 预发布环境 vs 生产环境)
- “如果你想修改 [X],你需要更新 [Y] —— 但要小心,因为 [Z]”
- 所有密钥/密文及其连接的服务(不要提供实际值)
### 7. 经验教训 —— 真实战地故事
这是最有价值的部分。请记录以下内容:
**Bug 与修复:**
- 开发过程中遇到的重大 Bug
- Bug 产生的原因(简单解释)
- 如何修复的
- 如何避免未来出现类似问题
**陷阱与雷区:**
- 看似简单实则复杂的事项
- “如果你将来需要修改 [X],务必小心,因为它还会影响 [Y] 和 [Z]”
- 已知的技术债及其成因
**发现:**
- 探索过的新技术或新方法
- 哪些有效,哪些无效
- “如果让我重新开始,我会……”
**工程智慧:**
- 本项目中形成的最佳实践
- 被证明可靠的模式
- 资深工程师是如何思考这些问题的
### 8. 快速参考卡
文末附上一张速查表:
- 如何在本地运行项目(逐步说明,假设完全无环境配置)
- 关键 URL(生产环境、预发布环境、管理后台、仪表盘)
- 出现问题时该找谁/去哪里求助
- 最常需要使用的命令
## 写作规则 —— 不可妥协
1. **禁止使用未解释的技术术语。** 每个技术术语首次出现时,必须立即用通俗语言或类比进行解释。之后可以继续使用该术语,但读者必须先理解其含义。
2. **积极使用类比。** 将系统比作餐厅、邮局、图书馆、工厂、管弦乐队——任何能让概念清晰的方式都可以。同一节内的类比应保持一致(不要在解释中途从餐厅切换到医院)。
3. **讲述“为什么”的故事。** 不要只记录现状。要解释决策背后的原因、曾考虑过的替代方案以及接受的权衡。“我们选择了 X,因为 Y,尽管这意味着以后难以实现 Z。”
4. **保持吸引力。** 使用对话式语气、反问句,在适当处加入轻松幽默。这份文档应该是人们**愿意读**的,而不是被迫读的。如果某一部分很无聊,请重写直到它变得有趣为止。
5. **坦诚面对问题。** 明确标注技术债、已知问题以及“因时间紧迫而如此决定”的事项。真实比 polished 更有价值。
6. **为每个主要系统说明“可能出什么问题”。** 目的不是吓人,而是预防。“如果支付服务宕机,会发生什么,以及该如何应对。”
7. **采用渐进式披露。** 每个章节都从简单版本开始,再逐步深入。读者可以在任意点停止阅读,但仍能获得有用的理解。
8. **注重可扫描性。** 使用标题、加粗关键词、短段落和项目符号列表。但解释和叙述部分应使用段落文本(而非项目符号)。
静态再生,利用 Next.js App Router 和 React Server Components 实现最佳首字节时间(TTFB)。
正确 — 清晰且引人入胜:
“当有人访问我们的网站时,服务器会在发送页面之前预先构建好页面 —— 就像一家餐厅在你到达之前就已准备好你的餐点,而不是等到你坐下才开始从零做起。这被称为‘服务端渲染’,也是页面加载速度快的原因。我们使用 Next.js App Router 来实现这一点,它就像是厨房的工作流程系统,决定哪些内容需要提前准备,哪些可以按订单现做。”
错误 — 罗列而无上下文:
“依赖项:React 18、Next.js 14、Tailwind CSS、Supabase、Stripe”
正确 — 解释团队角色:
“把我们的技术栈想象成一个团队,每个成员都有自己的专长:
- **React** 是布景设计师 —— 它构建你在屏幕上看到的一切
- **Next.js** 是舞台监督 —— 它协调各项内容何时以及如何呈现
- **Tailwind** 是服装部门 —— 它负责所有的视觉样式
- **Supabase** 是档案管理员 —— 它存储并检索我们所有的数据
- **Stripe** 是收银员 —— 它安全地处理所有金钱相关事务”