fleet
A pane of this session's agents grouped by the epics and tickets of GitHub project boards: ticket status, epic completion, each ticket's agents with their sub-agents folded
何をするか
- 欄・トーストを描く
- /fleet を足す
- ツールの呼び出しを見張る
- agent.spawn・session.start・turn.complete・ui.closeにフックする
- ターンをまたいで自分の状態を持つ
良いところ
- ネットワークに出ない
- TypeScript で書かれている
- エラーを扱う
- ファイルを書かない
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like fleet by neonelemental (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/neonelemental-fleet/
// 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: "Fleet" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Button } = $.ui.resolve(e)
const plural = '…'
const missing = '…'
const problem = '…'
const problem2 = '…'
const problem3 = '…'
const error = '…'
const label = '…'
const running = '…'
const glyph = '…'
const type = '…'
const when = '…'
const doing = '…'
const age = '…'
const glyph2 = '…'
const type2 = '…'
const glyph3 = '…'
const type3 = '…'
return (
<Box flexDirection="column">
<Box gap={1} justifyContent="space-between">
<Text bold>
{`${plural} running`}
</Text>
<Button label="Refresh" />
</Box>
<Text wrap="wrap">
{missing}
</Text>
<Text color="yellow" wrap="wrap">
{problem}
</Text>
<Text color="yellow" wrap="wrap">
{problem2}
</Text>
<Text color="yellow" wrap="wrap">
{problem3}
</Text>
<Text color="red" wrap="wrap">
{`GitHub: ${error}`}
</Text>
<Text dimColor wrap="wrap">
No agents yet. An agent joins a ticket by naming its id or its #number in its description.
</Text>
<Box flexDirection="column" marginTop={1}>
<Text bold>
Not in an epic
</Text>
</Box>
<Box flexDirection="column" marginTop={1}>
<Box flexDirection="column">
<Box paddingLeft="0">
<Button plain dimColor label={`▾ ${label} · ${running} running`} />
</Box>
<Box flexDirection="column">
<Box gap={1}>
<Text>
{glyph}
</Text>
<Box flexShrink={1}>
<Text wrap="truncate-end">
{type}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
{`${type} · ${when} · on screen`}
</Text>
</Box>
</Box>
<Box paddingLeft={2}>
<Text dimColor wrap="truncate-end">
{`↳ ${doing} · ${age} ago`}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box gap={1}>
<Text>
{glyph2}
</Text>
<Box flexShrink={1}>
<Text wrap="truncate-end">
{type2}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
{`${type} · ${when} · on screen`}
</Text>
</Box>
</Box>
<Box paddingLeft={2}>
<Text dimColor wrap="truncate-end">
{`↳ ${doing} · ${age} ago`}
</Text>
</Box>
</Box>
<Box flexDirection="column">
<Box gap={1}>
<Text>
{glyph3}
</Text>
<Box flexShrink={1}>
<Text wrap="truncate-end">
{type3}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>
{`${type} · ${when} · on screen`}
</Text>
</Box>
</Box>
<Box paddingLeft={2}>
<Text dimColor wrap="truncate-end">
{`↳ ${doing} · ${age} ago`}
</Text>
</Box>
</Box>
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
await $.ui.toast(`Fleet: type /fleet to open the pane`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
fleet/hooks/register.tsx 941〜1100 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text, Button, Link } = $.ui.resolve(e)
const v = await read($, view)
const shown = await read($, open)
const width = Math.max(40, e.props.bodyColumns)
const viewing = e.props.view?.agentId
const toggle = (key: string, byDefault = false) => () =>
update($, open, m => ({ ...m, [key]: !(m[key] ?? byDefault) }))
if (!v) return <Text dimColor>Reading this session's agents…</Text>
const agentLine = (a: FleetAgent, indent: number) => {
const mark = MARKS[a.status] ?? { glyph: '·' }
const when = isActive(a.status)
? a.startedAt
? `running ${age(v.now - a.startedAt)}`
: 'running'
: a.endedAt
? `${a.status} ${age(v.now - a.endedAt)} ago`
: a.status
const onScreen = a.id === viewing
return (
<Box key={`a-${a.id}`} flexDirection="column" paddingLeft={indent}>
<Box gap={1}>
<Text {...tint(mark.color)}>{mark.glyph}</Text>
<Box flexShrink={1}>
<Text bold={onScreen} wrap="truncate-end">
{a.description || a.type}
</Text>
</Box>
<Box flexShrink={0}>
<Text dimColor>{`${a.type} · ${when}${onScreen ? ' · on screen' : ''}`}</Text>
</Box>
</Box>
{!!a.doing && (
<Box paddingLeft={2}>
<Text dimColor wrap="truncate-end">{`↳ ${a.doing} · ${age(v.now - (a.doingAt ?? v.now))} ago`}</Text>
</Box>
)}
</Box>
)
}
const folded = (key: string, label: string, indent: number, agents: FleetAgent[]) => {
const isOpen = shown[key] === true
const running = agents.filter(a => isActive(a.status)).length
return (
<Box key={`f-${key}`} flexDirection="column">
<Box paddingLeft={indent}>
<Button
key={key}
plain
dimColor
label={`${isOpen ? '▾' : '▸'} ${label}${running ? ` · ${running} running` : ''}`}
onPress={toggle(key)}
/>
</Box>
{isOpen && agents.map(a => agentLine(a, indent + 2 * a.depth))}
</Box>
)
}
const ticketBlock = (t: FleetTicket) => {
const tone = toneOf(t.status)
const key = `fold-${t.id}`
// a completed ticket starts folded, unless an agent under it still runs
const byDefault = !t.isDone || t.running > 0
const isOpen = shown[key] ?? byDefault
return (
<Box key={`t-${t.id}`} flexDirection="column" paddingLeft={2}>
<Box gap={1}>
<Button key={key} plain dimColor label={isOpen ? '▾' : '▸'} onPress={toggle(key, byDefault)} />
<Text {...tint(tone.color)}>{tone.glyph}</Text>
<Box flexShrink={0}>{t.url ? <Link href={t.url} label={t.id} /> : <Text bold>{t.id}</Text>}</Box>
<Box flexShrink={0}>
<Text {...tint(tone.color)}>{t.isDone ? 'Complete' : t.status}</Text>
</Box>
<Box flexShrink={1}>
<Text wrap="truncate-end">{t.title}</Text>
</Box>
{!isOpen && (
<Box flexShrink={0}>
<Text dimColor>{plural(t.leads.length + t.subs.length, 'agent')}</Text>
</Box>
)}
</Box>
{isOpen && t.leads.map(a => agentLine(a, 2))}
{isOpen && t.subs.length > 0 && folded(`sub-${t.id}`, plural(t.subs.length, 'sub-agent'), 2, t.subs)}
</Box>
)
}
const epicBlock = (ep: FleetEpic) => {
const pct = ep.total ? Math.round((100 * ep.done) / ep.total) : 0
const bar = Math.max(10, Math.min(24, width - 40))
const filled = Math.round((bar * pct) / 100)
return (
<Box key={`e-${ep.key}`} flexDirection="column" marginTop={1}>
<Box gap={1}>
<Box flexShrink={0}>
<Link href={ep.url} label={ep.id} />
</Box>
<Box flexShrink={1}>
<Text bold wrap="truncate-end">
{ep.title}
</Text>
</Box>
</Box>
<Box gap={1}>
<Box flexShrink={0}>
{filled > 0 && <Text color="green">{'█'.repeat(filled)}</Text>}
{filled < bar && <Text dimColor>{'░'.repeat(bar - filled)}</Text>}
</Box>
<Box flexShrink={0}>
<Text bold>{`${pct}%`}</Text>
</Box>
<Box flexShrink={1}>
<Text dimColor wrap="truncate-end">
{`${ep.done} of ${ep.total} done${ep.running ? ` · ${plural(ep.running, 'agent')} running` : ''}`}
</Text>
</Box>
</Box>
{ep.tickets.map(ticketBlock)}
{ep.own.length > 0 &&
folded(`own-${ep.key}`, `${plural(ep.own.length, 'agent')} on the epic itself`, 2, ep.own)}
{ep.waiting.length > 0 && (
<Box paddingLeft={2}>
<Text dimColor wrap="wrap">
{`No agent yet: ${ep.waiting.map(w => `${w.id} (${w.status})`).join(', ')}`}
</Text>
</Box>
)}
</Box>
)
}
const nothing = v.epics.length === 0 && v.loose.length === 0 && v.other.length === 0
return (
<Box flexDirection="column">
<Box gap={1} justifyContent="space-between">
<Text bold>{`${plural(v.running, 'agent')} running`}</Text>
<Button key="refresh" label="Refresh" onPress={() => void refreshAll()} />
</Box>
{settings.missing ? (
<Text wrap="wrap">{settings.missing}</Text>
) : (
<Text dimColor>{v.boardAt ? `Boards read ${age(v.now - v.boardAt)} ago` : 'Reading the boards…'}</Text>
)}
{settings.problems.map((problem, i) => (
<Text key={`problem-${i}`} color="yellow" wrap="wrap">
{problem}
</Text>
))}
{!!v.error && (
<Text color="red" wrap="wrap">
{`GitHub: ${v.error}`}
</Text>
)}
{nothing && (
<Text dimColor wrap="wrap">ライセンスの全文(MIT)
MIT License Copyright (c) 2026 neonelemental 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 に読んだコミット c7ba1db04db8 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。fleet/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 のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。fleet/hooks/register.tsx:870 実行時に決まるプログラム |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。通信しない |
| ソースの鍵 | ソースに 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 のデザイン「neonelemental-fleet」をコードごと読んで、同じようなペインを作って似たデザイン
-
Claude に頼む…Fix login▸★ build ok▸★ build ok▸★ build ok+3 moretasks 3 pending · Glob claimed · 3 doneConsensus42%
-
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
-
Claude に頼む…moai-boardmoai-boardPickedx closebuild 1build 2build 3r refreshQueue not read yetokPick
-
Open a file first: /crit-tui file <path>Reopen this one in the crit browser view.Claude に頼む…
-
Claude に頼む…./rows.tsx●●●●●×./rows.tsxnothing loaded yet● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login● Fix login./rows.tsxWorkspaceWorkspaceWorkspaceselected: build● open in Databricks
-
Claude に頼む…build 3 app●●●◉●●okno Library app here yet; Library adds one●./rows.tsx./rows.tsxselected: Nerd