Borrowing it
Nothing to install: this file belongs to ianlkl11234s/mini-taiwan-pulse. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/ianlkl11234s/mini-taiwan-pulse/develop/.claude/commands/check-rpc.mdgit clone --depth 1 https://github.com/ianlkl11234s/mini-taiwan-pulseWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/ianlkl11234s/mini-taiwan-pulse/check-rpc)<a href="https://agentmods.dev/commands/ianlkl11234s/mini-taiwan-pulse/check-rpc"><img src="https://agentmods.dev/badge/commands/ianlkl11234s/mini-taiwan-pulse/check-rpc/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/commands/ianlkl11234s/mini-taiwan-pulse/check-rpc"><img src="https://agentmods.dev/badge/commands/ianlkl11234s/mini-taiwan-pulse/check-rpc.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00022 | $0.00706 |
| Opus 5.5 | $0.00009 | $0.00282 |
| Sonnet 5.5 | $0.00004 | $0.00141 |
| Haiku 4.5 | $0.00002 | $0.00071 |
Grade A, and why
check-rpc scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
/check-rpc
檢查某個 Supabase RPC 的執行計畫與實際耗時,判斷是否需要套用 pre-aggregate pattern(詳見 docs/supabase-optimization.md)。
參數
$1(必填): RPC 名稱,例如get_ship_trails$2(選填): 測試參數(通常是日期),預設CURRENT_DATE
執行步驟
- 讀取
SUPABASE_DB_URL(從.env) - 找到 RPC 定義:
psql "$SUPABASE_DB_URL" -c "\sf public.$1" - EXPLAIN ANALYZE(重點看 plan 結構):
psql "$SUPABASE_DB_URL" -c "EXPLAIN (ANALYZE, BUFFERS, COSTS OFF) SELECT * FROM public.$1('${2:-CURRENT_DATE}');" - 測實際 RPC 響應:
time psql "$SUPABASE_DB_URL" -c "SELECT count(*) FROM public.$1('${2:-CURRENT_DATE}');"
判斷準則
| 現況 | 建議 |
|---|---|
| 響應 < 500ms、rows < 5k | ✅ 不需優化 |
| 響應 500ms ~ 1s、plan 穩定 | 🟡 監控即可,加進 audit 報告 |
| 響應 > 1s 或 rows > 10k | 🔴 必須 套 pre-aggregate pattern |
看到 Sort + 大量 rows |
🔴 可能是 plan 問題,先跑 ANALYZE <source_table> |
看到 Parallel Append + Sort global |
🔴 planner 選錯 plan,試圖 force Merge Append + index |
含 string_agg / ST_Union / 複雜 JOIN |
🔴 一律套 pre-aggregate |
套 pre-aggregate 的下一步
使用 skill supabase-optimize 產生 SQL 範本:
使用 supabase-optimize skill 為 $1 產生 pre-aggregate SQL
或手動參考 docs/supabase-optimization.md 與 ../data-collectors/docs/sql/matview_*.sql 範本。
注意事項
- Supabase pooler 強制 2min statement_timeout,若 EXPLAIN ANALYZE 超時,代表現況已不可用,必須優化
- anon role default timeout 3s,前端實際可用時間更短
- 若 plan 有 stale stats 嫌疑,先
ANALYZE realtime.xxx_source_YYYYMMDD;看是否改善 - 大 payload RPC 記得加
SET statement_timeout TO '60s'function 屬性
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2mo ago First seen · 57 lines · 22 tokens per session scan A daea81368cc4
check-rpc is a command published in the GitHub repository ianlkl11234s/mini-taiwan-pulse (543 stars, last pushed yesterday), licensed MIT. It adds 22 tokens to every session and 706 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
check-rpc compared with commands from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| check-rpcianlkl11234s/mini-taiwan-pulse | Command | 543 | yesterday | MIT | A | 22 | Claude Code |
| psql-queryoliver-kriska/claude-elixir-phoenix | Command | 574 | yesterday | MIT | A | 16 | Claude Code |
| dbtextura-agency/next16-claude-starter | Command | 145 | 23d ago | Unlicense | A | 11 | Claude Code |
| splunk-observability-database-monitoring-setupchambear2809/splunk-cisco-skills | Command | 40 | 6d ago | Apache-2.0 | A | 0 | Claude Code |
| pg-indexespgrundev/pgbot | Command | 1.5k | 4d ago | none | A | 12 | Claude Code |
| chadi-dbchadixearth/graphyloop | Command | 3 | 4d ago | MIT | A | 22 | Claude Code |
| rls-plankensaurus/cursor-kenji | Command | 9 | 1mo ago | MIT | A | 16 | Claude Code |