modscode JA

modscode / Gallery / whiteboard

whiteboard

Claude draws Mermaid, D2 and PlantUML diagrams (UML, flowcharts, sequences, architecture) into a side pane with history, versions, export, copy and share.

Code you can checkTerminal + desktopPaneToastBoxButtonInputMarkdownSvgText

What it does

  • Draws a pane, toasts
  • Adds /whiteboard
  • Watches tool calls and can refuse them
  • Hooks command.register, fs.exists, fs.list, fs.read and 18 more
  • Keeps its own state between turns

Good points

  • No network calls
  • Written in TypeScript
  • Has a desktop-specific branch
  • Handles errors

Code to start from

Two kinds: a starter modscode writes from the design above, and the lines of the mod's own code that draw it.

Starter (register.tsx)

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

// Drawn like whiteboard by Kiko Stefanov (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/kikostefanov-lab-whiteboard/
// 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: "Whiteboard" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Button, Text, Markdown, Input } = $.ui.resolve(e)
    const index = '…'
    const length = '…'
    const title = '…'
    const n = '…'
    const value = '…'
    const note = '…'
    const text = '…'
    return (
      <Box flexDirection="column" gap={1}>
        <Box flexDirection="row" gap={1} flexWrap="wrap">
          <Button hotkey="h" plain label="◀" />
          <Text>
            {`${index}1/${length}`}
          </Text>
          <Button hotkey="l" plain label="▶" />
          <Text bold>
            {title}
          </Text>
          <Box flexDirection="row" gap={1}>
            <Button plain label={`‹`} />
            <Text dimColor>
              {`v${n}/${value}`}
            </Text>
            <Button plain label="›" />
          </Box>
        </Box>
        <Box flexDirection="row" gap={1} flexWrap="wrap">
          <Button label="Export" />
          <Button label="Copy" />
          <Button label="Copy MD" />
          <Button label="Share" />
          <Button hotkey="o" label="Open" />
        </Box>
        <Box flexDirection="row" gap={1} flexWrap="wrap">
          <Text>
            {`Upload '${title}' as a secret GitHub gist? Anyone with the link can see it.`}
          </Text>
          <Button variant="primary" label="Upload" />
          <Button label="Cancel" />
        </Box>
        <Box flexDirection="row" gap={1}>
          <Text dimColor>
            {note}
          </Text>
          <Button label="Re-render" />
        </Box>
        <Box flexDirection="column">
          <Markdown text={`${text}`} />
          <Text dimColor>
            Source truncated: use Copy or Export for the full text.
          </Text>
        </Box>
        <Input placeholder="Ask Claude to change this diagram…" submitLabel="send" />
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    const split = '…'
    const request = '…'
    await $.ui.toast(`Re-render failed: ${split}`)
    await $.ui.toast(`Sent to Claude: "${request}"`)
    return next(e)
  })
}

The mod's own code

Shown under the mod's licence (MIT); its text is below. Keep the notice if you copy these lines.

whiteboard/hooks/register.tsx lines 402–499 · Pane
  on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
    const els = $.ui.resolve(e)
    const { Box, Text, Button, Markdown } = els
    const board = (await read($, history)) ?? EMPTY
    const entry = current(board)
    if (!entry) {
      return (
        <Box flexDirection="column">
          <Text dimColor>{EMPTY_HINT}</Text>
        </Box>
      )
    }

    const language = languageOf(entry)
    const isTerminal = e.surface === 'terminal'
    // The terminal's table carries an Svg that draws nothing there: show the source instead.
    const Svg = !isTerminal && 'Svg' in els ? els.Svg : undefined
    const Image = isTerminal && 'Image' in els ? els.Image : undefined
    const Input = 'Input' in els ? els.Input : undefined
    const isMissing = !(await $.fs.exists(entry.svgPath))
    const isTooLarge = entry.svgBytes > MAX_INLINE_SVG
    const svg = Svg && !isMissing && !isTooLarge ? await $.fs.read(entry.svgPath).catch(() => undefined) : undefined
    const png = Image && entry.pngPath && entry.pngWidth && entry.pngHeight && (await isKitty($)) && (await $.fs.exists(entry.pngPath))
      ? { path: entry.pngPath, width: entry.pngWidth, height: entry.pngHeight }
      : undefined
    const columns = Math.max(10, Math.min(e.props.bodyColumns, 255))
    const view = sourceView(entry.source, language)
    const version = versionInfo(board, entry)
    const isConfirmingShare = (await read($, shareConfirm)) === entry.id
    const note = isMissing
      ? 'Render missing (its files were cleaned up).'
      : Svg && isTooLarge
        ? 'Too large to show inline: press Open to view it.'
        : ''

    return (
      <Box flexDirection="column" gap={1}>
        <Box flexDirection="row" gap={1} flexWrap="wrap">
          <Button key="prev" hotkey="h" plain label="◀" dimColor={board.index <= 0}
            onPress={() => changeBoard($, x => step(x, -1))} />
          <Text>{`${board.index + 1}/${board.entries.length}`}</Text>
          <Button key="next" hotkey="l" plain label="▶" dimColor={board.index >= board.entries.length - 1}
            onPress={() => changeBoard($, x => step(x, 1))} />
          <Text bold>{entry.title}</Text>
          {version.of > 1 ? (
            <Box flexDirection="row" gap={1}>
              <Button key="olderVersion" plain label="‹" dimColor={version.older === undefined}
                onPress={() => (version.older === undefined ? undefined : changeBoard($, x => jumpTo(x, version.older!)))} />
              <Text dimColor>{`v${version.n}/${version.of}`}</Text>
              <Button key="newerVersion" plain label="›" dimColor={version.newer === undefined}
                onPress={() => (version.newer === undefined ? undefined : changeBoard($, x => jumpTo(x, version.newer!)))} />
            </Box>
          ) : null}
        </Box>
        <Box flexDirection="row" gap={1} flexWrap="wrap">
          <Button key="export" label="Export" onPress={async () => $.ui.toast(await exportEntry($, entry).catch((err: unknown) => `Export failed: ${errorText(err)}`))} />
          <Button key="copy" label="Copy" onPress={async p => $.ui.toast(await copyText($, entry.source, p.surface, 'Copied the diagram source.'))} />
          <Button key="copyMd" label="Copy MD" onPress={async p => $.ui.toast(await copyText($, fenceBlock(language, entry.source), p.surface,
            language === 'mermaid' ? 'Copied as a Markdown block: it renders in GitHub, GitLab and Notion.' : 'Copied as a Markdown block.'))} />
          <Button key="share" label="Share" onPress={() => update($, shareConfirm, () => entry.id)} />
          <Button key="open" hotkey="o" label="Open" onPress={async () => {
            const problem = await openEntry($, entry)
            if (problem) $.ui.toast(problem)
          }} />
        </Box>
        {isConfirmingShare ? (
          <Box flexDirection="row" gap={1} flexWrap="wrap">
            <Text>{`Upload '${entry.title}' as a secret GitHub gist? Anyone with the link can see it.`}</Text>
            <Button key="shareYes" variant="primary" label="Upload" onPress={async p => {
              await update($, shareConfirm, () => null)
              $.ui.toast(await shareEntry($, entry, p.surface).catch((err: unknown) => `Share failed: ${errorText(err)}`))
            }} />
            <Button key="shareNo" label="Cancel" onPress={() => update($, shareConfirm, () => null)} />
          </Box>
        ) : null}
        {note ? (
          <Box flexDirection="row" gap={1}>
            <Text dimColor>{note}</Text>
            {isMissing ? <Button key="rerender" label="Re-render" onPress={() => rerender($, entry, settings)} /> : null}
          </Box>
        ) : null}
        {Svg && svg !== undefined
          ? <Svg source={svg} alt={entry.title} />
          : Image && png
            ? <Image key="diagram" source={{ file: png.path, format: 'png' }} columns={columns} rows={imageRows(png.width, png.height, columns)} alt={entry.title} />
            : (
              <Box flexDirection="column">
                <Markdown text={view.text} />
                {view.isTruncated ? <Text dimColor>Source truncated: use Copy or Export for the full text.</Text> : null}
              </Box>
            )}
        {Input ? (
          <Input key="revise" placeholder="Ask Claude to change this diagram…" submitLabel="send"
            onSubmit={value => askToRevise($, entry, value)} />
        ) : null}
      </Box>
    )
  })
Licence text (MIT)
MIT License

Copyright (c) 2026 Kiko Stefanov

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.

What its code calls

runs programswrites filesenv varsdrives Claudetool callsremembers

The design, read from code

Drawn from the mod's source at the commit read, not from a run: a list is drawn three times, a condition takes its first branch that draws in the desktop app, and a value only the run time knows is shown as a made-up sample (dotted underline) or left out. Colours and type are this site's.

What its code shows

Read from the source at commit 7b3783a612e8 on 2026-10-06. The first group decides whether a mod is listed; the rest is for you to weigh. A later commit is not read until the next crawl.

Decides the listing: code you can check
Entry readEvery module hooks/hooks.json names was read.whiteboard/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.5 files parsed
All its code is in the modEvery import is a file of the mod or the engine's own module; no packages, no require.all its code is in the mod
ReadableNo minified lines, no eval or new Function, no import of a computed path, no encoded blobs.no minified code, no eval, no encoded blobs
Calls in the openNetwork and programs are reached as $.http.fetch and $.process.run in place, never passed around.every call outside goes through $ in the open
For you to weigh before installing
Where it drawsThe terminal, the desktop app, both, or nothing (hooks only: a guard or a prompt rewriter), as its code says. Shown, never a reason to leave a mod out.draws in the terminal and the desktop app, with its own branch for the desktop
Install lineWhether its repository's own .claude-plugin/marketplace.json lists it, so it installs from that marketplace with the lines on its page.listed in its repository's .claude-plugin/marketplace.json: installs from there
Programs on WindowsWhether every program it starts through $.process exists on Windows (tail, date, open, osascript, /usr/… do not).runs no program a Windows PC lacks
NetworkWhether every fetch names its https host in the code.no network
ProgramsWhether every program it starts is named in the code and is not a shell, an interpreter or a network tool.whiteboard/hooks/register.tsx:80 a program named at run time; whiteboard/hooks/register.tsx:100 a program named at run time; whiteboard/hooks/register.tsx:140 a program named at run time; whiteboard/hooks/register.tsx:238 a program named at run time; whiteboard/hooks/register.tsx:248 a program named at run time
Reads and sendsWhether it both reads files or environment variables and reaches the network.reaches no network
Keys in the sourceWhether the source holds what looks like an API key or a private key.no keys in the source
LicenceAn open licence (MIT, Apache-2.0, BSD, ISC, Unlicense, 0BSD, CC0) with its text lets modscode show its code; otherwise the code is linked.MIT

This is a reading of the code text, not a security review: it does not run the mod, and it cannot see what a program the mod starts does. The check before installing is yours. How mods are chosen

Install it

Check it yourself before you install it. Mods run unsandboxed, with your permissions, and modscode does not vouch for what this code does. Read the code below (or run claude plugin validate . in its folder), weigh what it reaches, and install the commit you read.

Its repository is its marketplace. Add that marketplace (in the terminal with these commands, or in the desktop app's plugin settings) and install the mod from it:

/plugin marketplace add kikostefanov-lab/claude-code-mods
/plugin install whiteboard@claude-code-mods

This installs the marketplace's latest commit, which may not be the one read here (7b3783a612e8). Compare them before you install.

Ask Claude about it

With the modscode connector added, Claude can read this design, what its code reaches and its code, and build on them. Ask it like this:

Read the modscode design "kikostefanov-lab-whiteboard" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs