modscode EN

modscode / 図鑑 / superset-deck

superset-deck

A Superset-style workspace sidebar inside Claude Code, driven by the Superset CLI

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

何をするか

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

良いところ

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

作り始めるためのコード

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

雛形(register.tsx)

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

// Drawn like superset-deck by tomikng (pane, band), as modscode read it from the mod's code:
// https://modscode.com/gallery/tomikng-superset-deck/
// 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: "Superset" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button, Input } = $.ui.resolve(e)
    const logo = '…'
    const host = '…'
    const length = '…'
    const live = '…'
    const n = '…'
    const spin = '…'
    const bz = '…'
    const plus = '…'
    const refresh = '…'
    const restore = '…'
    const up = '…'
    const down = '…'
    const start = '…'
    const length2 = '…'
    const length3 = '…'
    const glyph = '…'
    const name = '…'
    const open = '…'
    const trash = '…'
    const branch = '…'
    const branch2 = '…'
    const folder = '…'
    const projectName = '…'
    const clock = '…'
    const ago = '…'
    const word = '…'
    const label = '…'
    const icon = '…'
    const k = '…'
    const v = '…'
    const icon2 = '…'
    const k2 = '…'
    const v2 = '…'
    const icon3 = '…'
    const k3 = '…'
    const v3 = '…'
    const terminal = '…'
    const terminalId = '…'
    const terminal2 = '…'
    const terminalId2 = '…'
    const terminal3 = '…'
    const terminalId3 = '…'
    const send = '…'
    const warn = '…'
    const text = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" justifyContent="space-between">
          <Text>
            <Text color="magenta" bold>
              {logo}
              {" Superset"}
            </Text>
            <Text dimColor>
              {"  "}
              {host}
              {" local · "}
              {length}
              {" workspaces ·"}
              {" "}
            </Text>
            <Text color="green">
              {live}
              {" "}
              {`${n}${length}`}
              {" live"}
            </Text>
            <Text color="yellow">
              {"  "}
              {spin}
              {" "}
              {bz}
            </Text>
          </Text>
          <Box flexDirection="row" gap={1}>
            <Button plain hotkey="n" label={`${plus} New`} />
            <Button plain hotkey="r" label={`${refresh}`} />
            <Button plain hotkey="z" label={`${restore}`} />
          </Box>
        </Box>
        <Text dimColor>
          ────────
        </Text>
        <Box flexDirection="row" gap={1} flexGrow={1}>
          <Box flexDirection="column" flexShrink={0}>
            <Box flexGrow={1} />
            <Box flexDirection="row" gap={1} marginTop={1}>
              <Button plain hotkey="k" label={`${up} k`} />
              <Button plain hotkey="j" label={`${down} j`} />
              <Text dimColor>
                {`${start}1`}
                –
                {length2}
                /
                {length3}
              </Text>
            </Box>
          </Box>
          <Text dimColor>
            │
│
│
│
│
│
│
│
          </Text>
          <Box flexDirection="column">
            <Box flexDirection="row" justifyContent="space-between">
              <Text bold wrap="truncate">
                <Text>
                  {glyph}
                  {" "}
                </Text>
                {name}
              </Text>
              <Box flexDirection="row" gap={1}>
                <Button plain hotkey="o" label={`${open} Open`} />
                <Button hotkey="y" variant="primary" label={`${trash} Confirm delete`} />
              </Box>
            </Box>
            <Text dimColor wrap="truncate">
              {branch}
              {" "}
              {branch2}
              {" · "}
              {folder}
              {" "}
              {projectName}
              {" · "}
              {clock}
              {" "}
              {ago}
              {" · "}
              {word}
            </Text>
            <Box flexDirection="row" gap={2} marginY={1}>
              <Button plain hotkey="1" variant="primary" label={`▸${label}`} />
              <Button plain hotkey="2" variant="primary" label={`▸${label}`} />
              <Button plain hotkey="3" variant="primary" label={`▸${label}`} />
            </Box>
            <Box flexDirection="column" borderStyle="round" borderColor="gray" paddingX={1}>
              <Box flexDirection="row">
                <Text color="cyan">
                  {icon}
                  {" "}
                  {k}
                </Text>
                <Text wrap="truncate-middle">
                  {v}
                </Text>
              </Box>
              <Box flexDirection="row">
                <Text color="cyan">
                  {icon2}
                  {" "}
                  {k2}
                </Text>
                <Text wrap="truncate-middle">
                  {v2}
                </Text>
              </Box>
              <Box flexDirection="row">
                <Text color="cyan">
                  {icon3}
                  {" "}
                  {k3}
                </Text>
                <Text wrap="truncate-middle">
                  {v3}
                </Text>
              </Box>
              <Text dimColor wrap="truncate">
                {"  "}
                {terminal}
                {" "}
                {terminalId}
              </Text>
              <Text dimColor wrap="truncate">
                {"  "}
                {terminal2}
                {" "}
                {terminalId2}
              </Text>
              <Text dimColor wrap="truncate">
                {"  "}
                {terminal3}
                {" "}
                {terminalId3}
              </Text>
            </Box>
            <Box marginTop={1}>
              <Input label={`${send} `} placeholder="Message the agent… (Enter sends)" submitLabel="send" value="" />
            </Box>
          </Box>
        </Box>
        <Box flexDirection="row" justifyContent="space-between">
          <Text color="red" wrap="truncate">
            {warn}
            {" "}
            {text}
          </Text>
        </Box>
      </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, Button } = $.ui.resolve(e)
    const logo = '…'
    const length = '…'
    const live = '…'
    const n = '…'
    const hot = '…'
    const open = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" gap={1}>
          <Text>
            <Text color="magenta" bold>
              {logo}
              {" Superset"}
            </Text>
            <Text dimColor>
              {" "}
              {length}
              {" workspaces · "}
            </Text>
            <Text color="green">
              {live}
              {" "}
              {`${n}${length}`}
              {" live"}
            </Text>
            <Text color="yellow">
              {" · "}
              {hot}
              {" active"}
            </Text>
          </Text>
          <Button plain hotkey="o" label={`${open} open`} />
        </Box>
        {await next(e)}
      </Box>
    )
  })
}

Mod 自身のコード

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

hooks/register.tsx 412〜571 行 · ペイン
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e, next) => {
    if (e.surface === 'mobile') return next(e)
    const { Box, Text, Button, Input, Select, Code } = $.ui.resolve(e)
    const cols = e.props.bodyColumns
    if (e.viewport?.columns) screenColumns = e.viewport.columns
    if (needsWiden && screenColumns) {
      needsWiden = false
      void openPane($, false)
    }
    const rows = Math.max(12, (e.viewport?.rows ?? 30) - 3)
    const now = Date.now()

    const [list, terms, stat, projs, sel, term, t, m, f, scr, d, off, del, bz, ban, loaded, fr] =
      await Promise.all([
        read($, workspaces), read($, terminals), read($, stats), read($, projects), read($, selected),
        read($, terminal), read($, tab), read($, mode), read($, form), read($, screen), read($, diff),
        read($, diffOffset), read($, confirmDelete), read($, busy), read($, banner),
        read($, loadedAt), read($, frame),
      ])

    const spin = icons.spinner[fr % icons.spinner.length]
    const ws = list.find(w => w.id === sel) ?? null
    const live = liveTerminals(ws ? terms[ws.id] : [])
    const totalLive = Object.values(terms).reduce((n, l) => n + liveTerminals(l).length, 0)
    const isWide = cols >= 90
    const sideW = isWide ? Math.min(40, Math.max(28, Math.floor(cols * 0.32))) : cols
    const mainW = isWide ? cols - sideW - 1 : cols

    const statusOf = (w: Workspace) => {
      const l = liveTerminals(terms[w.id]).length
      const isHot = now - w.lastActivityAt < ACTIVE_MS || (w.id === sel && scr && now - scr.changedAt < SCREEN_ACTIVE_MS)
      if (l > 0 && isHot) return { glyph: spin, color: 'yellow', word: 'working' }
      if (l > 0) return { glyph: icons.live, color: 'green', word: `${l} live` }
      return { glyph: icons.idle, color: 'gray', word: 'idle' }
    }

    const StatText = ({ s }: { s: DiffStat | undefined }) =>
      s && (s.added || s.removed) ? (
        <Text>
          <Text color="green">+{s.added}</Text>
          <Text color="red"> −{s.removed}</Text>
        </Text>
      ) : (
        <Text dimColor> </Text>
      )

    // ── header ───────────────────────────────────────────────
    const header = (
      <Box flexDirection="row" justifyContent="space-between" width={cols}>
        <Text>
          <Text color="magenta" bold>
            {icons.logo} Superset
          </Text>
          <Text dimColor>
            {'  '}
            {icons.host} local · {list.length} workspaces ·{' '}
          </Text>
          <Text color={totalLive ? 'green' : 'gray'}>
            {icons.live} {totalLive} live
          </Text>
          {bz && (
            <Text color="yellow">
              {'  '}
              {spin} {bz}
            </Text>
          )}
        </Text>
        <Box flexDirection="row" gap={1}>
          <Button key="new" plain hotkey="n" label={`${icons.plus} New`} onPress={() => update($, mode, () => 'new' as Mode)} />
          <Button key="refresh" plain hotkey="r" label={icons.refresh} onPress={() => refresh($, { force: true })} />
          <Button key="max" plain hotkey="z" label={isMax ? icons.restore : icons.maximize} onPress={() => toggleMax($)} />
        </Box>
      </Box>
    )

    // ── sidebar ──────────────────────────────────────────────
    const sideRows: { key: string; node: RenderElement; id?: string }[] = []
    for (const [project, items] of grouped(list)) {
      const liveInGroup = items.reduce((n, w) => n + liveTerminals(terms[w.id]).length, 0)
      sideRows.push({
        key: `g:${project}`,
        node: (
          <Box key={`g:${project}`} flexDirection="row" justifyContent="space-between" width={sideW} marginTop={sideRows.length ? 1 : 0}>
            <Text bold color="blue" wrap="truncate">
              {icons.folderOpen} {cut(project, sideW - 8)}
            </Text>
            <Text dimColor>{liveInGroup ? `${liveInGroup}/${items.length}` : items.length}</Text>
          </Box>
        ),
      })
      for (const w of items) {
        const st = statusOf(w)
        const isSel = w.id === sel
        const s = stat[w.id]
        const right = `${s && (s.added || s.removed) ? `+${s.added} −${s.removed} ` : ''}${ago(w.lastActivityAt, now)}`
        sideRows.push({
          key: `w:${w.id}`,
          id: w.id,
          node: (
            <Box key={`w:${w.id}`} flexDirection="row" width={sideW} backgroundColor={isSel ? 'blackBright' : undefined}>
              <Text color={isSel ? 'cyan' : 'gray'}>{isSel ? '▌' : ' '}</Text>
              <Text color={st.color}>{st.glyph} </Text>
              <Box flexGrow={1} flexShrink={1}>
                <Button
                  key={`ws:${w.id}`}
                  plain
                  label={cut(w.branch || w.name, sideW - right.length - 6)}
                  onPress={() => select($, w.id)}
                />
              </Box>
              <StatText s={s} />
              <Text dimColor> {ago(w.lastActivityAt, now)}</Text>
            </Box>
          ),
        })
      }
    }
    const sideRoom = Math.max(4, (isWide ? rows : Math.floor(rows / 3)) - 4)
    const selIndex = Math.max(0, sideRows.findIndex(r => r.id === sel))
    const start = Math.max(0, Math.min(selIndex - Math.floor(sideRoom / 2), sideRows.length - sideRoom))
    const visible = sideRows.slice(start, start + sideRoom)

    const sidebar = (
      <Box flexDirection="column" width={sideW} flexShrink={0}>
        {list.length === 0 ? (
          <Text dimColor>
            {loaded ? 'No workspaces on this machine yet. Press n to make one.' : `${spin} Loading workspaces…`}
          </Text>
        ) : (
          visible.map(r => r.node)
        )}
        <Box flexGrow={1} />
        <Box flexDirection="row" gap={1} marginTop={1}>
          <Button key="up" plain hotkey="k" label={`${icons.up} k`} onPress={() => move($, -1)} />
          <Button key="down" plain hotkey="j" label={`${icons.down} j`} onPress={() => move($, 1)} />
          <Text dimColor>
            {start + 1}–{Math.min(sideRows.length, start + sideRoom)}/{sideRows.length}
          </Text>
        </Box>
      </Box>
    )

    // ── main: new-workspace form ─────────────────────────────
    const newForm = () => (
      <Box flexDirection="column" width={mainW} borderStyle="round" borderColor="magenta" paddingX={1}>
        <Text bold color="magenta">
          {icons.plus} New workspace
        </Text>
        <Text dimColor>A git worktree on a new branch, with {agentPreset} started on your prompt.</Text>
        <Box marginTop={1} flexDirection="column">
          {projs.length === 0 ? (
            <Text dimColor>
              {spin} Loading projects…
            </Text>
          ) : (
          <Select
            key="new:project"
            label={`${icons.folder} Project `}
            value={f.projectId || undefined}
            options={projs.map(p => ({ value: p.id, label: p.name }))}
hooks/register.tsx 808〜837 行 · バンド
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const below = await next(e)
    if (!showBand || e.props.hasSurvey) return below
    const [list, terms] = [await read($, workspaces), await read($, terminals)]
    if (list.length === 0) return below
    const isOpen = await paneShown($)
    if (isOpen) return below
    const { Box, Text, Button } = $.ui.resolve(e)
    const now = Date.now()
    const live = Object.values(terms).reduce((n, l) => n + liveTerminals(l).length, 0)
    const hot = list.filter(w => now - w.lastActivityAt < ACTIVE_MS).length
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" gap={1}>
          <Text>
            <Text color="magenta" bold>
              {icons.logo} Superset
            </Text>
            <Text dimColor> {list.length} workspaces · </Text>
            <Text color={live ? 'green' : 'gray'}>
              {icons.live} {live} live
            </Text>
            {hot > 0 && <Text color="yellow"> · {hot} active</Text>}
          </Text>
          <Button key="band:open" plain hotkey="o" label={`${icons.open} open`} onPress={() => openPane($, true)} />
        </Box>
        {below}
      </Box>
    )
  })
ライセンスの全文(MIT)
MIT License

Copyright (c) 2026 Tom Nguyen

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

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

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

入れる

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

リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。

/plugin marketplace add tomikng/claude-superset-deck
/plugin install superset-deck@superset-deck

入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(4edab00343c7)と違うことがあります。入れる前に見比べてください。

Claude に聞く

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

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

Claude から探す: MCP コネクタ

似たデザイン