zuar-portal-mcp: Skill for Claude Code

.claude/skills/portal-block-perf/SKILL.md

portal-block-perf is a skill for Claude Code from patrickdeanfox/zuar-portal-mcp. It costs 104 tokens per session (2,426 once invoked), scanned A, original, MIT.

A performance guide for Zuar Portal blocks that display large datasets. It focuses on sending only needed database columns, loading chart libraries alongside data, setting honest timeouts, and measuring response sizes.

In plain words
What is it for?
Use it to audit large-data blocks, reduce query payloads, prefetch chart libraries, set 60-second polling limits with failure messages, and measure requests with curl.
Why use it?
It helps diagnose slow or blank blocks caused by oversized JSON responses, serial resource loading, and timeouts that are too short for real conditions.

Skill for Claude Code

Written for Claude Code: installed under .claude/.

This is patrickdeanfox/zuar-portal-mcp's own configuration. It tells Claude Code how to work on zuar-portal-mcp itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything zuar-portal-mcp configures →

Reuse

Borrowing it

Nothing to install: this file belongs to patrickdeanfox/zuar-portal-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/patrickdeanfox/zuar-portal-mcp/main/.claude/skills/portal-block-perf/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/patrickdeanfox/zuar-portal-mcp

Made for: Claude Code.

Wrote 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.

agentmods badge for portal-block-perf

README.md
[![agentmods](https://agentmods.dev/badge/skills/patrickdeanfox/zuar-portal-mcp/portal-block-perf/github.svg)](https://agentmods.dev/skills/patrickdeanfox/zuar-portal-mcp/portal-block-perf)
Your own site
<a href="https://agentmods.dev/skills/patrickdeanfox/zuar-portal-mcp/portal-block-perf"><img src="https://agentmods.dev/badge/skills/patrickdeanfox/zuar-portal-mcp/portal-block-perf/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.

agentmods 80×15 button for portal-block-perf

Your own site · 80×15
<a href="https://agentmods.dev/skills/patrickdeanfox/zuar-portal-mcp/portal-block-perf"><img src="https://agentmods.dev/badge/skills/patrickdeanfox/zuar-portal-mcp/portal-block-perf.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 104 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,426 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00104 $0.02426
Opus 5 $0.00052 $0.01213
Sonnet 5 $0.00021 $0.00485
Haiku 4.5 $0.00010 $0.00243

Measured 12d ago against content hash 141da419d9f5, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

portal-block-perf scanned grade A with 1 finding 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 12d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

description: Performance playbook for Zuar Portal blocks with large datasets — audit and trim SELECT * queries to referenced columns, load chart libraries in parallel with the query (amCharts prefetch pattern), 60s data-
.claude/skills/portal-block-perf/SKILL.md · 174 lines

How it starts

The opening of the file, as written. The whole thing — 174 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Portal block performance playbook

Distilled from a production incident on a customer portal (2026-07-08): a block took 17–19 s to load on a fast connection and never loaded on slow ones. Root causes, in order of impact: a SELECT * query shipping 46.8 MB of uncompressed JSON, a chart library loaded serially after the data arrived, and a 15 s load timeout that turned "slow" into "permanently blank". Every pattern below was verified in production.

The performance model

A block's wall-clock load = DB query → server JSON serialization → network transfer → JS parse → chart-lib load → render.

For large datasets the DB is usually the SMALLEST slice (3 s of an 18 s load). Payload size drives serialization + transfer + parse, so bytes are the enemy, not the index. Diagnose with real numbers before touching anything:

# Login (host/creds in .zuar-portal/config.json)
curl -s -c cookies.txt "$HOST/auth/login?api_key=$KEY&user_id=$UID"

# Replay the block's exact execute call with timing
curl -s -b cookies.txt -H "X-Api-Key: $KEY" -H "Content-Type: application/json" --compressed \
  -d '{"query_id":"<QID>","dsl":{"where":[]},"params":[],"datasource_filters":[{"datasource_id":"<DSID>","where":[]}],"response_control":{"include_count":true,"include_params_details":true,"include_columns":false}}' \
  -o resp.json -w "ttfb=%{time_starttransfer}s total=%{time_total}s bytes=%{size_download}\n" \
  "$HOST/api/queries/<QID>/execute"
jq '{count, rows: (.data|length), db_time: .timings.main_query}' resp.json

timings.main_query = DB time. ttfb − db_time = server serialization. total − ttfb = transfer. Multi-second serialization or multi-MB payloads → trim the query.

1. Query audit: trim SELECT * to referenced columns

A granular table × 39 columns × 120k rows ≈ 47 MB. Blocks typically read fewer than half the columns. Trimming is free — no block-code changes — IF done safely:

  1. Find every column the block reads. Blocks access columns by NAME through accessor helpers. Grep the block HTML for ALL of these patterns per column:
    • quoted refs: 'col_name' / "col_name" (accessors like str(r,'x'), num(r,'x'), getVal(row,'x'), getColVal(...))
    • dot lookups on a column map: colMap.col_name
    • plain word-boundary greps LIE (title matches HTML attributes; period matches variable names) — count quoted+dot matches only.
  2. Names referenced in JS but absent from the query are usually guarded fallbacks (if (colMap.x !== undefined)) — dropping nothing they need. Verify the guard exists.
  3. Check the query isn't shared: get_references resource="query" id=<QID> — the dependents list shows every block bound to it. Trim only if this block is the sole binder (or audit all binders).
  4. Update sql_form.columns from ["*"] to the explicit list via update_resource resource="query". Keep where/order_by verbatim.
  5. Datasource filters are unaffecteddatasource_filters apply inside the datasource CTE which still has all columns; the query projection only shapes the SELECT.
  6. Re-measure with the curl above. Expect roughly (kept/total columns) × old size.

Read the full file on GitHub · 174 lines

Changes

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.

  1. 12d ago First seen · 174 lines · 104 tokens per session scan A 141da419d9f5

Subscribe to this mod's changes

portal-block-perf is a skill published in the GitHub repository patrickdeanfox/zuar-portal-mcp (1 stars, last pushed 1mo ago), licensed MIT. It adds 104 tokens to every session and 2,426 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

create-pr

Creates a GitHub PR with a Linear-ticket-prefixed title and a decision-led, narrative description for Prisma 8. Use when the user wants to create a pull request, open a PR, or submit changes for review.

prisma/orm · 48 tokens

schema-exploration

Lists tables, describes columns and data types, identifies foreign key relationships, and maps entity relationships in a database. Use when the user asks about database schema, table structure, column types, what tables exist, ERD, foreign keys, or how entities relate.

langchain-ai/deepagents · 57 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens

nornicdb-cypher-queries

Pick fast, predictable Cypher query shapes in NornicDB — point lookups, batch retrieval, pagination, search, traversal, batched UNWIND/MERGE writes, cleanup, multi-tenant isolation. Use when writing or reviewing Cypher whose latency or throughput matters; maps user intent to the executor's hot-path query templates.

orneryd/NornicDB · 79 tokens

supabase

Supabase / PostgREST Row-Level-Security playbook — pull the anon (or leaked servicerole) key out of the frontend JS, map tables from the auto-generated OpenAPI spec, test anonymous RLS READ disclosures (PII/secret leaks), and anonymous RLS WRITE abuse (insert/update/delete — e.g. forging…

PentesterFlow/agent · 120 tokens

volcengine-rds-postgresql

A tool for operating PostgreSQL databases hosted by Volcano Engine's managed database service. PostgreSQL is a relational database used to store structured application data.

bytedance/agentkit-samples · 63 tokens