Skip to content
cccskills
FreePublished on GitHub

doc-sentinel

Document-code change notification system: traceable doc-code binding via git tree hash, git-diff-driven reconciliation plans with confidence/risk metadata, and idempotent execution. Use when maintaining documentation freshness, detecting stale docs, or binding docs to source code.

The English summary is being prepared. Showing the original description.

Run score Not tested

See how to install

Files included (10)

  • SKILL.md4.2 KB
  • agents/openai.yaml190 B
  • references/decision-tree.md2.1 KB
  • references/traceback-spec.md3.1 KB
  • scripts/lib/__init__.py37 B
  • scripts/lib/identity.py9.5 KB
  • scripts/lib/indexer.py6.0 KB
  • scripts/lib/reconciler.py13.5 KB
  • scripts/lib/registry.py8.5 KB
  • scripts/sentinel.py13.4 KB

SKILL.md (original)

Review the instructions the agent will receive before you install.

Doc Sentinel — 文档-代码变更通知系统

核心概念

你负责守护一个仓库的文档健康度。三平面架构:

平面目标核心能力
Identity绑定真值文档 frontmatter 绑定 source paths + git tree hash
Reconciliation变更推理Git diff → ChangeEvent → Policy → ChangePlan (含 confidence/risk)
Capability可选能力索引生成(默认可用),矢量检索(未来独立技能)

核心价值:让 Agent 准确知道「哪些文档可能需要更新」,不承诺自动修复,不假装语义理解。

成功标准:

  • 零漏报:代码变更必须被检测到
  • 低误报:误报率 < 20%
  • 可解释:每个通知附带变更证据和 confidence

工具

# 主入口
uv run <SKILLS_DIR>/doc-sentinel/scripts/sentinel.py <command> [options]

# --- 4 个核心命令 ---

# 1. 只读状态查询(无副作用)
status [--root <path>] [--doc <id>] [--source <path>] [--format json]

# 2. 建立/更新文档-代码绑定
bind <doc.md> [--source <path>...] [--auto-detect] [--root <path>]

# 3. 生成变更计划(不执行)
plan [--since <commit>] [--output plan.json] [--format json] [--root <path>]

# 4. 执行计划(幂等)
apply [--dry-run] [--root <path>]

工作流

Phase 1: 理解仓库

  1. 运行 status 查看文档健康状态
  2. 如无文档追踪,用 bind 为关键文档建立绑定

Phase 2: 绑定文档

为需要追踪的文档注入溯源 frontmatter:

# 显式指定源码路径
sentinel.py bind docs/auth.md --source "src/auth/" "src/middleware/auth.py"

# 自动检测(使用文档所在目录)
sentinel.py bind docs/api/overview.md --auto-detect

Phase 3: 检测变更

代码变更后,生成变更计划:

sentinel.py plan
# 输出:
#   📋 Stable actions (auto-executable):
#     📝 UPDATE → auth/overview
#        Reason: Source modified (42 lines): src/auth/handler.py
#   🔍 Review items (need confirmation):
#     ✨ CREATE → ?
#        Reason: New file in untracked area: src/billing/stripe.py

Phase 4: 执行计划

# 预览
sentinel.py apply --dry-run

# 执行(仅执行 STABLE 级别的操作)
sentinel.py apply

溯源 Frontmatter 规范

每份受管文档头部嵌入:

---
doc_id: "module/feature"
source_paths: ["module/src/"]
source_tree_hash: "a3f2b8c4d5e6"
last_sync_commit: "e7d1c4a..."
sync_timestamp: "2026-03-05T14:00:00+08:00"
doc_version: 3
status: "synced"
---

变更计划 (ChangePlan) 结构

每个 PlanItem 附带 Agent 可消费的元数据:

{
  "action": "update",
  "risk": "stable",
  "doc_id": "auth/overview",
  "reason": "Source modified (42 lines): src/auth/handler.py",
  "confidence": 0.84,
  "details": {
    "modified_source": "src/auth/handler.py",
    "lines_changed": 42
  }
}

动作分类:

分类动作语义
STABLEUPDATE, RENAME, ARCHIVE可自动执行,风险低
REVIEWCREATE需 Agent/人工确认

显著性阈值

修改 (M) 状态使用阈值过滤噪声(默认 5 行)。可通过环境变量调整:

DOC_SENTINEL_THRESHOLD=10 sentinel.py plan

数据目录

<repo_root>/.doc-sentinel/
├── registry.json          # 文档注册表(绑定关系)
├── last_sync_commit       # 上次同步 commit SHA
└── change_log.json        # 操作历史(保留最近 50 条)

参考文档

文档用途何时读取
decision-tree.md变更操作决策树详解处理 plan/apply 时
traceback-spec.md溯源标识详细规范维护 frontmatter 时

输出约定

  • 思考/规划/报告: 中文
  • 代码/命令/文件名: English
  • Frontmatter: YAML (English keys)

Reviews

No reviews yet. Tell others what you thought.

Comments

No login needed. Share how it worked for you, ask a question, or note where it did not run.

No comments yet. Be the first to write one.

Comments are published right away. Do not include personal information such as email addresses or phone numbers. Up to 2 URLs.

0 / 1,000 characters

This form is protected by reCAPTCHA, and the Google Privacy Policy and Terms of Service apply.

More skills from this repository

阿里云 AnalyticDB (ADB) for MySQL 只读数据分析。 多维分析(计数/聚合/时间序列)、交叉验证、Schema 文档生成、多 Profile。

The English summary is being prepared. Showing the original description.

northseadl/norix-skills6Updated Apr 10, 2026

Multi-agent brainstorming: async opinion collision with expert personas. Mixed Codex/Claude Code engine. Use when multiple AI agents need to collaboratively discuss, debate, and converge on solutions through structured dialog. Triggers: brainstorm, multi-perspective discussion, opinion collision, expert debate, war room, collective intelligence, 头脑风暴, 多视角讨论, 集思广益.

The English summary is being prepared. Showing the original description.

northseadl/norix-skills6Updated Apr 10, 2026

Frontend design blueprints with craftsmanship scoring, self-critique loops, and engineering handoff. Aesthetic intelligence against AI homogeneity. Use for: UI/UX design specs, design system creation, visual direction exploration, component design review, design-to-engineering handoff.

The English summary is being prepared. Showing the original description.

northseadl/norix-skills6Updated Apr 10, 2026

Multi-agent SWE team built on the Workshop model. Full-stack vertical workers, meeting room with @mention notification, private pipes, shared task board. Git worktree isolation, Leader-driven coordination. Mixed Codex/Claude Code engine. Use when a task needs engineering depth beyond a single agent. NOT for simple task parallelism (use agent-task-orchestration) or design discussions (use agent-brainstorm).

The English summary is being prepared. Showing the original description.

northseadl/norix-skills6Updated Apr 10, 2026

Task decomposition and multi-agent orchestration with retry, checkpoint recovery, and real-time monitoring. Mixed Codex/Claude Code engine. Parallel/sequential execution.

The English summary is being prepared. Showing the original description.

northseadl/norix-skills6Updated Apr 10, 2026

针对 cnb.cool 的云原生构建(CNB Build):生成/修改 .cnb.yml 流水线、触发规则、 构建环境、runner 资源、缓存、环境变量、手动触发与调试。 在接入、迁移、优化或排查 CNB 构建配置时使用。

The English summary is being prepared. Showing the original description.

northseadl/norix-skills6Updated Apr 10, 2026

See all skills by northseadl

Report a problem with this skill