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

dino-break

一個 ASCII 恐龍跑酷遊戲外掛,Claude 處理耗時工作時會在提示列上方的橫條中開啟

TravisBumgarner@TravisBumgarner

TravisBumgarner/claude-mods/tree/main/dino

已翻譯

關於這個 mod

dino

這是一個 ASCII 版的 Chrome 離線恐龍遊戲。Claude 處理耗時較長的工作時,它會在 Claude Code 提示列上方的橫條中執行。外掛名稱是 dino-break。

HI 00412  00087   Claude is working...
      .--.
     (____)
    __
   / o)
__/ /         \|/
  /\           |
_____._______._______._______._______.
Space/Up: jump   P: pause   X: close

載入外掛

Mod 需要 Claude Code v2.1.287 或更新版本(claude --version)。

只用於一個工作階段:

claude --plugin-dir ~/Programming/mods/dino

用於所有工作階段:將資料夾加入 ~/.claude/settings.json 的 env 區塊:

{
  "env": {
    "CLAUDE_CODE_PLUGIN_DIRS": "~/Programming/mods/dino"
  }
}

要載入多個 mod,請用 : 分隔路徑。互動式工作階段會監看資料夾,因此儲存後編輯內容就會重新載入。

執行 /plugin 檢查是否載入:分頁下方的暗色列應該會顯示 dino-break。

玩法

| 按鍵 | 作用 | | --- | --- | | 點擊遊戲 | 將鍵盤焦點交給遊戲(Esc 會把焦點交還給提示列) | | D | 開始,或在 3-2-1 倒數後繼續暫停中的遊戲 | | Space / Up / W | 跳躍 | | P | 暫停並儲存分數 | | X | 儲存並關閉 |

/dino 可手動開啟或關閉遊戲。

自動開啟方式

這個 mod 提供 start_break 工具,並在系統提示中加入一列指示:當工作看起來會花費超過大約 1 分鐘時,先呼叫它。Claude 完成這個工作階段後,遊戲會暫停、儲存這次遊戲,並顯示提示訊息。

這取決於 Claude 對工作時間的猜測,所以不會每次都觸發。/dino 永遠有效。

分數

儲存在 mod 自己位於 ~/.claude 下的儲存空間(不在此儲存庫中):

  • best:最高分
  • scores:最近 50 次執行
  • saved:暫停中的遊戲,下一個工作階段會顯示為「Press D to resume」

檔案

| 檔案 | 內容 | | --- | --- | | .claude-plugin/plugin.json | 資訊清單 | | hooks/hooks.json | 指向 register.tsx | | hooks/register.tsx | start_break 工具、/dino、橫條、儲存分數 | | hooks/game.tsx | 遊戲:按鍵、物理、繪圖(以 Client surface module 執行) | | types/index.d.ts | 狀態契約 | | tests/dino.test.tsx | 開始、暫停、繼續 |

開發

claude plugin validate ~/Programming/mods/dino
claude plugin test ~/Programming/mods/dino

Mod 載入一次後,Claude Code 會把型別寫入 .claude-plugin/types/,並產生 tsconfig.json;tsc -p . 會進行型別檢查。兩者都是產生檔案,並且會被 gitignore。

本文撰寫時,claude plugin test 因為「hooks modules are turned off in this process」而拒絕執行,因此測試已完成型別檢查,但尚未執行。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add TravisBumgarner/claude-mods
claude plugin install dino-break
原文 / README

dino

An ASCII take on Chrome's offline dino game that runs in a band above the Claude Code prompt while Claude works on something long. The plugin is named dino-break.

HI 00412  00087   Claude is working...
      .--.
     (____)
    __
   / o)
__/ /         \|/
  /\           |
_____._______._______._______.
Space/Up: jump   P: pause   X: close

Load it

Mods need Claude Code v2.1.287 or later (claude --version).

For one session:

claude --plugin-dir ~/Programming/mods/dino

For every session, add the folder to the env block of ~/.claude/settings.json:

{
  "env": {
    "CLAUDE_CODE_PLUGIN_DIRS": "~/Programming/mods/dino"
  }
}

To load several mods, separate their paths with :. Interactive sessions watch the folder, so edits reload when you save.

Run /plugin to check it loaded: the dim line under the tabs should name dino-break.

Play

| Key | Does | | --- | --- | | click the game | gives it the keyboard (Esc hands it back to the prompt) | | D | start, or resume a paused run after a 3-2-1 countdown | | Space / Up / W | jump | | P | pause and save the score | | X | save and close |

/dino opens or closes the game by hand.

How it opens on its own

The mod gives Claude a start_break tool and adds a line to the system prompt telling Claude to call it first when a task looks like it'll take more than about a minute. When Claude finishes the turn, the game pauses, saves your run, and shows a toast.

This depends on Claude guessing the task length, so it won't fire every time. /dino always works.

Scores

Saved in the mod's own store under ~/.claude (not in this repo):

  • best: high score
  • scores: last 50 runs
  • saved: the paused run, which comes back as "Press D to resume" in the next session

Files

| File | What | | --- | --- | | .claude-plugin/plugin.json | manifest | | hooks/hooks.json | points at register.tsx | | hooks/register.tsx | start_break tool, /dino, the band, saving scores | | hooks/game.tsx | the game: keys, physics, drawing (runs as a Client surface module) | | types/index.d.ts | state contract | | tests/dino.test.tsx | start, pause, resume |

Develop

claude plugin validate ~/Programming/mods/dino
claude plugin test ~/Programming/mods/dino

After the mod loads once, Claude Code writes its types into .claude-plugin/types/ and a tsconfig.json, and tsc -p . type-checks it. Both are generated and gitignored.

claude plugin test refused to run while this was written ("hooks modules are turned off in this process"), so the test is type-checked but hasn't run yet.

更多類似作品