second-brain-doctor

second-brain-doctor is a skill for Codex from YusenZhang0601/context-canopy. It costs 117 tokens per session (2,356 once invoked), scanned A, original, MIT.

A read-only health check for an agent’s connection to a local Second Brain. It checks the authoritative files, installed skills, supporting service, access rules, version drift, and behavior in a new session.

In plain words
What is it for?
Use it after attaching or synchronizing an agent, or when checking whether its rules, identity, skills, and connections are up to date.
Why use it?
It shows whether the setup is genuinely working or has become inconsistent, without changing anything automatically.

Skill for Codex

Written for Codex: agents/openai.yaml present. Also seen: mentions CLAUDE.md; mentions AGENTS.md; mentions Codex.

Good fit Use it after attaching or synchronizing an agent, or when checking whether its rules, identity, skills, and connections are up to date.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yusenzhang0601/context-canopy/second-brain-doctor
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add YusenZhang0601/context-canopy --skill second-brain-doctor
Clone the repo
git clone --depth 1 https://github.com/YusenZhang0601/context-canopy

Made for: Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for second-brain-doctor

README.md
[![agentmods](https://agentmods.dev/badge/skills/yusenzhang0601/context-canopy/second-brain-doctor/github.svg)](https://agentmods.dev/skills/yusenzhang0601/context-canopy/second-brain-doctor)
Your own site
<a href="https://agentmods.dev/skills/yusenzhang0601/context-canopy/second-brain-doctor"><img src="https://agentmods.dev/badge/skills/yusenzhang0601/context-canopy/second-brain-doctor/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for second-brain-doctor

Your own site · 80×15
<a href="https://agentmods.dev/skills/yusenzhang0601/context-canopy/second-brain-doctor"><img src="https://agentmods.dev/badge/skills/yusenzhang0601/context-canopy/second-brain-doctor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 117 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,356 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00117 $0.02356
Opus 5 $0.00059 $0.01178
Sonnet 5 $0.00023 $0.00471
Haiku 4.5 $0.00012 $0.00236

Measured 10d ago against content hash a4a0d361eb17, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

second-brain-doctor scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/second-brain-doctor/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Second Brain - Doctor(检查接入、注入和同步状态)

用真实证据判断当前 Agent 是否接到了同一个“我”。默认只读:不要自动修复、写 LOG、重建派生文件、修改宿主配置、提交 Git 或更新 receipt。发现 drift 后把修复路由给 second-brain-attachsecond-brain-sync

显式调用

  • Codex:$second-brain-doctor,或从 /skills 选择。不要把字面量 /second-brain-doctor 报告为 Codex 原生命令。
  • Claude、Hermes、AntiGravity:/second-brain-doctor

状态词

每项只使用:

  • PASS:用当前命令或内容证据证明符合 contract。
  • DRIFT:authority 可读,但投影、版本或哈希不一致。
  • BLOCKED:已知阻点使检查或能力不可用。
  • UNKNOWN:没有足够证据,不猜测。
  • NOT-APPLICABLE:当前宿主确实不使用该表面。

不要把“文件存在”提升为 PASS,也不要用旧 receipt 代替实时检查。

检查顺序

1. 识别现场

记录当前设备、宿主、版本、会话是否为 fresh session、Vault 路径和 MCP 路径。优先使用宿主官方版本/配置查询;不要输出可能含 token 的完整进程命令行或配置文件。

2. Vault authority

检查:

  • AGENTS.md90-System/SCHEMA.mdONTOLOGY.mdWORKFLOWS.mdINDEX.md 可读。
  • 90-System/.capture.lock 是否存在;存在只报告,不删除。
  • 90-System/Personal-AI/COMMON-RULES.md 可读且是唯一通用 owner。
  • 当前 90-System/Personal-AI/AGENTS/<agent-id>.md 可读且保持独立角色。
  • 03-Personal/Profile/个人AI协作体系.md 与山脉 owner 可按权限最小读取。
  • 实时 compiler、lint 和图谱检查结果。只读 Doctor 使用 --check,不使用 --write-derived

3. 七个 Skills

以 Vault 90-System/Personal-AI/SKILLS/ 为 authority,验证七个精确 ID:

  • second-brain-attach
  • second-brain-sync
  • second-brain-learn
  • second-brain-distill
  • second-brain-climb
  • second-brain-doctor
  • second-brain-help

逐个检查 frontmatter、宿主发现状态和 authority SHA。符号链接应解析到 owner;物理副本应与记录哈希一致。少一个就不是完整接入。检查宿主显示名带 Second Brain - 和中文注释。

4. 薄 MCP

调用 MCP 初始化与工具列表,再安全调用读取工具。预期能力包括:

  • get_common_rules
  • get_agent_profile
  • get_mountain_context
  • list_second_brain_skills
  • read_second_brain_skill
  • 既有知识搜索、捕捉和条目读取能力

验证 MCP 版本、Vault root、allowlist 越界拒绝、读取内容与 authority SHA。MCP 不应成为语义裁决器,不应调用外部推理 API、持有独立数据库或启动守护进程。只握手成功但无法读取 owner 应标为 DRIFTBLOCKED

5. 活动规则质量

把 COMMON、当前 Agent profile、受影响 Skill 和项目实际注入入口作为一个活动规则集审计:

  • 每项行为是否只有一个正确 owner;common、profile、Skill 与项目文件之间的同义正文应标为 DRIFT,必要的短投影不算第二 owner。
  • 是否仍有被较强证据纠错、缩限、替代、迁移或退役的旧规则留在活动注入链;历史只应由 Git、LOG、receipt 或不可变来源承担。
  • 是否存在只增不减的日期流水、tombstone、失效兼容正文或可无损合并的重复规则。长度只触发语义审查,不单独决定状态;除非有可验证宿主限制,不使用任意行数或字节上限判定健康。
  • 最近一次 Learn/Sync 是否记录了转换类型、旧/新预期行为、同步目标,以及正向新行为和负向旧行为退出证据。
  • 项目级规则是否进入该项目真正自动加载的 AGENTS.mdCLAUDE.mdGEMINI.md 或既有受管投影;只写 canonical、MCP 可读或自然语言指针不能证明项目行为已注入。

Read the full file on GitHub · 150 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 150 lines · 117 tokens per session scan A a4a0d361eb17

Subscribe to this mod's changes

second-brain-doctor is a skill published in the GitHub repository YusenZhang0601/context-canopy (2 stars, last pushed 18d ago), licensed MIT. It adds 117 tokens to every session and 2,356 once invoked, about $0.0006 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories