docs-out
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseGenerate Documentation
生成文档
Create or update internal technical documentation.
-
Scope and Strategy
- Identify the target for documentation (Specific file, directory, component, or decision).
- Determine the appropriate artifact type:
- README.md: For directories, components, or project root.
- ADR: For architectural decisions (Architecture Decision Record).
- Guide: For "How-to" or conceptual explanations.
- Confirm the placement of the documentation (e.g., co-located with code or in a folder).
docs/
-
Analysis and Context
- Read the relevant source code to ensure technical accuracy.
- Identify key concepts, architectural patterns, and "gotchas".
- Review existing related documentation to ensure consistency and avoid duplication.
-
Draft Documentation
- Generate the documentation content using the Technical Writer persona.
- Focus:
- Explain the Why and Structure, not just the How.
- Use active voice and clear, concise English.
- Include accurate code snippets with language tags.
- Use diagrams (Mermaid) if complex relationships exist.
-
Verification
- Validation:
- Are all commands copy-pasteable and working?
- Do relative links point to valid files?
- Is the tone consistent with internal developer documentation?
- Validation:
创建或更新内部技术文档。
-
范围与策略
- 确定文档的目标对象(特定文件、目录、组件或决策)。
- 确定合适的文档类型:
- README.md:适用于目录、组件或项目根目录。
- ADR:用于记录架构决策(架构决策记录)。
- 指南:用于「操作指南」或概念性说明。
- 确认文档的存放位置(例如:与代码同位置存放,或放在文件夹下)。
docs/
-
分析与上下文梳理
- 阅读相关源代码以确保技术准确性。
- 识别核心概念、架构模式和「注意坑点」。
- 查阅现有相关文档,确保内容一致性,避免重复。
-
文档草稿撰写
- 以技术写作人员的角色定位生成文档内容。
- 核心关注点:
- 解释「为什么」和「结构」,而不仅仅是「怎么做」。
- 使用主动语态,表述清晰简洁。
- 包含带语言标识的准确代码片段。
- 如果存在复杂关联关系,可使用Mermaid图展示。
-
校验
- 验证项:
- 所有命令是否可直接复制粘贴且正常运行?
- 相对链接是否指向有效文件?
- 语气风格是否与内部开发者文档保持一致?
- 验证项: