modscode JA

modscode / Gallery / roco

roco

Pixel-art mascot that reacts live to what Claude does. Pick one of 8, recolor it or create your own with /roco:crear. Mascota pixel art para Claude Code.

Code you can checkTerminal + desktopPaneBandToastBoxButtonSvgText

What it does

  • Draws a pane, a band above the prompt
  • Adds /roco
  • Watches mcp__roco__guardar_personaje, mcp__roco__ajustar calls and can refuse them
  • Hooks session.start, turn.complete, turn.start, ui.close
  • 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 roco by s4duq (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/s4duq-roco/
// 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: "‹titulo›" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Text, Button } = $.ui.resolve(e)
    const pista = '…'
    const animo = '…'
    const mascotas = '…'
    const tema = '…'
    const color = '…'
    const info = '…'
    const tamano = '…'
    const crear = '…'
    const cerrar = '…'
    return (
      <Box flexDirection="column" gap={1}>
        <Text dimColor wrap="truncate-end">
          {pista}
        </Text>
        <Box flexDirection="column">
          <Text bold>
            {animo}
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1} />
        </Box>
        <Box flexDirection="column">
          <Text bold>
            {mascotas}
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1} />
        </Box>
        <Box flexDirection="column">
          <Text bold>
            {tema}
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1} />
        </Box>
        <Box flexDirection="column">
          <Text bold>
            {color}
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1} />
        </Box>
        <Box flexDirection="column">
          <Text bold>
            {info}
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1} />
        </Box>
        <Box flexDirection="column">
          <Text bold>
            {tamano}
          </Text>
          <Box flexDirection="row" flexWrap="wrap" columnGap={1} />
        </Box>
        <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
          <Button label={`${crear}`} variant="primary" />
          <Button label={`${cerrar}`} role="dismiss" />
        </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, Svg, Text } = $.ui.resolve(e)
    const svg = '…'
    const nombreDisplay = '…'
    const animo = '…'
    const detalle = '…'
    const nombreDisplay2 = '…'
    const animo2 = '…'
    const detalle2 = '…'
    const nombreDisplay3 = '…'
    const animo3 = '…'
    const detalle3 = '…'
    const turnos = '…'
    const turnos2 = '…'
    const ediciones = '…'
    const comandos = '…'
    const errores = '…'
    const turnos3 = '…'
    const turnos4 = '…'
    const ediciones2 = '…'
    const comandos2 = '…'
    const errores2 = '…'
    const turnos5 = '…'
    const turnos6 = '…'
    const ediciones3 = '…'
    const comandos3 = '…'
    const errores3 = '…'
    return (
      <Box flexDirection="column">
        <Box flexDirection="row" alignItems="center" gap={1} width="100%" borderStyle="round">
          <Svg source={`${svg}`} alt={`${nombreDisplay} · ${animo}: ${detalle}`} />
          <Box flexGrow={1} flexShrink={1} minWidth={0}>
            <Box flexDirection="column" justifyContent="center" minWidth={0}>
              <Box flexDirection="row" minWidth={0}>
                <Text bold>
                  <Text>
                    {nombreDisplay}
                    {" ·"}
                  </Text>
                  {" "}
                  {animo}
                </Text>
                <Text dimColor wrap="truncate-end">
                  {" — "}
                  {detalle}
                </Text>
              </Box>
              <Box flexDirection="row" minWidth={0}>
                <Text bold>
                  <Text>
                    {nombreDisplay2}
                    {" ·"}
                  </Text>
                  {" "}
                  {animo2}
                </Text>
                <Text dimColor wrap="truncate-end">
                  {" — "}
                  {detalle2}
                </Text>
              </Box>
              <Box flexDirection="row" minWidth={0}>
                <Text bold>
                  <Text>
                    {nombreDisplay3}
                    {" ·"}
                  </Text>
                  {" "}
                  {animo3}
                </Text>
                <Text dimColor wrap="truncate-end">
                  {" — "}
                  {detalle3}
                </Text>
              </Box>
            </Box>
          </Box>
          <Box flexDirection="column" alignItems="flex-start" justifyContent="center" flexShrink={0}>
            <Text dimColor wrap="truncate-end">
              {"💬 "}
              {turnos}
              {" "}
              {turnos2}
              {" · ✏️ "}
              {ediciones}
              {" · ▶ "}
              {comandos}
              {" · ⚠ "}
              {errores}
            </Text>
            <Text dimColor wrap="truncate-end">
              {"💬 "}
              {turnos3}
              {" "}
              {turnos4}
              {" · ✏️ "}
              {ediciones2}
              {" · ▶ "}
              {comandos2}
              {" · ⚠ "}
              {errores2}
            </Text>
            <Text dimColor wrap="truncate-end">
              {"💬 "}
              {turnos5}
              {" "}
              {turnos6}
              {" · ✏️ "}
              {ediciones3}
              {" · ▶ "}
              {comandos3}
              {" · ⚠ "}
              {errores3}
            </Text>
          </Box>
        </Box>
        {await next(e)}
      </Box>
    )
  })
}

The mod's own code

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

hooks/register.tsx lines 266–292 · Pane
  on('ui.render', { component: 'Pane', requestId: MENU }, async ($, e) => {
    const ui = $.ui.resolve(e)
    const animo = await read($, animoMenu)
    const tarjetas = await cargarGaleria($)
    const actual = { personaje: o.personaje, tema: o.temaId, acento: o.acento, campos: o.campos, estilo: o.estilo, animo }
    return panelMenu(ui, ov, actual, tarjetas, {
      animo: a => void update($, animoMenu, () => a),
      // El panel sigue abierto tras la recarga y se redibuja con lo nuevo.
      guardar: cambios =>
        void (async () => {
          if (!(await guardarEnOrden($, cambios))) $.ui.toast(tx.comando.noGuardado)
        })(),
      // Con el panel abierto (un diálogo) el cuadro no acepta texto: primero se cierra.
      crear: () =>
        void (async () => {
          await $.store.set('menuVisto', true).catch(() => undefined)
          await $.ui.close({ id: MENU }).catch(() => undefined)
          const r = await $.prompt.fill({ text: '/roco:crear ' }).catch(() => ({ isFilled: false }))
          $.ui.toast(r.isFilled ? tx.menu.escribeIdea : tx.menu.escribeComando)
        })(),
      cerrar: () =>
        void (async () => {
          await $.store.set('menuVisto', true).catch(() => undefined)
          await $.ui.close({ id: MENU }).catch(() => undefined)
        })(),
    })
  })
hooks/menu.tsx lines 75–163 · Pane
export function panelMenu(ui: PiezasMenu, o: Opciones, a: Actual, tarjetas: readonly Tarjeta[], hacer: AccionesMenu) {
  const { Box, Text, Button } = ui
  const { tx, tema } = o
  const m = tx.menu

  const seccion = (key: string, titulo: string, hijos: unknown[]) => (
    <Box key={key} flexDirection="column">
      <Text bold>{titulo}</Text>
      <Box flexDirection="row" flexWrap="wrap" columnGap={1}>
        {hijos}
      </Box>
    </Box>
  )

  const animos = ANIMOS.map((an, i) => (
    <Button key={`animo-${an}`} label={tx.animo[an]} hotkey={String(i + 1)} {...marca(an === a.animo)} onPress={() => hacer.animo(an)} />
  ))

  const galeria = tarjetas.map(t => (
    <Box key={`tarjeta-${t.id}`} flexDirection="column" alignItems="center" width={18}>
      {figura(ui, t, a.animo, `${t.nombre} · ${tx.animo[a.animo]}`)}
      <Text bold wrap="truncate-end">
        {t.nombre}
      </Text>
      {t.id === a.personaje ? (
        <Text color={tema.acento}>✓ {m.actual}</Text>
      ) : (
        <Button key={`elegir-${t.id}`} label={m.elegir} onPress={() => hacer.guardar([['roco.personaje', t.id]])} />
      )}
    </Box>
  ))

  // Un tema trae su color: si había un color propio, se quita después de guardar el tema.
  const temas = TEMAS_VALIDOS.map(t => (
    <Button
      key={`tema-${t}`}
      label={t}
      {...marca(t === a.tema)}
      onPress={() => hacer.guardar(a.acento ? [['roco.tema', t], ['roco.acento', '']] : [['roco.tema', t]])}
    />
  ))

  const colores = [
    ...COLORES.map(c => (
      <Box key={`color-${c.id}`} flexDirection="row">
        <Text color={c.hex}>● </Text>
        <Button key={`boton-${c.id}`} label={m.colores[c.id] ?? c.id} {...marca(c.hex === a.acento)} onPress={() => hacer.guardar([['roco.acento', c.hex]])} />
      </Box>
    )),
    <Button key="color-tema" label={m.colorTema} {...marca(!a.acento)} onPress={() => hacer.guardar([['roco.acento', '']])} />,
  ]

  const campos = CAMPOS_MENU.map(c => {
    const prendido = a.campos.includes(c)
    const nuevos = alternarCampo(a.campos, c).join(',')
    return (
      <Button
        key={`campo-${c}`}
        label={`${prendido ? '✓' : '·'} ${m.campos[c] ?? c}`}
        {...(prendido ? {} : { dimColor: true })}
        onPress={() => {
          if (nuevos !== a.campos.join(',')) hacer.guardar([['roco.campos', nuevos]])
        }}
      />
    )
  })

  const estilos = ESTILOS.map(s => (
    <Button key={`estilo-${s}`} label={m.estilos[s]} {...marca(s === a.estilo)} onPress={() => hacer.guardar([['roco.estilo', s]])} />
  ))

  return (
    <Box flexDirection="column" gap={1}>
      <Text dimColor wrap="truncate-end">
        {m.pista}
      </Text>
      {seccion('animos', m.animo, animos)}
      {seccion('galeria', m.mascotas, galeria)}
      {seccion('temas', m.tema, temas)}
      {seccion('colores', m.color, colores)}
      {seccion('campos', m.info, campos)}
      {seccion('estilos', m.tamano, estilos)}
      <Box flexDirection="row" flexWrap="wrap" columnGap={2}>
        <Button key="crear" label={m.crear} variant="primary" onPress={hacer.crear} />
        <Button key="cerrar" label={m.cerrar} role="dismiss" onPress={hacer.cerrar} />
      </Box>
    </Box>
  )
}
hooks/register.tsx lines 384–405 · Band
  on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
    if (e.props.hasSurvey || (await read($, oculto))) {
      return next(e)
    }

    const l: Lectura = {
      ahora: await read($, estado),
      hechas: await read($, acciones),
      medido: await read($, uso),
      c: await read($, cuenta),
      g: await read($, git),
      ahoraMs: await read($, minuto),
    }
    const estilo = estiloEfectivo(o.estilo, (e.props as unknown as Record<string, unknown>).bodyColumns)

    if (e.surface === 'terminal') {
      // `cuadro` cambia cada 600 ms: solo se lee (y suscribe) donde se dibuja el ASCII; el personaje propio va fijo.
      const n = estilo === 'minimo' || dibujo ? 0 : await read($, cuadro)
      return franjaTerminal($.ui.resolve(e), ov, l, estilo, n, dibujo)
    }
    return franjaGrafica($.ui.resolve(e), ov, l, estilo, dibujo)
  })
hooks/vista.tsx lines 136–247 · Band
export function franjaGrafica(ui: PiezasSvg, o: Opciones, l: Lectura, estilo: Estilo, d: Dibujo | null = null) {
  const { Box, Text, Svg } = ui
  const { tx, tema, camposDer } = o
  const nombreDisplay = o.nombre
  const { ahora, medido, c, ahoraMs } = l
  const aviso = avisoDe(medido, c, o.avisos, tx)
  const lineas = columnaIzquierda(ui, o, l)
  // Roco o el personaje propio, al alto pedido. El nombre va solo en `alt`, nunca dentro del SVG.
  const dibujar = (alto: number) => {
    const m = medidaSvg(d ? d.caja : null, alto)
    return (
      <Svg
        source={d ? d.svg[ahora.animo] : svg(ahora.animo)}
        alt={`${nombreDisplay} · ${tx.animo[ahora.animo]}: ${ahora.detalle}`}
        width={m.width}
        height={m.height}
      />
    )
  }

  if (estilo === 'minimo') {
    return (
      <Box flexDirection="row" alignItems="center" gap={1}>
        {dibujar(37)}
        <Text bold>
          <Text color={tema.acento}>{nombreDisplay} ·</Text> {tx.animo[ahora.animo]}
        </Text>
        <Text dimColor wrap="truncate-end">
          {' — '}
          {ahora.detalle}
        </Text>
      </Box>
    )
  }

  if (estilo === 'compacto') {
    const detalleCompacto = `${ahora.detalle} · 5 h ${pct(medido.cinco)} · ${tx.uso.semana} ${pct(medido.semana)}${aviso ? ` · ⚠ ${aviso}` : ''}`
    return (
      <Box flexDirection="row" alignItems="center" gap={1} width="100%">
        {dibujar(44)}
        <Box flexDirection="row" flexGrow={1} flexShrink={1} minWidth={0}>
          <Text bold>
            <Text color={tema.acento}>{nombreDisplay} ·</Text> {tx.animo[ahora.animo]}
          </Text>
          <Text dimColor wrap="truncate-end">
            {' — '}
            {detalleCompacto}
          </Text>
        </Box>
      </Box>
    )
  }

  const elementosDerecha = camposDer
    .map(campo => {
      switch (campo) {
        case 'sesion':
          return (
            <Text key="sesion" dimColor wrap="truncate-end">
              {tx.derecha.sesion(medido.inicio !== undefined && ahoraMs > 0 ? duracion(ahoraMs - medido.inicio, tx) : '–')}
            </Text>
          )
        case 'reinicio':
          return (
            <Text key="reinicio" dimColor wrap="truncate-end">
              {tx.derecha.cuotaCinco(medido.reinicioCinco !== undefined && ahoraMs > 0 ? duracion(medido.reinicioCinco - ahoraMs, tx) : '–')}
            </Text>
          )
        case 'contadores':
          return (
            <Text key="contadores" dimColor wrap="truncate-end">
              💬 {c.turnos} {tx.derecha.turnos} · ✏️ {c.ediciones} · ▶ {c.comandos} · ⚠ {c.errores}
            </Text>
          )
        default:
          return null
      }
    })
    .filter(Boolean)

  // Ancho fijo (peor caso de duraciones y contadores): si cambiara cada minuto, empujaría el texto de la izquierda.
  const anchoDer =
    Math.max(
      tx.derecha.sesion('23 h 59 m').length,
      tx.derecha.cuotaCinco('23 h 59 m').length,
      `💬 999 ${tx.derecha.turnos} · ✏️ 999 · ▶ 999 · ⚠ 999`.length,
    ) + 2
  const derecha =
    elementosDerecha.length > 0 ? (
      <Box flexDirection="column" alignItems="flex-start" justifyContent="center" flexShrink={0} width={anchoDer}>
        {elementosDerecha}
      </Box>
    ) : null

  return (
    <Box
      flexDirection="row"
      alignItems="center"
      gap={1}
      width="100%"
      borderStyle="round"
      borderColor={tema.acento}
    >
      {/* Como imagen (sin isInteractive): fondo transparente; el marco interactivo pinta blanco en modo oscuro. */}
      {dibujar(72)}
      <Box flexGrow={1} flexShrink={1} minWidth={0}>
        {lineas}
      </Box>
      {derecha}
    </Box>
  )
}
hooks/vista.tsx lines 32–91 · Band
function columnaIzquierda(ui: Piezas, o: Opciones, l: Lectura) {
  const { Box, Text } = ui
  const { tx, tema, camposIzq } = o
  const nombreDisplay = o.nombre
  const { ahora, hechas, medido, c, g } = l
  const aviso = avisoDe(medido, c, o.avisos, tx)

  const elementosIzquierda = camposIzq
    .map(campo => {
      switch (campo) {
        case 'estado':
          return (
            <Box key="estado" flexDirection="row" minWidth={0}>
              <Text bold>
                <Text color={tema.acento}>{nombreDisplay} ·</Text> {tx.animo[ahora.animo]}
              </Text>
              <Text dimColor wrap="truncate-end">
                {' — '}
                {ahora.detalle}
              </Text>
            </Box>
          )
        case 'acciones':
          return (
            <Text key="acciones" dimColor wrap="truncate-end">
              {hechas.length > 0 ? hechas.join(' · ') : tx.acciones.sinAcciones}
            </Text>
          )
        case 'uso':
          return aviso ? (
            <Text key="uso" color={tema.aviso} wrap="truncate-end">
              {lineaUso(medido, tx)} · ⚠ {aviso}
            </Text>
          ) : (
            <Text key="uso" dimColor wrap="truncate-end">
              {lineaUso(medido, tx)}
            </Text>
          )
        case 'git': {
          const lg = lineaGit(g, tx)
          return lg ? (
            <Text key="git" dimColor wrap="truncate-end">
              {lg}
            </Text>
          ) : null
        }
        default:
          return null
      }
    })
    .filter(Boolean)

  const lineas = (
    <Box flexDirection="column" justifyContent="center" minWidth={0}>
      {elementosIzquierda}
    </Box>
  )

  return lineas
}
Licence text (MIT)
MIT License

Copyright (c) 2026 s4duq

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

What its code shows

Read from the source at commit 6d4465b6b0cc 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.hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.13 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, the same in both
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.hooks/register.tsx:72 a program named at run time
Reads and sendsWhether it both reads files or environment variables and reaches the network.reads environment variables and files and reaches the 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 s4duq/roco
/plugin install roco@roco

This installs the marketplace's latest commit, which may not be the one read here (6d4465b6b0cc). 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 "s4duq-roco" with its code and make me a pane like it

Search them from Claude: the MCP connector

Similar designs