KilimcininKorOglu/claude-code-mods/tree/main/plugins/mod-doctor
mod-doctor
Claude Code mod,命名已安装的插件,其市场克隆已经提供更新版本,并打印Claude插件更新命令以缩小差距。
关于这个 mod
模组医生
您运行 claude plugin marketplace update,克隆会获取新版本,并且安装的插件将保留在原来的位置,直到您还为每个 one 运行 claude plugin update。第二步很容易被忘记。该模组命名了每个市场的每个已安装插件,其本地克隆已经提供了较新的版本,因此您为市场而不是插件运行的更新不会被忽视。
它的作用
1。在每个会话开始时、每个主循环结束时以及交互式会话中的每个 60 时,mod 都会读取主机在磁盘上保存的内容:
-
~/.claude/plugins/installed_plugins.json(当设置CLAUDE_CONFIG_DIR时改为$CLAUDE_CONFIG_DIR/plugins/,如主机读取),它按范围命名每个<plugin>@<marketplace>的安装版本:用户安装,以及它命名的项目安装。一个项目的另一个项目的安装不读取,与 update available sidebar 0.4.1 → 0.5.0 turkish-native 1.0.0 → 1.2.0 claude plugin update sidebar@kilimcininkoroglu-mods turkish-native@turkish-native Q的强制安装的旧版本进行比较; -
每个市场在其克隆中都有自己的
.claude-plugin/marketplace.json,它表示该插件位于其中的位置(one 市场将其插件保留在plugins/下,另一个是 one 插件在其根目录下); -
该插件的
.claude-plugin/plugin.json,克隆提供的版本。 2。它将安装与每个部件的数量提供的进行比较,因此0.10.0比0.9.0新。它无法比较 Two 版本,因为数字相等,因此另一个形状的版本永远不会要求更新。 3。当侧边栏打开时,后面的插件是在会话中保留的 oneupdate available部分:update available sidebar 0.4.1 → 0.5.0 turkish-native 1.0.0 → 1.2.0 claude plugin update sidebar@kilimcininkoroglu-mods turkish-native@turkish-native
在每一行中,已安装的版本都很微弱,并且提供的版本通过跳跃着色:新的主要版本为红色,新的次要版本为黄色,新的补丁为绿色。第八行之后的行计入 one 微弱行,并且它们下面的微弱更新命令命名前 eight 行的插件。在侧边栏关闭或未安装该 mod 的情况下,one 转录行也有相同的发现。
4。当每个安装的插件都处于其克隆版本时,不会绘制任何内容,并且一旦情况属实,该部分就会被删除。
5。每回合结束时的测量和 60 s one 捕获会话开始时无法捕获的内容:此会话打开时您在另一个窗口中更新的插件或市场,以及当此 mod 首次测量时其自己的插件尚未打开其窗格的侧边栏。 60 的措施也会在该会话空闲时捕获它们。调查结果一次到达笔录;后来对同一发现的测量没有说明什么。
6。 /mod-doctor 再次现场测量并打印设置、范围、拥有多少插件以及落后于哪些插件。 /mod-doctor marketplace <name> 将其缩小到 one 市场,而 marketplace all 将其扩大回来。克隆版本仅与最后一个 claude plugin marketplace update 一样新,因此该 mod 回答“我更新了市场,我更新了插件吗?”,而不是“GitHub 上有更新的版本吗?”。
命令
/mod-doctor the setting, the scope, and every plugin that is behind
/mod-doctor on | off on by default
/mod-doctor marketplace my-mods that marketplace alone
/mod-doctor marketplace all every marketplace the host cloned; the default, stored across sessions
安装
claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install mod-doctor@kilimcininkoroglu-mods
函数钩子是抢先体验的。Claude Code 2.1.288 以及后来默认加载它们,所以没有什么可以打开的。
安装后
1。重新启动Claude Code。 2。为每个插件行安装 侧边栏 mod。如果没有它,mod 会改为写入 one 转录行。
它可以达到什么
在 Claude Code 2.1.284 上使用 claude plugin validate 进行验证:
❯ ./register.ts hooks: session.start, command.run{command=mod-doctor}, turn.complete
❯ ./register.ts calls: $.clock.every, $.command.register, $.env.get, $.fs.read (via readText), $.sidebar.clear (via clearShown), $.sidebar.set (via toPerson), $.store.get (via readScope, readSettings), $.store.set (via setEnabled, setScope), $.ui.log (via toPerson)
❯ ./register.ts env writes: nothing
❯ ./register.ts env reads: CLAUDE_CONFIG_DIR, HOME
到达L1,它读取文件。
1. Reads: CLAUDE_CONFIG_DIR, HOME, the host's install record, each marketplace clone's manifest, and one plugin.json per installed plugin. No project file, no prompt, no transcript.
2. Runs: nothing; the update command is text for the person to run
3. Sends: nothing to the model and nothing to the network; the rows are for the person only
4. Persists: in $.store, the on/off setting and the scope
5. Hostile input: every file is read as data, the versions are compared as numbers, and a file of another shape is skipped without a finding
限制
- 克隆是衡量标准,而不是上游存储库。首先运行
claude plugin marketplace update <marketplace>,否则 mod 不会报告任何新内容。 - 通过提交 sha 版本其插件的市场(官方 one 这样做)没有报告任何内容,因为 two sha 无法与数字进行比较。
- 市场从另一个存储库中提取的插件,因为 git 子目录在克隆中没有版本,因此会被跳过。
- 它没有说明正在运行的会话是否加载了新代码。会话期间的
claude plugin update会保留加载旧代码,直到/reload-plugins或重新启动。 - 没有为您更新任何内容。 mod 命名命令;运行它是你的。
发展
make install # eslint, typescript-eslint, typescript
make lint # complexity limit 10, the build fails above it
make typecheck # needs .claude/types/ from /plugin-types
make validate
make test # claude plugin test
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add KilimcininKorOglu/claude-code-mods claude plugin install mod-doctor
原文 / README
mod-doctor
You run claude plugin marketplace update, the clone gets the new versions, and the installed plugins stay where they were until you also run claude plugin update for each one. That second step is easy to forget. This mod names each installed plugin, of every marketplace, whose local clone already offers a newer version, so an update you ran for the marketplace and not for the plugin does not stay unnoticed.
What it does
-
At each session start, at the end of each main-loop turn, and every 60 s in an interactive session, the mod reads what the host keeps on disk:
~/.claude/plugins/installed_plugins.json($CLAUDE_CONFIG_DIR/plugins/instead whenCLAUDE_CONFIG_DIRis set, as the host reads it), which names the version installed of each<plugin>@<marketplace>per scope: the user install, and a project install for the project it names. A project install of another project is not read, and of two installs in force the older version is compared;- each marketplace's own
.claude-plugin/marketplace.jsonin its clone, which says where that plugin sits inside it (one marketplace keeps its plugins underplugins/, another is one plugin at its root); - that plugin's
.claude-plugin/plugin.json, the version the clone offers.
-
It compares installed against offered by the numbers of each part, so
0.10.0counts as newer than0.9.0. Two versions it cannot compare as numbers count as equal, so a version of another shape never asks for an update. -
While the sidebar is open, the plugins that are behind are one
update availablesection that stays for the session:update available sidebar 0.4.1 → 0.5.0 turkish-native 1.0.0 → 1.2.0 claude plugin update sidebar@kilimcininkoroglu-mods turkish-native@turkish-nativeIn each row the installed version is faint and the offered version is coloured by the jump: a new major version red, a new minor version yellow, a new patch green. The rows past the eighth are counted in one faint line, and the faint update command under them names the plugins of the first eight rows. With the sidebar closed, or without that mod installed, the same finding is one transcript line.
-
Nothing is drawn while every installed plugin is at its clone's version, and the section is taken down as soon as that is true.
-
The measure at each turn's end and the 60 s one catch what the session start cannot: a plugin or a marketplace you updated in another window while this session was open, and a sidebar whose own plugin had not opened its pane yet when this mod first measured. The 60 s measure also catches them while this session is idle. The finding reaches the transcript once; a later measure of the same finding says nothing.
-
/mod-doctormeasures again on the spot and prints the setting, the scope, how many plugins it holds and which are behind./mod-doctor marketplace <name>narrows it to one marketplace, andmarketplace allwidens it back.
The clone is only as new as the last claude plugin marketplace update, so this mod answers "I updated the marketplace, did I update the plugins?", not "is there a newer version on GitHub?".
Command
/mod-doctor the setting, the scope, and every plugin that is behind
/mod-doctor on | off on by default
/mod-doctor marketplace my-mods that marketplace alone
/mod-doctor marketplace all every marketplace the host cloned; the default, stored across sessions
Install
claude plugin marketplace add KilimcininKorOglu/claude-code-mods
claude plugin install mod-doctor@kilimcininkoroglu-mods
Function hooks are early access. Claude Code 2.1.288 and later load them by default, so there is nothing to switch on.
After installing
- Restart Claude Code.
- Install the sidebar mod for the per-plugin rows. Without it the mod writes one transcript line instead.
What it can reach
Validated with claude plugin validate on Claude Code 2.1.284:
❯ ./register.ts hooks: session.start, command.run{command=mod-doctor}, turn.complete
❯ ./register.ts calls: $.clock.every, $.command.register, $.env.get, $.fs.read (via readText), $.sidebar.clear (via clearShown), $.sidebar.set (via toPerson), $.store.get (via readScope, readSettings), $.store.set (via setEnabled, setScope), $.ui.log (via toPerson)
❯ ./register.ts env writes: nothing
❯ ./register.ts env reads: CLAUDE_CONFIG_DIR, HOME
Reach L1, it reads files.
1. Reads: CLAUDE_CONFIG_DIR, HOME, the host's install record, each marketplace clone's manifest, and one plugin.json per installed plugin. No project file, no prompt, no transcript.
2. Runs: nothing; the update command is text for the person to run
3. Sends: nothing to the model and nothing to the network; the rows are for the person only
4. Persists: in $.store, the on/off setting and the scope
5. Hostile input: every file is read as data, the versions are compared as numbers, and a file of another shape is skipped without a finding
Limits
- The clone is the measure, not the upstream repository. Run
claude plugin marketplace update <marketplace>first, or the mod reports nothing new. - A marketplace that versions its plugins by commit sha (the official one does) reports nothing, because two shas are not comparable as numbers.
- A plugin the marketplace pulls from another repository as a git subdirectory has no version in the clone, so it is skipped.
- It does not say whether the running session loaded the new code. A
claude plugin updateduring a session leaves the old code loaded until/reload-pluginsor a restart. - Nothing is updated for you. The mod names the command; running it is yours.
Development
make install # eslint, typescript-eslint, typescript
make lint # complexity limit 10, the build fails above it
make typecheck # needs .claude/types/ from /plugin-types
make validate
make test # claude plugin test
