8.7k superdesigndev

tools-registry-context Skill

tools-registry 上下文 + 文档维护。用于给新会话热身(了解架构和近期提交),或在处理 tools-registry 时使用——改代码、规则、内容、数据或流程(proxy · 认证/密钥 · API · CLI · registry skill)——会从 docs/context 加载相关片段,让你在准确、有出处的上下文中行动。可接受可选的焦点查询(如 `/tools-registry-context <领域>`)。也运行 `/tools-registry-context sync` 在改动后更新文档片段(展示 → 批准 → 应用)。快要推送 main 分支时务必提到它。

安装方式:把技能目录放入 ~/.claude/skills/(Claude Code)或在 claude.ai 设置中启用;也可复制右侧安装命令一键添加。

查看源码

技能指令原文(SKILL.md)

tools-registry-context — load the right design fragment, keep docs honest

tools-registry's design docs are fragments under docs/context/ (one per subsystem), each declaring the
source files it covers in frontmatter. MAP.md (next to this file) is the generated reverse
index: source file → the fragment that documents it. This skill has two modes.

Mode A — LOAD context (default). Adapt to when you're called:

Cold start (a fresh session, little/no prior context) → warm up. Read
docs/context/README.md (the index), then the fragments that matter
(the foundation-style overview fragments plus whichever subsystems the query or repo state points at).
Run git log --oneline -15 and git status to catch recent commits + uncommitted work. Then give a
short orientation — what tools-registry is, the subsystems in play, what changed recently — and say you're ready.

Mid-chat (a task/topic is already in play) → stay targeted. Map the artifacts/topic at hand via
MAP.md's "Source file → fragment(s)" table, read just those fragment(s), and proceed.
Don't re-warm the whole tree.

A focus query (/tools-registry-context ) always wins — use it to pick the fragment(s) and
focus the warm-up on that area, in either case.

Always: read the data model / behavior / RCAs / symbol anchors before changing anything; load only
what's relevant (never dump the whole tree); if an artifact you touch has no fragment, note it as a
gap for Mode B.

Mode B — SYNC docs (/tools-registry-context sync, or before a push)

Before a push to the main branch, remind the user to run this; proceed only on their yes. Then
follow MAINTAINING.md — the short version:

  1. Detect drift: bash .Codex/skills/tools-registry-context/scripts/drift.sh (defaults to

origin/main..HEAD). It prints, per changed source, which fragment(s) document it — plus gaps.

  1. Draft updates: for each affected fragment, read it + the diff; update prose to match changed

behavior and verify cited symbols still exist (no line-number chasing — symbols don't drift).
New subsystem with no fragment → draft a new fragment from fragment.md.tmpl.

  1. Show, then apply: present proposed changes and get approval before writing.
  2. Regenerate: python3 .Codex/skills/tools-registry-context/scripts/build-map.py (rewrites README + MAP).
  3. Commit together: doc updates ride with the code in the same commit/push.

Invariants

  • Docs are the source of truth; this skill is a lens. Fragments live in docs/context/; never

duplicate them into the skill. The skill holds only the generated MAP.md + scripts + config.

  • Frontmatter drives everything. A fragment's sources: feeds the index, the MAP, and drift. When a

fragment starts covering a new file, add it to sources: and rerun build-map.py.

  • Cite stable symbols, not line numbers. Anchor every claim to a grep-able symbol; bare line

numbers drift on every edit and slow sync. Describe what shipped, not intent.

  • No automation behind the user's back. Sync is reminder → approve → apply. There is no git hook.
  • Handoffs and plans are NOT documentation. They live outside docs/context/ (e.g. .context/) and

are out of scope — never read, fold in, or scan them as fragment input.

配合站内内容