prdeck
PR feed, review pane and security checks above the prompt
何をするか
- 欄・トーストを描く
- /prdeck を足す
- Write・Edit・Bash の呼び出しを見張る(止めることがある)
- prompt.context・session.start・turn.complete・turn.startにフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- TypeScript で書かれている
- デスクトップ専用の分岐がある
- エラーを扱う
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like prdeck by Vishal K Setti (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/settivishal-prdeck/
// Written by modscode from that reading, not copied from the mod: use it as you like.
// Each value below stands for one the mod works out at run time; put in your own.
export const register: Register = on => {
// the pane: open it with $.ui.open({ id: 'my-pane', title: "PR security" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Select, Text, Button } = $.ui.resolve(e)
const length = '…'
const line = '…'
const sev = '…'
const rule = '…'
const text = '…'
const why = '…'
const file = '…'
return (
<Box flexDirection="column">
<Box gap={1}>
<Select label="rule" value="all" options={[{"value":"all","label":"all"},{"label":"‹option›"}]} />
<Text dimColor>
{`${length} shown · ${length} ignored`}
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text bold />
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate">
<Text dimColor>
{`L${line} `}
</Text>
<Text>
{`[${sev}] `}
</Text>
{`${rule}: ${text}`}
<Text dimColor>
{` — ${why}`}
</Text>
</Text>
</Box>
<Box flexShrink={0} gap={1}>
<Button plain dimColor>
fix
</Button>
<Button plain dimColor>
ignore
</Button>
</Box>
</Box>
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate">
<Text dimColor>
{`L${line} `}
</Text>
<Text>
{`[${sev}] `}
</Text>
{`${rule}: ${text}`}
<Text dimColor>
{` — ${why}`}
</Text>
</Text>
</Box>
<Box flexShrink={0} gap={1}>
<Button plain dimColor>
fix
</Button>
<Button plain dimColor>
ignore
</Button>
</Box>
</Box>
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate">
<Text dimColor>
{`L${line} `}
</Text>
<Text>
{`[${sev}] `}
</Text>
{`${rule}: ${text}`}
<Text dimColor>
{` — ${why}`}
</Text>
</Text>
</Box>
<Box flexShrink={0} gap={1}>
<Button plain dimColor>
fix
</Button>
<Button plain dimColor>
ignore
</Button>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text bold />
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate">
<Text dimColor>
{`L${line} `}
</Text>
<Text>
{`[${sev}] `}
</Text>
{`${rule}: ${text}`}
<Text dimColor>
{` — ${why}`}
</Text>
</Text>
</Box>
<Box flexShrink={0} gap={1}>
<Button plain dimColor>
fix
</Button>
<Button plain dimColor>
ignore
</Button>
</Box>
</Box>
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate">
<Text dimColor>
{`L${line} `}
</Text>
<Text>
{`[${sev}] `}
</Text>
{`${rule}: ${text}`}
<Text dimColor>
{` — ${why}`}
</Text>
</Text>
</Box>
<Box flexShrink={0} gap={1}>
<Button plain dimColor>
fix
</Button>
<Button plain dimColor>
ignore
</Button>
</Box>
</Box>
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate">
<Text dimColor>
{`L${line} `}
</Text>
<Text>
{`[${sev}] `}
</Text>
{`${rule}: ${text}`}
<Text dimColor>
{` — ${why}`}
</Text>
</Text>
</Box>
<Box flexShrink={0} gap={1}>
<Button plain dimColor>
fix
</Button>
<Button plain dimColor>
ignore
</Button>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text bold />
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate">
<Text dimColor>
{`L${line} `}
</Text>
<Text>
{`[${sev}] `}
</Text>
{`${rule}: ${text}`}
<Text dimColor>
{` — ${why}`}
</Text>
</Text>
</Box>
<Box flexShrink={0} gap={1}>
<Button plain dimColor>
fix
</Button>
<Button plain dimColor>
ignore
</Button>
</Box>
</Box>
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate">
<Text dimColor>
{`L${line} `}
</Text>
<Text>
{`[${sev}] `}
</Text>
{`${rule}: ${text}`}
<Text dimColor>
{` — ${why}`}
</Text>
</Text>
</Box>
<Box flexShrink={0} gap={1}>
<Button plain dimColor>
fix
</Button>
<Button plain dimColor>
ignore
</Button>
</Box>
</Box>
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate">
<Text dimColor>
{`L${line} `}
</Text>
<Text>
{`[${sev}] `}
</Text>
{`${rule}: ${text}`}
<Text dimColor>
{` — ${why}`}
</Text>
</Text>
</Box>
<Box flexShrink={0} gap={1}>
<Button plain dimColor>
fix
</Button>
<Button plain dimColor>
ignore
</Button>
</Box>
</Box>
</Box>
<Box flexDirection="column" marginTop={1}>
<Text dimColor bold>
{`ignored (${length})`}
</Text>
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text dimColor wrap="truncate">
{`${file}:${line} ${rule}: ${text}`}
</Text>
</Box>
<Box flexShrink={0}>
<Button plain dimColor>
unignore
</Button>
</Box>
</Box>
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text dimColor wrap="truncate">
{`${file}:${line} ${rule}: ${text}`}
</Text>
</Box>
<Box flexShrink={0}>
<Button plain dimColor>
unignore
</Button>
</Box>
</Box>
<Box gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text dimColor wrap="truncate">
{`${file}:${line} ${rule}: ${text}`}
</Text>
</Box>
<Box flexShrink={0}>
<Button plain dimColor>
unignore
</Button>
</Box>
</Box>
</Box>
<Box gap={2} marginTop={1}>
<Button plain dimColor hotkey="r">
rescan
</Button>
<Button plain dimColor hotkey="c">
clear ignores
</Button>
<Text dimColor>
Esc close
</Text>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const number = '…'
const title = '…'
await $.ui.toast(`New PR #${number}: ${title}`)
await $.ui.toast(`format: <line>: <comment>`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
prdeck/hooks/hooks.tsx 656〜726 行 · ペイン
on("ui.render", { component: "Pane" }, ($, e, next) => {
if (e.requestId !== PANE || !cfg.security) return next(e);
const els = $.ui.resolve(e);
const { Box, Text, Button } = els;
const Select = "Select" in els ? els.Select : null; // mobile has no Select
const all = state.findings;
const rules = [...new Set(all.map(f => f.rule))];
const shown = live().filter(f => filter === "all" || f.rule === filter);
const hidden = all.filter(f => ignored.has(ignoreKey(f)));
const files = [...new Set(shown.map(f => f.file))];
const w = e.props.bodyColumns;
return (
<Box flexDirection="column" width={w}>
<Box gap={1}>
{Select ? (
<Select key="rule" label="rule" value={filter}
options={[{ value: "all", label: "all" }, ...rules.map(r => ({ value: r, label: r }))]}
onSelect={(v: string) => { filter = v; $.ui.invalidate("ui.render"); }} />
) : null}
<Text dimColor>{`${shown.length} shown · ${hidden.length} ignored`}</Text>
</Box>
{files.map(file => (
<Box key={file} flexDirection="column" marginTop={1}>
<Text bold>{file}</Text>
{shown.filter(f => f.file === file).map(f => {
const k = ignoreKey(f);
return (
<Box key={k} gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text wrap="truncate">
<Text dimColor>{`L${f.line} `}</Text>
<Text color={SEV_COLOR[f.sev]}>{`[${f.sev}] `}</Text>
{`${f.rule}: ${f.text}`}
{triage.get(k)?.why ? <Text dimColor>{` — ${triage.get(k)!.why}`}</Text> : null}
</Text>
</Box>
<Box flexShrink={0} gap={1}>
<Button key={`fix:${k}`} plain dimColor onPress={() => fillFix($, f)}>fix</Button>
<Button key={`ign:${k}`} plain dimColor onPress={() => void setIgnored($, k, true)}>ignore</Button>
</Box>
</Box>
);
})}
</Box>
))}
{hidden.length ? (
<Box flexDirection="column" marginTop={1}>
<Text dimColor bold>{`ignored (${hidden.length})`}</Text>
{hidden.map(f => {
const k = ignoreKey(f);
return (
<Box key={`h:${k}`} gap={1}>
<Box flexGrow={1} flexShrink={1} minWidth={0}>
<Text dimColor wrap="truncate">{`${f.file}:${f.line} ${f.rule}: ${f.text}`}</Text>
</Box>
<Box flexShrink={0}>
<Button key={`un:${k}`} plain dimColor onPress={() => void setIgnored($, k, false)}>unignore</Button>
</Box>
</Box>
);
})}
</Box>
) : null}
<Box gap={2} marginTop={1}>
<Button key="p-rescan" plain dimColor hotkey="r" onPress={() => void scan($)}>rescan</Button>
<Button key="p-clear" plain dimColor hotkey="c" onPress={() => void setIgnored($, null, false)}>clear ignores</Button>
<Text dimColor>Esc close</Text>
</Box>
</Box>
);
});ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Vishal K Setti 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 に読んだコミット 67f772992deb のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。prdeck/hooks/hooks.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。6 ファイルを解析 |
| コードが 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 のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。prdeck/hooks/hooks.tsx:258 curl(通信する) |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。読んだうえで通信する |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add settivishal/prdeck/plugin install prdeck@prdeck入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(67f772992deb)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「settivishal-prdeck」をコードごと読んで、同じようなペインを作って似たデザイン
-
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 に頼む…ReviewPR #3 Fix loginbranche couranteà traiter ▸3 ▸3 ▸3 · en relecture ▸3 ▸3 ▸3▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review▸◉3 a1b2c3d ↩ répondu obsolète → Claude Review────────fil 31/3 Review ↗ GitHub
Review@alexReview@alexReview@alexReviewRéponse : Review publierEntrée publie · Esc annule la réponse · les touches n, p… tapent dans le champ… ReviewLe panneau n'a pas le clavier : ctrl+x tab ou un clic, et les touches marchent.p préc. n suiv. t PR suiv. x démarquer a tout démarquer f corriger (3) r répondre v résoudre o web q fermer -
Claude に頼む…QuestList 1 Kanban 2Fleet f This repo l Refs g Refresh r Normal size z Collapse cOpen FilterokAll reposDoneClosedClose itList* marks a task whose refs disagree about its status; origin/dev is drawn where it has one. Resolving it is that reposit…New task in acme/app CreateClosed tracker change in acme/app not committed yet. Until they land, this repository's other checkouts cannot see the ids in them and can mint the same… Ask Claude to land them⋯
-
何をするか
- 欄を描く
- session.end・session.start・ui.close・ui.focus ほか 1 個にフックする
- ターンをまたいで自分の状態を持つ
- プロセスを起こす
-
何をするか
- 欄を描く
- ツールの呼び出しを見張る(止めることがある)
- agent.spawn・prompt.submit・session.end・session.start ほか 5 個にフックする
- ターンをまたいで自分の状態を持つ
-
slop Edit1 of 3accepteditrejectClaude に頼む…