openui-forge-langchain

openui-forge-langchain is a skill for Claude Code from OthmanAdi/openui-forge. It costs 29 tokens per session (1,586 once invoked), scanned A, original, MIT.

A setup guide for building generative user interfaces with OpenUI and LangChain or LangGraph, tools for connecting applications to language models and managing their responses.

In plain words
What is it for?
Use it to create OpenUI applications with a LangChain or LangGraph backend, using OpenAI or Anthropic models.
Why use it?
It shows how to connect ChatOpenAI or ChatAnthropic to a React and Next.js application and stream model output in the format the interface expects.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: installed under .agents/ (shared by several agents).

Not installable on its own: it runs a file from its repository that does not travel with it. Clone the repository, or install whatever ships that file. The line is npx @openuidev/cli generate ./src/lib/library.ts --out src/generated/system-prompt.txt.

Part of the openui-forge plugin — 14 skills, 6 commands shipped together

Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add OthmanAdi/openui-forge
Claude Code
/plugin install openui-forge

Made for: Claude Code.

Or install openui-forge, the plugin that ships this one along with the rest of its 14 skills, 6 commands.

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 openui-forge-langchain

README.md
[![agentmods](https://agentmods.dev/badge/skills/othmanadi/openui-forge/openui-forge-langchain.svg)](https://agentmods.dev/skills/othmanadi/openui-forge/openui-forge-langchain)
Your own site
<a href="https://agentmods.dev/skills/othmanadi/openui-forge/openui-forge-langchain"><img src="https://agentmods.dev/badge/skills/othmanadi/openui-forge/openui-forge-langchain.svg" alt="Measured on agentmods" height="20"></a>
Per session 29 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,586 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00029 $0.01586
Opus 5 $0.00015 $0.00793
Sonnet 5 $0.00006 $0.00317
Haiku 4.5 $0.00003 $0.00159

Measured 6d ago against content hash 611595b94e35, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

openui-forge-langchain 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 6d 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.

.agents/skills/openui-forge-langchain/SKILL.md · 185 lines

How it starts

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

OpenUI Forge — LangChain

Build generative UI apps with OpenUI + LangChain. Stream from ChatOpenAI or ChatAnthropic, convert to OpenAI NDJSON.

Activation Triggers

  • "openui langchain", "openui langgraph", "openui langsmith"
  • "generative ui langchain", "langchain streaming ui"

Prerequisites

  • Node.js >= 22 (24 LTS recommended), React >= 18.3.1 (19+ recommended)
  • OPENAI_API_KEY or ANTHROPIC_API_KEY set
  • Next.js project (App Router recommended)

Quick Start

  1. Install dependencies (pick one or both LLM providers):
npm install @openuidev/react-ui @openuidev/react-headless @openuidev/react-lang lucide-react zod @langchain/openai @langchain/core
# For Anthropic: npm install @langchain/anthropic
  1. Add the CSS import to app/layout.tsx:
import "@openuidev/react-ui/components.css";
  1. Create the API route and frontend page below
  2. Run npm run dev and test

Full Code

Backend (OpenAI): app/api/chat/route.ts

import { openuiChatLibrary } from "@openuidev/react-ui/genui-lib";
import { ChatOpenAI } from "@langchain/openai";
import { HumanMessage, SystemMessage, AIMessage } from "@langchain/core/messages";

const model = new ChatOpenAI({ model: process.env.OPENAI_MODEL ?? "gpt-5.5", streaming: true });

export async function POST(req: Request) {
  const { messages } = await req.json();

  const systemPrompt = openuiChatLibrary.prompt({
    preamble: "You are a helpful assistant that generates interactive UIs.",
  });

  const lcMessages = [
    new SystemMessage(systemPrompt),
    ...messages.map((m: { role: string; content: string }) =>
      m.role === "user" ? new HumanMessage(m.content) : new AIMessage(m.content)
    ),
  ];

  const stream = await model.stream(lcMessages);
  const encoder = new TextEncoder();
  const id = `chatcmpl-${Date.now()}`;

  const readableStream = new ReadableStream({
    async start(controller) {
      for await (const chunk of stream) {
        const text = typeof chunk.content === "string" ? chunk.content : "";
        if (!text) continue;
        const payload = {
          id,
          object: "chat.completion.chunk",
          choices: [{ index: 0, delta: { content: text }, finish_reason: null }],
        };
        controller.enqueue(encoder.encode(`data: ${JSON.stringify(payload)}\n\n`));
      }
      const done = {
        id,
        object: "chat.completion.chunk",
        choices: [{ index: 0, delta: {}, finish_reason: "stop" }],
      };
      controller.enqueue(encoder.encode(`data: ${JSON.stringify(done)}\n\n`));
      controller.enqueue(encoder.encode("data: [DONE]\n\n"));
      controller.close();
    },
  });

  return new Response(readableStream, {
    headers: { "Content-Type": "text/event-stream" },
  });
}

Read the full file on GitHub · 185 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. 6d ago First seen · 185 lines · 29 tokens per session scan A 611595b94e35

Subscribe to this mod's changes

openui-forge-langchain is a skill published in the GitHub repository OthmanAdi/openui-forge (22 stars, last pushed 1mo ago), licensed MIT. It adds 29 tokens to every session and 1,586 once invoked, about $0.0001 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-30.

Related

Other skills, from other repositories

golang-gomlx

Machine learning models training and inference using GoMLX for Go. It provides an abstraction to create vectorized computation graphs, that can then be JIT-compiled (Just-In-Time) and executed very fast, with backends using XLA (for CPU/CUDA/TPU), Go and others. Includes a reach set of vector (tensors) operations on…

gomlx/gomlx · 143 tokens

streamsql

当需要创建实时数据聚合/窗口统计、流式过滤转换、变化检测(CDC)、生命周期累计、元数据富化(流-表 JOIN)、CEP 模式识别(MATCHRECOGNIZE)等规则链时使用,或当使用 x/streamAggregator 和 x/streamTransform 组件时使用。包含 SQL 语法、窗口、分析函数、JOIN、CEP 和配置示例.

rulego/rulego · 90 tokens

pi-loop-forensics

Diagnose pi-go agent loops and degenerate turns — "agent loop aborted", runaway thinking with no tool calls, repeated phrases. Discriminates genuine model repetition collapse from a race, a tool-parse failure, or a too-low guard, and A/B replays a seed session across providers.

dimetron/pi-go · 65 tokens

nightly-session-watch

Nightly sweep of the last 24h of pi-go sessions — anomalous runs, loop aborts, tool error rates, token waste, real prompt-token spend, and whether the observation and palace pipelines are still recording. Triages each finding to the specialist skill that diagnoses it. Use for an unattended daily health check, or on…

dimetron/pi-go · 78 tokens

migration-helper

Analyze GORM model changes, estimate resulting schema (DDL) differences, and propose safe migration steps with verification guidance.

pilinux/gorest · 26 tokens

memory-status

Show MemPalace memory system status — drawer counts, wings, rooms, knowledge graph stats, and embedding model state.

dimetron/pi-go · 27 tokens