boberto
Boberto, a bat-winged mascot drawn at run time by its own Canvas engine: a pane with a wardrobe and idle gestures, and an animated reaction under each assistant reply
何をするか
- 欄を描く
- /boberto を足す
- ツールの呼び出しを見張る(止めることがある)
- prompt.submit・session.start・turn.complete・turn.startにフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- プロセスを起こさない
- TypeScript で書かれている
- デスクトップ専用の分岐がある
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like boberto by Christian Buzzetti (pane), as modscode read it from the mod's code:
// https://modscode.com/gallery/christianbuzzetti-boberto/
// 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: "Boberto" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Svg, Text, Button, Select, Input } = $.ui.resolve(e)
const svg = '…'
const alt = '…'
const status = '…'
const source = '…'
const summarize = '…'
const TARGET_NAMES = '…'
const hat = '…'
const swatchCardSvg = '…'
const hex = '…'
const problem = '…'
return (
<Box flexDirection="column" alignItems="center" paddingY={1} gap={1}>
<Svg source={`${svg}`} alt={`${alt}`} height={190} />
<Text dimColor>
{status}
{" · preview"}
</Text>
<Box flexDirection="column" gap={1} width="100%" paddingX={1}>
<Box flexDirection="row" alignItems="center" gap={1} width="100%">
<Svg source={`${source}`} alt="Wardrobe" height={14} />
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text dimColor wrap="truncate-end">
{summarize}
</Text>
</Box>
<Button label="Done ▴" variant="secondary" />
</Box>
<Box flexDirection="row" flexWrap="wrap" gap={1}>
<Button label={`${TARGET_NAMES}`} />
<Button label={`${TARGET_NAMES}`} />
<Button label={`${TARGET_NAMES}`} />
</Box>
<Box flexDirection="column" gap={1}>
<Select label="Accessory" value={`${hat}`} />
<Select label="Color" options={[{"value":"auto","label":"Natural"},{"label":"‹option›"},{"label":"‹option›"}]} value="custom" />
<Box flexDirection="column" gap={1} paddingX={1} paddingY={1} borderStyle="round" borderColor="#2a2833" backgroundColor="#141319">
<Svg source={`${swatchCardSvg}`} alt={`${TARGET_NAMES} color ${hex}`} width={210} height={76} />
<Input label="Hex" value={`${hex}`} placeholder="#rrggbb, #rgb or r,g,b" submitLabel="set" />
#f87171
#4ade80
#60a5fa
<Text color="#f87171">
{problem}
</Text>
</Box>
</Box>
<Text dimColor wrap="truncate">
────────
</Text>
<Box flexDirection="row" gap={1} justifyContent="flex-end">
<Button label="Shuffle" variant="primary" />
<Button label="Reset" variant="secondary" />
</Box>
</Box>
</Box>
)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
mods/boberto/hooks/register.tsx 743〜902 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANEL }, async ($, e) => {
const what = await drawn($)
const isPinned = (await read($, preview)) !== null
const status = what.kind === 'gesture' ? (GESTURE_STATUS[what.id] ?? what.id) : STATUS[what.name]
if (e.surface !== 'desktop') {
const { Text } = $.ui.resolve(e)
return <Text dimColor>Boberto is {status} (drawn in the desktop app).</Text>
}
const attire = await read($, outfit)
const o = optionsOf()
let svg: string
let alt: string
if (what.kind === 'gesture' && hasGesture(what.id, attire, 'full')) {
svg = (await gestureSvg(what.id, attire, 'full'))?.svg ?? liveSvg('idle', attire, 'full')
alt = `Boberto is ${status}`
} else {
const name = what.kind === 'live' ? what.name : 'idle'
svg = liveSvg(name, attire, 'full')
alt = LABELS[name]
}
const { Box, Button, Input, Select, Svg, Text } = $.ui.resolve(e)
const isOpen = await read($, isWardrobeOpen)
const tab = await read($, wardrobeTab)
const editing = await read($, colorEditing)
const problem = await read($, colorError)
const columns = e.props.bodyColumns
const hasBars = columns >= BARS_FROM_COLUMNS
// Handlers read live state when they run; nothing here is written while drawing.
const toggleWardrobe = () => void update($, isWardrobeOpen, value => !value)
const choose = (target: BobertoColorTarget) => (value: string) => void pickColor($, target, value)
const custom = { value: CUSTOM, label: 'Custom RGB…' }
const hatColorPreset = attire.hatHex !== undefined && o.hatColors.some(c => c.id === attire.hatHex)
/** Whether a part shows its RGB card: a custom color, or Custom picked over a matching preset. */
const isCustom = (target: BobertoColorTarget) =>
editing === target ||
(target === 'hat' ? attire.hatHex !== undefined && !hatColorPreset : attire[HEX_FIELD[target]] !== undefined)
const presetValue = (target: BobertoColorTarget, preset: string) => (isCustom(target) ? CUSTOM : preset)
const label = labelSvg('Wardrobe')
const header = (
<Box key="wardrobe-head" flexDirection="row" alignItems="center" gap={1} width="100%">
<Svg source={label.source} alt="Wardrobe" height={14} width={label.width} />
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text dimColor wrap="truncate-end">
{summarize(attire)}
</Text>
</Box>
<Button key="wardrobe" label={isOpen ? 'Done ▴' : 'Customize ▾'} variant="secondary" onPress={toggleWardrobe} />
</Box>
)
if (!isOpen) {
return (
<Box flexDirection="column" alignItems="center" paddingY={1} gap={1}>
<Svg source={svg} alt={alt} height={PANEL_HEIGHT} width={Math.round(PANEL_HEIGHT * aspectOf(svg))} />
<Text dimColor>
{status}
{isPinned ? ' · preview' : ''}
</Text>
<Box flexDirection="column" width="100%" paddingX={1}>
{header}
</Box>
</Box>
)
}
// One channel row: the letter, its bar (when there is room), the value field, and ∓16 steps.
const channelRow = (c: keyof Rgb, value: number) => (
<Box key={`row-${c}`} flexDirection="row" gap={1} alignItems="center">
<Box width={2}>
<Text color={CHANNEL_LETTER_COLORS[c]} bold>
{c.toUpperCase()}
</Text>
</Box>
{hasBars ? (
<Svg
source={channelBarSvg(c, value)}
alt={`${c.toUpperCase()} ${value} of 255`}
width={CHANNEL_BAR.width}
height={CHANNEL_BAR.height}
/>
) : null}
<Box width={12}>
<Input
key={c}
value={String(value)}
placeholder="0–255"
submitLabel="set"
onSubmit={text =>
void editColor(
$,
cur => {
const n = parseByte(text)
return n === null ? null : withChannel(cur, c, n)
},
BAD_CHANNEL,
)
}
/>
</Box>
<Button
key={`${c}-minus`}
label={`−${STEP}`}
variant="secondary"
dimColor
onPress={() => void editColor($, cur => withChannel(cur, c, hexToRgb(cur)[c] - STEP), BAD_CHANNEL)}
/>
<Button
key={`${c}-plus`}
label={`+${STEP}`}
variant="secondary"
dimColor
onPress={() => void editColor($, cur => withChannel(cur, c, hexToRgb(cur)[c] + STEP), BAD_CHANNEL)}
/>
</Box>
)
// The open tab's RGB card: swatch, hex field, three channel rows, and the last note.
const colorCard = (target: BobertoColorTarget) => {
const hex = currentHex(attire, target)
const rgb = hexToRgb(hex)
return (
<Box
key="color-card"
flexDirection="column"
gap={1}
paddingX={1}
paddingY={1}
borderStyle="round"
borderColor="#2a2833"
backgroundColor="#141319"
>
<Svg
source={swatchCardSvg(hex, TARGET_NAMES[target])}
alt={`${TARGET_NAMES[target]} color ${hex}`}
width={SWATCH_CARD.width}
height={SWATCH_CARD.height}
/>
<Input
key="hex"
label="Hex"
value={hex}
placeholder="#rrggbb, #rgb or r,g,b"
submitLabel="set"
onSubmit={value => void editColor($, () => parseColor(value), BAD_COLOR)}
/>
{channelRow('r', rgb.r)}
{channelRow('g', rgb.g)}
{channelRow('b', rgb.b)}
{problem === null ? null : <Text color="#f87171">{problem}</Text>}
</Box>
)
}
// The open tab's controls: its preset Select(s), then its RGB card when its color is custom.
const tabControls = (target: BobertoColorTarget) => {
switch (target) {ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Christian Buzzetti 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 に読んだコミット bb9a01b44204 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。mods/boberto/hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。8 ファイルを解析 |
| コードが 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 .)、触るものを見て、読んだコミットを入れてください。
リポジトリの .claude-plugin/marketplace.json にこの Mod が載っていないため、入れる手順は出せません。コードとして読むか、作者の README に従ってください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「christianbuzzetti-boberto」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…Skins0 Your promptadd rate limiting to the hub api0 Tool rows: finished, running, failedYour prompt Spinner0 Folded group of reads and searches●main · note 3 · note 3 · note 30 Edit diff cardDesktop only; the terminal keeps Claude Code's diff.0 Shell output cardDesktop only.0 Code block cardDesktop only; the terminal keeps Claude Code's markdown.0 TableAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopyAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentAccentCopy0 SpinnerAccent SpinnerSpinnerSpinner… 2h 10m0 Band above the prompt: normal, then nudging to compact█████░░░ 42% build█████░░░ 42% build█████░░░ 42% buildContext is 42% full0 Compact now0 Band above a questionTable BashBashBash0 Turn footer (terminal)3 build in 2h 10m · Grep · +3 −3
-
Claude に頼む…Model routerLast reply: Fix login → a1b2c3dKept off Opus to save the cache. Start a prompt with @Opus to force it.OnOffRoutes model and effort for each kind of prompt0 Fix loginbuildbuildbuildbuildbuildbuild0 Fix loginbuildbuildbuildbuildbuildbuild0 Fix loginbuildbuildbuildbuildbuildbuildYour rules checked firstNo rules yet. Pick a model and effort, type the words, press Add rule.Tasksa1b2c3d✕Tasksa1b2c3d✕Tasksa1b2c3d✕words, for example landing page, redesign Add rulebuildbuildbuildbuildbuildbuildOptions CoolingWhen still broken after xhigh, move tobuildbuildbuildCache saver: skip one-off model switches in long chatsbuildbuildbuildOne prompt only: start it with @opus, @max or @hardReset
-
Claude に頼む…VN Stock WatchHCMC Sector4s ago · Closed · caps 0/0 · Source: SSI APISector sExch eOpenReset dShowing Closed ✕Closed ✕Closed ✕mainShowing mainShowing mainShowingLoading…Stock tableStock tableStock tableStock tableStock tableStock tableStock tableStock tableStock tableVN30main mainLoading VN30…Map sizeMap sizeMap size Map sizeMap sizeMap sizeMy WatchlistSearch Exch add Open
-
Claude に頼む…Agent Cats🐾 Agent CatsWorking SearchAsleep DoneWaiting for you 3Skills for this taskMode: only the chosen onesRefresh listbuild ✕build ✕build ✕Clear allAsleep Filter__pick__No installed skills found. Try "Refresh list".Find a new skill: say what you need, Enter asks the main agent to search SearchNeeds your replyNo agents yet.⋯ᓚᘏᗢᶻbuildFilter[Answer here] Working✓ build✓ build✓ buildOther (type your own, Enter to confirm) Confirm[Answer here] Working✓ build✓ build✓ buildOther (type your own, Enter to confirm) Confirm[Answer here] Working✓ build✓ build✓ buildOther (type your own, Enter to confirm) ConfirmSend answersUse the native dialogᓚᘏᗢᶻbuildFilter[Answer here] Working✓ build✓ build✓ buildOther (type your own, Enter to confirm) Confirm[Answer here] Working✓ build✓ build✓ buildOther (type your own, Enter to confirm) Confirm[Answer here] Working✓ build✓ build✓ buildOther (type your own, Enter to confirm) ConfirmSend answersUse the native dialogᓚᘏᗢᶻbuildFilter[Answer here] Working✓ build✓ build✓ buildOther (type your own, Enter to confirm) Confirm[Answer here] Working✓ build✓ build✓ buildOther (type your own, Enter to confirm) Confirm[Answer here] Working✓ build✓ build✓ buildOther (type your own, Enter to confirm) ConfirmSend answersUse the native dialog
-
Claude に頼む…IssuesChoose a repositoryBackRefresh open⠋Refreshing…This session● buildacme/appalex● buildacme/app● buildacme/app● buildacme/appalex● buildacme/app● buildacme/app● buildacme/appalex● buildacme/app● buildacme/app● buildacme/appPress Enter to open Refresh.
-
Claude に頼む…Prayer timesOct 6Next prayer‹Today›⋯buildnowin 2h 10m2h 10m✓Sunrise 14:32buildnowin 2h 10m2h 10m✓Sunrise 14:32buildnowin 2h 10m2h 10m✓Sunrise 14:32