pr-bar
Your GitHub pull requests in the Claude Code sidebar: review queue, merge-ready PRs, fixes needed, with one-press Claude reviews.
何をするか
- プロンプトの上の帯・欄・ステータス行を描く
- /pr-bar を足す
- session.startにフックする
- ターンをまたいで自分の状態を持つ
- プロセスを起こす
良いところ
- ネットワークに出ない
- TypeScript で書かれている
- エラーを扱う
- ファイルを書かない
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like pr-bar by Designibl (pane, band, status), as modscode read it from the mod's code:
// https://modscode.com/gallery/designibl-pr-bar/
// 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 t = '…'
const t2 = '…'
const t3 = '…'
return (
<Box flexDirection="column">
<Box>
<Text dimColor>
{"PRs: "}
</Text>
<Text>
{" · "}
{t}
</Text>
<Text>
{" · "}
{t2}
</Text>
<Text>
{" · "}
{t3}
</Text>
<Text color="red">
{" !"}
</Text>
<Text>
{" "}
</Text>
<Button label="Open list" />
<Button label="Refresh" />
</Box>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "PRs" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button, Link } = $.ui.resolve(e)
const length = '…'
const eyes = '…'
const error = '…'
const title = '…'
const length2 = '…'
const url = '…'
const number = '…'
const repo = '…'
const files = '…'
const additions = '…'
const deletions = '…'
const text = '…'
const author = '…'
const fixReasons = '…'
const label = '…'
const repo2 = '…'
const files2 = '…'
const additions2 = '…'
const deletions2 = '…'
const text2 = '…'
const fixReasons2 = '…'
const repo3 = '…'
const files3 = '…'
const additions3 = '…'
const deletions3 = '…'
const text3 = '…'
const fixReasons3 = '…'
const length3 = '…'
const repo4 = '…'
const files4 = '…'
const additions4 = '…'
const deletions4 = '…'
const text4 = '…'
const fixReasons4 = '…'
const repo5 = '…'
const files5 = '…'
const additions5 = '…'
const deletions5 = '…'
const text5 = '…'
const fixReasons5 = '…'
const repo6 = '…'
const files6 = '…'
const additions6 = '…'
const deletions6 = '…'
const text6 = '…'
const fixReasons6 = '…'
const length4 = '…'
const repo7 = '…'
const files7 = '…'
const additions7 = '…'
const deletions7 = '…'
const text7 = '…'
const fixReasons7 = '…'
const repo8 = '…'
const files8 = '…'
const additions8 = '…'
const deletions8 = '…'
const text8 = '…'
const fixReasons8 = '…'
const repo9 = '…'
const files9 = '…'
const additions9 = '…'
const deletions9 = '…'
const text9 = '…'
const fixReasons9 = '…'
const length5 = '…'
const repo10 = '…'
const files10 = '…'
const additions10 = '…'
const deletions10 = '…'
const text10 = '…'
const fixReasons10 = '…'
const repo11 = '…'
const files11 = '…'
const additions11 = '…'
const deletions11 = '…'
const text11 = '…'
const fixReasons11 = '…'
const repo12 = '…'
const files12 = '…'
const additions12 = '…'
const deletions12 = '…'
const text12 = '…'
const fixReasons12 = '…'
const length6 = '…'
const repo13 = '…'
const files13 = '…'
const additions13 = '…'
const deletions13 = '…'
const text13 = '…'
const fixReasons13 = '…'
const repo14 = '…'
const files14 = '…'
const additions14 = '…'
const deletions14 = '…'
const text14 = '…'
const fixReasons14 = '…'
const repo15 = '…'
const files15 = '…'
const additions15 = '…'
const deletions15 = '…'
const text15 = '…'
const fixReasons15 = '…'
const length7 = '…'
const repo16 = '…'
const files16 = '…'
const additions16 = '…'
const deletions16 = '…'
const text16 = '…'
const fixReasons16 = '…'
const repo17 = '…'
const files17 = '…'
const additions17 = '…'
const deletions17 = '…'
const text17 = '…'
const fixReasons17 = '…'
const repo18 = '…'
const files18 = '…'
const additions18 = '…'
const deletions18 = '…'
const text18 = '…'
return (
<Box flexDirection="column">
<Box>
<Text bold>
{length}
{" open"}
</Text>
<Text>
{" · 👀 "}
{eyes}
</Text>
<Text dimColor>
{" · "}
refreshing…
{" "}
</Text>
<Button label="Refresh" hotkey="r" />
</Box>
<Text color="red">
{"! "}
{error}
</Text>
<Text dimColor>
No open pull requests.
</Text>
<Box flexDirection="column" marginTop={1}>
<Button label={`▾ ${title} (${length})`} />
<Box flexDirection="column">
<Text dimColor>
Requested of you
{" ("}
{length2}
)
</Text>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo}
{" · "}
{files}
f +
{additions}
/-
{deletions}
{" · "}
</Text>
<Text>
{text}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo2}
{" · "}
{files2}
f +
{additions2}
/-
{deletions2}
{" · "}
</Text>
<Text>
{text2}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons2}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo3}
{" · "}
{files3}
f +
{additions3}
/-
{deletions3}
{" · "}
</Text>
<Text>
{text3}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons3}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Text dimColor>
Requested of you
{" ("}
{length3}
)
</Text>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo4}
{" · "}
{files4}
f +
{additions4}
/-
{deletions4}
{" · "}
</Text>
<Text>
{text4}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons4}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo5}
{" · "}
{files5}
f +
{additions5}
/-
{deletions5}
{" · "}
</Text>
<Text>
{text5}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons5}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo6}
{" · "}
{files6}
f +
{additions6}
/-
{deletions6}
{" · "}
</Text>
<Text>
{text6}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons6}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Text dimColor>
Requested of you
{" ("}
{length4}
)
</Text>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo7}
{" · "}
{files7}
f +
{additions7}
/-
{deletions7}
{" · "}
</Text>
<Text>
{text7}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons7}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo8}
{" · "}
{files8}
f +
{additions8}
/-
{deletions8}
{" · "}
</Text>
<Text>
{text8}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons8}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo9}
{" · "}
{files9}
f +
{additions9}
/-
{deletions9}
{" · "}
</Text>
<Text>
{text9}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons9}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Button label={`▾ ${title} (${length})`} />
<Box flexDirection="column">
<Text dimColor>
Requested of you
{" ("}
{length5}
)
</Text>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo10}
{" · "}
{files10}
f +
{additions10}
/-
{deletions10}
{" · "}
</Text>
<Text>
{text10}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons10}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo11}
{" · "}
{files11}
f +
{additions11}
/-
{deletions11}
{" · "}
</Text>
<Text>
{text11}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons11}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo12}
{" · "}
{files12}
f +
{additions12}
/-
{deletions12}
{" · "}
</Text>
<Text>
{text12}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons12}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Text dimColor>
Requested of you
{" ("}
{length6}
)
</Text>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo13}
{" · "}
{files13}
f +
{additions13}
/-
{deletions13}
{" · "}
</Text>
<Text>
{text13}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons13}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo14}
{" · "}
{files14}
f +
{additions14}
/-
{deletions14}
{" · "}
</Text>
<Text>
{text14}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons14}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo15}
{" · "}
{files15}
f +
{additions15}
/-
{deletions15}
{" · "}
</Text>
<Text>
{text15}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons15}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
</Box>
<Box flexDirection="column">
<Text dimColor>
Requested of you
{" ("}
{length7}
)
</Text>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo16}
{" · "}
{files16}
f +
{additions16}
/-
{deletions16}
{" · "}
</Text>
<Text>
{text16}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons16}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo17}
{" · "}
{files17}
f +
{additions17}
/-
{deletions17}
{" · "}
</Text>
<Text>
{text17}
</Text>
<Text dimColor>
{" · "}
</Text>
<Text>
no CI
</Text>
<Text dimColor>
{" · "}
{`by ${author}`}
</Text>
</Box>
<Text color="red">
{" "}
{fixReasons17}
</Text>
<Box>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Link href={`${url}`}>
{`${label} `}
</Link>
<Button label="Review with Claude" />
</Box>
</Box>
<Box flexDirection="column" marginBottom={0}>
<Box>
<Link href={`${url}`}>
{`#${number} ${title}`}
</Link>
</Box>
<Box>
<Text dimColor>
{repo18}
{" · "}
{files18}
f +
{additions18}
/-
{deletions18}
{" · "}
</Text>
<Text>
{text18}
</Text>
<Text dimColor />
</Box>
</Box>
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
await $.ui.status(`PR Bar: ! (see /pr-bar)`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
hooks/register.tsx 421〜445 行 · バンド
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const d = await read($, data)
if (e.props.hasSurvey || (d.prs.length === 0 && !d.error)) return next(e)
const { Box, Text, Button } = $.ui.resolve(e)
const s = await readSettings($)
const by = grouped(d.prs)
const eyes = reviewCount(by.review!, s.isCountingTeams)
const mine = d.prs.length - by.review!.length
const bits: [string, string?][] = [[`${mine} open`]]
if (eyes) bits.push([`👀 ${eyes} to review`, 'yellow'])
if (by.merge!.length) bits.push([`${by.merge!.length} ready to merge`, 'green'])
if (by.fixes!.length) bits.push([`${by.fixes!.length} need fixes`, 'red'])
return (
<Box>
<Text dimColor>PRs: </Text>
{bits.map(([t, c], i) => (
<Text key={`b${i}`} color={c}>{i ? ' · ' : ''}{t}</Text>
))}
{d.error && <Text color="red"> !</Text>}
<Text> </Text>
<Button key="band-open" label="Open list" onPress={() => $.ui.open({ id: PANE, title: 'PRs', focus: true })} />
<Button key="band-refresh" label="Refresh" onPress={() => refresh($)} />
</Box>
)
})hooks/register.tsx 447〜586 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text, Button, Link } = $.ui.resolve(e)
const d = await read($, data)
const s = await readSettings($)
const v = await read($, view)
const busy = await read($, isBusy)
const now = await $.clock.now()
const by = grouped(d.prs)
let budget = Math.max(6, (e.viewport?.rows ?? 30) - 6)
const prRow = (pr: Pr, key: string) => {
const age = fmtAge(pr.lastChange, now)
const draftOrFix = !pr.isReviewRequested && pr.bucket === 'fixes'
budget -= 2
return (
<Box key={key} flexDirection="column" marginBottom={0}>
<Box>
<Link href={pr.url}>{`#${pr.number} ${pr.title}`}</Link>
</Box>
<Box>
<Text dimColor>{pr.repo} · {pr.files}f +{pr.additions}/-{pr.deletions} · </Text>
<Text color={age.color} dimColor={!age.color}>{age.text}</Text>
<Text dimColor> · </Text>
<Text color={ciColor(pr.ci)}>{ciText(pr.ci)}</Text>
<Text dimColor> · {pr.isReviewRequested ? `by ${pr.author}` : mergeText(pr)}</Text>
</Box>
{draftOrFix && <Text color="red"> {pr.fixReasons.join(', ')}</Text>}
<Box>
{pr.issues.map(l => (
<Link key={l.url} href={l.url}>{`${l.label} `}</Link>
))}
{pr.previews.map(l => (
<Link key={l.url} href={l.url}>{`${l.label} `}</Link>
))}
{pr.isReviewRequested || pr.bucket === 'ready' || pr.bucket === 'fixes' ? (
<Button
key={`act-${key}`}
label={pr.isReviewRequested ? 'Review with Claude' : pr.bucket === 'fixes' ? 'Fix with Claude' : 'Self-review'}
onPress={() => $.prompt.submit({ text: pr.isReviewRequested || pr.bucket === 'ready' ? reviewPrompt(pr) : fixPrompt(pr) })}
/>
) : null}
</Box>
</Box>
)
}
const sectionEl = (key: string, title: string, items: Pr[]) => {
const isOpen = !v.collapsed.includes(key)
budget -= 1
return (
<Box key={`s-${key}`} flexDirection="column" marginTop={1}>
<Button
key={`toggle-${key}`}
label={`${isOpen ? '▾' : '▸'} ${title} (${items.length})`}
onPress={async () => {
const next = { ...v, collapsed: isOpen ? [...v.collapsed, key] : v.collapsed.filter(k => k !== key) }
await update($, view, () => next)
await $.store.set('view', next)
}}
/>
{isOpen &&
(key === 'review'
? reviewGroups(items).map(([via, sub]) => (
<Box key={`g-${via}`} flexDirection="column">
<Text dimColor>{via === YOU ? 'Requested of you' : `Team ${via}`} ({sub.length})</Text>
{sub.map(pr => (budget > 0 ? prRow(pr, `${key}-${via}-${pr.url}`) : null))}
</Box>
))
: items.map(pr => (budget > 0 ? prRow(pr, `${key}-${pr.url}`) : null)))}
</Box>
)
}
const copy = (scope: Scope, label: string) => (
<Button
key={`copy-${scope}`}
label={label}
onPress={press =>
$.ui.copy({ text: formatSummary(d.prs, v.format, scope), surface: press.surface })
}
/>
)
const nextFormat = { md: 'slack', slack: 'text', text: 'md' } as const
const eyes = reviewCount(by.review!, s.isCountingTeams)
return (
<Box flexDirection="column">
<Box>
<Text bold>{d.prs.filter(p => !p.isReviewRequested).length} open</Text>
{eyes > 0 && <Text> · 👀 {eyes}</Text>}
<Text dimColor> · {busy ? 'refreshing…' : d.fetchedAt ? `updated ${fmtAge(d.fetchedAt, now).text} ago` : 'no data yet'} </Text>
<Button key="refresh" label="Refresh" hotkey="r" onPress={() => refresh($)} />
</Box>
{d.error && <Text color="red">! {d.error}</Text>}
{d.prs.length === 0 && !d.error && <Text dimColor>No open pull requests.</Text>}
{SECTIONS.map(([key, title]) => (by[key]!.length ? sectionEl(key, title, by[key]!) : null))}
{budget <= 0 && <Text dimColor>… more hidden; collapse sections to see the rest</Text>}
<Box marginTop={1}>
<Text dimColor>Copy </Text>
{copy('all', 'all')}
{copy('review', 'to review')}
{copy('mine', 'awaiting review')}
<Button
key="format"
label={`as ${v.format}`}
onPress={async () => {
const next = { ...v, format: nextFormat[v.format] }
await update($, view, () => next)
await $.store.set('view', next)
}}
/>
</Box>
<Box>
<Text dimColor>Poll </Text>
{INTERVALS.map(m => (
<Button
key={`i-${m}`}
label={m === s.intervalMinutes ? `[${m}m]` : `${m}m`}
onPress={async () => {
const next = { ...s, intervalMinutes: m }
await update($, settings, () => next)
await $.store.set('settings', next)
schedule($, m)
}}
/>
))}
<Button
key="teams"
label={s.isCountingTeams ? '👀 incl. teams' : '👀 direct only'}
onPress={async () => {
const next = { ...s, isCountingTeams: !s.isCountingTeams }
await update($, settings, () => next)
await $.store.set('settings', next)
await setStatus($)
}}
/>
</Box>
</Box>
)
})ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Designibl 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.
コードが呼ぶもの
プログラム起動Claude を動かす保存
コードから読み取ったデザイン
読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。
コードから読めること
2026-10-06 に読んだコミット 492c95f49a4d のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。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 のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。hooks/register.tsx:67 実行時に決まるプログラム |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。通信しない |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリの .claude-plugin/marketplace.json にこの Mod が載っていないため、入れる手順は出せません。コードとして読むか、作者の README に従ってください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「designibl-pr-bar」をコードごと読んで、同じようなペインを作って似たデザイン
-
✦ explain as pick how Claude answers×3 ● build3 ● build3 ● build▸ VideoClaude に頼む…
-
Claude に頼む…CIcross Bash · Classicmain · a1b2c3d · failed at 14:32Open the run on GitHubFix it fClose x
(no log available)
-
Claude に頼む…GitHub inboxGitHubloading…Refresh rbuildbuildbuildClose xStealth IssuesNo open issues in this view.#3 Fix login · Pinned notice · 2h 10m · Top row commentsWork on itopen#3 Fix login · Pinned notice · 2h 10m · Top row commentsWork on itopen#3 Fix login · Pinned notice · 2h 10m · Top row commentsWork on itopenPull requestsNo open pull requests.#3 Fix login · main · draft · build · HiddenChecksReviewopen#3 Fix login · main · draft · build · HiddenChecksReviewopen#3 Fix login · main · draft · build · HiddenChecksReviewopenChecks for #3Plain
-
Claude に頼む…gh-pulser Refreshm buildf Fix ite Rerun failedl Next logy Copy loga Review with Claudeo Openx Removed Clear finished (3)c Clearz Undo (build)h Hide keyspending Detail only…KFailingKFailingKFailingKFailingKFailingKFailingKFailingKFailingKFailing3 buildNothing open. Press m to bring the list back.3 build3 build
-
Claude に頼む…◉ Subcommands◆ acme/app● Backlog build▲ Backlog build⇄ Backlog build✗ Backlog buildPriorityBacklog 3%◌ syncing… r⚙ Set up build for the board◌ Reading the repo, its project and its issues…Couldn't read what setup needs: Item closed/issues check says what is missing and how to fix it.Projectnone is linked to buildFix login (#3)buildApply will:● Fix login Item closed● Fix login Item closed● Fix login Item closedarea labels to create: Off track updateWhich Status is whichInbox (folds)Inbox (folds)Inbox (folds)In the project's Workflows settings, by hand: · turn on Off track · turn off Inactive: it marks every closed issue Done, even an abandoned one; the board moves issues closed as comp… · new issues arrive with Status Todo, GitHub's default, so they skip the Inbox: open Item added to project and set it…↗ WorkflowsNo issue template has an Acceptance list.◌ Applying…build █████░░░ Off trackbuild █████░░░ Off tracklast 12 weeks✗ Setup needed⋯Fix loginSubcommandsSubcommands↗ example.comFix loginSubcommandsSubcommands↗ example.comFix loginSubcommandsSubcommands↗ example.com
-
Claude に頼む…Tokenbreak● Learn moresponsoredFix loginTokenbreak ↗ 🔊 muteCloses when Claude finishes · /ads pause hides ads