qrspi-pane
A pane showing each QRSPI task in thoughts/: which phase it is in, what blocks it, and the /qrspi:next command to run
何をするか
- 欄を描く
- /qrspi-status を足す
- session.start・turn.completeにフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- プロセスを起こさない
- 小さい(232 行)
- TypeScript で書かれている
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like qrspi-pane by Allan Nava (pane), as modscode read it from the mod's code:
// https://modscode.com/gallery/allan-nava-qrspi-pane/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
// the pane: open it with $.ui.open({ id: 'my-pane', title: "QRSPI" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text } = $.ui.resolve(e)
const root = '…'
const dir = '…'
const letter = '…'
const letter2 = '…'
const letter3 = '…'
const done = '…'
const total = '…'
const name = '…'
const name2 = '…'
const label = '…'
const label2 = '…'
const label3 = '…'
const length = '…'
const dir2 = '…'
const letter4 = '…'
const letter5 = '…'
const letter6 = '…'
const name3 = '…'
const name4 = '…'
const label4 = '…'
const label5 = '…'
const label6 = '…'
const length2 = '…'
const done2 = '…'
const total2 = '…'
const dir3 = '…'
const letter7 = '…'
const letter8 = '…'
const letter9 = '…'
const name5 = '…'
const name6 = '…'
const label7 = '…'
const label8 = '…'
const label9 = '…'
const length3 = '…'
const done3 = '…'
const total3 = '…'
const toISOString = '…'
return (
<Box flexDirection="column">
<Text dimColor>
{root}
</Text>
<Text dimColor>
thoughts/ holds no QRSPI task yet.
</Text>
<Box flexDirection="column" marginBottom={1}>
<Text bold>
{dir}
</Text>
<Text>
<Text color="green">
{letter}
{" "}
</Text>
<Text color="green">
{letter2}
{" "}
</Text>
<Text color="green">
{letter3}
{" "}
</Text>
<Text color="green">
{"I "}
{`${done}/${total}`}
</Text>
</Text>
<Text dimColor>
{name}
: not started
</Text>
<Box flexDirection="column">
<Text>
{name2}
{" waits on:"}
</Text>
<Text dimColor>
{" "}
{label}
</Text>
<Text dimColor>
{" "}
{label2}
</Text>
<Text dimColor>
{" "}
{label3}
</Text>
<Text dimColor>
{" and "}
{length}
{" more"}
</Text>
</Box>
<Text dimColor>
{"Implement: "}
{done}
{" of "}
{total}
{" steps done"}
</Text>
<Text color="green">
every step done
</Text>
</Box>
<Box flexDirection="column" marginBottom={1}>
<Text bold>
{dir2}
</Text>
<Text>
<Text color="green">
{letter4}
{" "}
</Text>
<Text color="green">
{letter5}
{" "}
</Text>
<Text color="green">
{letter6}
{" "}
</Text>
<Text color="green">
{"I "}
{`${done}/${total}`}
</Text>
</Text>
<Text dimColor>
{name3}
: not started
</Text>
<Box flexDirection="column">
<Text>
{name4}
{" waits on:"}
</Text>
<Text dimColor>
{" "}
{label4}
</Text>
<Text dimColor>
{" "}
{label5}
</Text>
<Text dimColor>
{" "}
{label6}
</Text>
<Text dimColor>
{" and "}
{length2}
{" more"}
</Text>
</Box>
<Text dimColor>
{"Implement: "}
{done2}
{" of "}
{total2}
{" steps done"}
</Text>
<Text color="green">
every step done
</Text>
</Box>
<Box flexDirection="column" marginBottom={1}>
<Text bold>
{dir3}
</Text>
<Text>
<Text color="green">
{letter7}
{" "}
</Text>
<Text color="green">
{letter8}
{" "}
</Text>
<Text color="green">
{letter9}
{" "}
</Text>
<Text color="green">
{"I "}
{`${done}/${total}`}
</Text>
</Text>
<Text dimColor>
{name5}
: not started
</Text>
<Box flexDirection="column">
<Text>
{name6}
{" waits on:"}
</Text>
<Text dimColor>
{" "}
{label7}
</Text>
<Text dimColor>
{" "}
{label8}
</Text>
<Text dimColor>
{" "}
{label9}
</Text>
<Text dimColor>
{" and "}
{length3}
{" more"}
</Text>
</Box>
<Text dimColor>
{"Implement: "}
{done3}
{" of "}
{total3}
{" steps done"}
</Text>
<Text color="green">
every step done
</Text>
</Box>
<Text dimColor>
{"read "}
{toISOString}
{" UTC · refreshes every 10 s and after each turn"}
</Text>
</Box>
)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
plugins/qrspi-pane/hooks/register.tsx 142〜203 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text } = $.ui.resolve(e)
const { value: snap = EMPTY } = await $.state.get(SNAPSHOT)
const width = Math.max(24, (e.props?.bodyColumns ?? 60) - 2)
if (!snap.hasThoughts) {
return (
<Box flexDirection="column">
<Text dimColor>No thoughts/ directory in {short(snap.root, width)}.</Text>
<Text dimColor>Start a task with /qrspi:new <TASK-ID> <ticket>.</Text>
</Box>
)
}
return (
<Box flexDirection="column">
<Text dimColor>{short(snap.root, width)}</Text>
{snap.tasks.length === 0 && <Text dimColor>thoughts/ holds no QRSPI task yet.</Text>}
{snap.tasks.map(task => {
const current = task.phases.find(p => p.state !== 'done')
const implementing = current === undefined
const finished = implementing && task.steps.total > 0 && task.steps.done === task.steps.total
return (
<Box flexDirection="column" marginBottom={1}>
<Text bold>{short(task.dir, width)}</Text>
<Text>
{task.phases.map(p => (
<Text
color={p.state === 'done' ? 'green' : p === current ? 'yellow' : undefined}
dimColor={p.state !== 'done' && p !== current}
bold={p === current}
>
{p.letter}{' '}
</Text>
))}
<Text color={finished ? 'green' : implementing ? 'yellow' : undefined} dimColor={!implementing} bold={implementing && !finished}>
I {task.steps.total > 0 ? `${task.steps.done}/${task.steps.total}` : ''}
</Text>
</Text>
{current && current.state === 'absent' && <Text dimColor>{current.name}: not started</Text>}
{current && current.state === 'open' && (
<Box flexDirection="column">
<Text>{current.name} waits on:</Text>
{current.open.slice(0, 3).map(label => (
<Text dimColor> {short(label, width - 2)}</Text>
))}
{current.open.length > 3 && <Text dimColor> and {current.open.length - 3} more</Text>}
</Box>
)}
{implementing && !finished && <Text dimColor>Implement: {task.steps.done} of {task.steps.total} steps done</Text>}
{finished ? (
<Text color="green">every step done</Text>
) : (
<Text dimColor>{short(`/qrspi:next thoughts/${task.dir}`, width)}</Text>
)}
</Box>
)
})}
<Text dimColor>read {snap.readAt ? new Date(snap.readAt).toISOString().slice(11, 19) : '—'} UTC · refreshes every 10 s and after each turn</Text>
</Box>
)
})ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Allan Nava Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
コードが呼ぶもの
ファイル読み取り保存
コードから読み取ったデザイン
読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。
コードから読めること
2026-10-06 に読んだコミット 7f4a9d42a6aa のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。plugins/qrspi-pane/hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。1 ファイルを解析 |
| コードが Mod の中で完結 | import は Mod 自身のファイルかエンジンのモジュールだけ。パッケージも require もない。コードはすべて Mod の中 |
| 読める | 圧縮した行・eval・new Function・計算した道の import()・符号化した塊がない。圧縮・eval・符号化した塊なし |
| 呼び出しが見える | 通信とプログラム起動はその場で $.http.fetch・$.process.run と書き、他へ渡さない。外への呼び出しはすべてその場の $ で |
| 入れる前に自分で判断する材料 | |
| 描く場所 | コードから読んだ、描く先。ターミナル・デスクトップアプリ・両方・何も描かない(フックだけ: 見張りやプロンプトの書き換え)のどれか。出すだけで、外す理由にはしない。ターミナルとデスクトップアプリに同じように描く |
| 入れる手順 | リポジトリ自身の .claude-plugin/marketplace.json にこの Mod が載っていて、ページに書いた手順でそのマーケットプレイスから入れられるか。リポジトリの .claude-plugin/marketplace.json に載っており、そこから入れられる |
| Windows のプログラム | $.process で起動するプログラムが Windows にあるか(tail・date・open・osascript・/usr/… などは無い)。Windows にないプログラムを使わない |
| 通信 | fetch の送り先(https のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。プログラムを起動しない |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。通信しない |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add Allan-Nava/qrspi/plugin install qrspi-pane@allan-nava入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(7f4a9d42a6aa)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「allan-nava-qrspi-pane」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…Blast RadiusBlast Radius: npm testWould Cancel. Proceed Proceed ProceedProceed 1Cancel 2
-
Claude に頼む…Replay TheaterReplay Theater 31 31 31src/app.ts (step 01 of 3)● Write● Write● WritePrev pNext nClose q
-
何をするか
- 欄を描く
- session.end・session.start・ui.closeにフックする
- プロセスを起こす
-
Claude に頼む…Fix login▸★ build ok▸★ build ok▸★ build ok+3 moretasks 3 pending · Glob claimed · 3 doneConsensus42%
-
Claude に頼む…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava
-
何をするか
- プロンプトの上の帯を描く
- /seo-spend・/seo-doctor・/seo-cockpit を足す
- Agent の呼び出しを見張る(止めることがある)
- agent.spawn・classic.SessionStart・prompt.submit・session.compact ほか 3 個にフックする