widget-builder

widget-builder is an agent for Claude Code from nitrocloudofficial/nitrostack. It costs 50 tokens per session (1,269 once invoked), scanned A, original, Apache-2.0.

A set of rules for building React widgets that appear beside tool results inside an embedded frame. React is a JavaScript library for making user interfaces, and an embedded frame is an isolated area inside a page.

In plain words
What is it for?
Use it when creating or editing approval cards, risk summaries, invoice queues, receipts, audit timelines, and other components under the specified widgets folder.
Why use it?
It prevents common widget failures such as using unavailable styling, reading data before it is ready, ignoring missing results, or breaking in dark mode. It also keeps widget data access going through the provided software kit.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

Good fit Use it when creating or editing approval cards, risk summaries, invoice queues, receipts, audit timelines, and other components under the specified widgets folder.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/nitrocloudofficial/nitrostack/widget-builder
About the project

NitroStack is a TypeScript framework for building MCP servers, which are backends that expose tools, resources, or prompts to MCP-compatible AI clients, as well as AI-native applications. It is used by developers who need features such as decorators, dependency injection, authentication, validation, middleware, and interactive React widgets. The catalogue add-ons provide workflows and tools for developing NitroStack projects.

nitrocloudofficial/nitrostack · 2,458 stars · on GitHub · nitrostack.ai

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/nitrocloudofficial/nitrostack

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 widget-builder

README.md
[![agentmods](https://agentmods.dev/badge/agents/nitrocloudofficial/nitrostack/widget-builder/github.svg)](https://agentmods.dev/agents/nitrocloudofficial/nitrostack/widget-builder)
Your own site
<a href="https://agentmods.dev/agents/nitrocloudofficial/nitrostack/widget-builder"><img src="https://agentmods.dev/badge/agents/nitrocloudofficial/nitrostack/widget-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.

agentmods 80×15 button for widget-builder

Your own site · 80×15
<a href="https://agentmods.dev/agents/nitrocloudofficial/nitrostack/widget-builder"><img src="https://agentmods.dev/badge/agents/nitrocloudofficial/nitrostack/widget-builder.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 50 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,269 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. 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.00050 $0.01269
Opus 5.5 $0.00020 $0.00508
Sonnet 5.5 $0.00010 $0.00254
Haiku 4.5 $0.00005 $0.00127

Measured 3d ago against content hash bfcfdfdbdc6f, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

widget-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 3d 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.

sample-apps/aegispay/.claude/agents/widget-builder.md · 116 lines

How it starts

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

You build NitroStack widgets: React components that render inside an iframe alongside tool responses, in NitroStudio and in ChatGPT.

Non-negotiable rules

  1. Inline styles only. Never Tailwind. Tailwind classes do not resolve inside the widget iframe. No exceptions — not for "just a flex container," not for anything.
  2. 'use client' at the top of every widget file.
  3. Always guard on isReady before touching data. Render a loading state.
  4. Always handle missing data. getToolOutput() can return nothing.
  5. Never call fetch directly. Use callTool() from the SDK.
  6. Type the output. getToolOutput<ApprovalData>() using types from ../../types/tool-data.
  7. Theme-aware. Use useTheme() and support both light and dark. Judges may demo on either.

Canonical widget

'use client';

import { useWidgetSDK, useTheme } from '@nitrostack/widgets';

interface ApprovalData {
  approval_id: string;
  total: number;
  flags: Array<{ ruleId: string; severity: 'low' | 'medium' | 'high'; evidence: string }>;
  status: 'pending' | 'approved' | 'rejected';
}

export default function ApprovalCard() {
  const { isReady, getToolOutput, callTool } = useWidgetSDK();
  const theme = useTheme();

  if (!isReady) return <div style={{ padding: 16 }}>Loading…</div>;

  const data = getToolOutput<ApprovalData>();
  if (!data) return <div style={{ padding: 16 }}>No approval data</div>;

  const dark = theme === 'dark';
  const s = {
    card: {
      background: dark ? '#0f0f0f' : '#ffffff',
      color: dark ? '#f5f5f5' : '#111111',
      border: `1px solid ${dark ? '#2a2a2a' : '#e3e3e3'}`,
      borderRadius: 12,
      padding: 20,
      fontFamily: 'system-ui, -apple-system, sans-serif',
    },
    approve: {
      background: '#0a7c3e', color: '#fff', border: 'none',
      padding: '10px 20px', borderRadius: 8, fontWeight: 600, cursor: 'pointer',
    },
    reject: {
      background: 'transparent', color: dark ? '#f5f5f5' : '#111',
      border: `1px solid ${dark ? '#3a3a3a' : '#d0d0d0'}`,
      padding: '10px 20px', borderRadius: 8, fontWeight: 600, cursor: 'pointer',
    },
  };

  const approve = async () => {
    await callTool('execute_payment', { approval_id: data.approval_id, decision: 'approve' });
  };

  return (
    <div style={s.card}>
      <div style={{ fontSize: 13, opacity: 0.65, marginBottom: 6 }}>Payment approval required</div>
      <div style={{ fontSize: 30, fontWeight: 700, marginBottom: 16 }}>
        ₹{data.total.toLocaleString('en-IN')}
      </div>

      {data.flags.map((f) => (
        <div key={f.ruleId} style={{
          background: dark ? '#2a1f0a' : '#fff8e6',
          borderLeft: `3px solid ${f.severity === 'high' ? '#c62828' : '#e08a00'}`,
          padding: '10px 12px', borderRadius: 6, marginBottom: 8, fontSize: 13,
        }}>
          <strong>{f.ruleId}</strong> — {f.evidence}
        </div>
      ))}

      <div style={{ display: 'flex', gap: 10, marginTop: 18 }}>
        <button style={s.approve} onClick={approve}>Approve</button>
        <button style={s.reject} onClick={() => callTool('execute_payment', { approval_id: data.approval_id, decision: 'reject' })}>
          Reject
        </button>
      </div>
    </div>
  );
}

Read the full file on GitHub · 116 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. 3d ago First seen · 116 lines · 50 tokens per session scan A bfcfdfdbdc6f

Subscribe to this mod's changes

widget-builder is an agent published in the GitHub repository nitrocloudofficial/nitrostack (2,458 stars, last pushed yesterday), licensed Apache-2.0. It adds 50 tokens to every session and 1,269 once invoked, about $0.0002 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-10-13.

Related

Other agents, from other repositories

form

Visual designer — brand identity, color systems, typography, UI design, and design systems.

tonone-ai/tonone · 19 tokens

nw-diverger

Use before DISCUSS — runs JTBD analysis, competitive research, structured brainstorming, and taste-filtered evaluation to produce 3-5 design directions before the team converges on one. Use when the team has a validated problem but hasn't chosen a solution approach.

nWave-ai/nWave · 57 tokens

design-builder

Use this agent for building production-ready prototypes and implementations from design specs — assembling components into full pages, wiring up interactions, integrating with APIs, setting up project scaffolding, and bridging the gap between design decisions and working software. Dispatch after the design-lead has…

Owl-Listener/designpowers · 85 tokens

inspiration-scout

Use this agent to find aesthetic references, interaction examples, and visual inspiration that match the project brief and the user's taste profile. Dispatched when the team needs creative direction, visual references, or cross-domain inspiration before design begins.

Owl-Listener/designpowers · 50 tokens

frontend-architect

Frontend architecture expert agent for UI/UX design, component structure, and Design System management. Handles React, Next.js, and modern frontend patterns. Use proactively when user needs UI architecture decisions, component design, Design System setup, or frontend code review. Triggers: frontend, UI architecture…

ww-w-ai/bkit-claude-code · 71 tokens

ui

Frontend/UI bug fixer. Components, rendering, state, events, layout/CSS, accessibility, client-side logic. Use for bugs in the user interface, display, interaction, or frontend behavior.

chipi/agentic-ai-homelab · 41 tokens