doc-sync
A skill for maintaining strong consistency between code, documentation, and a private knowledge base.
Workflows
1. Synchronize Docstrings and Comments
When you modify function logic or signatures in Python or Go, use this skill to update the relevant comments.
- - Python: Follows Google Style. Updates
Args, Returns, and Attributes. - Go: Follows Standard Go Doc style. Updates exported function/struct comments.
How to trigger: "Update docstrings for [filepath]" or "Sync comments in [filepath] after my changes."
2. README.md Real-time Update
When adding new exported functions, CLI flags, or API endpoints, this skill ensures the root
README.md is updated to reflect the new interface.
- - Scans for changes in public APIs.
- Updates "Usage" or "API Reference" sections in
README.md.
How to trigger: "Update README.md based on the latest changes in [directory/file]."
3. Knowledge Base (KB) Sync
For major code changes, this skill generates a concise summary of "why" the change was made and stores it for future retrieval.
- - Uses
scripts/kb_sync.py to interface with a local ChromaDB (if available) or log to .gemini/changelog.jsonl. - Ensures you can later query the project's history via CLI.
How to trigger: "Log this change to the knowledge base" or "Summarize my changes and sync to KB."
Reference Materials
- - Doc Styles: Detailed examples of Google and Go documentation styles.
Usage Guidelines
- - Always review suggested docstring changes before applying.
- For README updates, provide the specific section title if possible.
- Ensure
chromadb is installed if you want vector-based retrieval; otherwise, it defaults to a local JSONL log.
doc-sync
一个用于维护代码、文档和私有知识库之间强一致性的技能。
工作流程
1. 同步文档字符串和注释
当你在 Python 或 Go 中修改函数逻辑或签名时,使用此技能更新相关注释。
- - Python:遵循 Google 风格。更新 Args、Returns 和 Attributes。
- Go:遵循标准 Go Doc 风格。更新导出的函数/结构体注释。
触发方式:更新 [文件路径] 的文档字符串 或 在我修改后同步 [文件路径] 中的注释。
2. README.md 实时更新
当添加新的导出函数、CLI 标志或 API 端点时,此技能确保根目录下的 README.md 更新以反映新的接口。
- - 扫描公共 API 的变更。
- 更新 README.md 中的使用说明或API 参考部分。
触发方式:根据 [目录/文件] 的最新变更更新 README.md。
3. 知识库同步
对于重大代码变更,此技能生成一个关于为什么进行变更的简洁摘要,并存储以供将来检索。
- - 使用 scripts/kb_sync.py 与本地 ChromaDB(如果可用)交互,或记录到 .gemini/changelog.jsonl。
- 确保你以后可以通过 CLI 查询项目历史。
触发方式:将此变更记录到知识库 或 总结我的变更并同步到知识库。
参考资料
- - 文档风格:Google 和 Go 文档风格的详细示例。
使用指南
- - 在应用建议的文档字符串变更前,请务必进行审查。
- 对于 README 更新,如有可能请提供具体的章节标题。
- 如果需要基于向量的检索,请确保已安装 chromadb;否则,默认使用本地 JSONL 日志。