agentleFS
terrene-foundationterrene-foundation/pact/.claude/skills/20-interactive-widgets/SKILL.md

interactive-widgets

Skill0 starsChanged 7 months agoApache-2.0View on GitHub

Interactive widget systems for AI applications including LLM-driven widget generation, dynamic UI components, form builders, and streaming response widgets. Use when asking about 'interactive widgets', 'dynamic UI', 'LLM widgets', 'widget generation', 'streaming widgets', 'form widgets', 'AI response widgets', 'structured responses', or 'widget protocol'.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when:

    line 123

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Interactive Widget System

Production-ready patterns for building interactive widget systems that integrate with AI/LLM backends for dynamic, structured user interfaces.

Overview

Interactive widget patterns for:

  • LLM-driven widget generation
  • Streaming response with structured components
  • Dynamic form builders
  • Action-response patterns
  • Widget protocol design

Reference Documentation

System Overview

  • overview - Widget system architecture and navigation
    • System components
    • Documentation structure
    • Quick reference

Technical Specification

  • technical-spec - Complete technical specification
    • Widget protocol design
    • Backend integration
    • Frontend rendering
    • State management
    • Error handling

Implementation Guide

  • implementation-guide - Step-by-step implementation
    • Backend widget generation
    • Frontend widget rendering
    • Event handling
    • Real-world examples

Quick Patterns

Widget Protocol (JSON)

{
  "type": "form",
  "id": "user-input-form",
  "content": {
    "fields": [
      {
        "type": "text",
        "name": "query",
        "label": "Enter your question",
        "required": true
      }
    ],
    "actions": [
      {
        "type": "submit",
        "label": "Send",
        "action": "submit_query"
      }
    ]
  }
}

Backend Widget Generation (Python)

def generate_widget_response(user_query: str) -> dict:
    """Generate structured widget response from LLM."""
    response = llm.generate(
        prompt=f"Generate a widget response for: {user_query}",
        output_schema=WidgetSchema
    )
    return {
        "type": response.widget_type,
        "content": response.content,
        "actions": response.available_actions
    }

Frontend Widget Renderer (Dart)

Widget buildWidget(Map<String, dynamic> widgetData) {
  switch (widgetData['type']) {
    case 'form':
      return FormWidget(data: widgetData['content']);
    case 'card':
      return CardWidget(data: widgetData['content']);
    case 'table':
      return TableWidget(data: widgetData['content']);
    default:
      return TextWidget(data: widgetData['content']);
  }
}

Widget Types

TypePurposeUse Case
textPlain text responseSimple answers
cardStructured informationEntity displays
formUser input collectionQueries, settings
tableTabular dataLists, comparisons
chartData visualizationAnalytics, metrics
actionClickable actionsWorkflows, confirmations
progressProgress indicationLong-running tasks

CRITICAL Gotchas

RuleWhy
❌ NEVER trust widget IDs from clientSecurity - validate server-side
✅ ALWAYS validate widget schemasPrevent malformed rendering
❌ NEVER block UI on widget generationUse streaming for responsiveness
✅ ALWAYS handle unknown widget typesGraceful degradation

When to Use This Skill

Use this skill when:

  • Building AI chat interfaces with structured responses
  • Creating dynamic form systems
  • Implementing streaming UI components
  • Designing widget protocols for LLM integration
  • Building action-response patterns

Related Skills

  • 04-kaizen - AI agent framework
  • 19-flutter-patterns - Flutter components
  • 22-conversation-ux - Conversation UX

Support

For widget system questions, invoke:

  • kaizen-specialist - LLM integration patterns
  • flutter-specialist - Widget rendering
  • pattern-expert - Protocol design

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.