lint-feedback
Runs your linter on every file Claude edits and hands the errors back with the edit's result, so Claude fixes them right away.
何をするか
- 欄を描く
- /lint-feedback を足す
- ツールの呼び出しを見張る
- session.startにフックする
- プロセスを起こす
良いところ
- ネットワークに出ない
- TypeScript で書かれている
- デスクトップ専用の分岐がある
- エラーを扱う
作り始めるためのコード
2 種類あります。上のデザインから modscode が書いた雛形と、その Mod 自身のコードのうち描いている部分です。
雛形(register.tsx)
import type { Register } from 'claude-code'
// Drawn like lint-feedback by mako-code (pane), as modscode read it from the mod's code:
// https://modscode.com/gallery/mako-code-lint-feedback/
// 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: "Lint feedback" })
on('ui.render', { component: 'Pane', requestId: 'my-pane' }, async ($, e) => {
const { Box, Text, Code, Button } = $.ui.resolve(e)
const ruleCount = '…'
const length = '…'
const SOURCE = '…'
const patterns = '…'
const command = '…'
const command2 = '…'
const command3 = '…'
const p = '…'
const hhmmss = '…'
const glyph = '…'
const tool = '…'
const fileOf = '…'
const detail = '…'
const seconds = '…'
const glyph2 = '…'
const fileOf2 = '…'
const glyph3 = '…'
const fileOf3 = '…'
return (
<Box flexDirection="column" gap={1}>
<Text>
<Text bold>
Lint feedback
</Text>
<Text dimColor>
{` · ${ruleCount} rule · ${length} recent check`}
</Text>
</Text>
<Box flexDirection="column">
<Text>
<Text bold>
Rules
</Text>
<Text dimColor>
{` · ${SOURCE}`}
</Text>
</Text>
<Text wrap="truncate-end">
{` ${patterns}`}
<Text dimColor>
{" → "}
</Text>
{command}
</Text>
<Text wrap="truncate-end">
{` ${patterns}`}
<Text dimColor>
{" → "}
</Text>
{command2}
</Text>
<Text wrap="truncate-end">
{` ${patterns}`}
<Text dimColor>
{" → "}
</Text>
{command3}
</Text>
<Text color="yellow" wrap="wrap">
{` ▲ ${p}`}
</Text>
<Text color="yellow" wrap="wrap">
{` ▲ ${p}`}
</Text>
<Text color="yellow" wrap="wrap">
{` ▲ ${p}`}
</Text>
</Box>
<Box flexDirection="column">
<Text dimColor>
No checks run. Add .claude/lint-feedback.json to the project, for example:
</Text>
<Code source={"{\n \"*.ts,*.tsx,*.js,*.jsx\": \"npx --no-install eslint {file}\",\n \"*.py\": \"ruff check {file}\"\n}"} language="json" />
<Text dimColor>
or set the plugin’s rules option (patterns=command). Without either, ESLint and Ruff/flake8 are used when the project s…
</Text>
</Box>
<Box flexDirection="column">
<Text bold>
Latest checks
</Text>
<Text dimColor>
None yet: a check runs after each successful Edit, Write or NotebookEdit.
</Text>
<Text wrap="truncate-end">
<Text dimColor>
{`${hhmmss} `}
</Text>
<Text>
{glyph}
</Text>
{` ${tool} `}
<Text bold>
{fileOf}
</Text>
<Text dimColor>
{` ${detail} · ${seconds} · subagent`}
</Text>
</Text>
<Text wrap="truncate-end">
<Text dimColor>
{`${hhmmss} `}
</Text>
<Text>
{glyph2}
</Text>
{` ${tool} `}
<Text bold>
{fileOf2}
</Text>
<Text dimColor>
{` ${detail} · ${seconds} · subagent`}
</Text>
</Text>
<Text wrap="truncate-end">
<Text dimColor>
{`${hhmmss} `}
</Text>
<Text>
{glyph3}
</Text>
{` ${tool} `}
<Text bold>
{fileOf3}
</Text>
<Text dimColor>
{` ${detail} · ${seconds} · subagent`}
</Text>
</Text>
</Box>
<Box gap={1}>
<Button hotkey="r" label="Reload rules" />
<Button hotkey="x" role="dismiss" label="Close" />
</Box>
</Box>
)
})
}
Mod 自身のコード
Mod のライセンス(MIT)に従って載せています。全文は下にあります。写すときは著作権表示を残してください。
mods/autopilot/lint-feedback/hooks/register.tsx 287〜351 行 · ペイン
on('ui.render', { component: 'Pane', requestId: PANE }, async ($, e) => {
const { Box, Text, Button, Code } = $.ui.resolve(e)
const set = await read($, ruleSet)
const list = await read($, results)
const root = await $.session.root()
const cols = Math.max(30, e.props.bodyColumns)
const fileRoom = Math.max(12, cols - 40)
const fileOf = (file: string) => {
const shown = shortPath(file, root)
return shown.length > fileRoom ? `…${shown.slice(-(fileRoom - 1))}` : shown
}
const ruleCount = set?.rules.length ?? 0
return (
<Box flexDirection="column" gap={1}>
<Text>
<Text bold>Lint feedback</Text>
<Text dimColor>{` · ${ruleCount} ${ruleCount === 1 ? 'rule' : 'rules'} · ${list.length} recent ${list.length === 1 ? 'check' : 'checks'}`}</Text>
</Text>
<Box flexDirection="column">
<Text>
<Text bold>Rules</Text>
<Text dimColor>{` · ${SOURCE[set?.source ?? 'none']}`}</Text>
</Text>
{(set?.rules ?? []).map((r, i) => (
<Text key={`rule${i}`} wrap="truncate-end">
{` ${r.patterns.join(' ')}`}
<Text dimColor> → </Text>
{r.command}
</Text>
))}
{(set?.problems ?? []).map((p, i) => (
<Text key={`problem${i}`} color="yellow" wrap="wrap">{` ▲ ${p}`}</Text>
))}
</Box>
{(set === null || set.rules.length === 0) && (
<Box flexDirection="column">
<Text dimColor>No checks run. Add .claude/lint-feedback.json to the project, for example:</Text>
<Code source={EXAMPLE} language="json" />
<Text dimColor>or set the plugin’s rules option (patterns=command). Without either, ESLint and Ruff/flake8 are used when the project sets them up.</Text>
</Box>
)}
<Box flexDirection="column">
<Text bold>Latest checks</Text>
{list.length === 0 && <Text dimColor>None yet: a check runs after each successful Edit, Write or NotebookEdit.</Text>}
{[...list].reverse().map((r, i) => {
const mark = MARK[r.outcome]
const glyph = mark.glyph[modeFor(e.surface) === 'full' ? 0 : 1]
return (
<Text key={`result${i}`} wrap="truncate-end">
<Text dimColor>{`${hhmmss(r.at)} `}</Text>
<Text color={mark.color}>{glyph}</Text>
{` ${r.tool} `}
<Text bold>{fileOf(r.file)}</Text>
<Text dimColor>{` ${r.detail}${r.ms > 0 ? ` · ${seconds(r.ms)}` : ''}${r.agentId !== null ? ' · subagent' : ''}`}</Text>
</Text>
)
})}
</Box>
<Box gap={1}>
<Button key="redetect" hotkey="r" label="Reload rules" onPress={() => void redetect($)} />
<Button key="close" hotkey="x" role="dismiss" label="Close" onPress={() => void $.ui.close({ id: PANE })} />
</Box>
</Box>
)
})ライセンスの全文(MIT)
MIT License Copyright (c) 2026 mako-code 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.
コードが呼ぶもの
プログラム起動ファイル読み取り環境変数ツール呼び出し
コードから読み取ったデザイン
{
"*.ts,*.tsx,*.js,*.jsx": "npx --no-install eslint {file}",
"*.py": "ruff check {file}"
}or set the plugin’s rules option (patterns=command). Without either, ESLint and Ruff/flake8 are used when the project s…読み取ったコミットのソースから描いたもので、動かした結果ではありません。一覧は 3 回描き、条件はデスクトップアプリで描く最初の分岐を取り、動かしたときにだけ決まる値は仮の例(点線の下線)にするか省きます。色と書体はこのサイトのものです。
コードから読めること
2026-10-06 に読んだコミット ec6ea2383749 のソースから。最初のまとまりが載せる条件で、残りは自分で判断するための材料です。後のコミットは、次に読むまで見ていません。
| 載せる条件: 確かめやすいコード | |
|---|---|
| 入口を読んだ | hooks/hooks.json が名指すモジュールをすべて読んだ。mods/autopilot/lint-feedback/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/… などは無い)。Windows にないプログラムを使わない |
| 通信 | fetch の送り先(https のホスト)がコードに書いてあるか。通信なし |
| プログラム | 起動するプログラムの名前がコードに書いてあり、シェル・インタプリタ・通信用の道具でないか。mods/autopilot/lint-feedback/hooks/register.tsx:159 実行時に決まるプログラム |
| 読んで送る | ファイルや環境変数を読み、かつ通信するか。通信しない |
| ソースの鍵 | ソースに API キーや秘密鍵らしきものがあるか。ソースに鍵なし |
| ライセンス | オープンなライセンス(MIT・Apache-2.0・BSD・ISC・Unlicense・0BSD・CC0)で全文があれば、modscode にコードを載せる。違えばリンクだけ。MIT |
コードの文面を読んだだけで、安全の審査ではありません。動かしてはおらず、起動するプログラムの中で何が起きるかも見えません。入れる前の確認はあなたの役目です。 載せる条件
入れる
入れる前に、必ず自分で確かめてください。Mod はサンドボックスなしで、あなたの権限で動きます。modscode はこのコードの安全を保証しません。下のコードを読み(またはフォルダーで claude plugin validate .)、触るものを見て、読んだコミットを入れてください。
リポジトリがそのままマーケットプレイスです。このマーケットプレイスを足し(ターミナルでは次のコマンド、デスクトップアプリではプラグインの設定)、そこから Mod を入れます。
/plugin marketplace add mako-code/gobworks/plugin install lint-feedback@gobworks入るのはマーケットプレイスの最新のコミットで、ここで読んだもの(ec6ea2383749)と違うことがあります。入れる前に見比べてください。
Claude に聞く
modscode のコネクタを入れると、Claude がこのデザイン・コードが触るもの・コードを読んで、それをもとに作れます。たとえば:
modscode のデザイン「mako-code-lint-feedback」をコードごと読んで、同じようなペインを作って似たデザイン
-
slop Edit1 of 3accepteditrejectClaude に頼む…
-
Claude に頼む…Review plannerEXAMPLE · REVIEW PLANNINGPrepare a focused reviewDemo data and a manual checklist. No code has been inspected.Review scope Chat composer: draft handling and keyboard focuscorrectnessView example diffPreparation checklist42%✓Fix loginExample diffUndo✓Fix loginExample diffUndo✓Fix loginExample diffUndoPrepare review promptReset checklistPreparing a prompt only updates the draft. Nothing is sent.
-
Claude に頼む…Mod controlsLive Claude ModCount: 0 / Initial / oneAdd oneName InitialOne**Markdown** with a [link](https://example.com)
const count = 1;
./counter.tsxFill composerAppend noteSuggest draftCopy text -
Claude に頼む…Desktop File DeskDesktop File DeskText file README.md applyFilter lines applyChoose a file to read.
RetryDraft a questionRefresh -
Claude に頼む…Desktop Markdown ReaderDesktop Markdown ReaderMarkdown file README.md applyChoose a Markdown file.No document loaded.Copy Markdown sourceRefresh
-
Claude に頼む…Desktop Prompt BuilderDesktop Prompt Builderbuild Retry applybuild Retry applybuild Retry apply
RetryFill composer draftCopy promptRetryRefresh