helm
The control panel for Claude Code: it sets up each project with the right skills and tools, shows what is in use, and vets new tools before you add them.
何をするか
- プロンプトの上の帯・欄を描く
- /helm を足す
- Skill の呼び出しを見張る
- prompt.submit・session.start・turn.complete・ui.messageにフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- TypeScript で書かれている
- デスクトップ専用の分岐がある
- エラーを扱う
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like helm by rlpb (pane, band), as modscode read it from the mod's code:
// https://modscode.com/gallery/rlpb-helm/
// 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 name = '…'
const active = '…'
const length = '…'
const label = '…'
const clamp = '…'
const label2 = '…'
const label3 = '…'
const t = '…'
const done = '…'
const total = '…'
const litName = '…'
return (
<Box flexDirection="column">
<Box justifyContent="space-between">
<Box columnGap={2}>
<Box columnGap={1}>
<Text bold color="claude">
⎈
</Text>
<Text dimColor>
{`${name} · ${active}/${length}`}
</Text>
</Box>
<Box columnGap={1}>
<Text dimColor>
{label}
</Text>
<Text bold>
{`${clamp}%`}
</Text>
</Box>
<Box columnGap={1}>
<Text dimColor>
{label2}
</Text>
<Text bold>
{`${clamp}%`}
</Text>
</Box>
<Box columnGap={1}>
<Text dimColor>
{label3}
</Text>
<Text bold>
{`${clamp}%`}
</Text>
</Box>
<Box>
<Text>
●
</Text>
<Button label={`${t} ${done}/${total}`} plain />
</Box>
<Text>
{`● ${litName}`}
</Text>
</Box>
<Button label={`${t}`} />
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "Helm" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Client } = $.ui.resolve(e)
const name = '…'
const label = '…'
const topLine = '…'
const text = '…'
const T = '…'
const repo = '…'
const stars = '…'
const description = '…'
const mark = '…'
const license = '…'
const note = '…'
const mark2 = '…'
const label2 = '…'
const mark3 = '…'
const label3 = '…'
const length = '…'
const sev = '…'
const pattern = '…'
const where = '…'
const text2 = '…'
const text3 = '…'
const issueText = '…'
const issueText2 = '…'
const issueText3 = '…'
const text4 = '…'
const ago = '…'
const text5 = '…'
const score = '…'
const map = '…'
const text6 = '…'
const name2 = '…'
const n = '…'
const name3 = '…'
const name4 = '…'
const text7 = '…'
const repo2 = '…'
const repo3 = '…'
const repo4 = '…'
const text8 = '…'
const value = '…'
const total = '…'
const name5 = '…'
const name6 = '…'
const name7 = '…'
const name8 = '…'
const name9 = '…'
const name10 = '…'
const name11 = '…'
const name12 = '…'
const name13 = '…'
return (
<Box flexDirection="column">
<Box flexDirection="column">
<Box justifyContent="space-between">
<Text bold>
{name}
</Text>
<Text dimColor>
head.reading
</Text>
</Box>
<Box marginTop={1} columnGap={1}>
<Button label={`${label}`} variant="primary" />
<Button label={`${label}`} variant="primary" />
</Box>
<Text dimColor>
────────
</Text>
<Box marginTop={1}>
<Text color="error">
{`✗ ${topLine}`}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box flexDirection="column" marginTop={1} borderStyle="round" borderColor="#f2b84b" paddingX={1}>
<Box flexDirection="column">
<Text bold>
{text}
</Text>
<Text dimColor>
find.about
</Text>
<Box flexDirection="column" marginTop={1}>
<Client module="./editor.tsx" width="100%" />
<Box marginTop={1} columnGap={1}>
<Button label={`${T}`} variant="primary" />
<Button label={`${T}`} plain />
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box columnGap={1}>
<Button label={`${repo}`} />
<Text dimColor wrap="truncate-end">
{`${stars}★ ${description}`}
</Text>
</Box>
<Box columnGap={1}>
<Button label={`${repo}`} />
<Text dimColor wrap="truncate-end">
{`${stars}★ ${description}`}
</Text>
</Box>
<Box columnGap={1}>
<Button label={`${repo}`} />
<Text dimColor wrap="truncate-end">
{`${stars}★ ${description}`}
</Text>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text bold>
batch.title
</Text>
<Box flexDirection="column" marginTop={1}>
<Box columnGap={1}>
<Text>
{mark}
</Text>
<Text bold>
{label}
</Text>
<Text dimColor>
{`${license} · ${stars}★`}
</Text>
</Box>
<Text dimColor wrap="truncate-end">
{` ${note}`}
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box columnGap={1}>
<Text>
{mark2}
</Text>
<Text bold>
{label2}
</Text>
<Text dimColor>
{`${license} · ${stars}★`}
</Text>
</Box>
<Text dimColor wrap="truncate-end">
{` ${note}`}
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box columnGap={1}>
<Text>
{mark3}
</Text>
<Text bold>
{label3}
</Text>
<Text dimColor>
{`${license} · ${stars}★`}
</Text>
</Box>
<Text dimColor wrap="truncate-end">
{` ${note}`}
</Text>
</Box>
<Box marginTop={1} columnGap={1}>
<Button label={`${T} · ${length}`} variant="primary" />
<Button label={`${T}`} plain />
</Box>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Box columnGap={1}>
<Text bold>
{repo}
</Text>
<Text dimColor>
{`${license} · ${stars}★`}
</Text>
</Box>
<Text bold>
verdict.ok
</Text>
<Text dimColor>
{`· ${T}`}
</Text>
<Text dimColor>
{`· ${T}`}
</Text>
<Text dimColor>
{`· ${T}`}
</Text>
<Text dimColor wrap="truncate-end">
{` ${sev} · ${pattern} · ${where}`}
</Text>
<Text dimColor wrap="truncate-end">
{` ${sev} · ${pattern} · ${where}`}
</Text>
<Text dimColor wrap="truncate-end">
{` ${sev} · ${pattern} · ${where}`}
</Text>
<Box marginTop={1}>
<Button label={`${T}`} />
</Box>
<Box marginTop={1}>
<Button label={`${T}`} />
</Box>
<Box marginTop={1}>
<Button label={`${T}`} variant="primary" />
</Box>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Box flexDirection="column">
<Box justifyContent="space-between">
<Text bold>
{text2}
</Text>
<Text bold color="success">
{`✓ ${T}`}
</Text>
</Box>
<Box flexDirection="row" flexWrap="wrap" columnGap={1} rowGap={1} marginTop={1}>
<Box flexDirection="column" borderStyle="round" paddingX={1} flexGrow={1}>
<Box flexDirection="column">
<Text bold>
{text3}
</Text>
<Text dimColor>
g.unchecked
</Text>
<Box flexDirection="column" marginTop={1}>
<Text>
{issueText}
</Text>
<Button label={`${T}`} />
<Button label={`${T}`} />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text>
{issueText2}
</Text>
<Button label={`${T}`} />
<Button label={`${T}`} />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text>
{issueText3}
</Text>
<Button label={`${T}`} />
<Button label={`${T}`} />
</Box>
<Text dimColor>
g.more
</Text>
<Box flexGrow={1} />
<Box marginTop={1}>
<Button label={`${T}`} />
</Box>
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" paddingX={1} flexGrow={1}>
<Box flexDirection="column">
<Text bold>
{text4}
</Text>
<Text dimColor>
g.updatesText
</Text>
<Text color="success" bold>
{`✓ ${T}`}
</Text>
<Text color="warning" bold>
{`▲ ${T}`}
</Text>
<Text dimColor>
up.updated
</Text>
<Text dimColor wrap="truncate-end">
{`${name}: ${note}`}
</Text>
<Text dimColor wrap="truncate-end">
{`${name}: ${note}`}
</Text>
<Text dimColor wrap="truncate-end">
{`${name}: ${note}`}
</Text>
<Text dimColor>
up.manual
</Text>
<Text dimColor>
{ago}
</Text>
<Box flexGrow={1} />
<Box marginTop={1}>
<Button label={`${T}`} />
</Box>
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" paddingX={1} flexGrow={1}>
<Box flexDirection="column">
<Text bold>
{text5}
</Text>
<Text dimColor>
sec.missing
</Text>
<Text dimColor>
sec.ready
</Text>
<Text color="suggestion">
sec.running
</Text>
<Text color="success" bold>
{`✓ ${T}`}
</Text>
<Text color="error" bold>
{`▲ ${T}`}
</Text>
<Box flexDirection="column" marginTop={1}>
<Text>
{`${name} · ${score}/100`}
</Text>
<Text dimColor wrap="truncate-end">
{`${pattern} · ${where}`}
</Text>
<Button label={`${T}`} />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text>
{`${name} · ${score}/100`}
</Text>
<Text dimColor wrap="truncate-end">
{`${pattern} · ${where}`}
</Text>
<Button label={`${T}`} />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text>
{`${name} · ${score}/100`}
</Text>
<Text dimColor wrap="truncate-end">
{`${pattern} · ${where}`}
</Text>
<Button label={`${T}`} />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="warning" bold>
{`▲ ${T}`}
</Text>
<Text dimColor wrap="truncate-end">
{map}
</Text>
</Box>
<Box flexGrow={1} />
<Box marginTop={1}>
<Button label={`${T}`} />
</Box>
</Box>
</Box>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" borderColor="#b28cff" paddingX={1}>
<Box flexDirection="column">
<Text bold>
{text6}
</Text>
<Text dimColor>
g.nothingUsed
</Text>
<Box flexDirection="row" flexWrap="wrap" columnGap={3}>
<Box columnGap={1}>
<Text>
●
</Text>
<Text bold>
{name2}
</Text>
<Text dimColor>
{`×${n} · ${ago}`}
</Text>
</Box>
<Box columnGap={1}>
<Text>
●
</Text>
<Text bold>
{name3}
</Text>
<Text dimColor>
{`×${n} · ${ago}`}
</Text>
</Box>
<Box columnGap={1}>
<Text>
●
</Text>
<Text bold>
{name4}
</Text>
<Text dimColor>
{`×${n} · ${ago}`}
</Text>
</Box>
</Box>
<Text dimColor>
g.never
</Text>
<Box flexDirection="column" marginTop={1}>
<Text bold>
{text7}
</Text>
<Box columnGap={1}>
<Text>
{repo2}
</Text>
<Button label={`${T}`} />
</Box>
<Box columnGap={1}>
<Text>
{repo3}
</Text>
<Button label={`${T}`} />
</Box>
<Box columnGap={1}>
<Text>
{repo4}
</Text>
<Button label={`${T}`} />
</Box>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" borderColor="#5aa9ff" paddingX={1}>
<Box flexDirection="column">
<Box justifyContent="space-between">
<Text bold>
{text8}
</Text>
<Button label={`${T}`} plain />
</Box>
<Box flexDirection="column" marginTop={1}>
<Box columnGap={1}>
<Text>
●
</Text>
<Button label={`▾ ${T}`} plain />
<Text dimColor>
{`${value}/${total}`}
</Text>
</Box>
<Box flexDirection="column" paddingLeft={3}>
<Box flexDirection="row" flexWrap="wrap" columnGap={1}>
<Box columnGap={0}>
<Text color="inactive">
●
</Text>
<Button label={`▸ ${name}`} plain />
</Box>
<Box columnGap={0}>
<Text color="inactive">
●
</Text>
<Button label={`▸ ${name}`} plain />
</Box>
<Box columnGap={0}>
<Text color="inactive">
●
</Text>
<Button label={`▸ ${name}`} plain />
</Box>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Text bold>
{name5}
</Text>
<Text dimColor>
{`${T} · ${T} · ${T} · ${T}`}
</Text>
<Text>
—
</Text>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Text bold>
{name6}
</Text>
<Text dimColor>
{`${T} · ${T} · ${T} · ${T}`}
</Text>
<Text>
—
</Text>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Text bold>
{name7}
</Text>
<Text dimColor>
{`${T} · ${T} · ${T} · ${T}`}
</Text>
<Text>
—
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box columnGap={1}>
<Text>
●
</Text>
<Button label={`▾ ${T}`} plain />
<Text dimColor>
{`${value}/${total}`}
</Text>
</Box>
<Box flexDirection="column" paddingLeft={3}>
<Box flexDirection="row" flexWrap="wrap" columnGap={1}>
<Box columnGap={0}>
<Text color="inactive">
●
</Text>
<Button label={`▸ ${name}`} plain />
</Box>
<Box columnGap={0}>
<Text color="inactive">
●
</Text>
<Button label={`▸ ${name}`} plain />
</Box>
<Box columnGap={0}>
<Text color="inactive">
●
</Text>
<Button label={`▸ ${name}`} plain />
</Box>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Text bold>
{name8}
</Text>
<Text dimColor>
{`${T} · ${T} · ${T} · ${T}`}
</Text>
<Text>
—
</Text>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Text bold>
{name9}
</Text>
<Text dimColor>
{`${T} · ${T} · ${T} · ${T}`}
</Text>
<Text>
—
</Text>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Text bold>
{name10}
</Text>
<Text dimColor>
{`${T} · ${T} · ${T} · ${T}`}
</Text>
<Text>
—
</Text>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box columnGap={1}>
<Text>
●
</Text>
<Button label={`▾ ${T}`} plain />
<Text dimColor>
{`${value}/${total}`}
</Text>
</Box>
<Box flexDirection="column" paddingLeft={3}>
<Box flexDirection="row" flexWrap="wrap" columnGap={1}>
<Box columnGap={0}>
<Text color="inactive">
●
</Text>
<Button label={`▸ ${name}`} plain />
</Box>
<Box columnGap={0}>
<Text color="inactive">
●
</Text>
<Button label={`▸ ${name}`} plain />
</Box>
<Box columnGap={0}>
<Text color="inactive">
●
</Text>
<Button label={`▸ ${name}`} plain />
</Box>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Text bold>
{name11}
</Text>
<Text dimColor>
{`${T} · ${T} · ${T} · ${T}`}
</Text>
<Text>
—
</Text>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Text bold>
{name12}
</Text>
<Text dimColor>
{`${T} · ${T} · ${T} · ${T}`}
</Text>
<Text>
—
</Text>
</Box>
<Box flexDirection="column" marginTop={1} borderStyle="round" paddingX={1}>
<Text bold>
{name13}
</Text>
<Text dimColor>
{`${T} · ${T} · ${T} · ${T}`}
</Text>
<Text>
—
</Text>
</Box>
</Box>
</Box>
</Box>
</Box>
</Box>
</Box>
)
})
}
Mod 自身のコード
Mod のライセンス(Apache-2.0)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
hooks/register.tsx 876〜903 行 · バンド
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (e.props.hasSurvey) return next(e)
const ui = $.ui.resolve(e as any) as any
const c = await read($, core)
const now = await $.clock.now()
// The row redraws while a turn runs; each redraw is a chance to refresh the figures (throttled).
if (e.props.isWorking) void refreshUsageSoon($)
const lit = Object.entries(c.used)
.sort((x, y) => y[1] - x[1])
.find(([key, at]) => glow({ [key]: at }, key, now) > 0)
const litEntry = lit ? (c.index ?? []).find(x => x.key === lit[0]) : undefined
const act = {
open: () => void $.ui.open({ id: PANE, title: 'Helm', focus: true, closeOnEscape: true }),
accept: (key: string, scope: 'project' | 'session') => void accept($, key, scope),
dismiss: (key: string) => void dismiss($, key),
start: () => {
void setState($, 'ready')
void $.ui.open({ id: PANE, title: 'Helm', focus: true, closeOnEscape: true })
},
look: () => void lookHere($),
skip: () => void setState($, 'declined'),
security: () => {
void update($, nav, s => ({ ...s, tab: 'global' }))
void $.ui.open({ id: PANE, title: 'Helm', focus: true, closeOnEscape: true })
},
}
return Band({ ui, c, lang: c.lang, act, terminal: e.surface === 'terminal', width: e.props.bodyColumns ?? 100, litName: litEntry?.name, litCat: litEntry?.category })
})src/views/band.tsx 23〜89 行 · バンド
export function Band({ ui, c, lang, act, terminal, width, litName, litCat }: Props) {
const { Box, Button, Text } = ui
const hinted = c.hint ? (c.index ?? []).find(x => x.key === c.hint) : undefined
if (c.project && c.state === 'new') {
// A chat already under way is joined, not set up from zero: Helm reads the folder and proposes tools.
return (
<Box columnGap={1}>
<Text bold color="claude">⎈</Text>
<Text dimColor>{t(lang, c.chat ? 'band.existing' : 'band.new', c.project.name)}</Text>
{c.chat ? (
<Button key="look" label={t(lang, 'band.look')} variant="primary" onPress={act.look} />
) : (
<Button key="open" label={t(lang, 'band.open')} variant="primary" onPress={act.start} />
)}
<Button key="skip" label={t(lang, 'band.skip')} onPress={act.skip} />
</Box>
)
}
if (hinted && c.project) {
return (
<Box columnGap={1}>
<Text bold color="claude">⎈</Text>
<Text dimColor>{t(lang, 'hint.fits', hinted.name)}</Text>
<Button key="hint-session" label={t(lang, 'hint.session')} variant="primary" onPress={() => act.accept(hinted.key, 'session')} />
<Button key="hint-project" label={t(lang, 'hint.project')} onPress={() => act.accept(hinted.key, 'project')} />
<Button key="hint-no" label={t(lang, 'hint.no')} onPress={() => act.dismiss(hinted.key)} />
</Box>
)
}
const index = c.index ?? []
const active = index.filter(x => x.on).length
const u = c.usage
// On a narrow row the least urgent limit gives way.
const meters = [
u?.five != null && { id: 'five', label: t(lang, 'meter.five'), pct: u.five },
u?.week != null && { id: 'week', label: t(lang, 'meter.week'), pct: u.week },
u?.ctx != null && width >= 120 && { id: 'ctx', label: t(lang, 'meter.context'), pct: u.ctx },
].filter(Boolean) as { id: string; label: string; pct: number }[]
// The security dot: green when the last scan was clean, amber for cautions, red for a "do not install", dim when nothing was scanned yet.
const found = flagged(c.scans)
const scanned = Object.keys(c.scans).length > 0
// Green only when every installed tool was scanned and none is flagged or under caution; anything unscanned keeps it amber.
const unscanned = (c.index ?? []).filter(x => !c.scans[x.key]).length
const shield = c.scanning ? 'suggestion' : !scanned ? 'inactive' : found.length > 0 ? 'error' : watched(c.scans) > 0 || unscanned > 0 ? 'warning' : 'success'
const dot = litCat ? `#${(COLOR[litCat] ?? COLOR.other).toString(16).padStart(6, '0')}` : '#6fd08c'
return (
<Box justifyContent="space-between">
<Box columnGap={2}>
<Box columnGap={1}>
<Text bold color="claude">⎈</Text>
<Text dimColor>{c.project ? `${c.project.name} · ${active}/${index.length}` : t(lang, 'head.none')}</Text>
</Box>
{meters.map(m => Meter({ ui, terminal, id: m.id, label: m.label, pct: m.pct }))}
<Box>
<Text color={shield}>●</Text>
<Button key="helm-security" label={c.scanning ? `${t(lang, 'sec.title')} ${c.scanning.done}/${c.scanning.total}` : found.length > 0 ? `${t(lang, 'sec.title')} ${found.length}` : t(lang, 'sec.title')} plain onPress={act.security} />
</Box>
{litName && <Text color={dot}>{`● ${litName}`}</Text>}
</Box>
<Button key="helm-open" label={t(lang, 'band.openHelm')} onPress={act.open} />
</Box>
)
}src/views/meter.tsx 36〜45 行 · バンド
export function Meter({ ui, terminal, id, label, pct }: Props) {
const { Box, Raster, Svg, Text } = ui
return (
<Box key={id} columnGap={1}>
<Text dimColor>{label}</Text>
{terminal ? <Raster key={`m-${label}`} columns={8} rows={1} cells={meterCells(pct, 8)} /> : <Svg source={meterSvg(pct)} alt={`${label} ${clamp(pct)}%`} width={64} height={8} />}
<Text bold>{`${clamp(pct)}%`}</Text>
</Box>
)
}hooks/register.tsx 905〜963 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const ui = $.ui.resolve(e as any) as any
const c = await read($, core)
const n = await read($, nav)
const github = hasGithub(await $.tool.list().catch(() => []))
const terminal = e.surface === 'terminal'
const width = Math.max(40, Math.min(e.props.bodyColumns ?? 80, 100))
const now = await $.clock.now()
const act = {
tab: (tab: Nav['tab']) => void update($, nav, s => ({ ...s, tab })),
fold: (cat: string) => void update($, nav, s => ({ ...s, open: (s.open ?? []).includes(cat) ? s.open.filter(x => x !== cat) : [...(s.open ?? []), cat] })),
foldAll: (cats: string[]) => void update($, nav, s => ({ ...s, open: (s.open ?? []).length > 0 ? [] : cats })),
inspect: (key: string) => void update($, nav, s => ({ ...s, inspect: s.inspect === key ? null : key })),
lang: (pref: string) => void setLang($, pref),
ask: (text: string) => void update($, core, s => ({ ...s, ask: { text, picks: shortlist(s.index ?? [], text) } })),
refine: () => void refine($),
turnOn: () => void turnOnHere($),
undo: () => void undoHere($),
gh: () => void setSetup($, s => ({ ...s, on: !s.on })),
license: () => void setSetup($, s => ({ ...s, license: nextLicense(s.license) })),
item: (id: string) => void setSetup($, toggleItem(id)),
details: (text: string) => void setSetup($, s => ({ ...s, details: text })),
research: (text: string) => void research($, text),
search: () => void research($, draft),
clearDraft: () => {
draft = ''
cleared += 1
void update($, nav, s => ({ ...s }))
},
pickRow: (i: number) => void update($, core, s => ({ ...s, batch: s.batch ? s.batch.map((row, j) => (j === i ? { ...row, pick: !row.pick } : row)) : s.batch })),
installBatch: (scope: 'user' | 'local') => void installBatch($, scope),
clearBatch: () => void update($, core, s => ({ ...s, batch: null, message: null })),
pick: (repo: string) => void pickHit($, repo),
install: (scope: 'user' | 'local') => void install($, scope),
check: () => void runCheckup($),
update: () => void runUpdate($),
fix: (key: string) => void fixIssue($, key),
makeGlobal: (repo: string) => void globalInstall($, repo),
scan: () => void runScan($),
installScanner: () => void installScanner($),
toggle: (key: string) => void toggleTool($, key),
anyway: (scope: 'user' | 'local') => void installAnyway($, scope),
}
try {
isTerminal = terminal
// The module path has to be a literal in this file; surfaces without a `Client` keep the one-line field.
const Client = ui.Client
const editor = Client ? <Client key="research-editor" module="./editor.tsx" width="100%" props={{ placeholder: t(c.lang, 'find.placeholder'), start: draft, reset: cleared }} /> : null
return Panel({ ui, c, n, github, act, terminal, width, now, lang: c.lang, editor })
} catch (err) {
// A panel that cannot draw says why, instead of the engine's empty "nothing to show".
return (
<ui.Box flexDirection="column">
<ui.Text bold color="claude">Helm</ui.Text>
<ui.Text color="error">{`The panel could not be drawn: ${String((err as Error)?.message ?? err).slice(0, 300)}`}</ui.Text>
</ui.Box>
)
}
})src/views/panel.tsx 76〜235 行 · ペイン
export function Panel({ ui, c, n, github, act, terminal, width, now, lang, editor }: Props) {
const { Box, Button, Input, Select, Text } = ui
const T = (key: Key, ...vars: (string | number)[]) => t(lang, key, ...vars)
const index = c.index ?? []
const active = index.filter(x => x.on).length
const here = c.project !== null
const rule = terminal ? <Text dimColor>{'─'.repeat(Math.max(10, width))}</Text> : null
const title = (text: string, color?: string) => (
<Text bold color={color} dimColor={!color}>
{text.toUpperCase()}
</Text>
)
const card = (key: string, children: any, borderColor = 'subtle') => (
<Box key={`card-${key}`} flexDirection="column" marginTop={1} borderStyle="round" borderColor={borderColor} paddingX={1}>
{children}
</Box>
)
const tab = (id: Nav['tab'], label: string) => <Button key={id} label={label} variant={n.tab === id ? 'primary' : 'secondary'} onPress={() => act.tab(id)} />
const topLine = c.scanning ? T('sec.running', c.scanning.done, c.scanning.total) : c.message
const header = (
<Box flexDirection="column">
<Box justifyContent="space-between">
<Text bold>{c.project ? c.project.name : T('head.none')}</Text>
<Text dimColor>{c.index === null ? T('head.reading') : T('head.counts', index.length, active)}</Text>
</Box>
<Box marginTop={1} columnGap={1}>
{tab('project', T('tab.project'))}
{tab('global', T('tab.global'))}
</Box>
{rule}
{topLine && (
<Box marginTop={1}>
<Text color={c.failed ? 'error' : c.busy || c.scanning ? 'suggestion' : 'success'}>{`${c.failed ? '✗ ' : c.busy || c.scanning ? '◌ ' : '✓ '}${topLine}`}</Text>
</Box>
)}
</Box>
)
const footer = (
<Box marginTop={1} flexDirection="column">
<Select
key="lang"
label={`${T('lang.label')} `}
value={c.pref}
options={[{ value: 'auto', label: T('lang.auto') }, ...LANGS.map(l => ({ value: l.code, label: l.name }))]}
onSelect={act.lang}
/>
</Box>
)
// ---- the research box: the same in Discover and in Global ----
const discover = card(
'discover',
<Box flexDirection="column">
{title(T('find.title'), '#f2b84b')}
<Text dimColor>{T('find.about')}</Text>
{editor ? (
<Box flexDirection="column" marginTop={1}>
{editor}
<Box marginTop={1} columnGap={1}>
<Button key="research-go" label={T('find.submit')} variant="primary" onPress={act.search} />
<Button key="research-clear" label={T('batch.clear')} plain onPress={act.clearDraft} />
</Box>
</Box>
) : (
<Input key="research" placeholder={T('find.placeholder')} submitLabel={T('find.submit')} onSubmit={act.research} />
)}
{c.hits && (
<Box flexDirection="column" marginTop={1}>
{c.hits.map(h => (
<Box key={`hit-${h.repo}`} columnGap={1}>
<Button key={`h-${h.repo}`} label={h.repo} onPress={() => act.pick(h.repo)} />
<Text dimColor wrap="truncate-end">{`${h.stars}★ ${h.description}`}</Text>
</Box>
))}
</Box>
)}
{c.batch && (
<Box flexDirection="column" marginTop={1}>
<Text bold>{T('batch.title', c.batch.length)}</Text>
{c.batch.map((row, i) => {
const f = row.found
const level = f?.verdict.level
// Not a skill or a plugin at all is not a danger: it is greyed, not red.
const other = row.state === 'done' && !!f && level === 'no' && f.verdict.reasons.every(r => r.k === 'noform')
const color = row.state === 'installed' || row.state === 'have' ? 'success' : row.state === 'failed' ? 'error' : row.state === 'wait' || row.state === 'check' ? 'suggestion' : row.state === 'missing' || row.state === 'unsupported' || other ? 'inactive' : level ? LEVEL[level] : 'inactive'
const mark = row.state === 'installed' || row.state === 'have' ? '✓' : row.state === 'failed' ? '✗' : row.state === 'wait' || row.state === 'check' ? '◌' : row.state === 'missing' || row.state === 'unsupported' ? '?' : other ? '–' : level === 'ok' ? '●' : level === 'caution' ? '▲' : '✗'
const ready = row.state === 'done' && !!f && level !== 'no'
const note = (() => {
if (row.state === 'wait' || row.state === 'check') return T('batch.checking')
if (row.state === 'have') return T('batch.have')
if (other) return T('why.noform')
if (row.state === 'missing') return T('batch.missing')
if (row.state === 'unsupported') return T('batch.unsupported')
if (row.state === 'installed') return T('batch.installed')
if (row.state === 'failed') return `${T('batch.failed')}${row.why ? `: ${row.why}` : ''}`
return [T(level === 'ok' ? 'verdict.ok' : level === 'caution' ? 'verdict.caution' : 'verdict.no'), ...(f?.verdict.reasons ?? []).map(r => T(WHY[r.k], r.n ?? 0)), ...(row.via ? [T('batch.matched', row.via)] : [])].join(' · ')
})()
return (
<Box key={`b-${i}`} flexDirection="column" marginTop={1}>
<Box columnGap={1}>
{ready ? <Button key={`b-pick-${i}`} label={row.pick ? '☑' : '☐'} plain onPress={() => act.pickRow(i)} /> : <Text color={color}>{mark}</Text>}
<Text bold>{f?.meta.repo ?? row.label}</Text>
{f && <Text dimColor>{`${f.meta.license ?? '—'} · ${f.meta.stars}★`}</Text>}
</Box>
<Text color={color} dimColor wrap="truncate-end">{` ${note}`}</Text>
</Box>
)
})}
<Box marginTop={1} columnGap={1}>
{c.batch.some(row => row.pick && row.state === 'done') && (
<Button
key="b-install"
label={`${here && n.tab === 'project' ? T('install.here') : T('install.all')} · ${c.batch.filter(row => row.pick && row.state === 'done').length}`}
variant="primary"
onPress={() => act.installBatch(here && n.tab === 'project' ? 'local' : 'user')}
/>
)}
<Button key="b-clear" label={T('batch.clear')} plain onPress={act.clearBatch} />
</Box>
</Box>
)}
{c.found && (
<Box flexDirection="column" marginTop={1} borderStyle="round" borderColor={LEVEL[c.found.verdict.level]} paddingX={1}>
<Box columnGap={1}>
<Text bold>{c.found.meta.repo}</Text>
<Text dimColor>{`${c.found.meta.license ?? '—'} · ${c.found.meta.stars}★`}</Text>
</Box>
<Text color={LEVEL[c.found.verdict.level]} bold>
{T(c.found.verdict.level === 'ok' ? 'verdict.ok' : c.found.verdict.level === 'caution' ? 'verdict.caution' : 'verdict.no')}
</Text>
{c.found.verdict.reasons.map(r => (
<Text key={r.k} dimColor>{`· ${T(WHY[r.k], r.n ?? 0)}`}</Text>
))}
{(c.found.scan?.top ?? []).map(f => (
<Text key={`${f.pattern}${f.where}`} dimColor wrap="truncate-end">
{` ${f.sev.toLowerCase()} · ${f.pattern} · ${f.where}`}
</Text>
))}
{c.scanner.state === 'missing' && (
<Box marginTop={1}>
<Button key="scanner-install-found" label={T('sec.install')} onPress={act.installScanner} />
</Box>
)}
{isOverridable(c.found) && (
<Box marginTop={1}>
<Button key="anyway" label={c.anyway === c.found.meta.repo ? T('sec.anywayAgain') : T('sec.anyway')} onPress={() => act.anyway(here && n.tab === 'project' ? 'local' : 'user')} />
</Box>
)}
{c.found.verdict.level !== 'no' && (
<Box marginTop={1}>
<Button key="install" label={here && n.tab === 'project' ? T('install.here') : T('install.all')} variant="primary" onPress={() => act.install(here && n.tab === 'project' ? 'local' : 'user')} />
</Box>
)}
</Box>
)}
</Box>,
'#f2b84b',ライセンスの全文(Apache-2.0)
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2026 rlpb
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
コードが呼ぶもの
プログラム起動ファイル書き込み環境変数Claude を動かすツール呼び出し保存
コードから読み取ったデザイン
読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。
コードから読めること
2026-10-06 に読んだコミット 22cf85002765 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。34 ファイルを解析 |
| コードが 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 のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。hooks/register.tsx:370 実行時に決まるプログラム; hooks/register.tsx:543 実行時に決まるプログラム; hooks/register.tsx:569 実行時に決まるプログラム; hooks/register.tsx:609 実行時に決まるプログラム; hooks/register.tsx:616 実行時に決まるプログラム |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。reads environment variables and files and reaches the network |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。Apache-2.0 |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add rlpb/helm/plugin install helm@helm入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(22cf85002765)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「rlpb-helm」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…Historyf ◂ expand⚙ settingsFix loginbuildRemindAuto Remind ConcisebuildRemindAuto Remind ConcisebuildRemindAuto Remind Concise$1.24 this session · auto-compact at 3wrap-up 5h Remind · 7d Remind · /compact Learningwrap-up in 2h 10m CancelFix loginauto 2h 10m ■ Stop stotal 2h 10m · think 2h 10m0 · write 2h 10m0 · tools 2h 10m03 out · 12.4 tok/s◌ build 2h 10m◌ build 2h 10m◌ build 2h 10mFix login● 2h 10m · think 2h 10m · Explanatory tok/s · 3 tools · stopped● 2h 10m · think 2h 10m · Explanatory tok/s · 3 tools · stopped● 2h 10m · think 2h 10m · Explanatory tok/s · 3 tools · stoppedFix loginbuild 3 · Remind%build 3 · Remind%build 3 · Remind%
-
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 に頼む…Mod controlsLive Claude ModCount: 0 / Initial / oneAdd oneName InitialOne**Markdown** with a [link](https://example.com)
const count = 1;
./counter.tsxFill composerAppend noteSuggest draftCopy text -
Claude に頼む…蹦一蹦Claude needs youBack to ClaudeClick, hold SpaceContextShortcutShortcutShortcutSlow network, still loading…3 Skills33 Skills33 Skills3SkillsLeave leaderboardok. Showing the last resultsRetry3♪
-
Claude に頼む…────────Clear doneClaude⋯└─ buildCancelCancelCancel└─ buildCancelCancelCancel└─ buildCancelCancelCancel
-
何をするか
- 欄・プロンプトの上の帯を描く
- /lingo を足す
- prompt.edit・prompt.submit・session.startにフックする
- ターンをまたいで自分の状態を持つ