modscode EN

modscode / 図鑑 / board-pane

board-pane

/board opens a pane with the kit's board output and a Refresh button

確かめやすいコードターミナル+デスクトップペインバンドBoxButtonInputText

何をするか

  • 欄・プロンプトの上の帯を描く
  • /board を足す
  • session.start・turn.completeにフックする
  • プロセスを起こす

良いところ

  • ネットワークに出ない
  • TypeScript で書かれている
  • エラーを扱う
  • ファイルを書かない

作り始めるためのコード

2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。

雛形(register.tsx)

register.tsx
import type { Register } from 'claude-code'

// Drawn like board-pane by dwarvesf (pane, band), as modscode read it from the mod's code:
// https://modscode.com/gallery/dwarvesf-board-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: "Board" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Button, Text, Input } = $.ui.resolve(e)
    const repos = '…'
    const active = '…'
    const queued = '…'
    const filter = '…'
    const line = '…'
    const line2 = '…'
    const line3 = '…'
    const nextLabel = '…'
    const index = '…'
    const rail = '…'
    const repoLabel = '…'
    const repoNo = '…'
    const rail2 = '…'
    const rail3 = '…'
    const idle = '…'
    const stamp = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row">
          <Button label={`‹ back`} hotkey="b" />
          <Button label="Refresh" hotkey="r" />
          <Button label="Close" hotkey="q" role="dismiss" />
        </Box>
        <Box flexDirection="row">
          <Text bold>
            {`Board · ${repos} repos · ${active} in flight · ${queued} queued`}
          </Text>
        </Box>
        <Input placeholder="filter repos, IDs, titles" value={`${filter}`} />
        <Box flexDirection="column">
          <Text dimColor>
            no registry: set BOARD_REGISTRY for the cross-repo view
          </Text>
          <Text dimColor wrap="truncate-end">
            {line}
          </Text>
          <Text dimColor wrap="truncate-end">
            {line2}
          </Text>
          <Text dimColor wrap="truncate-end">
            {line3}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Text dimColor>
            NEXT
          </Text>
          <Button plain label={`${nextLabel}`} hotkey={`${index}`} />
          <Button plain label={`${nextLabel}`} hotkey={`${index}`} />
          <Button plain label={`${nextLabel}`} hotkey={`${index}`} />
        </Box>
        <Box flexDirection="column">
          <Text dimColor>
            {rail}
          </Text>
          <Button plain label={`${repoLabel}`} hotkey={`${repoNo}`} />
          <Button plain label={`${repoLabel}`} hotkey={`${repoNo}`} />
          <Button plain label={`${repoLabel}`} hotkey={`${repoNo}`} />
        </Box>
        <Box flexDirection="column">
          <Text dimColor>
            {rail2}
          </Text>
          <Button plain label={`${repoLabel}`} hotkey={`${repoNo}`} />
          <Button plain label={`${repoLabel}`} hotkey={`${repoNo}`} />
          <Button plain label={`${repoLabel}`} hotkey={`${repoNo}`} />
        </Box>
        <Box flexDirection="column">
          <Text dimColor>
            {rail3}
          </Text>
          <Button plain label={`${repoLabel}`} hotkey={`${repoNo}`} />
          <Button plain label={`${repoLabel}`} hotkey={`${repoNo}`} />
          <Button plain label={`${repoLabel}`} hotkey={`${repoNo}`} />
        </Box>
        <Box flexDirection="row">
          <Text dimColor wrap="truncate-end">
            {`idle  ${idle}`}
          </Text>
        </Box>
        <Text dimColor>
          {`press a repo to open it · Esc back${stamp}`}
        </Text>
      </Box>
    )
  })

  // the band above the prompt; what else goes there is drawn under it
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const { Box, Text } = $.ui.resolve(e)
    return (
      <Box flexDirection="column">
        <Box flexDirection="row">
          <Text dimColor>
            {" · "}
          </Text>
          <Text dimColor>
            {" · "}
          </Text>
          <Text dimColor>
            {" · "}
          </Text>
        </Box>
        {await next(e)}
      </Box>
    )
  })
}

Mod 自身のコード

Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。

integrations/claude-code/board-pane/hooks/register.tsx 256〜395 行 · ペイン
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const ui = $.ui.resolve(e)
    const { Box, Text, Button } = ui
    // Not every surface draws an Input; where it is missing the filter is skipped.
    const Input = 'Input' in ui ? ui.Input : undefined
    const board = await read($, state)
    const { repos, filter, isExpanded, isFallback, errorLines, refreshedAt, next } = board
    const isWide = e.props.bodyColumns >= WIDE_COLUMNS
    // The hotkey label and a tone bullet take about 6 cells; the rest is the row.
    const room = Math.max(12, e.props.bodyColumns - 6)
    const open = repos.find(repo => repo.name === board.repo)
    const back = () => update($, state, prev => ({ ...prev, repo: undefined, filter: '', isExpanded: false }))
    const setFilter = (value: string) => update($, state, prev => ({ ...prev, filter: value }))

    const controls = (
      <Box flexDirection="row">
        {open && !isFallback && <Button key="back" label="‹ back" hotkey="b" onPress={back} />}
        <Button key="refresh" label="Refresh" hotkey="r" onPress={() => refresh($)} />
        <Button key="close" label="Close" hotkey="q" role="dismiss" onPress={() => $.ui.close({ id: PANE })} />
      </Box>
    )
    const filterInput = Input && (
      <Input key="filter" placeholder="filter repos, IDs, titles" value={filter} onInput={setFilter} onSubmit={setFilter} />
    )
    const notes = (
      <Box flexDirection="column">
        {isFallback && <Text dimColor>no registry: set BOARD_REGISTRY for the cross-repo view</Text>}
        {errorLines.map(line => (
          <Text dimColor wrap="truncate-end">
            {line}
          </Text>
        ))}
      </Box>
    )
    const stamp = refreshedAt ? ` · ${refreshedAt}` : ''

    if (open) {
      const flying = filterItems(inFlightItems(open), filter)
      const queued = filterItems(queuedItems(open), filter)
      const shown = isExpanded ? queued : queued.slice(0, QUEUED_SHOWN)
      let itemNo = 0
      const row = (item: BoardRepo['items'][number]) => {
        itemNo += 1
        const tone = itemTone(item.state)
        // Button has no color prop, so the state tone rides on a bullet beside it.
        // A press fills the prompt instead of submitting: a stray key must never start a turn.
        return (
          <Box flexDirection="row">
            {tone && <Text color={tone}>* </Text>}
            <Button
              key={`item-${itemNo}`}
              plain
              label={itemLabel(item, room, isWide)}
              hotkey={itemNo <= 9 ? String(itemNo) : undefined}
              onPress={() => $.prompt.fill({ text: promptFor(item, open) })}
            />
          </Box>
        )
      }
      return (
        <Box flexDirection="column">
          {controls}
          <Box key="repo-title" flexDirection="row">
            <Text bold>{open.name}</Text>
            {open.behind > 0 && <Text dimColor>{`   ↓${open.behind} behind upstream`}</Text>}
          </Box>
          {filterInput}
          {notes}
          {flying.length > 0 && <Text bold>{`IN FLIGHT ${flying.length}`}</Text>}
          {flying.map(row)}
          {queued.length > 0 && <Text bold>{`QUEUED ${queued.length}`}</Text>}
          {shown.map(row)}
          {!isExpanded && queued.length > shown.length && (
            <Button
              key="more"
              plain
              dimColor
              label={`+ ${queued.length - shown.length} more`}
              onPress={() => update($, state, prev => ({ ...prev, isExpanded: true }))}
            />
          )}
          <Text dimColor>{`press an item to put it in the prompt · Esc back${stamp}`}</Text>
        </Box>
      )
    }

    const sum = totals(repos)
    const overview = buildOverview(repos, filter)
    const nameWidth = Math.min(16, Math.max(0, ...repos.map(repo => repo.name.length)))
    const picks = rankNext(next, filter)
    // NEXT rows take the first hotkeys, then the repos, so 1 to 9 map to the visible rows in order.
    let repoNo = picks.length
    return (
      <Box flexDirection="column">
        {controls}
        <Box key="header" flexDirection="row">
          <Text bold>{`Board · ${sum.repos} repos · ${sum.active} in flight · ${sum.queued} queued`}</Text>
        </Box>
        {filterInput}
        {notes}
        {picks.length > 0 && (
          <Box key="next" flexDirection="column">
            <Text dimColor>NEXT</Text>
            {picks.map((pick, index) => (
              <Button
                key={`next-${index + 1}`}
                plain
                label={fit(nextLabel(pick), room)}
                hotkey={index < 9 ? String(index + 1) : undefined}
                onPress={() => $.prompt.fill({ text: nextPrompt(pick, repos) })}
              />
            ))}
          </Box>
        )}
        {overview.groups.map(group => (
          <Box key={`rail-${group.rail}`} flexDirection="column">
            <Text dimColor>{group.rail}</Text>
            {group.repos.map(repo => {
              repoNo += 1
              return (
                <Button
                  key={`repo-${repo.name}`}
                  plain
                  label={fit(repoLabel(repo, nameWidth, isWide), room)}
                  hotkey={repoNo <= 9 ? String(repoNo) : undefined}
                  onPress={() => update($, state, prev => ({ ...prev, repo: repo.name, filter: '', isExpanded: false }))}
                />
              )
            })}
          </Box>
        ))}
        {overview.idle.length > 0 && (
          <Box key="idle" flexDirection="row">
            <Text dimColor wrap="truncate-end">{`idle  ${overview.idle.join(' · ')}`}</Text>
          </Box>
        )}
        <Text dimColor>{`press a repo to open it · Esc back${stamp}`}</Text>
      </Box>
    )
  })
integrations/claude-code/board-pane/hooks/register.tsx 397〜446 行 · バンド
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    if (e.props.hasSurvey) return next(e)
    const { tasks, handoffs, worktrees, staleWorktrees: stale, prs } = await read($, summary)
    const { Box, Text, Button } = $.ui.resolve(e)
    // A press fills the prompt and never submits: the person reads it and presses Enter.
    const fill = (text: string) => () => $.prompt.fill({ text })
    const segments = []
    if (tasks) {
      segments.push(
        <Box key="seg-tasks" flexDirection="row">
          <Button key="band-tasks" plain dimColor label="tasks" hotkey="b" onPress={() => toggleBoard($)} />
          <Text color="cyan"> {tasks.queued}</Text>
          <Text dimColor>q </Text>
          <Text color={tasks.executing > 0 ? 'yellow' : undefined}>{tasks.executing}</Text>
          <Text dimColor>act</Text>
        </Box>,
      )
    }
    if (handoffs !== undefined) {
      segments.push(
        <Box key="seg-handoffs" flexDirection="row">
          <Text>{handoffs}</Text>
          <Button key="band-handoffs" plain dimColor label="ho" hotkey="h" onPress={fill(HANDOFF_PROMPT)} />
        </Box>,
      )
    }
    if (worktrees !== undefined) {
      segments.push(
        <Box key="seg-worktrees" flexDirection="row">
          <Text>{worktrees}</Text>
          <Button key="band-worktrees" plain dimColor label="wt" hotkey="w" onPress={fill(WORKTREE_PROMPT)} />
          {stale !== undefined && stale > 0 && <Text dimColor>{` (${stale} stale)`}</Text>}
        </Box>,
      )
    }
    if (prs !== undefined) {
      segments.push(
        <Box key="seg-prs" flexDirection="row">
          <Text>{prs}</Text>
          <Button key="band-prs" plain dimColor label="pr" hotkey="p" onPress={fill(PR_PROMPT)} />
        </Box>,
      )
    }
    if (segments.length === 0) return next(e)
    return (
      <Box flexDirection="row">
        {segments.flatMap((segment, index) => (index === 0 ? [segment] : [<Text dimColor>{' · '}</Text>, segment]))}
      </Box>
    )
  })
ライセンスの全文(MIT)
MIT License

Copyright (c) 2026 Dwarves Foundation

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 に読んだコミット eb010c35c39d のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。

載せる条件: 確かめやすいコード
入口を読んだhooks/hooks.json が名指すモジュールをすべて読んだ。integrations/claude-code/board-pane/hooks/register.tsx
解析できるすべてのファイルが TypeScript か JavaScript として解析できる。2 ファイルを解析
コードが 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 のホスト)がコードに書いてあるか。通信なし
プログラム起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。integrations/claude-code/board-pane/hooks/register.tsx:80 実行時に決まるプログラム; integrations/claude-code/board-pane/hooks/register.tsx:81 実行時に決まるプログラム; integrations/claude-code/board-pane/hooks/register.tsx:90 実行時に決まるプログラム; integrations/claude-code/board-pane/hooks/register.tsx:143 実行時に決まるプログラム
読んで送るファイルや環境変数を読み、かつ通信するか。reads environment variables and files and reaches the network
ソースの鍵ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし
ライセンスオープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT

コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件

入れる

入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。

リポジトリの .claude-plugin/marketplace.json にこの Mod が載っていないため、入れる手順は出せません。コードとして読むか、作者の README に従ってください。

Claude に聞く

modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:

modscode のデザイン「dwarvesf-board-pane」をコードごと読んで、同じようなペインを作って

Claude から探す: MCP コネクタ

似たデザイン