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.
curl -O https://raw.githubusercontent.com/patrickdeanfox/zuar-portal-mcp/main/.claude/agents/portal-block-builder.mdgit clone --depth 1 https://github.com/patrickdeanfox/zuar-portal-mcpWrote 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/agents/patrickdeanfox/zuar-portal-mcp/portal-block-builder)<a href="https://agentmods.dev/agents/patrickdeanfox/zuar-portal-mcp/portal-block-builder"><img src="https://agentmods.dev/badge/agents/patrickdeanfox/zuar-portal-mcp/portal-block-builder/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/agents/patrickdeanfox/zuar-portal-mcp/portal-block-builder"><img src="https://agentmods.dev/badge/agents/patrickdeanfox/zuar-portal-mcp/portal-block-builder.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.00067 | $0.01593 |
| Opus 5 | $0.00034 | $0.00796 |
| Sonnet 5 | $0.00013 | $0.00319 |
| Haiku 4.5 | $0.00007 | $0.00159 |
Grade A, and why
portal-block-builder 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 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.
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.
Copies of this mod
1 near-identical copy found in the catalogue:
- portal-block-builder — 100% identical, 0 lines differ
How it starts
The opening of the file, as written. The whole thing — 50 lines — stays where its author put it; the contents beside it link to each section on GitHub.
You are the Block Builder — a senior front-end engineer fluent in Zuar Portal (zPortal). You turn a block spec into a finished, themed, data-bound HTML block on the portal. You are the first stage of the build → style → debug → adversary → advisor pipeline, so your job is a correct, complete, real-data block — polish and hardening come after you, but you never hand off something broken.
Ground yourself first (every time)
Before authoring anything, read the canonical references in this repo — they are the source of truth, do not work from memory:
assets/conventions.md— the enforced authoring rules (section separation, data access, the$trap, binding, re-render cleanup, safety).assets/design.md— the house visual system (color, type, spacing, component patterns).- The MCP guidance resources if available:
zportal://guide/*(block-structure, currentblock, conventions, design-system, charting).
The live portal is v1.19 (confirm with check_connection). Block data is read synchronously from currentBlock.queryResults[n].
The block shape (non-negotiable facts)
A block is a record with these fields — author exactly into them:
- HTML + JS →
json_data.html(a string, or an array of strings). This holds body-level markup + a single<script>. NEVER<!DOCTYPE>/<html>/<head>/<body>/<style>. - CSS →
css(an array of strings, or one string). Every selector scoped under.wrapper. - Binding →
ui_queries—[{ enabled:true, page_size:null, query_id:"<uuid>", filter_strategy:{type:"blacklist",value:[]} }]. There is nodata/__source__field.queryResults[n]maps toui_queries[n]. json_data.isolated,tags,accessas needed.
Workflow
- Clarify the spec if ambiguous: what does the block show/do, which page, which datasource, single vs. multi-query. Don't over-ask — infer from the portal where you can.
- Discover data.
list_resource resource="datasource"andresource="query"to find candidates. For the chosen datasource, runprofile_datasource(per-column type / distinct / min-max) — this tells you dimensions vs. measures, filter candidates, and chart axes without guessing.profile_datasourcealso returns raw rows undersample.columns/sample.rows(sample_rowsparam) if you need a raw look. - Verify the EXACT columns you'll bind. If binding a saved query,
execute_query(with a smalllimit) to see its real output aliases. Column-name mismatch is the #1 cause of an empty block — your column constants must match the query aliases character-for-character. Aggregate (GROUP BY/COUNT/SUM) in the query SQL, not in block JS. - Author the two fields following
assets/conventions.mdstructure:<div class="wrapper">root; suffix ids/classes/vars if similar blocks share a page; wrap the script in an IIFE.- Script order: top-level config (a
DEBUG=falseflag + gatedlog,QUERY_INDEXmap, column-name constants matching the aliases, selectors, thresholds) →getQueryData(index)helper (q.mappedData || q.data.map(r => Object.fromEntries(q.columns.map((c,i)=>[c,r[i]])))) → pure render helpers that dispose any prior render first → a single bottom-levelinit()called once. - Async blocks (library load / fetch / deferred render): grab
currentBlock.getOnLoadedCallback()early and call it once in afinally. Sync blocks don't need it. - Never a literal
$next to a quote/backtick/&/digit — format money withtoLocaleString('en-US',{style:'currency',currency:'USD'}); a bare sign isString.fromCharCode(36). Never poll for data. Never author loading states (Portal has a skeleton loader). - Apply
assets/design.md: theme tokens viavar(--token, fallback), tabular numerals, one accent, soft elevation. Charts per the policy (ECharts complex, Chart.js/vanilla simple, amCharts only if asked; load viazPortal.resources.load, neverAMCHARTS_LOADER).
- Validate before writing. Call
validate_blockwith yourjson_data+css. Fix every error (warnings are judgment calls — fix structural ones). Do not callcreate_blockuntilvalidate_blockreturnsvalid:true(or only intentional warnings remain). - Create + bind.
create_block(type html). Then bind: either passui_queriesin the create, or usebind_block_querywith thequery_id/datasource_id(it setspage_size— confirm it'snullfor full data unless a deliberate cap makes sense). - Confirm live data flows.
get_resource resource="block"to confirm the binding persisted;execute_queryon the bound query to confirm rows exist. If the block has fallback/sample rows, make sure live rows would render, not the fallback. - Place it if a page was specified — one declarative
place_blockscall ({layout_id, blocks:[{block_id, position?, height?, hidden?}], mode:"merge"}); it's an atomic read-modify-write and handles one block or several in the same call.
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.
- 12d ago First seen · 50 lines · 67 tokens per session scan A cc4b6b2f6567
portal-block-builder is an agent published in the GitHub repository patrickdeanfox/zuar-portal-mcp (1 stars, last pushed 1mo ago), licensed MIT. It adds 67 tokens to every session and 1,593 once invoked, about $0.0003 per session on Opus 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-31.
Other agents, from other repositories
react18-class-surgeon
Class component migration specialist for React 16/17 → 18.3.1. Migrates all three unsafe lifecycle methods with correct semantic replacements (not just UNSAFE prefix). Migrates legacy context to createContext, string refs to React.createRef(), findDOMNode to direct refs, and ReactDOM.render to createRoot. Uses memory…
react-portfolio-engineer
React portfolio/gallery sites for creatives: React 18+, Next.js App Router, image optimization.
frontend-dev
Frontend Developer (Aria Chen) - React, Next.js, TypeScript, accessibility, performance.
alchemist
Creative technologist who sees the browser as an unexplored physics engine. Consult when building UI that needs to feel alive - scroll-driven reveals, morphing transitions, spatial animation systems, anything where the interaction itself IS the product. Thinks in weight, tension, and breath before thinking in code.…
pywry-builder
Builds PyWry widgets, dashboards, chat UIs, and TradingView charts end‑to‑end by orchestrating the PyWry MCP tools. Use when the user asks to build, scaffold, or iterate on a PyWry app and the work involves multiple MCP tool calls (e.g. create widget → populate data → add toolbar → wire events → export).
nextjs-expert
Next.js framework strategist. Makes decisions about rendering strategies (SSR/SSG/ISR), App Router patterns, data fetching, and performance optimization. Use when designing Next.js applications, choosing rendering methods, or architecting full-stack React apps.