modscode EN

modscode / 図鑑 / lubbdubb

lubbdubb

LubbDubb at your keyboard: its skills, its desktop tool channel, and a notice board above the prompt.

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

何をするか

  • プロンプトの上の帯・欄・トーストを描く
  • /board・/panel を足す
  • session.end・session.start・ui.closeにフックする
  • ターンをまたいで自分の状態を持つ
  • ネットワークに出る

良いところ

  • プロセスを起こさない
  • TypeScript で書かれている
  • デスクトップ専用の分岐がある
  • エラーを扱う

作り始めるためのコード

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

雛形(register.tsx)

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

// Drawn like lubbdubb by AdamAwan (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/adamawan-lubbdubb/
// 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 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 text = '…'
    return (
      <Box flexDirection="column">
        <Box borderStyle="round" borderDimColor paddingX={1} gap={1}>
          <Text color="yellow">
            ■
          </Text>
          <Text bold>
            LubbDubb
          </Text>
          <Text>
            {`${text}`}
          </Text>
          <Text>
            {`${text}`}
          </Text>
          <Text>
            {`${text}`}
          </Text>
          <Button plain label="Work through asks" />
          <Button plain dimColor label="Hide panel" />
          <Button plain dimColor label="Hide" />
        </Box>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "LubbDubb" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Svg, Text, Button, Link } = $.ui.resolve(e)
    const logoSvg = '…'
    const length = '…'
    const cap = '…'
    const mark = '…'
    const href = '…'
    const label = '…'
    const meta = '…'
    const mark2 = '…'
    const meta2 = '…'
    const mark3 = '…'
    const meta3 = '…'
    const length2 = '…'
    const mark4 = '…'
    const meta4 = '…'
    const mark5 = '…'
    const meta5 = '…'
    const mark6 = '…'
    const meta6 = '…'
    const running = '…'
    const waiting = '…'
    const mark7 = '…'
    const meta7 = '…'
    const mark8 = '…'
    const meta8 = '…'
    const mark9 = '…'
    const meta9 = '…'
    const length3 = '…'
    const mark10 = '…'
    const meta10 = '…'
    const mark11 = '…'
    const meta11 = '…'
    const mark12 = '…'
    const meta12 = '…'
    return (
      <Box flexDirection="column" gap={1}>
        <Box gap={2} alignItems="center">
          <Svg source={`${logoSvg}`} alt="LubbDubb" width={44} height={44} isInteractive />
          <Box flexDirection="column" flexGrow={1}>
            <Text bold>
              Lubb
              <Text color="red">
                Dubb
              </Text>
            </Text>
            <Box justifyContent="space-between">
              <Box gap={1}>
                <Text color="yellow">
                  ■
                </Text>
                <Text bold>
                  Paused
                </Text>
                <Text dimColor>
                  {`· ${length} of ${cap} slots`}
                </Text>
              </Box>
              <Button hotkey="p" label="Resume" />
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text bold>
                Needs you
              </Text>
              <Text dimColor>
                {length}
              </Text>
            </Box>
            <Button hotkey="n" variant="primary" label="Work through asks" />
          </Box>
          <Text dimColor>
            Nothing waiting on you.
          </Text>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark2}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta2}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark3}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta3}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
          <Text dimColor>
            {`  +${length} more`}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text bold>
                Features
              </Text>
              <Text dimColor>
                {`${length} in progress`}
              </Text>
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text bold>
                Pull requests
              </Text>
              <Text dimColor>
                {length2}
              </Text>
            </Box>
          </Box>
          <Text dimColor>
            No open pull requests.
          </Text>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark4}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta4}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark5}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta5}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark6}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta6}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
          <Text dimColor>
            {`  +${length} more`}
          </Text>
        </Box>
        <Box flexDirection="column">
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text bold>
                Fleet
              </Text>
              <Text dimColor>
                {`${running} running · ${waiting} waiting`}
              </Text>
            </Box>
          </Box>
          <Text dimColor>
            No agents out.
          </Text>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark7}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta7}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark8}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta8}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark9}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta9}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
        </Box>
        <Box flexDirection="column">
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text bold>
                Up next
              </Text>
              <Text dimColor>
                {length3}
              </Text>
            </Box>
          </Box>
          <Text dimColor>
            Queue is empty.
          </Text>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark10}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta10}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark11}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta11}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
          <Box justifyContent="space-between">
            <Box gap={1}>
              <Text>
                {mark12}
              </Text>
              <Text>
                <Link href={`${href}`} label={`${label}`} />
              </Text>
            </Box>
            <Box gap={1}>
              <Text>
                {meta12}
              </Text>
              <Button plain dimColor label={`${label}`} />
            </Box>
          </Box>
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const title = '…'
    await $.ui.toast(`LubbDubb: ${title}`)
    await $.ui.toast(`LubbDubb: the prompt box did not take it`)
    return next(e)
  })
}

Mod 自身のコード

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

plugin/hooks/register.tsx 208〜246 行 · バンド
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    const now = await read($, board)
    if (e.props.hasSurvey || now === null || (await read($, isHidden))) return next(e)
    const { Box, Button, Text } = $.ui.resolve(e)
    const paneOpen = await read($, isPaneOpen)
    const theirs = await next(e)
    return (
      <Box flexDirection="column">
        <Box key="band" borderStyle="round" borderDimColor paddingX={1} gap={1}>
          <Text color={now.paused ? 'yellow' : 'green'}>{now.paused ? '■' : '●'}</Text>
          <Text bold>LubbDubb</Text>
          {bandParts(now).map((part, i) => {
            const color = part.tone === undefined ? undefined : TONE[part.tone].color
            return (
              <Text key={`part-${i}`} color={color} dimColor={color === undefined}>
                {`${i === 0 ? '' : '· '}${part.text}`}
              </Text>
            )
          })}
          {now.notices.length > 0 && (
            <Button key="next" plain label="Work through asks" onPress={draft($, '/lubbdubb:next')} />
          )}
          <Button
            key="toggle-panel"
            plain
            dimColor
            label={paneOpen ? 'Hide panel' : 'Show panel'}
            onPress={() =>
              void act($, paneOpen ? 'LubbDubb panel hidden' : 'LubbDubb panel opened', () =>
                paneOpen ? closePane($) : openPane($),
              )
            }
          />
          <Button key="hide" plain dimColor label="Hide" onPress={() => update($, isHidden, () => true)} />
        </Box>
        {theirs}
      </Box>
    )
  })
plugin/hooks/register.tsx 248〜407 行 · ペイン
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const { Box, Text, Button, Link } = $.ui.resolve(e)
    const now = await read($, board)
    const width = Math.max(24, e.props.bodyColumns)

    const logo = (alive: boolean) => {
      if (width < LOGO_MIN_WIDTH) return null
      if (e.surface === 'terminal') {
        const { Raster } = $.ui.resolve(e)
        return <Raster key={LOGO_KEY} columns={LOGO_COLUMNS} rows={LOGO_ROWS} cells={logoCells(alive ? beat : null)} />
      }
      const { Svg } = $.ui.resolve(e)
      return <Svg source={logoSvg(alive)} alt="LubbDubb" width={44} height={44} isInteractive />
    }
    const wordmark = (
      <Text bold>
        Lubb<Text color="red">Dubb</Text>
      </Text>
    )

    if (now === null) {
      return (
        <Box gap={2} alignItems="center">
          {logo(false)}
          <Text dimColor>{`LubbDubb is not answering at ${where.url}.`}</Text>
        </Box>
      )
    }

    const header = (label: string, count: string, action?: unknown) => (
      <Box justifyContent="space-between">
        <Box gap={1}>
          <Text bold>{label}</Text>
          <Text dimColor>{count}</Text>
        </Box>
        {action}
      </Box>
    )

    const row = (r: {
      id: string
      mark: string
      markColor?: string
      title: string
      meta: string
      metaColor?: string
      onPress?: () => void
      href?: string | null
      action?: { label: string; onPress: () => void }
    }) => {
      const room = Math.max(8, width - r.meta.length - (r.action ? r.action.label.length + 1 : 0) - 4)
      const label = clip(r.title, room)
      return (
        <Box key={r.id} justifyContent="space-between">
          <Box gap={1}>
            <Text color={r.markColor} dimColor={r.markColor === undefined}>
              {r.mark}
            </Text>
            {r.href ? (
              <Text>
                <Link href={r.href} label={label} />
              </Text>
            ) : r.onPress ? (
              <Button key={`${r.id}-go`} plain label={label} onPress={r.onPress} />
            ) : (
              <Text>{label}</Text>
            )}
          </Box>
          <Box gap={1}>
            <Text color={r.metaColor} dimColor={r.metaColor === undefined}>
              {r.meta}
            </Text>
            {r.action && <Button key={`${r.id}-action`} plain dimColor label={r.action.label} onPress={r.action.onPress} />}
          </Box>
        </Box>
      )
    }

    const featureRow = (f: Feature) => {
      const filled = Math.round((f.delivered / f.total) * BAR)
      const going = Math.min(BAR - filled, Math.round((f.inFlight / f.total) * BAR))
      const tally = `${f.delivered}/${f.total}`
      const room = Math.max(8, width - BAR - tally.length - 5)
      return (
        <Box key={`feature-${f.number}`} justifyContent="space-between">
          <Box gap={1}>
            <Text color={f.blocked > 0 ? 'red' : undefined} dimColor={f.blocked === 0}>
              {f.blocked > 0 ? '!' : '·'}
            </Text>
            <Button
              key={`feature-${f.number}-ask`}
              plain
              label={clip(f.title, room)}
              onPress={draft($, `/lubbdubb:feature ${f.number}`)}
            />
          </Box>
          <Box gap={1}>
            <Text>
              <Text color="green">{'━'.repeat(filled)}</Text>
              <Text color="yellow">{'━'.repeat(going)}</Text>
              <Text dimColor>{'─'.repeat(BAR - filled - going)}</Text>
            </Text>
            <Text dimColor>{tally}</Text>
          </Box>
        </Box>
      )
    }

    const waiting = now.agents.filter(a => a.isWaiting).length
    const running = now.agents.length - waiting

    return (
      <Box flexDirection="column" gap={1}>
        <Box gap={2} alignItems="center">
          {logo(true)}
          <Box flexDirection="column" flexGrow={1}>
            {wordmark}
            <Box justifyContent="space-between">
              <Box gap={1}>
                <Text color={now.paused ? 'yellow' : 'green'}>{now.paused ? '■' : '●'}</Text>
                <Text bold>{now.paused ? 'Paused' : 'Running'}</Text>
                <Text dimColor>{`· ${now.agents.length} of ${now.cap} slots`}</Text>
              </Box>
              <Button
                key="pause"
                hotkey="p"
                label={now.paused ? 'Resume' : 'Pause'}
                onPress={() =>
                  void act($, now.paused ? 'Fleet resumed' : 'Fleet paused', () => setPaused($, where, !now.paused))
                }
              />
            </Box>
          </Box>
        </Box>

        <Box flexDirection="column">
          {header(
            'Needs you',
            String(now.notices.length),
            now.notices.length > 0 && (
              <Button
                key="next"
                hotkey="n"
                variant="primary"
                label="Work through asks"
                onPress={draft($, '/lubbdubb:next')}
              />
            ),
          )}
          {now.notices.length === 0 && <Text dimColor>Nothing waiting on you.</Text>}
          {now.notices.slice(0, 5).map(n =>
            row({
              id: `ask-${n.id}`,
              mark: n.urgent ? '!' : '·',
              markColor: n.urgent ? 'red' : undefined,
              title: n.title,
              meta: n.kind,
              onPress: draft($, `/lubbdubb:next ${n.id}`),
            }),
          )}
ライセンスの全文(MIT)
MIT License

Copyright (c) 2026 Adam Awan

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

載せる条件: 確かめやすいコード
入口を読んだhooks/hooks.json が名指すモジュールをすべて読んだ。plugin/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 のホスト)がコードに書いてあるか。plugin/hooks/register.tsx:55 fetch(`${where.url}/api/state?sections=asks,control,flee); plugin/hooks/register.tsx:56 fetch(`${where.url}/api/features`); plugin/hooks/register.tsx:113 fetch(`${where.url}/api/control`)
プログラム起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。プログラムを起動しない
読んで送るファイルや環境変数を読み、かつ通信するか。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 のデザイン「adamawan-lubbdubb」をコードごと読んで、同じようなペインを作って

Claude から探す: MCP コネクタ

似たデザイン