AI赋能:完美详细设计书(詳細設計書)的写作指南

(株)PARA-TECH AI開発部 2025年11月

核心策略: 将 AI 定位为具备“日式严谨性”的文案与逻辑处理专家。采用“分步生成(Step-by-Step)”和“角色扮演(Role Prompting)”方法,确保输出的专业性和准确性。

一、 准备工作:明确“日式详细设计”的核心要素

日本的详细设计书通常需要覆盖以下关键要素。你需要针对这些要素分别向 AI 提问:

二、 第一步:定义 AI 的“人设”与“规则” (System Prompt)

在对话开始时,确立 AI 的身份和输出规范,确保后续所有输出风格的统一性。

通用 Prompt 模板:人设与规范

# Role You are a Senior System Engineer (SE) at a top-tier Japanese SIer company. Your task is to write a "Detailed Design Document" (詳細設計書). # Output Rules (CRITICAL) 1. **Language:** Professional Japanese (Technical/Business Context). 2. **Style:** - Use "だ・である" style for specifications (仕様). - Use "です・ます" only for notes or supplementary explanations. 3. **Tone:** Objective, unambiguous, and strict (厳密). 4. **Vocabulary:** Use standard IPA terms (e.g., 認証, 排他制御, トランザクション). 5. **Formatting:** Markdown tables or bullet points for readability. # Context We are designing a [系统名称, e.g., Employee Management System] for a Japanese client. Process specific logic step-by-step.

三、 第二步:核心逻辑转换 (Logic to Spec)

将你用中文或伪代码构思的逻辑,转换为标准的日语设计描述。这是利用 AI 弥补语言和规范差异的关键步骤。

Prompt 模板:逻辑转规范

你的输入(中文/伪代码示例):

// 你的逻辑草稿 1. 检查用户ID和密码是不是空的,空的话报错 E001。 2. 去 User 表查 ID,没查到就报错 E002。 3. 查到了对比密码 hash,不对就报错 E003,并且错误次数+1。 4. 如果错误次数超过 3 次,锁定账号。
# Task Convert the following logic into a "Processing Flow" (処理フロー) section of a Detailed Design Document. # Logic (Draft) [粘贴上面的中文逻辑] # Requirements 1. Structure the output as a numbered list (1, 2, 3...). 2. Explicitly mention specific Error Codes (e.g., E001). 3. Use phrases like: - "If..." -> "...の場合、~すること。" - "Retrieve..." -> "...を取得する。" - "Update..." -> "...を更新する。" 4. Clarify "Normal Flow" (正常系) and "Error Flow" (異常系).

四、 第三步:生成“输入/输出定义”表格 (I/O Definition)

利用 AI 擅长结构化数据的能力,生成符合日本格式要求的 Markdown 表格,便于后续复制到 Excel。

Prompt 模板:生成表格定义

# Task Create an "Input Item Definition" (画面入力項目定義) table for the Login Screen. # Items to Include - User ID (Alphanumeric, Max 20 chars, Required) - Password (Alphanumeric, Max 32 chars, Required, Masked) # Output Format (Markdown Table) | No. | 項目名 (Item Name) | 物理名 (Physical Name) | 型/桁数 (Type/Len) | 必須 (Req) | 備考 (Remarks) | |-----|-------------------|----------------------|-------------------|------------|----------------|

五、 第四步:补全“异常处理” (Exception Handling)

要求 AI 像经验丰富的 SE 一样,列出所有可能遗漏的异常情况,这是提高文档质量的关键细节。

Prompt 模板:异常场景列举

# Task List all necessary "Exception Handling" (例外処理) scenarios for this function based on the logic provided in Step 2. Consider: DB connection errors, timeout, data inconsistency, and business logic errors. # Output Format - Use a table: [Case] | [System Action] | [User Message]

六、 第五步:润色与检查 (Refinement & Review)

在交付前,利用 AI 的语言能力进行最终校对,确保日语表达的自然和严谨。

Prompt 模板:自查与修正

# Task Review the following Japanese design text for a "Strict Waterfall Project". Point out any expressions that are "ambiguous" (曖昧) or "unnatural" (不自然). Suggest a better, more professional version. # Text to Review [粘贴 AI 刚才生成的日语文本]
给你的特别建议:

1. “言い切り”(断言)的重要性:

2. 维护词汇表:

3. 最终格式: