design-it
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesedesign-it
生成设计文档
Overview
概述
Generate a technical design document as one self-contained HTML file in a fixed house style, so every new 需求 produces a visually identical page. The look is not improvised each time — it comes from a fixed block and a fixed section skeleton. Your job is to fill content into that skeleton, never to redesign it.
<style>Core principle: Copy verbatim, then replace only the content. Keep the block byte-for-byte. Consistency comes from not touching the design system.
template.html<style>生成符合固定内部风格的独立HTML格式技术设计文档,确保每个新需求对应的页面视觉效果完全一致。文档外观并非临时设计——它来自固定的块和固定的章节框架。你的任务是将内容填充到该框架中,绝不能重新设计框架。
<style>核心原则: 完整复制,仅替换内容部分。块需完全原样保留。一致性源于不修改设计系统。
template.html<style>When to Use
使用场景
- The user gives a new requirement / spec / feature and wants a design doc.
- Converting a technical spec into the shareable HTML form.
.md - Any request like "生成同样的 html / 用这套模板 / 出一份设计文档".
When NOT to use: quick throwaway notes, a real Markdown deliverable the user wants to stay Markdown, or slide decks.
- 用户提供新需求/规格说明/功能,需要生成设计文档时。
- 将格式的技术规格转换为可共享的HTML格式时。
.md - 任何类似「生成同样的html / 用这套模板 / 出一份设计文档」的请求。
不适用场景: 临时便签、用户希望保留Markdown格式的交付物,或幻灯片。
Workflow
工作流程
- Copy the template. Start from in this skill's directory. Do not hand-roll the
template.html/<head>— copy it whole.<style> - Gather real content first. Section titles, field names, SQL, code positions, protoIds — all must come from the actual requirement doc and codebase. Read the code; do not invent identifiers. If a fact is unknown, mark it
file:line, never guess.<span class="pill todo">待确认</span> - Fill the skeleton. Rename/reorder s to fit the feature. Keep the section kinds: 已对齐结论 → 业务规则 → 架构图 → 时序 → 数据模型 → 契约 → 清单 → 幂等降级 → 测试用例 → 代码索引 → 变更记录. Drop what doesn't apply; add feature-specific ones in the same style.
<section> - Keep TOC and sections in sync. Every needs a matching
<a href="#x">, and vice versa. This is the #1 breakage — verify at the end (see Quick Reference).<section id="x"> - Save as . Don't commit unless asked.
docs/<需求名>.html
- 复制模板:从本技能目录下的开始。不要手动编写
template.html/<head>——完整复制整个文件。<style> - 先收集真实内容:章节标题、字段名、SQL语句、代码位置、protoIds——所有内容必须来自实际需求文档和代码库。查看代码,不要编造标识符。如果某个信息未知,标记为
file:line,绝不要猜测。<span class="pill todo">待确认</span> - 填充框架:重命名/调整顺序以适配功能。保留章节类型:已对齐结论 → 业务规则 → 架构图 → 时序图 → 数据模型 → 契约 → 清单 → 幂等降级 → 测试用例 → 代码索引 → 变更记录。删除不适用的章节;以相同风格添加功能专属章节。
<section> - 保持目录与章节同步:每个必须对应一个
<a href="#x">,反之亦然。这是最常见的错误——最后务必验证(参见快速参考)。<section id="x"> - 保存为。除非被要求,否则不要提交代码。
docs/<需求名>.html
House-Style Rules (non-negotiable)
内部风格规则(不可协商)
| Element | Rule |
|---|---|
| Copy verbatim. Never restyle. Colors come from |
| Code / SQL / YAML | Always the template's |
| Callout boxes | |
| Diagrams | Hand-authored inline |
| Intro | Each section opens with one |
| Pills | |
| Tables | Plain |
| Lang | |
| 元素 | 规则 |
|---|---|
| 完整原样复制。绝不要重新设置样式。颜色仅来自 |
| 代码/SQL/YAML | 始终使用模板中的 |
| 提示框 | |
| 图表 | 在 |
| 引言 | 每个章节开头使用一个 |
| 状态标签 | 使用 |
| 表格 | 使用普通 |
| 语言 | |
Common Mistakes
常见错误
- Redesigning the CSS. The whole point is identical output — don't "improve" colors, spacing, or fonts. Copy untouched.
<style> - Unescaped angle brackets in .
<pre>renders as a broken tag. Escape toList<String>.List<String> - Dead TOC links. Adding a section without its TOC entry (or renaming an and forgetting the
id). Always cross-check.href - Inventing code positions. , table names, protoIds must be read from the repo. Unknown →
file:linepill, not a plausible-looking guess.待确认 - Making it a proposal. Keep it a design doc (what/how, locked decisions), not a persuasive pitch.
- 重新设计CSS:核心目标是输出一致的文档——不要「优化」颜色、间距或字体。完全复制块。
<style> - 内未转义尖括号:
<pre>会渲染为损坏的标签。需转义为List<String>。List<String> - 无效目录链接:添加章节但未添加对应的目录条目(或重命名但忘记更新
id)。务必交叉检查。href - 编造代码位置:、表名、protoIds必须从代码库中获取。未知内容→标记为
file:line标签,不要猜测看似合理的内容。待确认 - 将文档写成提案:保持文档为设计文档(说明内容和实现方式、已确定的决策),而非说服性的提案。
Quick Reference — final self-check
快速参考——最终自检
bash
f="docs/<需求名>.html"bash
f="docs/<需求名>.html"TOC hrefs vs section ids must match exactly (no output = perfect):
目录href与章节id必须完全匹配(无输出即为正确):
diff <(grep -oE 'href="#[a-z0-9-]+"' "$f" | sed 's/.#//;s/"//' | sort -u)
<(grep -oE '<section id="[a-z0-9-]+"' "$f" | sed 's/."//' | sort -u)
<(grep -oE '<section id="[a-z0-9-]+"' "$f" | sed 's/."//' | sort -u)
diff <(grep -oE 'href="#[a-z0-9-]+"' "$f" | sed 's/.#//;s/"//' | sort -u)
<(grep -oE '<section id="[a-z0-9-]+"' "$f" | sed 's/."//' | sort -u)
<(grep -oE '<section id="[a-z0-9-]+"' "$f" | sed 's/."//' | sort -u)
open in browser to eyeball diagrams + code blocks render cleanly
在浏览器中打开,检查图表和代码块是否正常渲染
undefinedundefined