modscode / 図鑑 / linear-claude-mod
linear-claude-mod
A Claude Code pane of your assigned Linear tickets by status; click one to load it into the session, read its details, comment, or change its status and priority
何をするか
- 欄・トーストを描く
- /tickets を足す
- session.startにフックする
- プロセスを起こす
良いところ
- ネットワークに出ない
- TypeScript で書かれている
- エラーを扱う
- ファイルを書かない
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like linear-claude-mod by rjohnt (pane, toast), as modscode read it from the mod's code:
// https://modscode.com/gallery/rjohnt-linear-claude-mod/
// 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: "Linear" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Button, Text, Input, Select, Markdown } = $.ui.resolve(e)
const id = '…'
const title = '…'
const meta = '…'
const labels = '…'
const branch = '…'
const saving = '…'
const stateValue = '…'
const priority = '…'
const detailError = '…'
const length = '…'
const author = '…'
const ago = '…'
const body = '…'
const author2 = '…'
const author3 = '…'
return (
<Box flexDirection="column" gap={1}>
<Box justifyContent="space-between">
<Button plain hotkey="b" label="Back to list" />
<Box gap={2}>
<Button plain hotkey="w" label="Work on this" />
<Button plain hotkey="o" label="Open in Linear" />
</Box>
</Box>
<Box flexDirection="column">
<Text bold>
{id}
{" "}
{title}
</Text>
<Text dimColor>
{meta}
</Text>
<Text color="magenta">
{labels}
</Text>
<Text dimColor>
{"branch "}
{branch}
</Text>
</Box>
<Box flexDirection="column">
<Box gap={2}>
<Button plain hotkey="c" label="Comment" />
<Button plain hotkey="m" label="Move" />
<Button plain hotkey="p" label="Priority" />
<Button plain hotkey="x" label="Cancel" />
</Box>
<Text dimColor>
{saving}
</Text>
<Input label="Comment: " placeholder="Markdown; Enter posts it" submitLabel="post" autoFocus />
<Text dimColor>
Loading statuses…
</Text>
<Select label="Move to: " value={`${stateValue}`} autoFocus />
<Select label="Priority: " value={`${priority}`} autoFocus />
</Box>
<Text dimColor>
Loading ticket…
</Text>
<Text color="red">
{"Linear: "}
{detailError}
</Text>
<Markdown text="_No description._" />
<Box flexDirection="column">
<Text bold>
Comments (
{length}
)
</Text>
<Text dimColor>
None yet.
</Text>
<Box flexDirection="column" marginTop={1}>
<Text color="cyan">
{author}
<Text dimColor>
{` ${ago}`}
</Text>
</Text>
<Markdown text={`${body}`} />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="cyan">
{author2}
<Text dimColor>
{` ${ago}`}
</Text>
</Text>
<Markdown text={`${body}`} />
</Box>
<Box flexDirection="column" marginTop={1}>
<Text color="cyan">
{author3}
<Text dimColor>
{` ${ago}`}
</Text>
</Text>
<Markdown text={`${body}`} />
</Box>
</Box>
</Box>
)
})
on('session.start', async ($, e, next) => {
const url = '…'
const id = '…'
await $.ui.toast(`Couldn't open a browser: ${url}`)
await $.ui.toast(`Loading ${id} into the session`)
return next(e)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
hooks/register.tsx 216〜375 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const ui = $.ui.resolve(e)
const { Box, Text, Button, Markdown } = ui
// Mobile draws no Input or Select yet, so it gets no actions.
const fields = 'Input' in ui && 'Select' in ui ? { Input: ui.Input, Select: ui.Select } : null
const now = await $.clock.now()
const {
selected,
detail,
isLoading: isDetailLoading,
error: detailError,
action,
states,
saving,
} = await read($, view)
if (selected) {
const t = detail ?? selected
const meta = [
t.status,
PRIORITY_LABEL[t.priority]?.trim() || null,
t.project,
detail?.assignee,
detail?.updatedAt ? `updated ${ago(now - Date.parse(detail.updatedAt))}` : null,
].filter(Boolean)
return (
<Box flexDirection="column" gap={1}>
<Box justifyContent="space-between">
<Button key="back" plain hotkey="b" label="Back to list" onPress={() => void backToList($)} />
<Box gap={2}>
<Button
key="work"
plain
hotkey="w"
label="Work on this"
onPress={() => {
void $.prompt.submit({ text: workPrompt(selected), asUser: true })
$.ui.toast(`Loading ${selected.id} into the session`)
}}
/>
<Button key="open" plain hotkey="o" label="Open in Linear" onPress={() => void openUrl($, t.url)} />
</Box>
</Box>
<Box flexDirection="column">
<Text bold>
{t.id} {t.title}
</Text>
<Text dimColor>{meta.join(' · ')}</Text>
{detail && detail.labels.length > 0 && <Text color="magenta">{detail.labels.join(', ')}</Text>}
{detail?.branch && <Text dimColor>branch {detail.branch}</Text>}
</Box>
{fields && (
<Box flexDirection="column">
<Box gap={2}>
<Button key="act:comment" plain hotkey="c" label="Comment" onPress={() => void openAction($, 'comment')} />
<Button key="act:move" plain hotkey="m" label="Move" onPress={() => void openAction($, 'move')} />
<Button key="act:priority" plain hotkey="p" label="Priority" onPress={() => void openAction($, 'priority')} />
{action && <Button key="act:cancel" plain hotkey="x" label="Cancel" onPress={() => void closeAction($)} />}
</Box>
{saving && <Text dimColor>{saving}</Text>}
{!saving && action === 'comment' && (
<fields.Input
key={ACTION_KEY.comment}
label="Comment: "
placeholder="Markdown; Enter posts it"
submitLabel="post"
autoFocus
onSubmit={value => void postComment($, value)}
/>
)}
{!saving && action === 'move' && !states && <Text dimColor>Loading statuses…</Text>}
{!saving && action === 'move' && states && states.length > 0 && (
<fields.Select
key={ACTION_KEY.move}
label="Move to: "
options={states.map(s => ({ value: stateValue(s), label: s.name }))}
value={stateValue(states.find(s => s.name === t.status) ?? states[0]!)}
autoFocus
onSelect={value => void moveTo($, value)}
/>
)}
{!saving && action === 'priority' && (
<fields.Select
key={ACTION_KEY.priority}
label="Priority: "
options={PRIORITY_OPTIONS}
value={String(t.priority)}
autoFocus
onSelect={value => void setPriority($, value)}
/>
)}
</Box>
)}
{isDetailLoading && <Text dimColor>Loading ticket…</Text>}
{detailError && <Text color="red">Linear: {detailError}</Text>}
{detail && (
<Markdown key="description" text={detail.description.trim() || '_No description._'} />
)}
{detail && (
<Box flexDirection="column">
<Text bold>Comments ({detail.comments.length})</Text>
{detail.comments.length === 0 && <Text dimColor>None yet.</Text>}
{detail.comments.map((c, i) => (
<Box key={`c:${i}`} flexDirection="column" marginTop={1}>
<Text color="cyan">
{c.author}
<Text dimColor>{c.createdAt ? ` ${ago(now - Date.parse(c.createdAt))}` : ''}</Text>
</Text>
<Markdown key={`cm:${i}`} text={c.body} />
</Box>
))}
</Box>
)}
</Box>
)
}
const { tickets, loadedAt, isLoading, error } = await read($, board)
const cols = e.props.bodyColumns || e.viewport?.columns || 80
const room = Math.max(3, (e.viewport?.rows ?? 24) - 3)
const groups = groupTickets(tickets)
const rows: RenderNode[] = []
let hotkey = 1
for (const g of groups) {
if (rows.length >= room) break
rows.push(
<Text key={`h:${g.status}`} bold color={g.tickets[0]?.statusType === 'started' ? 'cyan' : undefined}>
{g.status} ({g.tickets.length})
</Text>,
)
for (const t of g.tickets) {
if (rows.length >= room) break
const key = hotkey <= 9 ? String(hotkey++) : undefined
const label = `${PRIORITY_LABEL[t.priority] ?? ' '} ${t.id} ${t.title}`
rows.push(
<Button
key={t.id}
plain
hotkey={key}
dimColor={t.statusType === 'backlog'}
label={label.length > cols - 6 ? `${label.slice(0, cols - 7)}…` : label}
onPress={() => void showTicket($, t)}
/>,
)
}
}
const hidden = tickets.length + groups.length - rows.length
return (
<Box flexDirection="column">
<Box justifyContent="space-between">
<Text dimColor>
{isLoading ? 'Refreshing…' : loadedAt ? `${tickets.length} open · ${ago(now - loadedAt)}` : ''}
</Text>
<Button key="refresh" plain hotkey="r" label="Refresh" onPress={() => void refresh($)} />
</Box>
{error && <Text color="red">Linear: {error}</Text>}
{!isLoading && !error && loadedAt && tickets.length === 0 && <Text dimColor>No open tickets assigned to you.</Text>}ライセンスの全文(MIT)
MIT License Copyright (c) 2026 Ryan Timmons 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 に読んだコミット 629eb7d23bb8 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。hooks/register.tsx |
| 解析できる | すべてのファイルが TypeScript か JavaScript として解析できる。2 ファイルを解析 |
| コードが 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:92 実行時に決まるプログラム |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。通信しない |
| ソースの鍵 | ソースに 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 のデザイン「rjohnt-linear-claude-mod」をコードごと読んで、同じようなペインを作って似たデザイン
-
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 に頼む…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
-
a1b2c3d's result did not fit in the promptClaude に頼む…
-
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⋯
-
Claude に頼む…Vikunja 3 doing · 3 blockedVikunjaloading… · demo dataRefresh rAnyoneVikunjaAnyMarBlocked ShowHideDue buildbuildbuildClearFind # Mar findClearFOUND #Marlooking…MarNo task has that number.Apr✓ Fix loginOct 6my-app buildPhighApr✓ Fix loginOct 6my-app buildPhighApr✓ Fix loginOct 6my-app buildPhighTHIS SESSION3Apr✓ Fix loginOct 6my-app buildPhighApr✓ Fix loginOct 6my-app buildPhighApr✓ Fix loginOct 6my-app buildPhighbuild3Nothing here.my-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighmy-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighmy-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhigh3 more not shown. Narrow them with the filters.build3Nothing here.my-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighmy-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighmy-appApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhighApr✓ Fix loginOct 6Done buildPhigh
-
Claude に頼む…agent-discoverbuildbuildbuildRefreshMCP Browse/3Tab / shift+Tab move · Enter presses · ↑↓ scroll · Esc back to the promptBrowse...Audit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancelAudit asks:DeclineAcceptDeclineCancel