• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialproductivity

tables-error-sweep

プラグイン
clay
ソース
GitHub で見る ↗
説明

Clay テーブル — テーブル内でエラーが起きている行をスキャンして、根本原因(特定のレコードではなく)でグループ化したレポートを生成します。 次のような場合に使用: ユーザーが「{テーブル}で何がエラーになっていますか?」「失敗した行を表示して」「{アクション}が失敗していますか?」といった質問をしたとき。

原文を表示

Clay tables — sweep a table for errored rows and report grouped by root cause (not a specific record). Use when the user asks "what's erroring in {table}?", "show failed rows", or "is {action} failing?".

ユースケース
  • テーブル内のエラー行をスキャンしたい
  • エラーの根本原因を特定したい
  • 失敗した行を確認したい
  • 特定のアクションが失敗していないか調査する
本文(日本語訳)

エラースイープ

次のような場合に使用: 「{テーブル}でエラーは何が起きている?」「失敗した行を表示して」「{アクション}は失敗している?」— 特定のレコードではなく、テーブル全体についての質問。目的: エラーが発生している行を見つけ、そのメッセージを読み、根本原因でまとめて報告する(1行ずつではなく)。

action(アクション) 列だけがエラー状態になります。basic(基本)列と source(ソース)列はエラーが起きません(基本列が数式に基づく場合は稀にエラーになる可能性があります)。そのため、スイープはアクション列を対象としています。

1. まずテーブルを理解する

スイープを実行する前に、何がエラーになり得るのかを把握します。

  1. テーブル検索スキル(「Finding a table」)と同じ方法でテーブルを解決します。
  2. clay tables get <tableId> を実行し、その type(タイプ)と rowCount(行数)をメモします。
  3. clay tables columns get <tableId> を実行します(コマンドの --help で形式を確認)。情報を整理します:
    • type: "action" の列はどれか — これらが失敗する列です。読みやすいレポートのため、f_id → 列名 のマッピングを作成します。
    • 各アクション列について、authAccountId(認証関連の失敗)、conditionalRunFormulaText(条件判定 — スキップされたアクションは通常 empty(空)として表示され、エラーにはなりません)、inputsBinding(入力元 — 失敗が不良な入力または欠落している入力に起因する場合に必要)をメモします。
  4. テーブルにアクション列がない場合、エラーが起きる可能性は低いです — その旨を報告し、結論を出す前に1ページのスキャン(ステップ3)で確認します。

2. 対象範囲を決める: 特定の列か全般的か

  • ユーザーが特定のアクションを指定した(「Enrich Company は失敗していますか?」)→ ステップ1から名前を f_id にマッピングし、クライアント側フィルター(ステップ3)をその列に限定します。
  • ユーザーが全般的に聞いた(「何がエラーになっていますか?」)→ error(エラー)状態の 任意の 列をスイープします。
  • 名前が曖昧 / 複数のアクション列が該当(マッチ)→ アクション列を表示してユーザーに選ばせるか、全般的なスイープをデフォルトにして結果を列ごとに分類します。

3. エラーが発生している行を見つける

セルのステータスはサーバー側でフィルタリング不可なため、スイープはページを順番に処理し、エラーセルをクライアント側で抽出します。テーブルタイプ、その後通常テーブルがクエリ対応かで選択します:

一括エンリッチメント(大量データ一括処理)テーブル → 1つの保持行サンプルを検査します。 クエリ対応パスを使用したり、全スイープを試みたりしないでください。これらのテーブルは最大20行のフィルタなし・カーソルなしサンプルを truncated: true(切り詰められた)とともに返し、完了した行は既に削除されている可能性があります:

clay tables rows list <tableId> --limit 20 | jq '{truncated, errored: [ .data[] | { id, cols: (.cells | to_entries | map(select(.value.status == "error")) | map(.key)) } | select(.cols | length != 0) ]}'

ステップ4でこれらの行IDに進みます。検査した保持行の数をレポートし、結果をサンプルのみとして報告します。テーブル全体のエラー数を示唆しないでください。サンプルが空の場合、「検査できる保持行がない」と言い、「テーブルにエラーがない」とは言わないでください。

クエリ対応の通常テーブル → tables query でスキャンします。 各セルは status(ステータス)と、エラーの場合は error(エラー)メッセージとともに返されます — つまり1回で失敗 と メッセージが見つかります(ステップ4をスキップ)。トップレベルの cursor(カーソル)でページネーション(区切り表示)します:

echo '{"tables":[{"id":"t_abc123"}]}' | clay tables query --query - --limit 100 | jq '{next: .cursor, errored: [ .data[] | [ to_entries[] | select(.value.status == "error") | { col: .key, msg: .value.error } ] | select(length != 0) ]}'

クエリ非対応 → clay tables rows list ページをウォーク(走査)し、クライアント側でセルの status をフィルタリングします(リスト出力は全セルのステータスを含みます)。完全なメッセージはその後 rows get(ステップ4)から取得します。スイープのためだけに同期を有効化しないでください — 限定的なスロット(枠)を消費するエスカレーションです。

# 1ページ: エラーが起きた行と、どの列がエラーになったか(.cursor でさらにページを追加)
clay tables rows list <tableId> --limit 100 | jq '{next: .cursor, errored: [ .data[] | { id, cols: (.cells | to_entries | map(select(.value.status == "error")) | map(.key)) } | select(.cols | length != 0) ]}'

トップレベルの cursor でページネーションします(--cursor で渡す)。カーソルがなくなるまで続けます。リスティングは最初のページを取得したときに存在した行をカバーするため、アクティブにインポート中のテーブルでもウォークは終了します。clay tables get の rowCount を使用して計画を立てます: 大型テーブルの全スイープは rowCount / limit 回の呼び出しでレート制限内です — 非常に大型テーブルの場合、まずページサンプルを取り、サンプルしたことを述べます。

4. エラーメッセージを読む

rows list パスのみ必須 — tables query でスイープしたら、メッセージは既にその結果にあるため、ステップ5に進みます。rows list スキャンは どの 行と列がエラーになったかを教えていますが、その error 文字列は省略版のラベルです。完全なメッセージは clay tables rows get にあります:

clay tables rows get <tableId> <rowId> | jq '.cells | to_entries | map(select(.value.status == "error")) | map({col: .key, msg: .value.error})'

レート制限を守ります — rows get 呼び出しを小グループ(3程度)でバッチ処理し、終了時4(rate_limited)で後退し、details.retryAfter を尊重します。

黙って上限に達しないでください。 エラーが起きている行が多い場合、通常は失敗を特徴づけるために全部をフェッチする必要はありません — 異なるメッセージのセットが安定するまでフェッチします(新しい行が新しいメッセージをもたらさなくなるまで)。そして何行をサンプルしたか、合計のうち何行か述べます(clay tables get の rowCount と、収集したID)。サンプルしたときに全カバレッジを示唆しないでください。

1行に 複数の エラーアクションセルが含まれる可能性があります(全般的なスイープ)。エラーが起きている各セルをキャプチャし、col をステップ1の列名にマッピングして戻します。

5. 診断 — 根本原因でグループ分け

{col, msg}(列、メッセージ)ペアを行全体で集約します。メッセージでグループ分けします(似たようなメッセージを正規化 — 行固有の値(メールアドレスやIDなど)を削除して、「john@x のメールなし」と「jane@y のメールなし」が1つの原因に折りたたまれるようにします)。各グループについて、ステップ1が教えたことを使用して原因を推測します:

メッセージパターン 考えられる根本原因 対応方針
「rate limit」「429」「quota」「throttled」 このアクションでプロバイダースロットリング(制限)が発生 通常は一時的 — 再試行可能。customRateLimitRules / batchRunSettings を確認
「invalid api key」「unauthorized」「auth」「credential」 アクションの接続アカウント(authAccountId)が不良/期限切れ 統合アカウントを再接続
「no {x} found」「no input」「missing」「空入力」 上流の 列が何も出さなかったため、このアクションは使用可能な入力がありません 入力を追跡(inputsBinding → 上流列) — /tables-value-trace に引き渡し
「run condition not met」/ 条件判定ゲート 実際のエラーではない — conditionalRunFormulaText が偽と評価され、アクションは意図的にスキップされました 通常は予期された動作。ゲート付きスキップは、エラーセルより empty(空)として表示されることが多い
プロバイダー固有のエラーテキスト ダウンストリームプロバイダーがリクエストを却下 メッセージを文字通りに読む。入力のデータ品質の問題なことが多い

実際の失敗 と 予期されたゲート を区別します。条件スキップで失敗カウントを膨らませないでください — 別に呼び出します。

6. レポート

カウントと原因別の分類でリードします。分析(生のデータ行ではなく)を中心に据えます。

Lead Enrichment — 37行にエラーアクションセルあり(1,543行全スキャン;メッセージは12行取得)。

原因別:
  • 28 — Enrich Company: 「Clearbit API のレート制限超過」
         → プロバイダースロットリング。一時的/再試行可能。レート制限ルールまたはより小さいバッチを検討してください。
  • 6  — Enrich Person: 「入力に対するメールが見つかりません」
         → 上流の「Find Email」が何も返さなかったため、Enrich Person は使用するメールがありません。
            根本原因はこのアクションではなく上流です。(/tables-value-trace Find Email で確認してください。)
  • 3  — Enrich Person: 「無効な API キー」
         → このアクションの接続アカウントが期限切れです。再接続してください。

根本原因: 主な失敗(28/37)は Enrich Company での Clearbit スロットリング —
再試行可能で、データ問題ではありません。二次的なクラスタは上流の
Find Email が何もメールを出していないことを追跡します。

通常テーブルのスイープでエラーセルが見つからない場合、現在エラーになっていないことをレポートします — 根本的な訴えが「行が表示されない」の場合、/tables-capacity にリダイレクト(全テーブルは失敗に見えますがエラーセルを出さない)します。一括エンリッチメントサンプルの場合、検査した保持行にエラーが出なかったのみレポート;空のサンプルは、テーブルがエラーを持たないことも、容量の問題があることもどちらも証明しません。

引き継ぎ

  • ユーザーが理解したい特定のエラー行(全体を追跡) → /tables-trace。
  • 不良/欠落した 入力 に遡るエラー → /tables-value-trace(inputsBinding で上流をウォーク)。
  • 「行が表示されない」でエラーなし → /tables-capacity。
原文(English)を表示

Error sweep

Use when: "what's erroring in {table}?", "show failed rows", "is {action} failing?" — a table-level question with no specific record in hand. Goal: find the errored rows, read their messages, and report grouped by root cause, not row by row.

Only action columns can be in error. basic and source columns don't error (a formula-backed basic can, rarely), so the sweep is about action columns.

1. Understand the table first

Before sweeping, learn what can error.

  1. Resolve the table as in the tables entry-point skill ("Finding a table").
  2. Run clay tables get <tableId> and note its type and rowCount.
  3. clay tables columns get <tableId> (shape in the command's --help). Build the picture:
    • Which columns are type: "action" — these are the ones that fail. Keep a f_id → name map for readable reporting.
    • For each action column, note authAccountId (auth-related failures), conditionalRunFormulaText (a gate — a skipped action usually shows as empty, not a failure), and inputsBinding (what feeds it — needed if a failure turns out to be a bad/missing input).
  4. If the table has no action columns, errors are unlikely — say so, and confirm with a one-page scan (step 3) before concluding.

2. Settle the scope: one column or general

  • User named a specific action ("is Enrich Company failing?") → map that name to its f_id from step 1 and scope the client-side filter (step 3) to that column.
  • User asked generally ("what's erroring?") → sweep across any column in error.
  • Ambiguous name / multiple action columns match → show the action columns and let the user pick, or default to the general sweep and break the results down by column.

3. Find the errored rows

Cell status isn't filterable server-side on either path, so a sweep pages through the rows and picks out the errored cells client-side. Choose the scan by table type, then whether a normal table is query-enabled:

Bulk enrichment table → inspect one retained-row sample. Do not use the query-enabled path or attempt a full sweep. These tables return truncated: true with one unfiltered, cursorless sample of at most 20 currently retained rows, and completed rows may already have been deleted:

clay tables rows list <tableId> --limit 20 | jq '{truncated, errored: [ .data[] | { id, cols: (.cells | to_entries | map(select(.value.status == "error")) | map(.key)) } | select(.cols | length != 0) ]}'

Continue to step 4 for those row ids. Report the number of retained rows inspected and call the result sample-only; never claim a full-table error count. If the sample is empty, say that no retained rows were available to inspect, not that the table has no errors.

Query-enabled normal table → scan with tables query. Each cell comes back with its status and, on an error, its error message — so one pass finds the failures and their messages (skip step 4). Paginate via the top-level cursor:

echo '{"tables":[{"id":"t_abc123"}]}' | clay tables query --query - --limit 100 | jq '{next: .cursor, errored: [ .data[] | [ to_entries[] | select(.value.status == "error") | { col: .key, msg: .value.error } ] | select(length != 0) ]}'

Not query-enabled → walk clay tables rows list pages and filter client-side on cell status (list output carries every cell's status); the full messages then come from rows get (step 4). Don't enable sync just for a sweep — it's an escalation that costs a limited slot.

# One page: errored rows and which columns errored (add more pages via .cursor)
clay tables rows list <tableId> --limit 100 | jq '{next: .cursor, errored: [ .data[] | { id, cols: (.cells | to_entries | map(select(.value.status == "error")) | map(.key)) } | select(.cols | length != 0) ]}'

Paginate via the top-level cursor (pass it back with --cursor) until it's absent. A listing covers the rows that existed when its first page was fetched, so the walk terminates even on an actively-importing table. Use rowCount from clay tables get to budget: a full sweep of a big table is rowCount / limit calls under the rate limit — for very large tables, sample pages first and say you sampled.

4. Read the error messages

Only needed for the rows list path — if you swept via tables query, the messages are already in that result, so skip to step 5. The rows list scan tells you which rows and columns erred, but its error strings are abbreviated labels; the full messages live on clay tables rows get:

clay tables rows get <tableId> <rowId> | jq '.cells | to_entries | map(select(.value.status == "error")) | map({col: .key, msg: .value.error})'

Respect the rate limits — batch rows get calls in small groups (≈3) and back off on exit 4 (rate_limited, honor details.retryAfter).

Don't silently cap. If there are many errored rows, you usually don't need to fetch all of them to characterize the failure — fetch until the set of distinct messages stabilizes (new rows stop introducing new messages), then state how many rows you sampled out of the total (rowCount from clay tables get, and the ids you collected). Never imply full coverage when you sampled.

A single row can have multiple errored action cells (general sweep). Capture each errored cell, and map col back to the column name from step 1.

5. Diagnose — group by root cause

Aggregate the {col, msg} pairs across rows. Group by message (normalize near-identical messages — strip row-specific values like emails or ids so "No email for john@x" and "No email for jane@y" collapse to one cause). For each group, infer the cause using what step 1 told you:

Message pattern Likely root cause Direction
"rate limit", "429", "quota", "throttled" Provider throttling on this action Usually transient — retriable; check customRateLimitRules / batchRunSettings
"invalid api key", "unauthorized", "auth", "credential" The action's connected account (authAccountId) is bad/expired Reconnect the integration account
"no {x} found", "no input", "missing", empty-input An upstream column produced nothing, so this action had no usable input Trace the input (inputsBinding → upstream column) — hand to /tables-value-trace
"run condition not met" / conditional gate Not a real failure — conditionalRunFormulaText evaluated falsy and the action was intentionally skipped Usually expected; note a gated skip more often shows as empty than as an errored cell
provider-specific error text The downstream provider rejected the request Read the message literally; often a data-quality issue in the input

Separate genuine failures from expected gating. Don't let conditional skips inflate the failure count — call them out separately.

6. Report

Lead with the count and the breakdown by cause; put the analysis, not the raw rows, front and center.

Lead Enrichment — 37 rows with errored action cells (all 1,543 rows scanned; 12 fetched for messages).

By cause:
  • 28 — Enrich Company: "Rate limit exceeded for Clearbit API"
         → provider throttling. Transient/retriable; consider a rate-limit rule or smaller batches.
  • 6  — Enrich Person:  "No email found for input"
         → upstream "Find Email" returned nothing, so Enrich Person had no email to use.
            Root cause is upstream, not this action. (/tables-value-trace Find Email to confirm.)
  • 3  — Enrich Person:  "Invalid API key"
         → the connected account for this action is expired. Reconnect it.

Root cause: the dominant failure (28/37) is Clearbit throttling on Enrich Company —
retriable and not a data problem. A secondary cluster traces back to Find Email
producing no email upstream.

If a normal-table sweep found no errored cells, report that nothing is currently erroring — and if the underlying complaint was "rows aren't appearing," redirect to /tables-capacity (a full table looks like a failure but produces no errored cells). For a bulk enrichment sample, report only that no errors appeared in the retained rows inspected; an empty sample proves neither that the table has no errors nor that it has a capacity problem.

Hand-offs

  • A specific errored row the user wants to understand end-to-end → /tables-trace.
  • An error that traces to a bad/missing input → /tables-value-trace (walk inputsBinding upstream).
  • "Rows aren't appearing" with no errors found → /tables-capacity.

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