modscode JA

modscode / Gallery / glossary-browser

glossary-browser

Browse a repository's ubiquitous language (GLOSSARY-MAP.md, each context's GLOSSARY.md, the ADRs) in a band above the prompt and a pane, and steer you and the model away from its Avoid words: a note to the model on prompts, a refusal on Ma…

Code you can checkTerminal + desktopPaneBandToastBoxButtonInputMarkdownText

What it does

  • Draws a band above the prompt, a pane, toasts
  • Adds /glossary
  • Watches tool calls and can refuse them
  • Hooks prompt.submit, session.start

Good points

  • No network calls
  • Starts no processes
  • Written in TypeScript
  • Writes no files

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 glossary-browser by Fabrizio Duroni (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/chicio-glossary-browser/
// 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, Button, Text } = $.ui.resolve(e)
    const map = '…'
    const sum = '…'
    const length = '…'
    const adrs = '…'
    const word = '…'
    const term = '…'
    const index = '…'
    return (
      <Box flexDirection="column">
        <Box gap={1}>
          <Button label="Glossary" hotkey="g" />
          <Text dimColor wrap="truncate">
            {map}
            {" — "}
            {`${sum}${length}`}
            {" terms · "}
            {adrs}
            {" ADRs"}
          </Text>
        </Box>
        <Box gap={1}>
          <Text color="yellow">
            ⚠ Term Check
          </Text>
          <Button label={`'${word}' → ${term}`} hotkey={`${index}`} plain />
          <Button label={`'${word}' → ${term}`} hotkey={`${index}`} plain />
          <Button label={`'${word}' → ${term}`} hotkey={`${index}`} plain />
          <Text dimColor>
            +
            {length}
            {" more"}
          </Text>
          <Button label="clear" hotkey="x" plain dimColor />
        </Box>
        {await next(e)}
      </Box>
    )
  })

  // the pane: open it with $.ui.open({ id: 'my-pane', title: "Glossary Browser" })
  on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
    const { Box, Input, Text, Button, Markdown } = $.ui.resolve(e)
    const filter = '…'
    const text = '…'
    const text2 = '…'
    const text3 = '…'
    const page = '…'
    const pages = '…'
    const value = '…'
    return (
      <Box flexDirection="row" gap={2}>
        <Box flexDirection="column" width={34} flexShrink={0}>
          <Input placeholder="filter terms and ADRs" value={`${filter}`} submitLabel="open" />
          <Text dimColor wrap="truncate">
            {text}
          </Text>
          <Text dimColor wrap="truncate">
            {text2}
          </Text>
          <Text dimColor wrap="truncate">
            {text3}
          </Text>
          <Box gap={1}>
            <Button label="▲ prev" plain />
            <Text dimColor>
              {`${page}1`}
              /
              {pages}
            </Text>
            <Button label="▼ next" plain />
          </Box>
        </Box>
        <Box flexDirection="column" flexGrow={1}>
          <Markdown text={`${value}`} />
        </Box>
      </Box>
    )
  })

  on('session.start', async ($, e, next) => {
    await $.ui.toast(`Glossary Browser: widen the terminal to see it`)
    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.

claude-plugins/glossary-browser/hooks/register.tsx lines 299–349 · Band
    on("ui.render", { component: "AbovePrompt" }, async ($, e, next) => {
        const glossary = await read($, glossaryAtom);
        if (e.props.hasSurvey || glossary === null) {
            return next(e);
        }
        const { Box, Button, Text } = $.ui.resolve(e);
        const flags = await read($, flagsAtom);
        const terms = glossary.contexts.reduce((sum, context) => sum + context.terms.length, 0);
        const adrs = allAdrs(glossary).length;
        const openOn = (flag: Flag) => async () => {
            const index = glossary.contexts.findIndex((context) => context.name === flag.context);
            await select($, termId(index, flag.term));
            await update($, expandedAtom, () => contextId(index));
            await update($, filterAtom, () => "");
            await openPane($);
        };

        return (
            <Box flexDirection="column">
                <Box gap={1}>
                    <Button key="open" label="Glossary" hotkey="g" onPress={() => openPane($)} />
                    <Text dimColor wrap="truncate">
                        {glossary.contexts.map((context) => context.name).join(" · ")} — {terms} terms · {adrs} ADRs
                    </Text>
                </Box>
                {flags.length > 0 && (
                    <Box gap={1}>
                        <Text color="yellow">⚠ Term Check</Text>
                        {flags.slice(0, BAND_FLAGS).map((flag, index) => (
                            <Button
                                key={`flag-${index}`}
                                label={`'${flag.word}' → ${flag.term}`}
                                hotkey={String(index + 1)}
                                plain
                                onPress={openOn(flag)}
                            />
                        ))}
                        {flags.length > BAND_FLAGS && <Text dimColor>+{flags.length - BAND_FLAGS} more</Text>}
                        <Button
                            key="clear"
                            label="clear"
                            hotkey="x"
                            plain
                            dimColor
                            onPress={() => update($, flagsAtom, () => [])}
                        />
                    </Box>
                )}
            </Box>
        );
    });
claude-plugins/glossary-browser/hooks/register.tsx lines 351–440 · Pane
    on("ui.render", { component: "Pane", requestId: PANE }, async ($, e) => {
        const elements = $.ui.resolve(e);
        const { Box, Button, Markdown, Text } = elements;
        const Input = "Input" in elements ? elements.Input : null;
        const glossary = await read($, glossaryAtom);
        if (glossary === null) {
            return <Text dimColor>No GLOSSARY-MAP.md or GLOSSARY.md in this project.</Text>;
        }
        const selected = await read($, selectedAtom);
        const expanded = await read($, expandedAtom);
        const filter = await read($, filterAtom);
        const flags = await read($, flagsAtom);
        const rows = rowsOf(glossary, expanded, filter);
        const room = Math.max(4, (e.viewport?.rows ?? 24) - 4);
        const pages = Math.max(1, Math.ceil(rows.length / room));
        const page = Math.min(await read($, pageAtom), pages - 1);
        const visible = rows.slice(page * room, page * room + room);
        const detail = await detailOf($, glossary, selected);
        const press = (id: string) => async () => {
            if (isGroup(id)) {
                await update($, expandedAtom, (current) => (current === id ? null : id));
                await update($, pageAtom, () => 0);
            }
            await select($, id);
        };
        const flagNote = flags.length > 0 ? `\n\n---\n\n**Term Check**: ${describeFlags(flags)}` : "";

        return (
            <Box flexDirection="row" gap={2}>
                <Box flexDirection="column" width={LIST_WIDTH} flexShrink={0}>
                    {Input !== null && (
                        <Input
                            key="filter"
                            placeholder="filter terms and ADRs"
                            value={filter}
                            submitLabel="open"
                            onInput={(value: string) =>
                                update($, filterAtom, () => value).then(() => update($, pageAtom, () => 0))
                            }
                            onSubmit={(value: string) => {
                                const first = search(glossary, value)[0];
                                return first ? select($, first.id) : undefined;
                            }}
                        />
                    )}
                    {visible.map((row, index) =>
                        row.kind === "label" ? (
                            <Text key={`label-${page}-${index}`} dimColor wrap="truncate">
                                {row.text}
                            </Text>
                        ) : (
                            <Button
                                key={row.id}
                                label={`${row.id === selected ? "›" : " "}${row.text}`}
                                plain
                                dimColor={row.id !== selected}
                                onPress={press(row.id)}
                            />
                        ),
                    )}
                    {pages > 1 && (
                        <Box gap={1}>
                            {page > 0 && (
                                <Button
                                    key="prev"
                                    label="▲ prev"
                                    plain
                                    onPress={() => update($, pageAtom, () => page - 1)}
                                />
                            )}
                            <Text dimColor>
                                {page + 1}/{pages}
                            </Text>
                            {page < pages - 1 && (
                                <Button
                                    key="next"
                                    label="▼ next"
                                    plain
                                    onPress={() => update($, pageAtom, () => page + 1)}
                                />
                            )}
                        </Box>
                    )}
                </Box>
                <Box flexDirection="column" flexGrow={1}>
                    <Markdown key="detail" text={truncate(`${detail}${flagNote}`)} />
                </Box>
            </Box>
        );
    });
Licence text (MIT)
The MIT License (MIT)
Copyright © 2025 <copyright holders>

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

reads filestool calls

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 75eee69c7a6c 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.claude-plugins/glossary-browser/hooks/register.tsx
ParsesEvery file parses as TypeScript or JavaScript.2 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.starts no programs
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 chicio/chicio-labs
/plugin install glossary-browser@chicio-labs

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

Search them from Claude: the MCP connector

Similar designs