dagyard
Dagyard en Claude Code: lo que te espera y lo que está para tomar sobre el prompt, el menú /dagyard y un aviso cuando algo nuevo te espera
何をするか
- プロンプトの上の帯・欄を描く
- /dagyard を足す
- session.start・turn.completeにフックする
- ネットワークに出る
- プロセスを起こす
良いところ
- TypeScript で書かれている
- エラーを扱う
- ファイルを書かない
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like dagyard by Cofoundy (pane, band, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/cofoundy-dagyard/
// 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 } = $.ui.resolve(e)
const project = '…'
const progress = '…'
const waitingCount = '…'
const startableCount = '…'
return (
<Box flexDirection="column">
<Text wrap="truncate-end">
<Text color="#9fd3ff">
{"◆ dagyard "}
</Text>
<Text bold>
{project}
</Text>
<Text color="#6b7a93">
{progress}
{" · "}
</Text>
<Text color="#ffb547">
{waitingCount}
</Text>
<Text color="#6b7a93">
{" · "}
</Text>
<Text color="#9fd3ff">
{startableCount}
</Text>
</Text>
{await next(e)}
</Box>
)
})
// the pane: open it with $.ui.open({ id: 'my-pane', title: "Dagyard" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const offlineMenu = '…'
const retry = '…'
return (
<Box flexDirection="column">
<Text color="#6b7a93">
{offlineMenu}
</Text>
<Button label={`${retry}`} />
</Box>
)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
packages/mod/hooks/register.tsx 277〜380 行 · バンド
on('ui.render', { component: 'AbovePrompt' }, async ($, e, next) => {
const below = await next(e)
const v = view
if (!project || e.props.hasSurvey || e.props.isWorking || hidden) return below
if (!v) {
if (!loading && !lastError) void refresh($)
const { Box: B, Text: T } = $.ui.resolve(e)
return (
<B flexDirection="column">
<T color={MUTED}>{s.offline(base, lastError || s.loading)}</T>
{below}
</B>
)
}
const { Box, Button, Text } = $.ui.resolve(e)
const list: Item[] = [...v.waiting, ...v.startable]
const head = (
<Text wrap="truncate-end">
<Text color={BLUE}>◆ dagyard </Text>
<Text bold>{v.project}</Text>
<Text color={MUTED}>{s.progress(v.done, v.total, v.now)} · </Text>
<Text color={v.waiting.length ? AMBER : MUTED}>{s.waitingCount(v.waiting.length)}</Text>
<Text color={MUTED}> · </Text>
<Text color={v.startable.length ? BLUE : MUTED}>{s.startableCount(v.startable.length)}</Text>
</Text>
)
let body = null
const w = working
if (busy) {
body = <Text color={MUTED}>…</Text>
} else if (w) {
body = (
<Box flexDirection="column">
<Text wrap="truncate-end">
<Text color={BLUE}>{s.workingOn}</Text>
<Text bold>{w.title}</Text>
</Text>
<Box flexWrap="wrap">
<Button key="dy-done" label={s.done} hotkey="h" variant="primary" onPress={() => void patchWorking($, w, { status: 'done' }, s.isDone(w.title))} />
<Button key="dy-release" label={s.release} hotkey="l" onPress={() => void patchWorking($, w, { status: 'pending', team: null, progress: 0 }, '')} />
<Button key="dy-open" label={s.openSky} hotkey="o" dimColor onPress={() => void openSky($, w.id)} />
</Box>
</Box>
)
} else if (list.length > 0) {
const i = cursor % list.length
const it = list[i]!
const more =
list.length > 1 ? (
<Button key="dy-next" label={s.other(i + 1, list.length)} hotkey="s" dimColor onPress={() => void skip($)} />
) : null
if (it.kind === 'waiting') {
const b = it.blocker
const label = s.waitingLabel(b.kind)
const buttons =
b.kind === 'access'
? [<Button key="dy-sky" label={s.grantInSky} hotkey="o" variant="primary" onPress={() => void openSky($, it.node.id)} />]
: b.options.slice(0, 3).map((opt, k) => (
<Button key={`dy-opt-${k}`} label={opt} hotkey={String(k + 1)} variant={k === 0 ? 'primary' : undefined} onPress={() => void resolve($, it, k, '')} />
))
body = (
<Box flexDirection="column">
<Text wrap="truncate-end">
<Text color={AMBER}>{label} · </Text>
<Text bold>{it.node.title}</Text>
<Text color={MUTED}> — {b.kind === 'access' ? b.accessLabel ?? b.question : b.question}</Text>
</Text>
<Box flexWrap="wrap">
{buttons}
{more}
<Button key="dy-menu" label={s.seeAll} hotkey="m" dimColor onPress={() => void openMenu($)} />
</Box>
</Box>
)
} else {
const n = it.node
body = (
<Box flexDirection="column">
<Text wrap="truncate-end">
<Text color={BLUE}>{s.readyToTake}</Text>
<Text bold>{n.title}</Text>
{n.goal ? <Text color={MUTED}> — /goal {n.goal}</Text> : null}
</Text>
<Box flexWrap="wrap">
<Button key="dy-take" label={s.workOnThis} hotkey="t" variant="primary" onPress={() => void take($, n)} />
{more}
<Button key="dy-menu" label={s.seeAll} hotkey="m" dimColor onPress={() => void openMenu($)} />
</Box>
</Box>
)
}
}
return (
<Box flexDirection="column">
{head}
{body}
{below}
</Box>
)
})packages/mod/hooks/register.tsx 382〜485 行 · ペイン
on('ui.render', { component: 'Pane', requestId: MENU }, async ($, e) => {
const els = $.ui.resolve(e)
const { Box, Button, Text } = els
// «Qué cambiarías» se escribe donde la superficie tiene campo de texto (el celular no lo dibuja);
// donde no, «Pedir cambios» se manda sin nota en vez de dejar un «Cancelar» solo
const Input = e.surface !== 'mobile' && 'Input' in els ? els.Input : null
const v = view
if (!v) {
return (
<Box flexDirection="column">
<Text color={MUTED}>{s.offlineMenu(base, lastError || s.loading)}</Text>
<Button key="mn-retry" label={s.retry} onPress={() => void refresh($)} />
</Box>
)
}
const w = working
const rows: any[] = []
rows.push(
<Text key="mn-head" wrap="truncate-end">
<Text bold>{v.project}</Text>
<Text color={MUTED}>{s.progress(v.done, v.total, v.now)}</Text>
</Text>,
)
if (w) {
rows.push(<Text key="mn-w-sec" color={BLUE}>{'\n'}{s.working}</Text>)
rows.push(
<Box key="mn-w" flexDirection="column">
<Text bold>{w.title}</Text>
<Box flexWrap="wrap">
<Button key="mn-w-done" label={s.done} variant="primary" onPress={() => void patchWorking($, w, { status: 'done' }, s.isDone(w.title))} />
<Button key="mn-w-release" label={s.release} onPress={() => void patchWorking($, w, { status: 'pending', team: null, progress: 0 }, '')} />
</Box>
</Box>,
)
}
rows.push(<Text key="mn-wait-sec" color={v.waiting.length ? AMBER : MUTED}>{'\n'}{s.waitingSection(v.waiting.length)}</Text>)
if (v.waiting.length === 0) rows.push(<Text key="mn-wait-none" color={MUTED}>{s.nothingWaiting}</Text>)
v.waiting.forEach(it => {
if (it.kind !== 'waiting') return
const b = it.blocker
const kind = s.kindName(b.kind)
const id = b.id
let actions: any
if (b.kind === 'access') {
actions = <Button key={`mn-${id}-sky`} label={s.grantInSky} variant="primary" onPress={() => void openSky($, it.node.id)} />
} else if (commenting === id && Input) {
const k = b.options.findIndex(o => REQUEST_CHANGES.test(o))
actions = (
<Box flexDirection="column">
<Input key={`mn-${id}-note`} label={s.whatWouldYouChange} placeholder={s.oneLine} submitLabel={s.send} autoFocus onSubmit={(value: string) => void resolve($, it, k < 0 ? b.options.length - 1 : k, value)} />
<Button key={`mn-${id}-cancel`} label={s.cancel} dimColor onPress={() => void comment($, null)} />
</Box>
)
} else {
actions = (
<Box flexWrap="wrap">
{b.options.map((opt, k) =>
b.kind === 'review' && Input && REQUEST_CHANGES.test(opt) ? (
<Button key={`mn-${id}-${k}`} label={opt} onPress={() => void comment($, id)} />
) : (
<Button key={`mn-${id}-${k}`} label={opt} variant={k === 0 ? 'primary' : undefined} onPress={() => void resolve($, it, k, '')} />
),
)}
</Box>
)
}
rows.push(
<Box key={`mn-${id}`} flexDirection="column">
<Text wrap="wrap">
<Text color={AMBER}>{kind} · </Text>
<Text bold>{it.node.title}</Text>
</Text>
<Text wrap="wrap" color={MUTED}>{b.kind === 'access' ? `${b.question} (${b.accessLabel ?? s.access})` : b.question}</Text>
{actions}
</Box>,
)
})
rows.push(<Text key="mn-take-sec" color={v.startable.length ? BLUE : MUTED}>{'\n'}{s.startableSection(v.startable.length)}</Text>)
if (v.startable.length === 0) rows.push(<Text key="mn-take-none" color={MUTED}>{s.nothingStartable}</Text>)
v.startable.forEach(it => {
const n = it.node
rows.push(
<Box key={`mn-t-${n.id}`} flexDirection="column">
<Text bold>{n.title}</Text>
{n.goal ? <Text wrap="wrap" color={MUTED}>/goal {n.goal}</Text> : null}
<Button key={`mn-t-${n.id}-take`} label={s.workOnThis} variant="primary" onPress={() => void take($, n)} />
</Box>,
)
})
rows.push(
<Box key="mn-foot">
<Text>{'\n'}</Text>
<Button key="mn-sky" label={s.openSky} dimColor onPress={() => void openSky($, w?.id)} />
<Button key="mn-band" label={hidden ? s.showBand : s.hideBand} dimColor onPress={() => void toggleBand($)} />
</Box>,
)
return <Box flexDirection="column">{rows}</Box>
})ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Cofoundy SAC 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.
コードが呼ぶもの
通信プログラム起動ファイル読み取り環境変数
コードから読めること
2026-10-06 に読んだコミット 0ec6357adcb6 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。packages/mod/hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。3 ファイルを解析 |
| コードが 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/… などは無い)。packages/mod/hooks/register.tsx:215 open(Windows にない) |
| 通信 | fetch の送り先(https のホスト)がコードに書いてあるか。packages/mod/hooks/register.tsx:130 fetch(`${base}${path}`) |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。printenv, open(通信する) |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。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 .)、触るものを見て、読んだコミットを入れてください。
リポジトリの .claude-plugin/marketplace.json にこの Mod が載っていないため、入れる手順は出せません。コードとして読むか、作者の README に従ってください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「cofoundy-dagyard」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…2h 10m · █████░░░✓ build ✓ build ✓ buildJavaKotlin3 Python■ ok 3 ■ ok 3 ■ ok 3 Razor proven 3 Razor proven 3 Razor proven 3Phases ──────── 3/3build Pythonbuild Pythonbuild Python… 3 more phasesLua ──────── 3/Kotlin■ the whole upgrade Ruby■ build build Ruby■ build build Ruby■ build build Ruby … 3 moreNext ──────── PythonRuby (by hand)Podsclick a button, or ctrl+x tab then Tab, EnterAttention ──────── 3! Scala ! Scala ! Scala … 3 moreSession ──────── okJava
-
Open a file first: /crit-tui file <path>Reopen this one in the crit browser view.Claude に頼む…
-
Claude に頼む…TodayOct 63 left · Mar overdueRemCTL: Sep✓ All done for today.● build3● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓● build3● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓● build3● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓● Fix login ● ⚑Jul · build✓Updated 14:32UndoRefresh
-
Claude に頼む…TO graph› Fix login › Fix login › Fix loginScopeThis featureWhole projectHide done stepsReconnect
-
Claude に頼む…Blast Radius⚠ Blast Radius · buildCommand npm testWould CancelProceed Proceed ProceedBash1 Proceed2 CancelClaude is waiting on your answer
-
Claude に頼む…Agent Radar● Edit note · 2h 10m · 0 toolsnow: starting────────No messages yet.agent: (tool calls)agent: (tool calls)agent: (tool calls)Back bClose q