ClaudeMods
☰
ZH-TW
● 0 人在線上 · 瀏覽 0 次
贊助提交作品
GitHub 儲存庫 · 發布者 KilimcininKorOglu

mod-doctor

Claude Code mod,命名已安裝的外掛,其市場克隆已經提供更新版本,並列印Claude外掛更新命令以縮小差距。

KilimcininKorOglu@KilimcininKorOglu

KilimcininKorOglu/claude-code-mods/tree/main/plugins/mod-doctor

已翻譯

關於這個 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。當側邊欄開啟時,後面的外掛是在會話中保留的 one update 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

  1. 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 when CLAUDE_CONFIG_DIR is 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.json in its clone, which says where that plugin sits inside it (one marketplace keeps its plugins under plugins/, another is one plugin at its root);
    • that plugin's .claude-plugin/plugin.json, the version the clone offers.
  2. It compares installed against offered by the numbers of each part, so 0.10.0 counts as newer than 0.9.0. Two versions it cannot compare as numbers count as equal, so a version of another shape never asks for an update.

  3. While the sidebar is open, the plugins that are behind are one update available section 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-native
    

    In 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.

  4. 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.

  5. 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.

  6. /mod-doctor measures 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, and marketplace all widens 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

  1. Restart Claude Code.
  2. 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 update during a session leaves the old code loaded until /reload-plugins or 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

更多類似作品