documentation-guidelines
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseDocumentation Guidelines
文档指南
Overview
概述
Produce a single, canonical module doc that matches the repository's documentation rules and keeps backend/API contracts consistent and skimmable.
生成一份符合仓库文档规则的单一标准模块文档,确保后端/API契约一致且易于浏览。
Workflow
工作流程
- Locate the repo's documentation rules (prefer ). If missing, load
docs/memories/DOCUMENTATION_GUIDELINES.md.references/documentation-guidelines.md - Determine the correct documentation path for the current project. Use the repo's conventions; if no zones exist, default to (or the project's documented location).
docs/features/<module>.md - Create or update the module doc before changing logic. Remove outdated content instead of appending.
- Follow the required section order from the guidelines and keep the doc in English.
- 查找仓库的文档规则(优先选择)。如果缺失,加载
docs/memories/DOCUMENTATION_GUIDELINES.md。references/documentation-guidelines.md - 确定当前项目的正确文档路径。遵循仓库的约定;如果没有分区,默认使用(或项目指定的位置)。
docs/features/<module>.md - 在修改逻辑之前创建或更新模块文档。删除过时内容,而非追加。
- 遵循指南要求的章节顺序,文档保持英文撰写。
Required Content Checklist
必填内容清单
- Start every doc with YAML frontmatter metadata (,
name,description,version,last_updated), then write the rest as standard Markdown sections.maintained_by - Include Mermaid ERD and Mermaid flowchart.
- Document controllers/routes, requests, resources, models, services, jobs, and providers.
- Provide endpoint table, headers, payloads, response examples, and error dictionary.
- State permissions, feature flags, and client consumption rules.
- Add local development + seeding commands and troubleshooting/log hints.
- 每份文档开头需包含YAML前置元数据(、
name、description、version、last_updated),其余部分采用标准Markdown章节撰写。maintained_by - 包含Mermaid实体关系图(ERD)和Mermaid流程图。
- 记录控制器/路由、请求、资源、模型、服务、任务和提供者。
- 提供端点表格、请求头、负载、响应示例和错误字典。
- 说明权限、功能标志和客户端使用规则。
- 添加本地开发+数据填充命令以及故障排查/日志提示。
Style Rules
样式规则
- Use frontmatter + Markdown consistently (no plain-text-only docs).
- Describe contracts and behavior, not UI.
- Use tables for endpoints and business rules.
- Keep Mermaid labels short and safe; wrap special characters in quotes if needed.
- Delete obsolete text to keep the doc clean and non-duplicative.
- 始终一致使用前置元数据+Markdown格式(不允许纯文本文档)。
- 描述契约和行为,而非用户界面。
- 使用表格展示端点和业务规则。
- 保持Mermaid标签简短安全;如有需要,将特殊字符用引号包裹。
- 删除过时文本,保持文档简洁无重复。
Frontend API Documentation
前端API文档
If the user explicitly asks for frontend-facing API docs, load the repo's frontend guideline file (typically ) and follow it.
docs/memories/FRONTEND_API_DOCUMENTATION_GUIDELINES.md如果用户明确要求面向前端的API文档,加载仓库的前端指南文件(通常为)并遵循其规则。
docs/memories/FRONTEND_API_DOCUMENTATION_GUIDELINES.mdResources
资源
- : Canonical structure and ordering for backend feature documentation.
references/documentation-guidelines.md
- :后端功能文档的标准结构和顺序规范。
references/documentation-guidelines.md