plan-progress
Live plan progress bars with stages, steps, step times and soft sounds for decision, error and done. Local fork of zycck/claude-mods plan-progress 0.3.0 (ea2c96b) that sends its rules with the first prompt instead of prompt.compose and sen…
何をするか
- プロンプトの上の帯・欄・トーストを描く
- /progress・/progress-demo・/progress-clear・/progress-sounds を足す
- AskUserQuestion・ExitPlanMode の呼び出しを見張る(止めることがある)
- agent.spawn・prompt.submit・session.attach・session.compact ほか 6 個にフックする
- プロセスを起こす
良いところ
- ネットワークに出ない
- TypeScript で書かれている
- デスクトップ専用の分岐がある
- ファイルを書かない
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like plan-progress by Kirill Serditov (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/bqnhat-plan-progress/
// 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 STATE_GLYPH = '…'
const title = '…'
const bar = '…'
const bar2 = '…'
const stageName = '…'
const step = '…'
const stageSize = '…'
const pct = '…'
const STATE_GLYPH2 = '…'
const title2 = '…'
const bar3 = '…'
const bar4 = '…'
const STATE_GLYPH3 = '…'
const title3 = '…'
const bar5 = '…'
const bar6 = '…'
return (
<Box flexDirection="column" gap={1}>
<Box flexDirection="row" alignItems="center" gap={1}>
<Text>
{STATE_GLYPH}
</Text>
<Text wrap="truncate">
{title}
</Text>
<Button plain dimColor label="▴" />
<Box flexGrow={1} />
<Text>
<Text>
{bar}
</Text>
<Text dimColor>
{bar2}
</Text>
<Text>
{` ${stageName} ${step}/${stageSize}`}
</Text>
</Text>
<Text dimColor>
{`${pct}%`}
</Text>
<Button plain dimColor label="✕" />
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Text>
{STATE_GLYPH2}
</Text>
<Text wrap="truncate">
{title2}
</Text>
<Button plain dimColor label="▴" />
<Box flexGrow={1} />
<Text>
<Text>
{bar3}
</Text>
<Text dimColor>
{bar4}
</Text>
<Text>
{` ${stageName} ${step}/${stageSize}`}
</Text>
</Text>
<Text dimColor>
{`${pct}%`}
</Text>
<Button plain dimColor label="✕" />
</Box>
<Box flexDirection="row" alignItems="center" gap={1}>
<Text>
{STATE_GLYPH3}
</Text>
<Text wrap="truncate">
{title3}
</Text>
<Button plain dimColor label="▴" />
<Box flexGrow={1} />
<Text>
<Text>
{bar5}
</Text>
<Text dimColor>
{bar6}
</Text>
<Text>
{` ${stageName} ${step}/${stageSize}`}
</Text>
</Text>
<Text dimColor>
{`${pct}%`}
</Text>
<Button plain dimColor label="✕" />
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "Progress" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Svg } = $.ui.resolve(e)
const length = '…'
const STATE_GLYPH = '…'
const title = '…'
const overview = '…'
const part = '…'
const part2 = '…'
const part3 = '…'
const clockTime = '…'
const took = '…'
const note = '…'
const stepsSvg = '…'
const pos = '…'
const total = '…'
const name = '…'
const finished = '…'
const stageTime = '…'
const title2 = '…'
const title3 = '…'
const took2 = '…'
const title4 = '…'
const took3 = '…'
const title5 = '…'
const took4 = '…'
const title6 = '…'
const took5 = '…'
const title7 = '…'
const took6 = '…'
const title8 = '…'
const took7 = '…'
const title9 = '…'
const took8 = '…'
const title10 = '…'
const took9 = '…'
const title11 = '…'
const took10 = '…'
const title12 = '…'
const took11 = '…'
const title13 = '…'
const took12 = '…'
const name2 = '…'
const title14 = '…'
const took13 = '…'
const title15 = '…'
const took14 = '…'
const title16 = '…'
const took15 = '…'
const title17 = '…'
const took16 = '…'
const title18 = '…'
const took17 = '…'
const title19 = '…'
const took18 = '…'
const title20 = '…'
const took19 = '…'
const title21 = '…'
const took20 = '…'
const title22 = '…'
const took21 = '…'
const title23 = '…'
const took22 = '…'
const title24 = '…'
const took23 = '…'
const title25 = '…'
const took24 = '…'
const name3 = '…'
const title26 = '…'
const took25 = '…'
const title27 = '…'
const took26 = '…'
const title28 = '…'
const took27 = '…'
const title29 = '…'
const took28 = '…'
const title30 = '…'
const took29 = '…'
const title31 = '…'
const took30 = '…'
const title32 = '…'
const took31 = '…'
const title33 = '…'
const took32 = '…'
const title34 = '…'
const took33 = '…'
const title35 = '…'
const took34 = '…'
const title36 = '…'
const took35 = '…'
const title37 = '…'
const took36 = '…'
const agentCounts = '…'
const AGENT_GLYPH = '…'
const title38 = '…'
const tool = '…'
const elapsed = '…'
const AGENT_GLYPH2 = '…'
const title39 = '…'
const tool2 = '…'
const elapsed2 = '…'
const AGENT_GLYPH3 = '…'
const title40 = '…'
const tool3 = '…'
const elapsed3 = '…'
const STATE_GLYPH2 = '…'
const title41 = '…'
const overview2 = '…'
const part4 = '…'
const part5 = '…'
const part6 = '…'
const note2 = '…'
const name4 = '…'
const title42 = '…'
const took37 = '…'
const title43 = '…'
const took38 = '…'
const title44 = '…'
const took39 = '…'
const title45 = '…'
const took40 = '…'
const title46 = '…'
const took41 = '…'
const title47 = '…'
const took42 = '…'
const title48 = '…'
const took43 = '…'
const title49 = '…'
const took44 = '…'
const title50 = '…'
const took45 = '…'
return (
<Box flexDirection="column">
<Box flexDirection="row" alignItems="center" paddingX={1} marginTop="0">
<Text bold dimColor>
{`Active · ${length}`}
</Text>
<Box flexGrow={1} />
</Box>
<Box position="relative" flexDirection="row" alignItems="center" gap={1} paddingX={1} minWidth={0}>
<Text>
{STATE_GLYPH}
</Text>
<Box flexDirection="column" flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title}
</Text>
<Text wrap="truncate">
{overview}
</Text>
</Box>
<Box flexDirection="column" alignItems="flex-end">
<Text dimColor>
{part}
</Text>
<Text dimColor>
{part2}
</Text>
<Text dimColor>
{part3}
</Text>
</Box>
<Text dimColor>
⌄
</Text>
<Box position="absolute" top={0} bottom={0} left={0} right={0} flexDirection="row" alignItems="stretch">
<Button plain label=" " />
</Box>
</Box>
<Box flexDirection="column" marginLeft={5} marginRight={1} marginBottom={1} minWidth={0}>
<Text dimColor>
{`${clockTime} → now · ${took}`}
</Text>
<Box paddingX={1} marginTop={1}>
<Text wrap="wrap">
{note}
</Text>
</Box>
<Box marginTop={1}>
<Svg source={`${stepsSvg}`} alt={`${title}: ${pos}/${total} steps`} height={4} />
</Box>
<Box flexDirection="row" marginTop={1} minWidth={0}>
<Box flexGrow={1} minWidth={0}>
<Text bold dimColor wrap="truncate">
{name}
</Text>
</Box>
<Text dimColor>
{`${finished}/${length} · ${stageTime}`}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title2}
</Text>
</Box>
<Text dimColor>
{took}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title3}
</Text>
</Box>
<Text dimColor>
{took2}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title4}
</Text>
</Box>
<Text dimColor>
{took3}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title5}
</Text>
</Box>
<Text dimColor>
{took4}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title6}
</Text>
</Box>
<Text dimColor>
{took5}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title7}
</Text>
</Box>
<Text dimColor>
{took6}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title8}
</Text>
</Box>
<Text dimColor>
{took7}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title9}
</Text>
</Box>
<Text dimColor>
{took8}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title10}
</Text>
</Box>
<Text dimColor>
{took9}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title11}
</Text>
</Box>
<Text dimColor>
{took10}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title12}
</Text>
</Box>
<Text dimColor>
{took11}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title13}
</Text>
</Box>
<Text dimColor>
{took12}
</Text>
</Box>
<Box flexDirection="row" marginTop={1} minWidth={0}>
<Box flexGrow={1} minWidth={0}>
<Text bold dimColor wrap="truncate">
{name2}
</Text>
</Box>
<Text dimColor>
{`${finished}/${length} · ${stageTime}`}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title14}
</Text>
</Box>
<Text dimColor>
{took13}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title15}
</Text>
</Box>
<Text dimColor>
{took14}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title16}
</Text>
</Box>
<Text dimColor>
{took15}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title17}
</Text>
</Box>
<Text dimColor>
{took16}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title18}
</Text>
</Box>
<Text dimColor>
{took17}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title19}
</Text>
</Box>
<Text dimColor>
{took18}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title20}
</Text>
</Box>
<Text dimColor>
{took19}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title21}
</Text>
</Box>
<Text dimColor>
{took20}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title22}
</Text>
</Box>
<Text dimColor>
{took21}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title23}
</Text>
</Box>
<Text dimColor>
{took22}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title24}
</Text>
</Box>
<Text dimColor>
{took23}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title25}
</Text>
</Box>
<Text dimColor>
{took24}
</Text>
</Box>
<Box flexDirection="row" marginTop={1} minWidth={0}>
<Box flexGrow={1} minWidth={0}>
<Text bold dimColor wrap="truncate">
{name3}
</Text>
</Box>
<Text dimColor>
{`${finished}/${length} · ${stageTime}`}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title26}
</Text>
</Box>
<Text dimColor>
{took25}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title27}
</Text>
</Box>
<Text dimColor>
{took26}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title28}
</Text>
</Box>
<Text dimColor>
{took27}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title29}
</Text>
</Box>
<Text dimColor>
{took28}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title30}
</Text>
</Box>
<Text dimColor>
{took29}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title31}
</Text>
</Box>
<Text dimColor>
{took30}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title32}
</Text>
</Box>
<Text dimColor>
{took31}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title33}
</Text>
</Box>
<Text dimColor>
{took32}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title34}
</Text>
</Box>
<Text dimColor>
{took33}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title35}
</Text>
</Box>
<Text dimColor>
{took34}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title36}
</Text>
</Box>
<Text dimColor>
{took35}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title37}
</Text>
</Box>
<Text dimColor>
{took36}
</Text>
</Box>
<Box flexDirection="row" alignItems="center" paddingX={1} marginTop="1">
<Text bold dimColor>
Agents
</Text>
<Box flexGrow={1} />
<Text dimColor>
{agentCounts}
</Text>
</Box>
<Box flexDirection="row" gap={1} paddingX={1} minWidth={0}>
<Text>
{AGENT_GLYPH}
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title38}
</Text>
</Box>
<Text dimColor>
{tool}
</Text>
<Text dimColor>
{elapsed}
</Text>
</Box>
<Box flexDirection="row" gap={1} paddingX={1} minWidth={0}>
<Text>
{AGENT_GLYPH2}
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title39}
</Text>
</Box>
<Text dimColor>
{tool2}
</Text>
<Text dimColor>
{elapsed2}
</Text>
</Box>
<Box flexDirection="row" gap={1} paddingX={1} minWidth={0}>
<Text>
{AGENT_GLYPH3}
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title40}
</Text>
</Box>
<Text dimColor>
{tool3}
</Text>
<Text dimColor>
{elapsed3}
</Text>
</Box>
<Box flexDirection="row" marginTop={1}>
<Box flexGrow={1} />
<Button plain dimColor label="Show again" />
</Box>
</Box>
<Box position="relative" flexDirection="row" alignItems="center" gap={1} paddingX={1} minWidth={0}>
<Text>
{STATE_GLYPH2}
</Text>
<Box flexDirection="column" flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title41}
</Text>
<Text wrap="truncate">
{overview2}
</Text>
</Box>
<Box flexDirection="column" alignItems="flex-end">
<Text dimColor>
{part4}
</Text>
<Text dimColor>
{part5}
</Text>
<Text dimColor>
{part6}
</Text>
</Box>
<Text dimColor>
⌄
</Text>
<Box position="absolute" top={0} bottom={0} left={0} right={0} flexDirection="row" alignItems="stretch">
<Button plain label=" " />
</Box>
</Box>
<Box flexDirection="column" marginLeft={5} marginRight={1} marginBottom={1} minWidth={0}>
<Text dimColor>
{`${clockTime} → now · ${took}`}
</Text>
<Box paddingX={1} marginTop={1}>
<Text wrap="wrap">
{note2}
</Text>
</Box>
<Box marginTop={1}>
<Svg source={`${stepsSvg}`} alt={`${title}: ${pos}/${total} steps`} height={4} />
</Box>
<Box flexDirection="row" marginTop={1} minWidth={0}>
<Box flexGrow={1} minWidth={0}>
<Text bold dimColor wrap="truncate">
{name4}
</Text>
</Box>
<Text dimColor>
{`${finished}/${length} · ${stageTime}`}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title42}
</Text>
</Box>
<Text dimColor>
{took37}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title43}
</Text>
</Box>
<Text dimColor>
{took38}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title44}
</Text>
</Box>
<Text dimColor>
{took39}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title45}
</Text>
</Box>
<Text dimColor>
{took40}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title46}
</Text>
</Box>
<Text dimColor>
{took41}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title47}
</Text>
</Box>
<Text dimColor>
{took42}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title48}
</Text>
</Box>
<Text dimColor>
{took43}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title49}
</Text>
</Box>
<Text dimColor>
{took44}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate">
{title50}
</Text>
</Box>
<Text dimColor>
{took45}
</Text>
</Box>
<Box flexDirection="row" gap={1} minWidth={0}>
<Text dimColor>
○
</Text>
<Box flexGrow={1} minWidth={0}>
<Text wrap="truncate" />
</Box>
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
await $.ui.toast(`plan-progress is on. A bar appears when Claude starts a task with several steps.`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
plugins/plan-progress/hooks/register.tsx 997〜1035 行 · バンド
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
if (e.surface === 'desktop' && (await read($, paneState)) !== 'unplaced') return next(e)
const shown = (await read($, plans)).filter(isDrawn).slice(-MAX_BARS)
if (shown.length === 0 || e.props.hasSurvey || !(await read($, isOpen))) return next(e)
const { Box, Button, Text } = $.ui.resolve(e)
const isWide = await read($, isExpanded)
const focus = focusBar(shown)
const list = isWide || !focus ? shown : [focus]
return (
<Box flexDirection="column" gap={1}>
{list.map((p, i) => {
const w = where(p)
const pct = percent(p, w)
const color = STATE_COLOR[p.state]
const stageName = p.stages[w.stage]?.name ?? ''
const bar = `${'━'.repeat(Math.round(pct / 4))}${'─'.repeat(25 - Math.round(pct / 4))}`
return (
<Box key={`bar-${p.id}`} flexDirection="row" alignItems="center" gap={1}>
<Text color={color}>{STATE_GLYPH[p.state]}</Text>
<Text wrap="truncate">{p.title}</Text>
{i === 0 && shown.length > 1
? [<Button key="progress-expand" plain dimColor label={isWide ? '▴' : `+${shown.length - 1}`} onPress={() => update($, isExpanded, wide => !wide)} />]
: []}
<Box flexGrow={1} />
<Text>
<Text color={color}>{bar.replace(/─/g, '')}</Text>
<Text dimColor>{bar.replace(/━/g, '')}</Text>
<Text color={color}>{` ${stageName} ${w.step}/${w.stageSize}`}</Text>
</Text>
<Text dimColor>{`${String(pct).padStart(3, FIGURE_SPACE)}%`}</Text>
<Button key={`close-${p.id}`} plain dimColor label="✕" onPress={() => hidePlan($, p.id)} />
</Box>
)
})}
</Box>
)
})plugins/plan-progress/hooks/register.tsx 1037〜1196 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const t = $.ui.resolve(e)
const { Box, Button, Text } = t
const Svg = e.surface === 'desktop' && 'Svg' in t ? t.Svg : null
await read($, tick)
const now = await $.clock.now()
const kept = await read($, plans)
const all = kept.filter(p => !p.hidden)
const opened = await read($, expandedIds)
const isOlderShown = await read($, isHistoryOpen)
if (kept.length === 0) return <Text dimColor>No progress bars.</Text>
const isDesktop = e.surface === 'desktop'
const columns = e.props.bodyColumns || 40
const detailWidth = Math.min(1400, Math.max(120, (columns - DETAIL_INDENT - 2) * 7))
const byRecent = (a: Plan, b: Plan) => touchedAt(b) - touchedAt(a)
const live = all.filter(p => p.state !== 'done').sort(byRecent)
const done = all.filter(p => p.state === 'done').sort(byRecent)
const older = [...done.slice(RECENT_DONE), ...kept.filter(p => p.hidden)].sort(byRecent)
const rowFill = ROW_FILL_CHAR.repeat(Math.max(1, Math.floor(columns * ROW_FILL_PER_COLUMN)))
const heading = (key: string, text: string, top: number, extra: RenderElement[] = []) => (
<Box key={key} flexDirection="row" alignItems="center" paddingX={1} marginTop={top}>
<Text bold dimColor>
{text}
</Text>
<Box flexGrow={1} />
{extra}
</Box>
)
const stepRow = (item: Timed, key: string, depth: number, tint: string, times: Times) => {
const isLive = item.status === 'active' || item.status === 'error'
const took = times.items.get(item) ?? ''
const glyph = item.status === 'pending' ? <Text dimColor>{STEP_GLYPH.pending}</Text> : <Text color={stepColor(item.status, tint)}>{STEP_GLYPH[item.status]}</Text>
return (
<Box key={key} flexDirection="row" gap={1} marginLeft={depth * 2} minWidth={0}>
{glyph}
<Box flexGrow={1} minWidth={0}>
<Text bold={isLive} dimColor={!isLive} wrap="truncate">
{item.title}
</Text>
</Box>
{took ? [<Text key={`${key}-time`} dimColor>{took}</Text>] : []}
</Box>
)
}
const agentRows = (p: Plan) => {
const agents = p.agents ?? []
if (agents.length === 0) return []
return [
heading(`agents-${p.id}`, 'Agents', 1, [<Text key={`agents-${p.id}-count`} dimColor>{agentCounts(agents)}</Text>]),
...agents.map(a => (
<Box key={`agent-${p.id}-${a.id}`} flexDirection="row" gap={1} paddingX={1} marginLeft={a.depth * 2} minWidth={0}>
<Text color={AGENT_COLOR[a.state]}>{AGENT_GLYPH[a.state]}</Text>
<Box flexGrow={1} minWidth={0}>
<Text dimColor={a.state === 'done'} wrap="truncate">
{a.title}
</Text>
</Box>
<Text dimColor>{a.tool}</Text>
<Text dimColor>{elapsed((a.endedAt ?? now) - a.startedAt)}</Text>
</Box>
)),
]
}
const detail = (p: Plan) => {
const w = where(p)
const color = STATE_COLOR[p.state]
const times = timesOf(p, now)
const took = span(endOf(p, now) - p.startedAt)
const isSingle = p.stages.length === 1
return (
<Box key={`detail-${p.id}`} flexDirection="column" marginLeft={DETAIL_INDENT} marginRight={1} marginBottom={1} minWidth={0}>
<Text dimColor>{`${clockTime(p.startedAt)} → ${p.state === 'done' ? clockTime(touchedAt(p)) : 'now'}${took ? ` · ${took}` : ''}`}</Text>
{p.note
? [
<Box key={`note-${p.id}`} paddingX={1} marginTop={1} backgroundColor={`${color}26`}>
<Text color={color} wrap="wrap">
{p.note}
</Text>
</Box>,
]
: []}
{Svg && p.id !== AGENTS
? [
<Box key={`steps-${p.id}`} marginTop={1}>
<Svg source={stepsSvg(p, detailWidth)} alt={`${p.title}: ${Math.min(w.pos, w.total)}/${w.total} steps`} width={detailWidth} height={SEG_H} />
</Box>,
]
: []}
{p.id === AGENTS
? []
: p.stages.flatMap((s, i) => {
const finished = s.steps.filter(step => isFinished(step.status)).length
const stageTime = times.stages[i] ?? ''
const head = isSingle
? []
: [
<Box key={`stage-${p.id}-${i}`} flexDirection="row" marginTop={1} minWidth={0}>
<Box flexGrow={1} minWidth={0}>
<Text bold dimColor wrap="truncate">
{s.name}
</Text>
</Box>
<Text dimColor>{`${finished}/${s.steps.length}${stageTime ? ` · ${stageTime}` : ''}`}</Text>
</Box>,
]
return [
...head,
...s.steps.flatMap((step, j) => [
stepRow(step, `step-${p.id}-${i}-${j}`, 0, color, times),
...step.substeps.map((sub, k) => stepRow(sub, `sub-${p.id}-${i}-${j}-${k}`, 1, color, times)),
]),
]
})}
{agentRows(p)}
<Box flexDirection="row" marginTop={1}>
<Box flexGrow={1} />
{p.hidden ? (
<Button key={`close-${p.id}`} plain dimColor label="Show again" onPress={() => unhidePlan($, p.id)} />
) : (
<Button key={`close-${p.id}`} plain dimColor label="Hide" onPress={() => hidePlan($, p.id)} />
)}
</Box>
</Box>
)
}
const row = (p: Plan, isCompact: boolean) => {
const w = where(p)
const pct = percent(p, w)
const color = STATE_COLOR[p.state]
const isWide = opened.includes(p.id)
const isAlert = p.state === 'needs_input' || p.state === 'error'
const toggle = () => toggleBubble($, p.id)
const took = shortSpan(endOf(p, now) - p.startedAt)
const mark = isCompact || !Svg ? <Text color={color}>{STATE_GLYPH[p.state]}</Text> : <Svg source={ringSvg(p, pct)} alt={`${p.title} ${pct}%`} width={RING} height={RING} />
const right = isCompact ? [clockTime(touchedAt(p))] : [took].filter(part => part !== '')
const line = isAlert ? (
<Text key={`line-${p.id}`} color={color} wrap="truncate">
{overview(p, w)}
</Text>
) : (
<Text key={`line-${p.id}`} dimColor wrap="truncate">
{overview(p, w)}
</Text>
)
return [
<Box key={`row-${p.id}`} position="relative" flexDirection="row" alignItems="center" gap={1} paddingX={1} minWidth={0} {...(isDesktop ? {} : { hover: { backgroundColor: HOVER_BG } })}>
{mark}
<Box flexDirection="column" flexGrow={1} minWidth={0}>
{isDesktop ? (
<Text key={`title-${p.id}`} dimColor={p.state === 'done' || p.hidden === true} wrap="truncate">
{p.title}
</Text>ライセンスの全文(MIT)
MIT License Copyright (c) 2026 bqnhat Copyright (c) 2026 Kirill Serditov (plan-progress, from https://github.com/zycck/claude-mods) Copyright (c) Thariq Shihipar (next-steps, from https://github.com/anthropics/claude-plugins-community) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
コードが呼ぶもの
プログラム起動ツール呼び出し
コードから読み取ったデザイン
読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。
コードから読めること
2026-10-06 に読んだコミット 8f776935292d のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。plugins/plan-progress/hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。1 ファイルを解析 |
| コードが Mod の中で完結 | import は Mod 自身のファイルかエンジンのモジュールだけ。パッケージも require もない。コードはすべて Mod の中 |
| 読める | 圧縮した行・eval・new Function・計算した道の import()・符号化した塊がない。圧縮・eval・符号化した塊なし |
| 呼び出しが見える | 通信とプログラム起動はその場で $.http.fetch・$.process.run と書き、他へ渡さない。外への呼び出しはすべてその場の $ で |
| 入れる前に自分で判断する材料 | |
| 描く場所 | コードから読んだ、描く先。ターミナル・デスクトップアプリ・両方・何も描かない(フックだけ: 見張りやプロンプトの書き換え)のどれか。出すだけで、外す理由にはしない。ターミナルとデスクトップアプリに描く(デスクトップ用の分岐あり) |
| 入れる手順 | リポジトリ自身の .claude-plugin/marketplace.json にこの Mod が載っていて、ページに書いた手順でそのマーケットプレイスから入れられるか。リポジトリの .claude-plugin/marketplace.json に載っており、そこから入れられる |
| Windows のプログラム | $.process で起動するプログラムが Windows にあるか(tail・date・open・osascript・/usr/… などは無い)。Windows にないプログラムを使わない |
| 通信 | fetch の送り先(https のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。プログラムを起動しない |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。通信しない |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add bqnhat/claude-local-plugins/plugin install plan-progress@nhat-local入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(8f776935292d)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「bqnhat-plan-progress」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…Fix loginRemoveCopy markdownacme/app · mainCopy linkCopy markdownbuild2h 10mbuild2h 10mbuild2h 10mHosted on uploads.sh, not committed to the repo.They will appear in a comment on the pull request once opened.
-
何をするか
- プロンプトの上の帯・欄を描く
- /progress を足す
- ツールの呼び出しを見張る(止めることがある)
- classic.SessionStart・prompt.compose・prompt.submit・session.start ほか 2 個にフックする
-
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
-
spending-effort-with-jev: no TypeSafe API key, so effort tips are off. Set it in /plugin.⚠ effort: long run, fuzzy spec → have Claude interview you, then go maxClaude に頼む…
-
✦ explain as pick how Claude answers×3 ● build3 ● build3 ● build▸ VideoClaude に頼む…
-
Claude に頼む…Clawd's shopLevel 3 · Fix loginTinkerer1 coin per 12.4 tokens Claude writes, 100 per level, 25 per badgeTake everything offContextbuildLevel 3buildLevel 3buildLevel 3ContextbuildLevel 3buildLevel 3buildLevel 3ContextbuildLevel 3buildLevel 3buildLevel 3