一键导入
doc-sync
每晚审阅当天提交的代码 diff,检测 docs/ 知识库的漂移(liveness 漂移、过程词、与代码矛盾),低风险事实更新直接落盘到分支、其余实质漂移产出报告并开 PR 交人审。仅当用户要求运行 doc-sync 或配置每日文档同步时触发,不要在常规对话中自动调用。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
每晚审阅当天提交的代码 diff,检测 docs/ 知识库的漂移(liveness 漂移、过程词、与代码矛盾),低风险事实更新直接落盘到分支、其余实质漂移产出报告并开 PR 交人审。仅当用户要求运行 doc-sync 或配置每日文档同步时触发,不要在常规对话中自动调用。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Triage and resolve a codans crash reported to Sentry. Pull the symbolicated stack from the Sentry API, map the in-app frame to source, fix the root cause, and drive the issue's status (resolve / resolve-in-next-release / archive) with an audit trail. Use when the user references a Sentry crash, a SIGABRT / EXC_BAD_ACCESS / SIGSEGV / NSException report, a dashboard issue id like APPLE-MACOS-4, release health, or asks to triage / fix / resolve crashes.
Drive the codans Mac app from a terminal with the `codans` CLI — inspect the Project / Worktree / Tab / Pane hierarchy, create and switch worktrees, spawn tabs and panes, send keystrokes or text to a pane, read back its rendered output, broadcast input across panes, and check app health. Use this skill whenever the user is operating inside a codans Pane, references the `codans` command, asks how to script codans, or wants to coordinate panes / worktrees / agents from the shell. Prefer `codans tree` to discover state before issuing any other command.
Cut a codans stable release. Bump MARKETING_VERSION in Project.xcconfig, promote CHANGELOG [Unreleased] to a dated version section, commit, tag vX.Y.Z, and push to trigger the GitHub Actions Developer-ID release pipeline. Use when shipping a new stable build.
| name | doc-sync |
| description | 每晚审阅当天提交的代码 diff,检测 docs/ 知识库的漂移(liveness 漂移、过程词、与代码矛盾),低风险事实更新直接落盘到分支、其余实质漂移产出报告并开 PR 交人审。仅当用户要求运行 doc-sync 或配置每日文档同步时触发,不要在常规对话中自动调用。 |
夜间文档同步引擎:把 docs/README.md 的两条约定(现状优先 + liveness 状态字段)机械化为可执行的每日检测,杜绝知识库随代码漂移。
docs/ 是精选的 Library,不是 logbook——只承载持久的 invariants、边界、以及代码无法表达的为什么。实现进度与「我们建了什么」属于代码、git history 与 CHANGELOG。git log --since=... 取出当日提交、用 git diff 取出改动内容。不做全仓扫描,不审阅未被当天改动触及的文档。docs/ 知识库;不碰 docs/generated/(自动产物)与任何运行时状态。对每一篇被当天 diff 波及的文档,逐条跑以下三类检测。
对文档里引用的每一个 feature / 符号 / 文件路径,核验它是否仍存在且可达——不是被隐藏、未接线、或仅是 stub。判据:「符号在 ≠ 功能活」。一个 command-id 或空壳 stub 不构成 feature。
| 当天 diff 的事实 | 文档现状 | 建议动作 |
|---|---|---|
| feature/符号被移除 | 文档仍把它当现状描述 | 建议删档(git history 保留;已移除的 feature 不该有文档) |
| feature 仍存在但被刻意隐藏/未接线 | 文档标为 已上线(可见) | 建议改标 已实现但隐藏,并在正文点明 |
| 仅有设计/command-id/stub,无可用实现 | 文档当作已上线 | 建议改标 已设计未实现,并在正文点明 |
状态字段取值(与 docs/README.md 一致):已上线(可见) / 已实现但隐藏 / 已设计未实现。
扫描描述性正文里的过程叙事词:从前 / 曾经 / 取代了 / 降到 N 级 / v1→v2 / superseded / used to。文档要写现状而非到达现状的路径。
## 技术决策 / Decisions 段落作为一条决策记录。当天 diff 修改了文档所述的行为 / 契约 / 默认值 / 接口形状——文档与代码直接矛盾。逐处定位文档中的失真句,给出代码侧的今日真相。
.harness-runtime/、docs/generated/)。docs/README.md 的两条约定:现状优先(present-tense、无叙事)+ 每篇文档声明 liveness 状态字段。本地 nightly cron / launchd → headless claude -p(能完整访问本地代码与本地 MCP),优先于云端 routine——漂移检测需要读真实工作区与本地工具。
以下为用户需手动安装的一次性配置(skill 自身不安装调度器)。
crontab(每晚 02:30 跑一次本 skill):
30 2 * * * cd /Users/wanggang/.codans/repos/codans && /usr/bin/env claude -p "Run the doc-sync skill: review today's commits, detect docs drift, apply safe facts on a branch and PR the rest." >> ~/.codans/logs/doc-sync.log 2>&1
launchd(~/Library/LaunchAgents/dev.codans.doc-sync.plist,加载后每晚 02:30 触发):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>dev.codans.doc-sync</string>
<key>ProgramArguments</key>
<array>
<string>/bin/zsh</string>
<string>-lc</string>
<string>cd /Users/wanggang/.codans/repos/codans && claude -p "Run the doc-sync skill: review today's commits, detect docs drift, apply safe facts on a branch and PR the rest."</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key><integer>2</integer>
<key>Minute</key><integer>30</integer>
</dict>
<key>StandardOutPath</key>
<string>/Users/wanggang/.codans/logs/doc-sync.log</string>
<key>StandardErrorPath</key>
<string>/Users/wanggang/.codans/logs/doc-sync.err.log</string>
</dict>
</plist>
安装:launchctl load ~/Library/LaunchAgents/dev.codans.doc-sync.plist(卸载用 launchctl unload)。
执行时严格按序:
git log --since=midnight --oneline 列出当日提交;git diff --stat <first-commit>^..HEAD 取文件清单与摘要,必要时 git diff <first-commit>^..HEAD -- <path> 看具体改动。无当日提交则直接跳到第 6 步。docs/ 下对应被描述的文档(一个改动的 feature 对应它的 design-doc / product-spec)。只纳入被波及的文档。docs/doc-sync-<date>)。gh pr create 开 PR 交人审。PR / commit 时的 drift hint(在 authoring 时就提示漂移),作为夜间批处理的前置补漏——非本 skill 必需,可单独以 git hook 实现。