pocock-guide
A side pane that keeps a beginner on Matt Pocock's flow, from grilling to retro: /mod-pocock
何をするか
- 欄・トーストを描く
- /mod-pocock を足す
- Bash の呼び出しを見張る(止めることがある)
- prompt.submit・session.start・skill.prompt・turn.completeにフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- TypeScript で書かれている
- デスクトップ専用の分岐がある
- エラーを扱う
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like pocock-guide by Matt Nicosia (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/mattnicosia-pocock-guide/
// 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: "Pocock flow" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Button, Text, Code, Markdown } = $.ui.resolve(e)
const label = '…'
const filter = '…'
const question = '…'
const why = '…'
const name = '…'
const branch = '…'
const error = '…'
const label2 = '…'
const label3 = '…'
return (
<Box flexDirection="column" gap={1}>
<Box flexDirection="column" gap={1}>
<Box flexDirection="row" flexWrap="wrap" gap={1}>
<Button label={`${label}`} variant="primary" />
<Button label={`${label}`} variant="primary" />
<Button label={`${label}`} variant="primary" />
</Box>
<Box flexDirection="row" flexWrap="wrap" gap={1}>
<Button label={`• ${label}`} plain />
<Button label={`• ${label}`} plain />
<Button label={`• ${label}`} plain />
</Box>
</Box>
<Box flexDirection="column" gap={1} borderStyle="round" borderColor="#E5342C" paddingX={1}>
<Text bold color="#E5342C">
Your copy of Matt Pocock's skills is out of date
</Text>
<Text>
The copy from the official marketplace is older than v1.3.1 and has no /implement-spec, /pr or /retro, which later step…
</Text>
<Code source="claude plugin marketplace add mattnicosia/bldg-skills && claude plugin install matt-pocock@bldg-skills" />
<Text dimColor>
Then remove the old copy with: claude plugin uninstall mattpocock-skills
</Text>
<Box flexDirection="row" gap={1}>
<Button label="Check again" />
</Box>
</Box>
<Box flexDirection="column" gap={1} borderStyle="round" borderColor="#F56300" paddingX={1}>
<Text bold color="#F56300">
Sounds like something is broken
</Text>
<Text>
/diagnosing-bugs finds a command that shows the bug failing, then fixes it with a test. Claude will still help with wha…
</Text>
<Box flexDirection="row" flexWrap="wrap" gap={1}>
<Button label="Diagnose it" variant="primary" />
<Button label="Not this time" />
</Box>
</Box>
<Box flexDirection="column" borderStyle="round" borderColor="#F56300" paddingX={1}>
<Text bold color="#F56300">
Needs you
</Text>
<Markdown text={`${filter}`} />
</Box>
<Box flexDirection="column" gap={1} borderStyle="round" paddingX={1}>
<Text bold>
{"Claude is asking: "}
{question}
</Text>
<Text dimColor>
{why}
</Text>
<Box flexDirection="row" flexWrap="wrap" gap={1}>
<Button label={`${label}`} variant="primary" />
<Button label={`${label}`} variant="primary" />
<Button label={`${label}`} variant="primary" />
</Box>
</Box>
<Text bold>
{`${name} · ${branch}`}
</Text>
<Text dimColor>
{error}
</Text>
<Text bold>
Open work
</Text>
<Box flexDirection="row" flexWrap="wrap" gap={1} alignItems="center">
<Text>
{label}
</Text>
<Button label={`${label}`} />
<Button label={`${label}`} />
<Button label={`${label}`} />
</Box>
<Box flexDirection="row" flexWrap="wrap" gap={1} alignItems="center">
<Text>
{label2}
</Text>
<Button label={`${label}`} />
<Button label={`${label}`} />
<Button label={`${label}`} />
</Box>
<Box flexDirection="row" flexWrap="wrap" gap={1} alignItems="center">
<Text>
{label3}
</Text>
<Button label={`${label}`} />
<Button label={`${label}`} />
<Button label={`${label}`} />
</Box>
<Text bold>
Start something
</Text>
<Text color="#E5342C">
This repo is not set up for the skills yet. Press Set up this repo once, first.
</Text>
<Box flexDirection="row" flexWrap="wrap" gap={1}>
<Button label={`${label}`} variant="primary" />
<Button label={`${label}`} variant="primary" />
<Button label={`${label}`} variant="primary" />
</Box>
<Text dimColor>
Idea and broken fill your prompt: type what you mean after the command, then press Enter. The others send at once.
</Text>
<Box flexDirection="row" gap={1}>
<Button label="Refresh" />
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const what = '…'
await $.ui.toast(`Pocock flow: blocked ${what}.`)
await $.ui.toast(`Pocock flow: try /diagnosing-bugs. The pane has a button.`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
plugins/pocock-guide/hooks/register.tsx 1120〜1279 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const current = await read($, tab)
const f = await read($, flow)
const setup = await read($, env)
const { Box, Button, Markdown, Text, Code } = $.ui.resolve(e)
const isDesktop = e.surface !== 'terminal'
const guide = GUIDE.find(g => g.id === current)
const go = (id: Tab) => () => {
void update($, tab, () => id)
if (id === 'start') void readRepo($)
}
const top: { id: Tab; label: string; key: string; isOn: boolean }[] = [
{ id: 'start', label: 'Start', key: 'tab-start', isOn: current === 'start' },
{ id: 'now', label: 'Now', key: 'tab-now', isOn: current === 'now' },
{ id: guide ? current : 'flow', label: 'Guide', key: 'tab-guide', isOn: guide !== undefined },
]
const nav = (
<Box flexDirection="column" gap={1}>
<Box flexDirection="row" flexWrap="wrap" gap={1}>
{top.map(t => (
<Button key={t.key} label={t.label} variant={t.isOn ? 'primary' : 'secondary'} onPress={go(t.id)} />
))}
</Box>
{guide ? (
<Box flexDirection="row" flexWrap="wrap" gap={1}>
{GUIDE.map(g => (
<Button key={`tab-${g.id}`} label={g.id === current ? `• ${g.label}` : g.label} plain onPress={go(g.id)} />
))}
</Box>
) : null}
</Box>
)
const act = (a: Act | Move, variant: 'primary' | 'secondary' = 'secondary') => (
<Button
key={a.key}
label={a.label}
variant={variant}
onPress={() => {
if (!a.isSend) return void $.prompt.fill({ text: a.text })
// The engine refuses a submitted prompt that starts with a slash, so a
// slash command runs as a command.
const slash = /^\/(\S+)\s*([\s\S]*)$/.exec(a.text)
void (slash ? $.command.run({ command: slash[1] ?? '', args: slash[2] ?? '' }) : $.prompt.submit({ text: a.text, asUser: true }))
}}
/>
)
const asked = await read($, nudge)
const nudgeCard =
asked === null ? null : (
<Box key="nudge" flexDirection="column" gap={1} borderStyle="round" borderColor="#F56300" paddingX={1}>
<Text bold color="#F56300">
{asked.kind === 'bug' ? 'Sounds like something is broken' : 'Grill it first?'}
</Text>
<Text>
{asked.kind === 'bug'
? '/diagnosing-bugs finds a command that shows the bug failing, then fixes it with a test. Claude will still help with what you asked.'
: 'You asked for code before any grilling. A few minutes of questions now saves a rebuild later. Claude will still do what you asked.'}
</Text>
<Box flexDirection="row" flexWrap="wrap" gap={1}>
<Button
key="nudge-go"
label={asked.kind === 'bug' ? 'Diagnose it' : 'Grill it first'}
variant="primary"
onPress={() => {
void $.prompt.fill({ text: `${asked.kind === 'bug' ? '/diagnosing-bugs' : '/grill-with-docs'} ${asked.text}` })
}}
/>
<Button
key="nudge-off"
label="Not this time"
onPress={() => {
isNudgeOff = true
void update($, nudge, () => null)
}}
/>
</Box>
</Box>
)
const said = await read($, summary)
const summaryCard =
said === null ? null : (
<Box key="summary" flexDirection="column" borderStyle="round" borderColor={said.isWaiting ? '#F56300' : '#D2D2D7'} paddingX={1}>
<Text bold color={said.isWaiting ? '#F56300' : undefined}>
{said.isWaiting ? 'Needs you' : 'Last turn'}
</Text>
<Markdown
text={[said.done, said.next ? `**Next:** ${said.next}` : '', said.links.map(l => `[PR #${l.split('/').pop()}](${l})`).join(' · ')]
.filter(Boolean)
.join('\n\n')}
/>
</Box>
)
const open = await read($, decision)
const choose = (o: Choice, label: string) => (
<Button
key={`choose-${o.key}`}
label={label}
variant={o.key === open?.pick ? 'primary' : 'secondary'}
onPress={() => {
void $.prompt.submit({ text: o.key, asUser: true })
}}
/>
)
const decisionCard =
open === null ? null : isDesktop ? (
<Box key="decision" flexDirection="column" gap={1}>
{(() => {
const { Svg } = $.ui.resolve(e)
const source = decisionSvg(open)
return <Svg source={source} alt={`Claude is asking: ${open.question}`} {...fit(source, e.props.bodyColumns)} />
})()}
<Box flexDirection="row" flexWrap="wrap" gap={1}>
{open.options.map(o => choose(o, o.key === open.pick ? `★ ${o.key}` : o.key))}
</Box>
</Box>
) : (
<Box key="decision" flexDirection="column" gap={1} borderStyle="round" paddingX={1}>
<Text bold>Claude is asking: {open.question}</Text>
{open.why ? <Text dimColor>{open.why}</Text> : null}
<Box flexDirection="row" flexWrap="wrap" gap={1}>
{open.options.map(o => choose(o, `${o.key} · ${o.label}`))}
</Box>
</Box>
)
const installCard = setup.hasSkills && !setup.isOutdated ? null : (
<Box key="install" flexDirection="column" gap={1} borderStyle="round" borderColor="#E5342C" paddingX={1}>
<Text bold color="#E5342C">
{setup.hasSkills ? "Your copy of Matt Pocock's skills is out of date" : "Matt Pocock's skills are not installed"}
</Text>
<Text>
{setup.hasSkills
? 'The copy from the official marketplace is older than v1.3.1 and has no /implement-spec, /pr or /retro, which later steps need. Run this in a terminal, then start a new session:'
: 'The buttons here run his skills, so install them first. Run this in a terminal, then start a new session:'}
</Text>
<Code source={INSTALL} />
{setup.hasSkills ? <Text dimColor>Then remove the old copy with: claude plugin uninstall mattpocock-skills</Text> : null}
<Box flexDirection="row" gap={1}>
<Button key="check-again" label="Check again" onPress={() => readEnv($)} />
</Box>
</Box>
)
if (current === 'start') {
const r = await read($, repo)
const ciText = { fail: 'checks failing', pending: 'checks running', pass: 'checks green', none: 'no checks' } as const
const rows: { key: string; label: string; acts: Act[] }[] = [
...r.prs.map(pr => ({
key: `pr-${pr.number}`,
label: `PR #${pr.number}${pr.isDraft ? ' (draft)' : ''} · ${ciText[pr.ci]} · ${cut(pr.title, 48)}`,
acts: prActs(pr),
})),
...(r.dirty > 0
? [{
key: 'dirty',ライセンスの全文(MIT)
MIT License Copyright (c) 2026 BLDG / Matt Nicosia 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 を動かすツール呼び出し保存
コードから読み取ったデザイン
claude plugin marketplace add mattnicosia/bldg-skills && claude plugin install matt-pocock@bldg-skillsThen remove the old copy with: claude plugin uninstall mattpocock-skills
読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。
コードから読めること
2026-10-06 に読んだコミット 306192709f3d のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。plugins/pocock-guide/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 のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。git(通信する), gh(通信する) |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。reads environment variables and files and reaches the network |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add mattnicosia/bldg-skills/plugin install pocock-guide@bldg-skills入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(306192709f3d)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「mattnicosia-pocock-guide」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…Desktop Markdown ReaderDesktop Markdown ReaderMarkdown file README.md applyChoose a Markdown file.No document loaded.Copy Markdown sourceRefresh
-
Claude に頼む…⏺ src/ WriteUpdated·0·0·0search: Edit nextUpdated1/3── Updated ────────› Edit› Edit› Edit⎿Updated> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎⋯> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎> what to change in lines Warp-Edit sendenter to send to Claude ·cancel⎿ open the original⎿ open the original⎿ open the original✎
-
Claude に頼む…Tasks for you● Open (3)● Completed (3)Auto: on---Let Claude use this pane on its own?Claude would post anything only you can do here, and check tasks off when you confirm them in chat.Nothing for you to do right now.Yes, automaticallyOnly when I ask---#a1b2c3d Fix login31. CopyCopy
npm test31. CopyCopynpm test31. CopyCopyExpect: Donenpm testDoneCopyCopyCopyCancel replyReply What happened? Paste output or describe it send---#a1b2c3d Fix login31. CopyCopynpm test31. CopyCopynpm test31. CopyCopyExpect: Donenpm testDoneCopyCopyCopyCancel replyReply What happened? Paste output or describe it send---#a1b2c3d Fix login31. CopyCopynpm test31. CopyCopynpm test31. CopyCopyExpect: Donenpm testDoneCopyCopyCopyCancel replyReply What happened? Paste output or describe it send -
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 に頼む…PR securityall3 shown · 3 ignoredLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — EditLApprove [high] Pull requests: Merge — Editignored (3)⋯src/app.ts:Approve Pull requests: Mergesrc/app.ts:Approve Pull requests: Mergesrc/app.ts:Approve Pull requests: Merge
-
何をするか
- 欄・トーストを描く
- /chronicle を足す
- ツールの呼び出しを見張る
- agent.spawn・config.set・session.end・session.measure ほか 1 個にフックする