IntelliJプラグインのAnActionと登録設定を実装・変更し、表示文言やアイコンの定義、非同期処理の起動方法を整えます。
- IDEに新しいアクションを追加したいとき
- アクションの登録やアイコンを変更したいとき
- 表示名と説明文の定義を整理したいとき
コードの意味的な重複や未使用コードの候補を調べ、計画段階の担当箇所確認やレビュー時の重複チェック、削除判断を支援します。
Find semantic copies and dead code before a plan or a review.
実行スコア 未検証
インストール方法を見る変更計画の前に、追加しようとしている処理をすでに担うコードがないか調べます。動作や役割を手がかりに既存コードを探し、呼び出し元や参照先をたどって担当箇所を確認します。レビュー時には、構文や意味が似た関数を検出するコピー lint を実行し、変更したファイルに関係する候補を確認します。また、宣言や画像などの未使用候補を一覧にし、削除する場合の確認手順を示します。
同じ責務を別の場所に実装してしまうのを避けたいときや、変更箇所のレビューで重複を見つけたいときに役立ちます。未使用候補の調査にも使えます。検出結果は確定ではなく候補なので、コードを読んで判断する必要があります。
accio と jscpd を使います。accio が PATH にない場合は ./community/tools/accio.cmd、jscpd は指定のラッパー経由で実行します。初回の意味的解析には548 MBのモデルが必要です。
この紹介文は、公開されている SKILL.md をもとに AI(OpenAI Codex)が作成しました。正確な仕様は下の原文を確認してください。
SKILL.md の記述から、注意が要る操作と導入の前提を AI が確認しました。点数は実際に動かした結果(実行検証)だけで付けています。
点数には入れていません。 2026年10月29日 時点で AI(OpenAI Codex)が判定しました。目安なので、入れる前に原文も確認してください。
インストールする前に、エージェントに与えられる指示の中身を確認できます。
The exact copy-paste gate finds a copied text only. This skill finds one responsibility in two pieces of different code, and dead code. Each tool gives candidates, not a proof. Read each candidate before you act on it.
| Tool | What it finds | Use |
|---|---|---|
jscpd exact, --exit-code 1 | a copied text (Type-1) | the gate of an area |
jscpd --ignore-identifiers --kind renamed | a copy with renamed names (Type-2) | burn-down |
jscpd --similarity 0.9 --kind ast | two functions with one syntax tree (Type-3) | the copy lint |
jscpd --semantic --kind semantic | two functions that do one thing (Type-4) | the copy lint |
jscpd --compare <a>/ <b>/ | the functions of <a> with no counterpart in <b> | a port or two implementations |
accio locate '<question>' --mode semantic, accio context '<task>' | the code of a behaviour or a task | the owner check |
accio trace <Name> --direction callers, accio references <Name> | the callers and every use of a name | the owner check, dead code |
accio unused --scope <dir>/ | declarations, bundle keys and image variants used nowhere | dead code |
Without accio on the PATH, run ./community/tools/accio.cmd. Run jscpd only through
./community/tools/jscpd.cmd -c <config>. <config> is the .jscpd.json of the area, for example
plugins/air/.jscpd.json. An area without a .jscpd.json runs the commands without -c and has no exact gate. Write
each JSON report to a temporary directory of your session. The jscpd_test target of the area runs the gate too, for
example //plugins/air:air-duplicate-code_test.
Do this for each responsibility that the plan adds: a mapping, a policy, a parser, a cache, a lifecycle step.
accio locate '<a full question about the behaviour>' --mode semantic --scope <area>/. On a miss, ask again in
other words.accio context '<the task in words>' --scope <area>/. Name the task by the nouns of the domain, not by a role word
such as "mapper".accio references <ResultType> --scope <area>/ --no-tests --files. A private function that builds the type is an
owner too.accio files '<Prefix>V1*', accio files '<Prefix>V2*'.accio trace <Name> --direction callers for each candidate, then read it. A call site marked ? (:57?) fits
more than one overload: read it.The plan then has an Existing owners line. It names each owner and the decision: extend it, move it, or write new code with the reason why the owner does not fit. When the check finds nothing, the line names the queries.
The copy lint is a report, not a gate. Run it after the exact gate of the area passes, when the area has one. Give the touched directories and the directories of their owners: the scan compares only the files under the paths it gets.
./community/tools/jscpd.cmd -c <config> --similarity 0.9 --kind ast --absolute \
--reporters json --output <temp-dir>/ast <touched-dir>...
./community/tools/jscpd.cmd -c <config> --semantic --semantic-scope same --kind semantic \
--semantic-same-threshold 0.9 --ignore '**/testSrc/**,**/test/**,**/tests/**,**/testFramework/**' \
--absolute --reporters json --output <temp-dir>/semantic <touched-dir>...
Then keep the pairs that touch a file of the change. Run this from the repository root:
{ git diff --name-only <base>; git ls-files --others --exclude-standard; } | sed "s|^|$PWD/|" \
| jq -R . | jq -s . > <temp-dir>/changed.json
jq -r --slurpfile c <temp-dir>/changed.json '.duplicates[]
| select(.firstFile.name as $a | .secondFile.name as $b | $c[0] | index($a) or index($b))
| "\(.similarity) \(.firstFile.name):\(.firstFile.start)-\(.firstFile.end) ~ \(.secondFile.name):\(.secondFile.start)-\(.secondFile.end)"' \
<temp-dir>/ast/jscpd-report.json <temp-dir>/semantic/jscpd-report.json
Filter the report by file, not by kind. An --kind ast pair has "kind": "similar".
--changed or --baseline-from-ref. Each makes a git worktree of the base revision with 1.4 million
files.--semantic run on a machine needs --semantic-download (a model of 548 MB). The first run on a
directory takes minutes. A later run takes below 1 s.accio unused --scope <dir>/ --limit 1000 gives the candidates. Each candidate is a lead. The note of the answer
explains each mark, and accio unused --help says what the scan leaves out and cannot see.
(generated) icon field: delete its SVG and generate the icon class again with the icon-resources skill. First
search the SVG file name over the whole repository. A SKILL.md can name it as an icon, and then the fix is an
icon-robots.txt skip.(published) candidate is a published API. Keep it unless its owner decides otherwise.plugins/air/docs/guides/dead-code-guide.md. Read
it before the triage, and add each candidate that you keep.To delete a candidate, prove it with accio locate '<name>' without --scope. Then delete it, the tests that test
only it, the imports that only it needed, and the KDoc links to it. Delete a dead key from the English bundle only.
The translations under localization/ belong to the localization team. Run the tests of the area, and run
accio unused again.
まだレビューはありません。使ってみた感想をお寄せください。
ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。
まだコメントはありません。最初のコメントを書いてみませんか。
IntelliJプラグインのAnActionと登録設定を実装・変更し、表示文言やアイコンの定義、非同期処理の起動方法を整えます。
IntelliJのJPSテストモジュールをBazelへ移行し、Bazelだけで起きる失敗を依存関係や実行環境から切り分ける手順を案内します。
IntelliJのKotlin・Javaコードを新規作成やレビューする際に、言語の選び方、書式、型の扱い、例外処理などのプロジェクト規約に沿って整えるスキルです。
IntelliJ向けの変更を適切な単位に分け、チケットの有無に応じた形式で、理由や判断も伝わるコミットメッセージを作成・修正するスキルです。
Pythonコードの型推論や型エラーを複数の型チェッカーで比較し、各ツールの判定と診断内容をまとめたレポートを作成します。
Compose Desktopの画面で状態や副作用をどこに持たせるか整理し、表示と判断の境界、再利用部品やリストの設計を整えます。