Repository navigation
feat(skills): add an Agent Skill for compiling TeX with texrun - #64
Conversation
Add skills/texrun (SKILL.md, reference files and a summary script) and a Claude Code plugin marketplace in .claude-plugin/, with unit tests that check the skill against the CLI options, the JSON fields and the kinds. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add docs/agent-skills.md (Claude Code plugin and skills directory installs, other agents, why Claude.ai and the Claude API are not supported, and the consistency tests), a README section and CONTRIBUTING notes. Tell the agent to read the log when a failed compile has no recognized error. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nishide-dev
left a comment
There was a problem hiding this comment.
Verdict: CHANGES_REQUESTED
skill の内容、progressive disclosure、manifest はどれも公式の規約とベストプラクティスに沿っていて、実際に使っても skill の手順どおりに動きました。should-fix が 2 件あるので CHANGES_REQUESTED にしています。どちらも小さな変更で直せます。
確認したこと
- ゲート(clone した PR ブランチ c58eff1 で実行):
cargo check --workspace --all-targets --all-features --locked、cargo fmt --all -- --check、cargo clippy ... -D warnings、cargo test --workspace --all-features --lockedはすべて通過しました(skill_docsの 6 件も含む)。CI もすべて green です。 claude plugin validate .(Claude Code 2.1.289)はValidation passed with warningsで、warning はversion未指定の 1 件だけでした。- 公式ドキュメント(Agent Skills overview / best practices、Claude Code の skills / plugin manifest / marketplace / plugin loading)と照らし合わせました。
- frontmatter の制約(name は 64 文字以内で予約語を含まない、description は 1024 文字以内で XML タグを含まない)を満たしています。
- description は三人称で、何をするか(what)といつ使うか(when)が具体的に書かれています。
- 本文は 500 行未満、参照は SKILL.md から 1 段で、100 行を超える json.md には目次があります。
- チェックリスト付きのフィードバックループがあり、script は「実行する」と明示されています。
- marketplace の
source: "./"と entry 名 = manifest 名もドキュメントの規則どおりです。
- Claude.ai / API を「非対応」とした判断と docs の記述は、overview の Runtime environment constraints(API は network なし・package の導入なし、skill は Anthropic の code execution 環境で動く)や、claude.ai の Settings > Features と対象プランの記述と一致しています。
実際に使った結果(claude -p --plugin-dir <clone>、host に latexmk なし、OrbStack)
テスト文書は \foo{}(未定義)、\cite{knuth84}(bib のキーは knuth1984)、\ref{sec:method}(label なし)、\rule{1.3\textwidth}、ハイフネーションできない長い単語を含みます。
- 「メールで知らない人から送られてきた LaTeX 論文 main.tex がうまくコンパイルできないらしい。直して PDF を作って、ページの見た目も確認して。」
texrun:texrunが発火し、Claude が自分で--backend containerを選びました。- summary script で
main.tex:5: undefined_control_sequenceを確認し、\foo、cite キー、\ruleを直して再 compile するとsucceededになりました。 preview/page-001.pngを開いて見た目を確認しました。- 残った
undefined_reference(Method の節が無い)と overfull の長い単語は、勝手に直さず利用者に確認を求めました。 - 12 turns、約 $0.37 でした。
- 「この論文の PDF を作って。」(LaTeX という語なし、itemize を追加)
- skill が発火しました。
- 最初は host で実行して
error.kind: unavailableになり、手順どおり container で再試行しました。 \fooと cite キーを直した後、#65 の TS1 フォント不足でfailedになりました。summary script は「errors: none recognized; read the log」と表示し、Claude は log を grep して!pdfTeX error: ... tcrm1000を見つけました。- 文書を書き換えて回避しようとはせず、「環境側の問題」として報告しました。導入コマンドは提示しただけで、実行していません(setup.md の指示どおり)。
- 「LaTeX で分数と総和記号を書く方法を一行で教えて。」では skill は発火しませんでした。発火条件は過剰にも過少にもなっていないと思います。
should-fix
1. 整合性テストが 1 語のフィールド名(output_dir、texrun_exit_code など)を検査していない
is_field_path は . を含むパスしか対象にしません。このため、ループの中心で使う 1 語のフィールド(output_dir、texrun_exit_code、outcome、raw_excerpt、file、line、error など)は、名前が変わっても検出されません。
SKILL.md で次の 3 か所を書き換えても、cargo test -p texrun skill_docs は 6 件とも通りました。
texrun_exit_code→texrun_exitcodeproject.root+/+file→+ pathoutput_dir→out_dir
docs/agent-skills.md と PR 本文の「JSON field path ... が無いと失敗する」という説明は、実際よりも強く読めます。
修正案: backtick 内の ^[a-z][a-z0-9_]*$ に一致する語は、次の和集合のどれかに含まれることを要求してください。
field_paths(full_document())の各 leaf- 各 kind の集合(すでに抽出済み)
CompileOutcome、severity、preview.status、artifacts[].kind、error.stage/categoryの値- 小さな許可リスト(
texlive、mupdfなど)
kind の名前は大半が _ を含むので、誤検出は少ないはずです。最低限、SKILL.md と json.md の本文だけでも対象にすると効果が大きいと思います。
2. plugin は main を、texrun 本体はリリースタグを追うため、両者がずれる
marketplace の plugin は version を指定していないので、main の commit を追います。一方、setup.md は cargo install ... --tag v0.1.0(最新のリリースタグ)を案内しています。今は main = v0.1.0 + CI の変更だけなので問題ありません。しかし main に CLI の変更(option や kind の追加・改名)が入ると、その時点から、リリース版の texrun を使う利用者に「まだ存在しない option」を教える skill が配られます。skill_docs のテストは同じ commit の CLI としか照合しないので、このずれは検出できません。docs の「keep texrun itself up to date too」も、タグから入れる限り満たせません。
修正案(どれか、または組み合わせ):
- docs/agent-skills.md と README で、使っている texrun と同じタグの marketplace を追加する方法を推奨する。例:
claude plugin marketplace add nishide-dev/[email protected](owner/repo@ref形式は公式に対応しています)。main を追う方法は「main から texrun を入れた場合」として扱う。 - SKILL.md の「Before you start」に一文足す。例: 「If texrun rejects an option or prints a field this skill does not mention,
texrun compile --helpand the JSON are authoritative; the installed texrun may be older or newer than this skill.」
nit
-
script のパス:
python3 scripts/texrun_summary.pyは skill ディレクトリからの相対パスです。実際の run では、Claude が base directory から../../texrun/skills/texrun/scripts/...や絶対パスを自分で組み立てていました。動きはしますが、Claude Code では${CLAUDE_SKILL_DIR}/scripts/texrun_summary.py(公式の skills ドキュメントにある置換変数で、personal / project / plugin のどれでも解決されます)を使うほうが確実です。他のエージェントでも使えるよう、「(${CLAUDE_SKILL_DIR}is this skill's directory in Claude Code)」と併記する形がよいと思います。 -
texrun_summary.pyの堅牢性: 不正 JSON、ファイルが無い、ディレクトリを渡した場合はいずれも exit 2 で適切なメッセージが出ました。一方で次の場合は traceback(exit 1)になります。"notes": nullや、diagnosticsの要素が dict でない JSON- 非 UTF-8 の stdin(
PYTHONIOENCODING=asciiで日本語を含む JSON を渡すとUnicodeDecodeError)
また、未知の severity を持つ diagnostic は
--allでも表示されずに消えます。修正案:sys.stdin.buffer.read().decode("utf-8", "replace")で読み、sys.stdout.reconfigure(errors="backslashreplace")で書く。report.get(x) or []とisinstance(d, dict)で守る。by_severityの未知のキーは info と一緒に表示する。 -
kind の抽出の一部が手書き: CLI 独自の error kind(
kind::USAGEなど 8 件)と note kind 3 件は、テスト内に手書きされています。pub mod kindに定数を足したり、新しい note kind を足したりしても検出されません。report.rsのpub mod kind { ... }からpub const ...: &str = "..."を抽出すれば、enum と同じように自動で追従できます。note kind も定数にしておくと同じ仕組みで扱えます。docs の「list exactly the ... kinds of the implementation」は、そうしてから書くのが正確です。 -
リポジトリ root を plugin にすることの影響: install 時には tracked file 全体(現在 274 files、約 2 MB、Rust のソースや docs を含む)が
cache/texrun/texrun/<sha>/にコピーされます。また、今後 root にhooks/、agents/、commands/、bin/、.mcp.json、settings.jsonなどを置くと、それが plugin の component として利用者の環境で読み込まれます(bin/があると claude.ai / Cowork では install されなくなる、とも書かれています)。現状は問題ありませんが、この制約を CONTRIBUTING か docs/agent-skills.md に一文残しておくとよいと思います。versionを指定しない判断(commit を追う。third-party の marketplace は auto-update が既定で off なので、docs の「enable auto-update」の案内も正確)には同意します。 -
errors.md の
unsafe_rootとbroad_project_root: どちらも「$HOMEか一時ディレクトリ」と書かれていて紛らわしいです。実装(check_root)では、暗黙の root なら error、--rootで明示すれば note です。unsafe_rootの行を「The implicit project root (the entrypoint's directory) would be/,$HOMEor a temporary directory ...」とするとわかりやすくなります。 -
修正の報告: 2 回の run でどちらも Claude は
\foo{}を削除し、cite キーを推測で変えていました。どちらも最終報告で明示していたので問題ありません。ただ、Fix の節に「Tell the user about every change that guesses the author's intent (removed macros, renamed keys)」と一文あると、モデルによって振る舞いがぶれにくくなると思います。 -
docs/agent-skills.md: 「Claude API で作るアプリケーションからは自前の tool で texrun を呼ぶ」に加えて、Claude Agent SDK ならこの plugin をそのまま読み込める(
pluginsoption /.claude/skills)ことも書いておくと、選択肢として役立ちます。
…release
- Check every single snake_case word in the skill's code spans against
the JSON fields, kinds and enum and option values; read the CLI's error
kinds and the new note kind constants from the source.
- Recommend adding the marketplace at the tag of the installed texrun,
and say that --help and the JSON win over the skill.
- Use ${CLAUDE_SKILL_DIR} for the summary script, harden the script
against odd input and encodings, and ask the agent to report guessed
fixes.
- Document the Agent SDK, the constraints of the root plugin and the
skill in the release steps; clarify unsafe_root.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
nishide-dev
left a comment
There was a problem hiding this comment.
Verdict: APPROVE
1f6fa68 で、前回の should-fix 2 件と nit 7 件がすべて解消されていることを確認しました。残っているのは軽微な nit だけです。
確認したこと(head 1f6fa68)
- ゲート:
cargo check --workspace --all-targets --all-features --locked、cargo fmt --all -- --check、cargo clippy ... -D warnings、cargo test --workspace --all-features --lockedはすべて通過しました。skill_docsの 7 件(新しいsingle_word_names_existを含む)も通っています。 claude plugin validate .(Claude Code 2.1.289)はValidation passed with warningsで、warning は意図どおりのversion未指定の 1 件だけでした。- 前回わざと壊したケースと、追加のケースを再確認しました。どれも該当するテストが失敗し、
git checkoutで戻すと通ります。texrun_exit_code→texrun_exitcode、file→path_x、output_dir→out_dir(前回は検出できなかったもの):SKILL.md: `...` is not a JSON field, kind or value of texrunで検出されました。- 存在しない option(
--preview-dpix 200)、存在しないフィールドのパス(preview.page[].page)、errors.md からbibtex_failedの行を削除、exit code 表の 4 を 5 に変更: いずれも検出されました。 report.rsのpub mod kindにNEW_KINDを追加、pub mod noteにNEW_NOTEを追加: errors.md の表との不一致として検出されました。前回は検出できなかったケースです。
texrun_summary.py: 前回 traceback になった入力を再確認しました。- 不正 JSON、空入力、配列、
\xff、引数 2 個: exit 2 とメッセージ。 - null 値や dict 以外の要素: 無視して続行。
- 未知の severity:
--allでinfo and otherに[fatal]付きで表示。 PYTHONIOENCODING=asciiで日本語を含む入力:論...と escape して exit 0。
- 不正 JSON、空入力、配列、
- 発火の確認(
claude -p --plugin-dir): 「ダウンロードしてきた main.tex をビルドして、エラーがあれば直して。」と依頼しました。texrun:texrunが発火し、Claude は「Downloaded document → container backend」として--backend containerを選びました。${CLAUDE_SKILL_DIR}は絶対パスに置換され、summary script がそのまま動きました。main.tex:3の\fooを直して再 compile するとsucceededになり、preview の PNG も確認しました。- 最終報告で「これは作者の意図を推測した変更」と明示していて、追加した一文が効いていると思います(9 turns、約 $0.31)。
nit(任意)
- v0.1.1 が出るまでの導入手順: README、docs/agent-skills.md、setup.md は
nishide-dev/texrun@v<version>を案内し、「releases from v0.1.1 contain the plugin」と書いています。ただ、現時点の最新リリースは v0.1.0 で、.claude-plugin/を含みません。このため、v0.1.0 を入れた利用者が手順どおり@v0.1.0を指定すると、marketplace の追加に失敗します。v0.1.1 のリリースまでの間、「v0.1.0 では tag なし(nishide-dev/texrun)で追加する(main の CLI は v0.1.0 と同じ)」と一文あると親切です。v0.1.1 をすぐ切る予定なら不要です。 - 出力の空白:
texrun_summary.py --allの未知 severity の行が[fatal] (no file: ...)と 2 つの空白で始まります(print(..., end="")の後のprint_diagnosticが先頭に空白を 2 つ付けるため)。見た目だけの問題です。
## 概要 pdfTeX が自分で出す致命的エラー(`!pdfTeX error: ...`。font や画像を読めないときなど)を log parser が拾わず、`outcome: failed` なのに `diagnostics: []` になっていた問題を直す。あわせて、失敗した compile には必ず error diagnostic が 1 件以上付くようにする。 ## 変更内容 - `texrun-latex-log` - `!pdfTeX error: ...`(`!` の後に空白がなく、`-file-line-error` でも `file:line:` にならず、`l.<n>` もない)を error / `other` として報告する。直後の空白始まりの ` ==> Fatal error occurred, ...` は、TeX エラー後の stop と同じく `emergency_stop` の `info` として扱う(#40 の方針どおり、error の数が直すべき問題の数) - pdfTeX は位置を出さず、font のように input を読み終えて PDF を書く段階で落ちることも多いので、`file` / `line` は常に `None`(file stack の推測もしない。message に font 名や画像名が入る) - `unexplained_failure(log)` を公開:失敗したのに error が見つからないとき用に、log 末尾(最後の 16 KiB のうち非空行を最大 12 行)を `raw_excerpt` に持つ error / `other` を返す。末尾に `!` 行があればそれを message に引用する。計算量は log サイズに依らず定数、message / excerpt は既存と同じ上限と sanitize を通す - `texrun-texlive`:`outcome: failed` で error diagnostic が 0 件のとき(log・texrun・BibTeX のどれも error を出さなかったとき)だけ、上記の error を追加する。log の読み込みは既存の 1 回分を使い回す - kind は新設せず `other` にした。`! pdfTeX error (ext4): ...` のように TeX のエラールーチン経由の pdfTeX エラーは従来から `other` で、同じ pdfTeX 由来のエラーで kind が分かれるのを避けるため。新設は必要になったら後から足せる(未知の kind は `other` として deserialize される) - 実ログ fixture(dev コンテナで生成、`regenerate.sh` に追加) - `pdftex-missing-font`:T1 の `ecrm1000`(`MKTEXPK=0`、TeX Live engine と同じ設定)→ `!pdfTeX error: pdflatex (file ecrm1000): Font ecrm1000 at 600 not found`(#66 の再現) - `pdftex-missing-image`:`\pdfximage{nosuch.png}` → `!pdfTeX error: pdflatex: cannot find image file nosuch.png` - `pdftex-error-ext`:`\pdfendlink` だけ → `./main.tex:5: pdfTeX error (ext4): ...`(従来どおり位置付きの `other`) - `capacity-exceeded`(`TeX capacity exceeded`)、`cannot-write`(`openout_any=p` で `I can't write on file`)、`interruption`(SIGINT で `Interruption.`):いずれも既に `file:line:` 形式の TeX エラーとして拾えていたことを固定する回帰テスト - skill(`skills/texrun/SKILL.md`、`reference/errors.md`)を更新 - docs/cli.md の Diagnostics 節に、pdfTeX エラーの扱いと「失敗時は必ず error がある」ことを追記。crate docs の表も更新 ## 確認方法 - [x] `cargo check --workspace --all-targets --all-features --locked` - [x] `cargo fmt --all -- --check` - [x] `cargo clippy --workspace --all-targets --all-features --locked -- -D warnings` - [x] `cargo test --workspace --all-features --locked`(macOS host) - [x] dev コンテナで `TEXRUN_REQUIRE_TEXLIVE=1 TEXRUN_REQUIRE_PREVIEW_TOOLS=1 cargo test --workspace --all-features --locked` - [x] dev コンテナで実際に `texrun compile` して確認:T1 font の文書は `error: pdfTeX error: pdflatex (file ecrm1000): Font ecrm1000 at 600 not found`(1 error)、`\pdfximage` の文書は `error: pdfTeX error: pdflatex: cannot find image file nosuch.png` - 追加テスト:実ログ 4 件(`real_logs.rs`)、pdfTeX エラーが後続の偽 `l.<n>` や file stack から位置を取らないこと(`synthetic.rs`)、`unexplained_failure` の上限・sanitize・`!` 行の引用(unit)、fake latexmk で「認識できるエラーなら追加しない / 未知形式・log なしなら追加する」(`engine.rs`) ## 関連 Issue Closes #66 ## 補足 - PR #64(skill)の merge 後に rebase し、同じ PR で skill を更新:`SKILL.md` の「`failed` なのに error がなければ log を読む」という暫定案内を、位置なしの `other` error(pdfTeX の font / 画像エラー、または log 末尾の抜粋付きの原因不明エラー)の読み方に置き換え、`reference/errors.md` の `other` 行に対処を追記。kind は追加していないので `skill_docs` の整合性テストはそのまま通る。`scripts/texrun_summary.py` の「error が無い」分岐は古い texrun 向けに残した - `unexplained_failure` は latexmk 自体の失敗(TeX は成功したが latexmk が非 0 で終了など)でも出るが、latexmk の stdout は JSON に出していないので、その場合は TeX log の末尾しか示せない - 他の engine(XeTeX / LuaTeX)の `!` 直後に空白がない独自形式は未対応だが、その場合も `unexplained_failure` がその `!` 行を message に引用する 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
## 概要 v0.1.1 を公開するため、版を 0.1.1 に上げます。 ## 変更内容 - `Cargo.toml` の workspace と内部 crate の版を 0.1.1 に(`Cargo.lock` も更新) - README、docs/engine-image.md、skills/texrun/reference/setup.md の版表記を 0.1.1 に(docs/development.md のリリース手順の版表記も) v0.1.1 に含まれる主な変更: - engine image / dev image に Type1 font(cm-super、lmodern、texlive-fonts-recommended)を追加し、itemize や T1 を使う一般的な文書が compile できるように(#65、PR #67) - `!pdfTeX error:` を error diagnostic として報告し、失敗した compile には必ず error を返す(#66、PR #68) - Agent Skill と Claude Code の plugin marketplace(#63、PR #64) ## 確認方法 - [x] `cargo test --workspace --all-features --locked` - [x] `git grep -n '0\.1\.0' -- README.md docs/ skills/` で残りは履歴・説明上の記述のみ(release notes の初版の例、engine image 0.1.0 の不具合の説明) ## 補足 merge 後に main へ `v0.1.1` の tag を push し、engine image と release(notes 付き)を自動公開します。texrun 0.1.0 は既定で engine image 0.1.0 を使うため、font の修正を得るには texrun を 0.1.1 に上げる必要があります(release notes に追記予定)。 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
概要
AI エージェントが texrun を正しく使えるよう、Agent Skill を
skills/texrun/に追加し、Claude Code の plugin marketplace としてインストールできるようにします。skill の記述が CLI の実装とずれないよう、cargo testで照合するテストも追加します。変更内容
skills/texrun/(Agent Skill。英語)SKILL.md: frontmatter はname: texrun、description は「LaTeX/TeX を compile・build・typeset する / LaTeX・BibTeX のエラーや警告を直す / ページの見た目を確認する」場面で発火するよう具体的に記述(三人称、1024 文字以内)。本文は約 150 行で、次を扱います。texrun --version。無ければ setup.md の導入手順を利用者に伝えて止まる--backend containererror→outcomeの順に確認し、project.root+fileのlineを直して再 compile。TeX は最初のエラーで止まるので 1 回の実行で直すのは 1 件、emergency_stopは無視、修正が進まなければ 5 回程度で打ち切り、エラーを握りつぶすような修正はしないoutput_dir+preview.pages[].pathの画像を見る、--pages/--preview-dpi、古い出力が残る点reference/json.md: エージェント向けに要約した JSON フィールドの表と実例。reference/errors.md: diagnostic / error / note / preview notice の各 kind の意味と直し方。reference/setup.md: 導入手順。どれも SKILL.md から必要なときだけ読む形です(progressive disclosure)scripts/texrun_summary.py(Python 3 標準ライブラリのみ): JSON を絶対パス:line: kind: message、PDF のパス、preview 画像のパスの一覧にまとめる。failedなのに error diagnostic が無いときは log を読むよう促す.claude-plugin/marketplace.jsonと.claude-plugin/plugin.json: リポジトリ自体を marketplacetexrunとし、plugintexrun(source: "./")を 1 つ持たせる。versionは指定しないため、commit SHA が version になり、commit ごとに更新を受け取れますapps/texrun/src/skill_docs.rs: skill と実装の整合性を確かめる unit test(後述)docs/agent-skills.md: インストール方法、対応範囲、整合性チェックの仕組み。README に「Using texrun from AI agents」節を追加。CONTRIBUTING に scopeskillsと、CLI を変えるときは skill も更新する旨を追記インストール方法と対応範囲
/plugin marketplace add nishide-dev/texrun@v<version>(使っている texrun と同じ tag、v0.1.1 以降)→/plugin install texrun@texrun(shell ではclaude plugin ...)。main から texrun を入れた場合は tag なしskills/texrunを~/.claude/skills/または.claude/skills/にコピーplugins=[{"type": "local", "path": ...}]で読み込むskills/texrun/を読み込ませるPOST /v1/skillsの手順は公式ドキュメントで確認できた範囲だけ記載整合性チェック(
cargo testのskill_docs)skill のファイルを読み、次のどれかが成り立たないと失敗します。
texrun ...のコマンド例を clap(Cli::try_parse_from)がそのまま受け付ける。値付きの option 例(--pages 5-8など)も同様。code 中の--optionはすべてtexrun compileの option(cargo と script の option は許可リストで除外)snake_case(output_dir、texrun_exit_code、kind、succeededなど)が、JSON の leaf・kind・enum や option の値・テスト内の小さな許可リスト(latexmkなど)のいずれかに含まれるpreview.pages[].pathなど)、reference/json.mdの表と JSON 例、script が.get("...")で読むフィールドが、全フィールドを埋めたCompileReportを serialize した JSON に存在するreference/errors.mdの kind の表が、DiagnosticKind/EngineErrorKind/WorkspaceErrorKindと CLI 独自の kind / note kind /NoticeKindと完全に一致する(enum の variant とreport::kind/ 新設のreport::noteの定数はソースから抽出し、serde で妥当性も確認しているので、kind が追加されたときにも検出できます)SKILL.mdの exit code 表がreport::exitの値と一致し、outcome それぞれへの対応が書かれているskill をわざと壊して(存在しない option、存在しないフィールド、
texrun_exit_code→texrun_exitcode、output_dir→out_dir、kind の行の削除、pub mod kindへの定数追加、exit code の誤り)各テストが失敗することを確かめてから戻しました。確認方法
cargo check --workspace --all-targets --all-features --lockedcargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --all-features --lockedclaude plugin validate .は通過(version未指定の warning だけ。commit ごとに更新を受け取るため意図して指定していません)skill の手順どおりに動くかの検証(macOS、host に latexmk が無いので
--backend container)\foo(未定義)と\begin{itemize}…\end{enumerate}を含む文書をtexrun compile --json --backend container main.tex | python3 skills/texrun/scripts/texrun_summary.pyで compile すると、.../main.tex:5: undefined_control_sequence: ...と raw excerpt が出て、ファイルと行をそのまま特定できました。修正して再 compile するとsucceededになり、output_dir+preview.pages[].pathの PNG を確認できました。claude -p --plugin-dir <worktree>で、上の文書(幅の広い表を追加したもの)を「知らない人から届いた文書なので compile できるように直してページも確認して」と依頼しました。Claude は skilltexrun:texrunを起動し、自分から--backend containerを選んで、summary script →\fooの修正 →itemizeの修正 → 表の\resizebox→ 再 compile → preview 画像の確認まで、skill の手順どおりに完了しました。CLAUDE_CODE_PLUGIN_CACHE_DIRを一時ディレクトリにし、--scope localを使いました。そのうえでclaude plugin marketplace add(ローカルパスとnishide-dev/texrun@feat/agent-skillsの両方)→claude plugin install texrun@texrunが成功しました。claude plugin detailsにはSkills (1) texrun(常時 約 175 tokens、起動時 約 2.4k tokens)と表示され、claude plugin listでは Version が commit SHA になっています。レビュー対応(1f6fa68)
texrun compile --helpと実際の JSON が正」と追記。docs/development.md のリリース手順に skill(setup.md の版、tag の commit でskill_docsが通ること)を追加${CLAUDE_SKILL_DIR}を使用(claude -p --plugin-dirで絶対パスに置換されることを確認)、summary script の堅牢化(nullや dict 以外の要素、非 UTF-8 入力、ASCII の stdout、未知の severity)、CLI kind と note kind のソースからの自動抽出(note kind をreport::noteの定数に)、root plugin の制約の文書化、unsafe_root/broad_project_rootの説明、推測を含む修正の報告を SKILL.md に追記、Agent SDK の記載関連 Issue
Closes #63
補足
検証中に、この PR の範囲外の問題を 2 つ見つけました(別 Issue にするのがよさそうです)。
itemizeを含むだけの文書が compile できない:\begin{itemize}\item one\end{itemize}だけの文書で!pdfTeX error: pdflatex (file tcrm1000): Font tcrm1000 at 600 not foundになります(\textbulletに使う TS1 フォントtcrm1000が image に無く、bitmap の生成もできないため)。cm-super などのフォントを image に入れる必要がありそうです。!pdfTeX error:が diagnostic にならない:outcome: failedなのに error diagnostic が 1 件も出ません(emergency_stopすら出ない)。log parser が!pdfTeX error:形式を拾えていないようです。skill 側では「error diagnostic が無いfailedは log を読む」手順を入れ、summary script もそう表示するようにしました。🤖 Generated with Claude Code