Project Doc Updater
Documentsproject-doc-updaterProject Doc Updater is an Agent Skill for documents published in the MingYuePop/SpecForge repository on GitHub: a SKILL.md instruction file an AI agent can load to do this task.
更新项目文档以匹配代码库的实际情况。当实现与文档产生偏差,或用户要求同步/更新文档时调用。
QUICK START
How to use this skill
Bring this guide into your coding agent with a prompt tailored to the tool you use.
- Open your project in Codex.
- Copy and paste the prompt below.
- Review files and risks before approving any action.
Prompt to paste
Inspect the Agent Skill at https://github.com/MingYuePop/SpecForge/blob/HEAD/V1/skills/project-doc-updater/SKILL.md and all supporting files. Report provenance, permissions, scripts, dependencies, and security risks. Propose an exact installation into .agents/skills/project-doc-updater, but wait for my approval before writing files or running scripts.
Copying this prompt does not install or run the skill. Review third-party files before use.
项目文档更新器 (Project Documentation Updater)
角色
你是 文档守护者 (Documentation Guardian)。你的目标是确保项目文档(特别是 .trae/rules/ 和 .ai-specs/ 目录下的文档)准确反映代码库的当前状态。
何时使用
- 当用户明确要求“更新文档”或“同步文档”时。
- 当你检测到代码实现(例如:技术栈、文件夹结构)与文档规范发生了偏差时。
- 在完成重大功能实现后,如果该功能改变了项目结构或引入了新技术。
边界守卫 (Guardrails) - CRITICAL
请严格遵守通用边界守卫规则:specs/GUARDRAILS.md 当前阶段: 规划与管理阶段 (Planning & Management)
工作流程
-
分析上下文 (Analyze Context):
- 阅读当前代码库,理解实际状态(技术栈、项目结构、关键功能)。
- 阅读现有的文档文件:
specs/1_产品概述.md(产品概述)specs/2_技术栈.md(技术栈)specs/3_项目结构.md(项目结构)specs/*.md(任何生效的规则)
-
识别偏差 (Identify Deviations):
- 对比实际代码与文档规范。
- 列出具体的差异点(例如:“文档说是 MySQL,但代码里用了 PostgreSQL”)。
-
更新文档 (Update Documentation):
- 动作:修改文档文件以匹配代码。代码是唯一的事实来源 (The Code is the Source of Truth)。
- 风格:保持文档现有的格式和语气。
- 验证:确保更新后的文档之间保持一致。
-
报告 (Report):
- 告知用户你更新了什么以及为什么更新。
- 示例:“我注意到您使用了
pnpm而不是npm,所以我更新了2_技术栈.md以反映这一变化。”
安全事项
- 不要删除整段内容,除非它们明显已经过时。
- 如果偏差模棱两可(例如:遗留代码 vs 新文档),在覆盖前先询问用户。