world-agent
БесплатноБез исполняемых скриптовНе проверенTrain and deploy generative UI agents using behavioral programming constraints, A2A protocol for agent interoperability, and pattern registry for composition…
от majiayu000★ 31 звезда на GitHubОб этом скилле
World Agent
Purpose
This skill provides guidance for training and deploying generative UI agents that use behavioral programming for coordination. The world agent generates templates by composing validated patterns, learning from story execution feedback.
Use this when:
- Training agents with GRPO on Google Colab
- Generating training trajectories from stories
- Computing rewards from story execution results
- Integrating with other agents via A2A protocol
- Indexing validated stories as reusable patterns
- Deploying models to HuggingFace Inference Endpoints
- Executing generated code in a sandboxed environment
- Filtering tools progressively based on user intent
World Model Architecture
The name "world agent" reflects its alignment with world model concepts from reinforcement learning and cognitive science. The agent learns an internal representation of how UI generation works—not by memorizing templates, but by understanding the dynamics of template composition.
Why "World Agent"?
| Concept | Implementation | Purpose |
|---|---|---|
| World Model | Stories + story tests | Defines valid UI states and transitions |
| Policy | FunctionGemma (270M) + LoRA | Proposes actions (tool calls) given intent |
| Symbolic Constraints | bThreads | Block invalid actions before execution |
The HuggingFace model at plaited/plaited-world-agent-lora is the policy—trained via SFT/DPO/GRPO to predict which tool calls satisfy user intents. Stories serve as the world model, providing ground truth for what constitutes valid, accessible UI. bThreads add symbolic reasoning, enforcing constraints that the neural policy might violate.
Neuro-Symbolic Integration
flowchart TB
subgraph Neural["Neural Layer (Policy)"]
Intent["User Intent"]
Model["FunctionGemma + LoRA"]
Actions["Proposed Tool Calls"]
end
subgraph Symbolic["Symbolic Layer (bProgram)"]
Threads["bThreads"]
Block["Block Invalid"]
Allow["Allow Valid"]
end
subgraph World["World Model"]
Stories["Stories"]
Tests["Story Tests"]
Patterns["Pattern Registry"]
end
Intent --> Model --> Actions
Actions --> Threads
Threads --> Block
Threads --> Allow --> Execute["Tool Execution"]
Execute --> Stories
Stories --> Tests --> Reward["Reward Signal"]
Reward -.->|"Training"| Model
Stories --> Patterns
Key insight: The neural policy learns what to generate, while bThreads enforce how to generate it correctly. Training improves the policy; bThreads provide runtime safety.
Key Architectural Concept
The agent IS a bProgram, not a class.
Unlike HuggingFace tiny-agents which use async generator loops, Plaited's world agent uses useBehavioral where bThreads act as runtime constraints that block invalid generations BEFORE tool execution.
import { useWorldAgent, createCoreTools } from 'plaited/agent'
const trigger = await useWorldAgent({
tools: createCoreTools({ outputDir: './generated' }),
model: inferenceClient
})
trigger({ type: 'generate', detail: { intent: 'Create a button' } })
Quick Reference
| Task | Resource |
|---|---|
| Training workflow | training-workflow.md |
| Tool API | tool-api.md |
| Evaluation guide | eval-guide.md |
| Styling templates | styling-guide.md |
| Design tokens | tokens-guide.md |
| Scaffold training story | scripts/scaffold-training-story.ts |
| Generate trajectories | scripts/generate-trajectories.ts |
| Compute rewards | scripts/compute-rewards.ts |
| Run evaluation | scripts/run-eval-suite.ts |
| Compare baseline | scripts/compare-baseline.ts |
| Generate report | scripts/generate-report.ts |
Package Exports
// Agent factory
import { useWorldAgent } from 'plaited/agent'
// Tool infrastructure
import { createToolRegistry, createCoreTools } from 'plaited/agent'
// Constraints
import {
createEnforceTokenUsage,
createEnforceAccessibility,
registerBaseConstraints
} from 'plaited/agent'
// Training utilities
import {
computeReward,
createTrajectory,
generateTrajectories,
extractIntent,
parseFunctionGemmaOutput // Parse model output back to FunctionCall[]
} from 'plaited/agent'
// A2A Protocol
import {
useA2AServer,
createA2AClient,
createAgentCard,
discoverAgent
} from 'plaited/agent'
// Pattern Registry
import {
createPatternRegistry,
type Pattern,
type PatternMatch
} from 'plaited/agent'
// Tool Discovery
import {
createToolDiscovery,
filterToolsByIntent,
schemaToIndexedTool,
extractKeywords,
type ToolDiscovery,
type IndexedTool,
type ToolSource
} from 'plaited/agent'
// Code Sandbox
import {
executeSandboxed,
initializeSandbox,
createCod
Установить world-agent в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл world-agent?
Train and deploy generative UI agents using behavioral programming constraints, A2A protocol for agent interoperability, and pattern registry for composition. Use when working with agent training, trajectory generation, reward computation, A2A integration, or deploying models.
Как установить скилл world-agent?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл world-agent запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
frontend-design
Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making…
от Anthropicwebapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing…
от Anthropicbrand-guidelines
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand…
от Anthropicweb-artifacts-builder
Suite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use…
от Anthropic