- Home
- Skills
- Agents & Orchestration
- Agent Clarification UI Builder
Works with the AI Agents you already use
Agent Clarification UI Builder
Build interactive clarification forms for AI chat apps without disrupting simple conversations.
$9
Agent Clarification UI Builder
Example session with this skill installed
I need to add a clarification form to my React chat app to collect server specs (CPU, RAM, Region) when a user asks to deploy a node. Give me the tool schema and the React renderer code.
- Read your context and instructions
- Compiled the agent clarification ui
- Generated the UI component
I will implement the show_widget tool schema and a secure React iframe renderer to handle server specification collection.
Implementation Plan
The system will trigger this widget when a deploy command is missing specific infrastructure parameters. It will use a sandboxed iframe to prevent the model-generated HTML from accessing your application's DOM.
1. Tool Definition (JSON Schema)
{
"name": "show_widget",
"description": "Render a form to collect missing server specifications.",
"parameters": {
"type": "object",
"properties": {
"title": { "type": "string" },
"loading_messages": {
"type": "array",
"items": { "type": "string" },
"minItems": 2,
"maxItems": 4
},
"widget_code": { "type": "string", "description": "HTML form markup per contract" }
},
"required": ["title", "loading_messages", "widget_code"]
}
}
2. Secure React Renderer
import React, { useRef, useEffect } from 'react';
export const SafeWidget = ({ htmlContent, onFormSubmit }) => {
const iframeRef = useRef<HTMLIFrameElement>(null);
useEffect(() => {
const handleMessage = (event: MessageEvent) => {
// Validate event origin and source for security
if (event.source !== iframeRef.current?.contentWindow) return;
if (event.data.type === 'WIDGET_SUBMIT') {
onFormSubmit(event.data.payload);
}
};
window.addEventListener('message', handleMessage);
return () => window.removeEventListener('message', handleMessage);
}, [onFormSubmit]);
return (
<iframe
ref={iframeRef}
sandbox="allow-scripts"
srcDoc={htmlContent}
style={{ width: '100%', border: 'none', minHeight: '300px' }}
title="Agent Clarification Form"
/>
);
};
Next steps
- Add the tool definition to your LLM system prompt.
- Update your message component to switch to the
SafeWidgetwhen ashow_widgettool call is detected. - Test with
templates/widget-example.htmlto verify thepostMessagebridge.
widget-example.html
TSX · React component
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
Stop guessing what users want and start collecting structured data. This skill provides the logic and code contracts to implement interactive clarification forms directly within AI chat interfaces, reducing hallucination and conversational fatigue.
What it does
- Decision logic provides rules to determine if a task warrants a form or a simple follow-up question.
- HTML data contract defines a strict, script-free markup standard for reliable cross-platform rendering.
- Tool integration scaffolds the
show_widgettool schema with loading states and validation. - Secure rendering implements iframe sandboxing, CSP headers, and event-based communication between the host and agent.
- Result handling wires user form submissions back into the conversation as structured tool-result messages.
How it works
- Analyze stack by identifying message rendering, tool-calling pipelines, and security boundaries.
- Define tool using the provided schema for
title,loading_messages, andwidget_code. - Implement renderer with a sandboxed iframe that communicates via
postMessageto keep the host app secure. - Apply guardrails using the verification checklist to prevent XSS and ensure keyboard accessibility.
Frameworks & tools
Works with any web-based chat application stack including React, Next.js, and Vue. Compatible with OpenAI and Anthropic tool-calling protocols. Requires a host environment capable of rendering iframes and handling JSON tool results.
Why this beats prompting it yourself
Prompting an LLM to "make a form" usually results in broken layouts or dangerous inline scripts. This skill enforces a strict data contract and security architecture that separates untrusted model output from your application logic.
Use cases
- Gathering complex configuration parameters for DevOps or cloud infrastructure tasks.
- Collecting multi-field user preferences for travel itineraries or document generation.
- Auditing existing chat UIs to identify where forms should replace repetitive questioning.
Known limitations
Does not support branching decision trees or nested forms. Requires the host application to implement the rendering bridge as it is not a standalone plugin or hosted widget.
No support for multi-step branching logic or nested forms. Requires host application implementation for iframe rendering and postMessage handling. Not a standalone widget.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 1 day ago