claude-skills/

Anthropic公式スキル・プラグインの日本語ディレクトリ

last sync 22h ago
スキルOfficialmonitoring

🔗logfire-ui

プラグイン
logfire

説明

Logfireのプロジェクトページ、ライブビュー、トレースリンク、Exploreページを、テレメトリを事前にクエリすることなくCodexブラウザで開くまたは表示します。 次のような場合に使用: ユーザーが「Logfireで開く」「ライブビューで表示」「Exploreを開く」「UIを開く」「Codexで表示」「ブラウザを使う」「リンクをくれ」と依頼した場合、またはプロジェクト・時間範囲・サービス・スパン・トレース・ログ・フィルターをLogfireのGUI/ブラウザ/ライブビューで表示するよう求めた場合。 「表示する」「見る」などの表現が曖昧な場合は、UIビューでの表示とクエリ分析のどちらを希望するかをユーザーに確認してください。

原文を表示

Open or return Logfire project pages, live views, trace links, and Explore pages in the Codex browser without querying telemetry first. Use this skill when the user asks to "open in Logfire", "show in the live view", "open Explore", "open the UI", "show in Codex", "use the browser", "give me a link", or asks for a Logfire GUI/browser/live-view presentation of a project, time range, service, span, trace, log, or filter. If "show" or "view" wording is ambiguous, ask whether the user wants a UI view or query analysis.

ユースケース

  • Logfireのプロジェクトページを開くとき
  • ライブビューでテレメトリを表示したいとき
  • トレースリンクを確認するとき
  • Exploreページでデータを閲覧するとき
  • Codexブラウザで結果を表示するとき

本文(日本語訳)

Logfire UI を開く

次のような場合に使用: Logfire UI への直接アクセス、ブラウザ操作、ライブビュー、リンク生成、Explore ページに関するリクエスト。


ユーザー向けの進捗表示

進捗の通知は最小限に抑える。 このスキルが選ばれた理由の説明、ルーティングルールの再述、ローカル指示の引用、トークンスコープの説明、補助ツール呼び出しのアナウンスは行わない。 更新が必要な場合は、"エラーフィルターを適用して Logfire を開いています。" のように、アクションに焦点を絞った短い一文のみを使用する。

Logfire を開いた後は、ブラウザが応答なしになっている、ログインを求めている、またはユーザーが明示的に確認を求めた場合を除き、ページ状態の追加確認を実行・報告しない。


ブラウザのターゲット指定

Codex Desktop では、可能な限り Browser plugin の Codex アプリ内ブラウザ(iab)および現在選択中のタブを使用する。

ブラウザへのアクセスは間接的に行う。ブラウザ名を持つ MCP ツールが存在することを前提としない。 Browser plugin が利用可能として表示されている場合は、browser:browser スキルをロードし、その Node REPL の js / mcp__node_repl__js ブートストラップを使用して agent.browsers.get("iab") をバインドする。 js が表示されていない場合は、アプリ内ブラウザが利用不可と宣言する前に node_repl js のツール検索を実行する。

以下は使用しない(ユーザーが外部ブラウザを明示的に要求した場合を除く): agent-browserchrome-devtoolsmcp__chrome_devtools__*mcp__playwright__*、macOS の openxdg-open、スタンドアロン Playwright/Chromium、シェルから起動したブラウザ、Web プレビューカード、新規作成した外部ブラウザウィンドウ。

Logfire のライブビューがすでに選択されており、その場で更新可能な場合は、新しいアプリ内タブを作成しない。

以下のすべてに該当する場合にのみ、アプリ内ブラウザが利用不可と報告する:

  • Browser plugin がリストに表示されていない、またはスキルがロードできない
  • ツール検索後も Node REPL の js 実行ツールが利用不可
  • ブラウザスキルのブートストラップがナビゲーション開始前に失敗した

この場合は、クリーンな Logfire URL を返し、アプリ内ブラウザを制御できなかった旨を説明する。 chrome-devtools、Playwright MCP、スタンドアロン Playwright、Web プレビューカードは「ブラウザ利用不可」として扱い、フォールバックとして使用しない。 外部ブラウザや専用ブラウザウィンドウへのサイレントフォールバックは行わない。


基本ルール

プロジェクトレベルまたは集約的な UI リクエストに対しては、URL で Logfire を直接開くか URL を返す。

テレメトリの事前クエリは行わない:

  • query_run を呼び出さない。
  • Logfire へのクエリやスパンの取得を先に行うとは宣言しない。

クエリを先に実行するのは、「最も遅いトレースを開く」「最新のエラートレースを開く」など、事前に特定が必要な未知の項目をユーザーが要求した場合のみ。

「最近のエラーを表示」や「ログを確認」のようにリクエストが曖昧な場合は、UI で Logfire を開くのかチャットでクエリ分析を行うのかをユーザーに確認する。ユーザーが両方を明示的に求めない限り、両方は行わない。


プロジェクトの検出

組織・プロジェクトの指定がない UI リクエストの場合、まず Logfire MCP の auth/current-project メタデータを通じて正規のプロジェクト URL の解決を試みる。 利用可能な MCP サーバーが project-link または current-project ヘルパーを公開している場合はそれを使用する。 これはプロジェクトの検出であり、テレメトリのクエリではない。

MCP が現在のプロジェクトを正確に 1 つ解決できた場合は、そのプロジェクト URL を使用する。 解決できない、複数の候補が返る、または認証エラー状態の場合は、組織・プロジェクト名またはフルの Logfire プロジェクト URL をユーザーに確認する。

以下からプロジェクト URL を推測しない: LOGFIRE_BASE_URLLOGFIRE_URL、エクスポーター設定、リポジトリ名、ローカルホストの到達可能性。 これらの環境変数・設定値は Logfire プラットフォーム・API ベースの識別には使えるが、対象の組織・プロジェクトの特定には使えない。


URL ワークフロー

  1. フルプロジェクト URL がすでに判明している場合は、直接使用する。
  2. ユーザーがプロジェクトを省略した場合は、上記の方法で MCP を通じて現在のプロジェクトを解決する。
  3. ユーザーがプロジェクト名のみ指定し組織・ベース URL を省略した場合は、project_logfire_ui_link(project=project) をデフォルトのクリーンリンク動作で呼び出し、正規プロジェクト URL を導出する。これは URL 検出ヘルパーであり、テレメトリクエリではない。
  4. プロジェクトのライブビュー・フィルター URL については:
    • Codex Browser でリンクをすぐに開く場合: project_logfire_ui_link(project=project, query=query, since=since, until=until, handoff=True) を呼び出す。
    • 永続的・共有可能な URL を返す場合: デフォルトのクリーンリンク動作を使用する。
    • ユーザーが既存のクリーンな Logfire プロジェクト URL を提供しハンドオフを要求した場合: その URL から projectqsinceuntil を解析し、このツールに渡す。
  5. 実際の trace_id が判明している場合:
    • Codex Browser でリンクをすぐに開く場合: project_logfire_link(trace_id=trace_id, project=project, handoff=True) を呼び出す。
    • 永続的・共有可能な URL を返す場合: デフォルトのクリーンリンク動作を使用する。
  6. querysinceuntil は有用な場合に project_logfire_ui_link を通じて追加する。クリーン URL を手動で組み立てる場合は qsinceuntil を URL エンコードする。
  7. ユーザーが URL を開くよう求め、かつ Browser が利用可能な場合は Codex アプリ内ブラウザで開く。それ以外の場合は外部ブラウザを起動せずに URL を返す。

開いているライブビューの制御

Codex Browser で Logfire プロジェクトのライブビューがすでに開いている場合は、JSON コマンドブリッジを使用する。 これがサポートされている唯一のアプリ内インタラクションモデルである。ドキュメントの全リロードなしにビューを更新し、agent がアクティブにページを変更していることをユーザーに示す。

Codex Browser からページグローバルの JavaScript API を直接使用しようとしない。 サポートされている agent の制御インターフェースは JSON コマンド入力のみ。

Codex Browser / iab では、Logfire live view agent command 入力に以下のような JSON パッチを入力して Enter を押す:

{"q":"level='error'","last":"1h","since":null,"until":null}

非表示の送信ボタンはフォームターゲットに過ぎない。ボタンが視覚的にクリック不可に見えても、このパスをスキップしない。

ブリッジフォーム入力が存在しないか送信できない場合のみ、URL / 検索パラメータの直接更新を使用する。ブリッジフォームが利用可能な場合は URL を直接更新しない。

直接 URL フォールバックを使用する場合でブラウザ制御インターフェースがページスクリプト URL 更新を許可している場合は、window.history を更新し popstate イベントをディスパッチする。意味のあるユーザー可視ナビゲーションには pushState、クリーンアップや再試行には replaceState を使用する。ページ内 URL 更新が不可能な場合は、クリーン URL を開くことにフォールバックする。

/api/auth/handoff?ticket=... の URL を変更しない。ハンドオフ URL は一回限りのエントリポイントであり、リダイレクト後は最終的なクリーンプロジェクト URL を制御する。

ライブビューの検索パラメータ

パラメータ 説明
q SQL ライクな Logfire フィルター式(例: level='error'kind='span'service_name='api')。URL 文字列を構築する際は URL エンコードする。
last ローリングライブウィンドウ(例: 5m1h14d、またはミリ秒数)。ライブモードに使用し、since/until は削除する。
since / until ISO 8601 タイムスタンプによる固定の時間範囲。境界付き時間範囲に使用し、last は削除する。
env デプロイ環境フィルター。複数環境には env パラメータを繰り返す。全環境を対象にする場合は省略する。
traceId / spanId 特定のトレース・スパンへのフォーカス。メインクエリや時間範囲を変更する際は、ユーザーがフォーカスレコードの保持を求めない限り、traceIdspanIdfocusTraceIdfocusTraceTimestamp などの古いフォーカスパラメータをクリアする。

ブラウザハンドオフ URL

MCP リンクツールが handoff: bool = False をサポートしている場合、handoff=True はブラウザで即時に開く URL にのみ使用する。ハンドオフ URL は短命・一回限りであり、プラットフォームが生成した宛先に紐付けられている。

  • ハンドオフの結果が文字列の場合: その URL を直ちに開く。/api/auth/handoff?ticket=... 形式の URL の場合がある。クエリパラメータの追加、書き換え、永続化、ドキュメントへの引用、共有可能な URL としての扱いはすべて行わない。
  • ハンドオフの結果が handoff: false を持つオブジェクトの場合: その url 値をクリーンフォールバック URL として使用する。API キー認証や再認証が必要な場合など、ブラウザがログインを求める理由をユーザーが理解するうえで有用な場合のみ reason に言及する。
  • reason が Logfire MCP 接続の再認証を求めている場合: MCP OAuth リフレッシュトークンに UI セッションの生成に必要なメタデータが不足していることを説明する。ブラウザセッションの更新とは説明しない。ユーザーは Logfire MCP auth フローの再接続・再認証が必要である。
  • 利用可能な MCP サーバーが handoff を公開していない場合: リンクツールを通常通り呼び出し、クリーン URL を使用する。
  • ハンドオフ URL にフィルターや時間パラメータを手動で追加しない。最終的なプロジェクトフィルターの宛先を project_logfire_ui_link に渡し、プラットフォームにその宛先のチケットを生成させる。

Codex Browser を開く際の安定性

Codex Browser で Logfire ハンドオフ URL を開く場合は、同一宛先のクリーン URL をフォールバックとして保持する。 必要に応じて、ブラウザを開くことに失敗したと報告する前に、同じリンクツールを handoff=False で呼び出す。

Browser スキルのアプリ内ブラウザワークフローを使用し、ナビゲーションの試行に上限を設ける。 networkidle、WebSocket の完了、ライブビューページが完全に静止するのを待たない。 ナビゲーション後に待機する場合は、URL コミット、

原文(English)を表示

Open Logfire UI

Use this skill for direct Logfire UI, browser, live-view, link, and Explore-page requests.

User-Facing Progress

Keep progress updates quiet. Do not narrate why this skill was selected, restate routing rules, quote local instructions, explain token scope, or announce routine helper calls. If an update is needed, use one short sentence focused on the action, such as "Opening Logfire with the error filter."

After opening Logfire, do not run or narrate an extra page-state check unless the browser appears stuck, asks for login, or the user explicitly asked you to verify the page.

Browser Targeting

In Codex Desktop, use the Browser plugin's Codex in-app browser (iab) and the currently selected tab whenever possible.

Browser access is indirect: do not expect a browser-named MCP tool. If the Browser plugin is listed as available, load the browser:browser skill and use its Node REPL js / mcp__node_repl__js bootstrap to bind agent.browsers.get("iab"). If js is not visible, use tool discovery for node_repl js before declaring the in-app browser unavailable.

Do not use agent-browser, chrome-devtools, mcp__chrome_devtools__*, mcp__playwright__*, macOS open, xdg-open, standalone Playwright/Chromium, a shell-launched browser, web preview cards, or a newly created external browser window unless the user explicitly asks for an external browser. Do not create a new in-app tab when a Logfire live view is already selected and can be updated in place.

Only report the in-app browser unavailable after the Browser plugin is not listed or its skill cannot be loaded, the Node REPL js execution tool is unavailable after tool discovery, or the Browser skill bootstrap fails before navigation starts. Then return the clean Logfire URL and explain that the in-app browser could not be controlled. Treat chrome-devtools, Playwright MCP, standalone Playwright, and web preview cards as "Browser unavailable", not as fallbacks. Do not silently fall back to any external or dedicated browser window.

Core Rule

For project-level or aggregate UI requests, open or return Logfire directly by URL.

Do not query telemetry first:

  • Do not call query_run.
  • Do not say you will query Logfire or fetch spans first.

Only query first when the user asks to open a specific unknown item that must be found first, such as "open the slowest trace" or "open the latest error trace".

If the request is ambiguous, such as "show recent errors" or "view logs", ask whether the user wants Logfire opened in the UI or a query analysis in chat. Do not do both unless the user explicitly asks for both.

Project Discovery

For UI requests without an explicit organization/project, first try to resolve the canonical project URL through Logfire MCP auth/current-project metadata. Use a project-link or current-project helper if the available MCP server exposes one. This is project discovery, not telemetry querying.

If the MCP can resolve exactly one current project, use that project URL. If it cannot resolve a project, resolves multiple candidates, or returns an auth/error state, ask the user for the organization/project or full Logfire project URL.

Do not infer the project URL from LOGFIRE_BASE_URL, LOGFIRE_URL, exporter config, repository names, or localhost reachability. Env/config values can identify the Logfire platform/API base, but they do not by themselves identify the target organization/project.

URL Workflow

  1. If the full project URL is already known, use it directly.
  2. If the user omits the project, resolve the current project through MCP as described above.
  3. If the user gives a project name but not the organization/base URL, call project_logfire_ui_link(project=project) with the default clean-link behavior to derive the canonical project URL. This is a URL discovery helper, not a telemetry query.
  4. For project live-view/filter URLs, call project_logfire_ui_link(project=project, query=query, since=since, until=until, handoff=True) when opening the link immediately in Codex Browser. Use the default clean-link behavior when returning a durable or shareable URL. If the user provides an existing clean Logfire project URL and asks for handoff, parse its project, q, since, and until values and pass them through this tool.
  5. If the user gives or the query workflow has already found a real trace_id, call project_logfire_link(trace_id=trace_id, project=project, handoff=True) when opening the link immediately in Codex Browser. Use the default clean-link behavior when returning a durable or shareable URL.
  6. Add query, since, and until through project_logfire_ui_link when useful. If manually assembling a clean URL, URL-encode q, since, and until.
  7. If the user asked to open the URL and Browser is available, open it in the Codex in-app browser. Otherwise, return the URL rather than launching an external browser.

Already-Open Live View Control

If a Logfire project live view is already open in Codex Browser, use the JSON command bridge. This is the only supported in-app interaction model because it updates the view without a full document reload and shows the user that the agent is actively changing the page.

Do not try to use page-global JavaScript APIs from Codex Browser. The only supported agent control surface is the JSON command input.

For Codex Browser / iab, fill the Logfire live view agent command input with a JSON patch such as {"q":"level='error'","last":"1h","since":null,"until":null} and press Enter. The hidden submit button is only a form target; do not skip this path just because the button is not visibly clickable.

Use direct URL/search-param updates only when the bridge form input is not present or cannot be submitted. Do not update the URL directly when the bridge form is available.

When using the direct URL fallback and the browser control surface permits page-script URL updates, update window.history and dispatch a popstate event. Use pushState for meaningful user-visible navigation and replaceState for cleanup or retries. If in-page URL updates are unavailable, fall back to opening the clean URL.

Do not mutate an /api/auth/handoff?ticket=... URL. Handoff URLs are single-use entry points only; after the redirect, control the final clean project URL.

Live view search parameters:

  • q: SQL-like Logfire filter expression, for example level='error', kind='span', or service_name='api'. URL-encode this when constructing a URL string.
  • last: rolling live window, such as 5m, 1h, 14d, or a millisecond number. Use this for live mode and remove since/until.
  • since and until: fixed historical window as ISO 8601 timestamps. Use these for a bounded time range and remove last.
  • env: deployment environment filter. Use repeated env parameters for multiple environments. Omit it for all environments.
  • traceId and spanId: focus a specific trace/span when known. Clear stale focus parameters such as traceId, spanId, focusTraceId, and focusTraceTimestamp when changing the main query or time range unless the user asked to preserve the focused record.

Browser Handoff URLs

When the MCP link tools support handoff: bool = False, use handoff=True only for a URL that will be opened immediately in the browser. A handoff URL is short-lived, single-use, and bound to the destination minted by the platform.

  • If the handoff result is a string, open that exact URL promptly. It may be an /api/auth/handoff?ticket=... URL. Do not add query params to it, rewrite it, persist it, quote it in docs, or treat it as shareable.
  • If the handoff result is an object with handoff: false, use its url value as the clean fallback URL. Mention reason only when it helps the user understand why the browser may still ask for login, such as API-key auth or a need to re-authenticate.
  • If the reason says to re-authenticate the Logfire MCP connection, explain that the MCP OAuth refresh token is missing the metadata needed to mint a UI session. Do not describe this as a browser-session refresh; the user needs to reconnect/re-authenticate the Logfire MCP auth flow.
  • If the available MCP server does not expose handoff, call the link tool normally and use the clean URL.
  • Do not manually append filters or time params to a handoff URL. Put the final project filter destination into project_logfire_ui_link and let the platform mint the ticket for that destination.

Codex Browser Open Stability

When opening a Logfire handoff URL in Codex Browser, keep the durable clean URL for the same destination as a fallback. If needed, call the same link tool with handoff=False before reporting a browser-open failure.

Use the Browser skill's in-app browser workflow and bound the navigation attempt. Do not wait for networkidle, websocket completion, or a fully quiet live-view page. If waiting after navigation, wait only for URL commit, the final clean project URL, or a visible Logfire page signal.

If the browser remains on a grey about:blank screen or the browser navigation call times out, stop waiting and return the clean URL. Describe this as the browser open stalling before navigation, not as a Logfire auth failure. Do not expose the consumed or expired handoff URL.

Do not recover from Codex Browser stalls by launching a separate browser window. Return the clean URL unless the user explicitly asks you to try an external browser.

Common Filters

  • Spans: q=kind%3D%27span%27
  • Logs: q=kind%3D%27log%27
  • Exceptions: q=is_exception%3Dtrue
  • Errors: q=level%3D%27error%27
  • Service: URL-encode a filter such as service_name='api'

Example

For "open the Logfire live view for spans in starter-project for the last hour in Codex":

  1. Open the known or derived starter-project Logfire URL directly.
  2. Add q=kind%3D%27span%27.
  3. Add since=<one-hour-ago> and until=<now>.
  4. Open the URL in Codex Browser.
  5. Do not run SQL first.

For "find the slowest trace and open it", use the query workflow only to identify the trace, then use project_logfire_link(trace_id=trace_id, project=project, handoff=True) and open that link.

For "change the open live view to the last hour of errors", submit {"q":"level='error'","last":"1h","since":null,"until":null} through the Logfire live view agent command input; do not mint a new handoff URL.

Auth Boundary

Do not try to pass MCP auth tokens into the browser or Logfire UI. Never put bearer, API, read, or write tokens in URL query parameters, fragments, pasted browser instructions, logs, or notes. MCP/tool authentication and browser web sessions are separate security contexts.

For immediately opened UI links, prefer the platform handoff described above. If handoff is unavailable, fall back to the clean URL and explain the specific fallback reason when useful. A missing browser cookie may require normal browser login; a stale MCP OAuth connection requires MCP re-authentication instead.

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。