blueprints-maintenance
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseMaintaining Technical Blueprints
维护技术蓝图
The Sync Problem
同步问题
Documentation drifts from implementation when:
- Code changes without doc updates
- New features added without documentation
- Deprecated features remain documented
- Behavior changes aren't reflected
当出现以下情况时,文档会与实际实现脱节:
- 代码变更但未更新文档
- 添加新功能但未记录文档
- 已废弃的功能仍保留在文档中
- 行为变更未在文档中体现
Verification Process
验证流程
Before Making Changes
修改前准备
-
Find relevant blueprints:
# Search for blueprints related to your system Grep("auth", path: "blueprints/", output_mode: "files_with_matches") # Read the blueprint to understand current documentation Read("blueprints/authentication.md") -
Note what documentation exists:
- Overview accurate?
- API documentation complete?
- Behavior described correctly?
-
Plan documentation updates alongside code changes
-
查找相关蓝图:
# Search for blueprints related to your system Grep("auth", path: "blueprints/", output_mode: "files_with_matches") # Read the blueprint to understand current documentation Read("blueprints/authentication.md") -
记录现有文档内容:
- 概述是否准确?
- API文档是否完整?
- 行为描述是否正确?
-
在规划代码变更的同时规划文档更新
After Making Changes
修改后操作
-
Re-read the blueprint to verify accuracy:
Read("blueprints/authentication.md") -
Verify each section:
- Does Overview still describe the purpose?
- Are all public APIs documented?
- Is behavior description accurate?
- Are file paths still correct?
-
Update the blueprint:
# Read current content, modify as needed, write back Write("blueprints/authentication.md", updated_content_with_frontmatter) -
Remove stale content - outdated docs mislead
-
重新阅读蓝图以验证准确性:
Read("blueprints/authentication.md") -
验证每个章节:
- 概述是否仍能描述系统用途?
- 所有公开API是否都已记录?
- 行为描述是否准确?
- 文件路径是否仍然正确?
-
更新蓝图:
# Read current content, modify as needed, write back Write("blueprints/authentication.md", updated_content_with_frontmatter) -
移除过时内容 - 过时文档会产生误导
Types of Updates
更新类型
Adding New Features
添加新功能
When adding functionality:
- Update the Overview if scope expanded
- Add new API documentation
- Document new behavior
- Update Related Systems if new integrations
- Add to Files section if new files created
添加功能时:
- 如果范围扩大,更新概述部分
- 添加新的API文档
- 记录新的行为
- 如果有新的集成,更新相关系统部分
- 如果创建了新文件,添加到文件章节
Modifying Existing Features
修改现有功能
When changing behavior:
- Update behavior descriptions
- Revise API documentation if signatures changed
- Update examples if usage changed
- Check related blueprints for impact
变更行为时:
- 更新行为描述
- 如果签名变更,修订API文档
- 如果用法变更,更新示例
- 检查相关蓝图是否受影响
Removing Features
移除功能
When deprecating or removing:
- Remove API documentation
- Remove from behavior section
- Update Overview if scope reduced
- Consider keeping a "Removed" or "History" note if the change is significant
废弃或移除功能时:
- 删除API文档
- 从行为章节移除相关内容
- 如果范围缩小,更新概述
- 如果变更影响重大,可以考虑保留“已移除”或“历史记录”说明
Refactoring
重构
When restructuring without behavior changes:
- Update Files section with new paths
- Update Architecture if structure changed
- Verify examples still work
- API documentation usually unchanged
在不改变行为的前提下重构时:
- 更新文件章节中的新路径
- 如果架构变更,更新架构部分
- 验证示例是否仍可正常运行
- API文档通常无需变更
Documentation Debt
文档债务
Recognizing Debt
识别债务
Signs blueprints need attention:
- File paths that don't exist
- Functions that aren't in the codebase
- Behavior that doesn't match reality
- Missing documentation for visible features
蓝图需要维护的迹象:
- 文件路径不存在
- 代码库中没有对应的函数
- 行为与实际不符
- 可见功能缺少文档
Paying Down Debt
偿还债务
Prioritize by impact:
- Critical: Public APIs with wrong docs
- High: Core systems undocumented
- Medium: Internal systems outdated
- Low: Minor inaccuracies
按影响优先级处理:
- 关键:公开API文档错误
- 高:核心系统未文档化
- 中等:内部系统文档过时
- 低:轻微不准确
Verification Checklist
验证清单
When reviewing blueprints:
markdown
undefined审查蓝图时:
markdown
undefinedVerification Checklist
Verification Checklist
- Overview matches current purpose
- All public APIs documented
- API signatures accurate
- Examples execute correctly
- Behavior matches implementation
- File paths exist
- No removed features documented
- Related systems links work
- No duplicate content with other blueprints
undefined- Overview matches current purpose
- All public APIs documented
- API signatures accurate
- Examples execute correctly
- Behavior matches implementation
- File paths exist
- No removed features documented
- Related systems links work
- No duplicate content with other blueprints
undefinedKeeping Blueprints Fresh
保持蓝图时效性
During Development
开发过程中
- Treat docs as part of the feature
- Update blueprint in same commit as code
- Review blueprint changes in code review
- 将文档视为功能的一部分
- 在同一提交中更新蓝图和代码
- 在代码评审中审查蓝图变更
Regular Maintenance
定期维护
- Periodically audit blueprints vs code
- Use command to regenerate
/blueprints - Remove orphaned blueprint files
- 定期审核蓝图与代码是否一致
- 使用命令重新生成
/blueprints - 移除孤立的蓝图文件
Tooling Support
工具支持
The blueprints hooks automatically:
- Remind you to check docs (UserPromptSubmit)
- Verify docs match changes (Stop hook)
蓝图钩子会自动:
- 提醒你检查文档(UserPromptSubmit)
- 验证文档是否与变更匹配(Stop hook)
Anti-Patterns
反模式
Don't
不要
- Leave TODO comments in blueprints indefinitely
- Copy implementation details that will change
- Document external libraries (link instead)
- Keep deprecated feature docs "for reference"
- 在蓝图中无限期保留TODO注释
- 复制会变更的实现细节
- 记录外部库(改用链接)
- 保留已废弃功能的文档“供参考”
Do
要
- Delete stale content immediately
- Update atomically with code
- Cross-reference rather than duplicate
- Keep examples minimal but complete
- 立即删除过时内容
- 与代码同步原子性更新
- 使用交叉引用而非重复内容
- 示例保持精简但完整