[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CM7TXE41SNSE6KRTDKSJYM":3,"skill-same:01M7CM7TXE41SNSE6KRTDKSJYM":50},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M7CM7TXE41SNSE6KRTDKSJYM","molykit",null,"CRITICAL: Use for MolyKit AI chat toolkit. Triggers on:\nBotClient, OpenAI, SSE streaming, AI chat, molykit,\nPlatformSend, spawn(), ThreadToken, cross-platform async,\nChat widget, Messages, PromptInput, Avatar, LLM","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Fmolykit\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: molykit\ndescription: |\n  CRITICAL: Use for MolyKit AI chat toolkit. Triggers on:\n  BotClient, OpenAI, SSE streaming, AI chat, molykit,\n  PlatformSend, spawn(), ThreadToken, cross-platform async,\n  Chat widget, Messages, PromptInput, Avatar, LLM\nrisk: unknown\nsource: community\n---\n\n# MolyKit Skill\n\nBest practices for building AI chat interfaces with Makepad using MolyKit - a toolkit for cross-platform AI chat applications.\n\n**Source codebase**: `\u002FUsers\u002Fzhangalex\u002FWork\u002FProjects\u002FFW\u002Frobius\u002Fmoly\u002Fmoly-kit`\n\n## When to Use\nUse this skill when:\n- Building AI chat interfaces with Makepad\n- Integrating OpenAI or other LLM APIs\n- Implementing cross-platform async for native and WASM\n- Creating chat widgets (messages, prompts, avatars)\n- Handling SSE streaming responses\n- Keywords: molykit, moly-kit, ai chat, bot client, openai makepad, chat widget, sse streaming\n\n## Overview\n\nMolyKit provides:\n- Cross-platform async utilities (PlatformSend, spawn(), ThreadToken)\n- Ready-to-use chat widgets (Chat, Messages, PromptInput, Avatar)\n- BotClient trait for AI provider integration\n- OpenAI-compatible client with SSE streaming\n- Protocol types for messages, bots, and tool calls\n- MCP (Model Context Protocol) support\n\n## Cross-Platform Async Patterns\n\n### PlatformSend - Send Only on Native\n\n```rust\n\u002F\u002F\u002F Implies Send only on native platforms, not on WASM\n\u002F\u002F\u002F - On native: implemented by types that implement Send\n\u002F\u002F\u002F - On WASM: implemented by ALL types\npub trait PlatformSend: PlatformSendInner {}\n\n\u002F\u002F\u002F Boxed future type for cross-platform use\npub type BoxPlatformSendFuture\u003C'a, T> = Pin\u003CBox\u003Cdyn PlatformSendFuture\u003COutput = T> + 'a>>;\n\n\u002F\u002F\u002F Boxed stream type for cross-platform use\npub type BoxPlatformSendStream\u003C'a, T> = Pin\u003CBox\u003Cdyn PlatformSendStream\u003CItem = T> + 'a>>;\n```\n\n### Platform-Agnostic Spawning\n\n```rust\n\u002F\u002F\u002F Runs a future independently\n\u002F\u002F\u002F - Uses tokio on native (requires Send)\n\u002F\u002F\u002F - Uses wasm-bindgen-futures on WASM (no Send required)\npub fn spawn(fut: impl PlatformSendFuture\u003COutput = ()> + 'static);\n\n\u002F\u002F Usage\nspawn(async move {\n    let result = fetch_data().await;\n    Cx::post_action(DataReady(result));\n    SignalToUI::set_ui_signal();\n});\n```\n\n### Task Cancellation with AbortOnDropHandle\n\n```rust\n\u002F\u002F\u002F Handle that aborts its future when dropped\npub struct AbortOnDropHandle(AbortHandle);\n\n\u002F\u002F Usage - task cancelled when widget dropped\n#[rust]\ntask_handle: Option\u003CAbortOnDropHandle>,\n\nfn start_task(&mut self) {\n    let (future, handle) = abort_on_drop(async move {\n        \u002F\u002F async work...\n    });\n    self.task_handle = Some(handle);\n    spawn(async move { let _ = future.await; });\n}\n```\n\n### ThreadToken for Non-Send Types on WASM\n\n```rust\n\u002F\u002F\u002F Store non-Send value in thread-local, access via token\npub struct ThreadToken\u003CT: 'static>;\n\nimpl\u003CT> ThreadToken\u003CT> {\n    pub fn new(value: T) -> Self;\n    pub fn peek\u003CR>(&self, f: impl FnOnce(&T) -> R) -> R;\n    pub fn peek_mut\u003CR>(&self, f: impl FnOnce(&mut T) -> R) -> R;\n}\n\n\u002F\u002F Usage - wrap non-Send type for use across Send boundaries\nlet token = ThreadToken::new(non_send_value);\nspawn(async move {\n    token.peek(|value| {\n        \u002F\u002F use value...\n    });\n});\n```\n\n## BotClient Trait\n\n### Implementing AI Provider Integration\n\n```rust\npub trait BotClient: Send {\n    \u002F\u002F\u002F Send message with streamed response\n    fn send(\n        &mut self,\n        bot_id: &BotId,\n        messages: &[Message],\n        tools: &[Tool],\n    ) -> BoxPlatformSendStream\u003C'static, ClientResult\u003CMessageContent>>;\n\n    \u002F\u002F\u002F Get available bots\u002Fmodels\n    fn bots(&self) -> BoxPlatformSendFuture\u003C'static, ClientResult\u003CVec\u003CBot>>>;\n\n    \u002F\u002F\u002F Clone for passing around\n    fn clone_box(&self) -> Box\u003Cdyn BotClient>;\n}\n\n\u002F\u002F Usage\nlet client = OpenAIClient::new(\"https:\u002F\u002Fapi.openai.com\u002Fv1\".into());\nclient.set_key(\"sk-...\")?;\nlet context = BotContext::from(client);\n```\n\n### BotContext - Sharable Wrapper\n\n```rust\n\u002F\u002F\u002F Sharable wrapper with loaded bots for sync UI access\npub struct BotContext(Arc\u003CMutex\u003CInnerBotContext>>);\n\nimpl BotContext {\n    pub fn load(&mut self) -> BoxPlatformSendFuture\u003CClientResult\u003C()>>;\n    pub fn bots(&self) -> Vec\u003CBot>;\n    pub fn get_bot(&self, id: &BotId) -> Option\u003CBot>;\n    pub fn client(&self) -> Box\u003Cdyn BotClient>;\n}\n\n\u002F\u002F Usage\nlet mut context = BotContext::from(client);\nspawn(async move {\n    if let Err(errors) = context.load().await.into_result() {\n        \u002F\u002F handle errors\n    }\n    Cx::post_action(BotsLoaded);\n});\n```\n\n## Protocol Types\n\n### Message Structure\n\n```rust\npub struct Message {\n    pub from: EntityId,         \u002F\u002F User, System, Bot(BotId), App\n    pub metadata: MessageMetadata,\n    pub content: MessageContent,\n}\n\npub struct MessageContent {\n    pub text: String,           \u002F\u002F Main content (markdown)\n    pub reasoning: String,      \u002F\u002F AI reasoning\u002Fthinking\n    pub citations: Vec\u003CString>, \u002F\u002F Source URLs\n    pub attachments: Vec\u003CAttachment>,\n    pub tool_calls: Vec\u003CToolCall>,\n    pub tool_results: Vec\u003CToolResult>,\n}\n\npub struct MessageMetadata {\n    pub is_writing: bool,       \u002F\u002F Still being streamed\n    pub created_at: DateTime\u003CUtc>,\n}\n```\n\n### Bot Identification\n\n```rust\n\u002F\u002F\u002F Globally unique bot ID: \u003Clen>;\u003Cid>@\u003Cprovider>\npub struct BotId(Arc\u003Cstr>);\n\nimpl BotId {\n    pub fn new(id: &str, provider: &str) -> Self;\n    pub fn id(&self) -> &str;       \u002F\u002F provider-local id\n    pub fn provider(&self) -> &str; \u002F\u002F provider domain\n}\n\n\u002F\u002F Example: BotId::new(\"gpt-4\", \"api.openai.com\")\n\u002F\u002F -> \"5;gpt-4@api.openai.com\"\n```\n\n## Widget Patterns\n\n### Slot Widget - Runtime Content Replacement\n\n```rust\nlive_design! {\n    pub Slot = {{Slot}} {\n        width: Fill, height: Fit,\n        slot = \u003CView> {}  \u002F\u002F default content\n    }\n}\n\n\u002F\u002F Usage - replace content at runtime\nlet mut slot = widget.slot(id!(content));\nif let Some(custom) = client.content_widget(cx, ...) {\n    slot.replace(custom);\n} else {\n    slot.restore();  \u002F\u002F back to default\n    slot.default().as_standard_message_content().set_content(cx, &content);\n}\n```\n\n### Avatar Widget - Text\u002FImage Toggle\n\n```rust\nlive_design! {\n    pub Avatar = {{Avatar}} \u003CView> {\n        grapheme = \u003CRoundedView> {\n            visible: false,\n            label = \u003CLabel> { text: \"P\" }\n        }\n        dependency = \u003CRoundedView> {\n            visible: false,\n            image = \u003CImage> {}\n        }\n    }\n}\n\nimpl Widget for Avatar {\n    fn draw_walk(&mut self, cx: &mut Cx2d, ...) -> DrawStep {\n        if let Some(avatar) = &self.avatar {\n            match avatar {\n                Picture::Grapheme(g) => {\n                    self.view(id!(grapheme)).set_visible(cx, true);\n                    self.view(id!(dependency)).set_visible(cx, false);\n                    self.label(id!(label)).set_text(cx, &g);\n                }\n                Picture::Dependency(d) => {\n                    self.view(id!(dependency)).set_visible(cx, true);\n                    self.view(id!(grapheme)).set_visible(cx, false);\n                    self.image(id!(image)).load_image_dep_by_path(cx, d.as_str());\n                }\n            }\n        }\n        self.deref.draw_walk(cx, scope, walk)\n    }\n}\n```\n\n### PromptInput Widget\n\n```rust\n#[derive(Live, Widget)]\npub struct PromptInput {\n    #[deref] deref: CommandTextInput,\n    #[live] pub send_icon: LiveValue,\n    #[live] pub stop_icon: LiveValue,\n    #[rust] pub task: Task,           \u002F\u002F Send or Stop\n    #[rust] pub interactivity: Interactivity,\n}\n\nimpl PromptInput {\n    pub fn submitted(&self, actions: &Actions) -> bool;\n    pub fn reset(&mut self, cx: &mut Cx);\n    pub fn set_send(&mut self);\n    pub fn set_stop(&mut self);\n    pub fn enable(&mut self);\n    pub fn disable(&mut self);\n}\n```\n\n### Messages Widget - Conversation View\n\n```rust\n#[derive(Live, Widget)]\npub struct Messages {\n    #[deref] deref: View,\n    #[rust] pub messages: Vec\u003CMessage>,\n    #[rust] pub bot_context: Option\u003CBotContext>,\n}\n\nimpl Messages {\n    pub fn set_messages(&mut self, messages: Vec\u003CMessage>, scroll_to_bottom: bool);\n    pub fn scroll_to_bottom(&mut self, cx: &mut Cx, triggered_by_stream: bool);\n    pub fn is_at_bottom(&self) -> bool;\n}\n```\n\n## UiRunner Pattern for Async-to-UI\n\n```rust\nimpl Widget for PromptInput {\n    fn handle_event(&mut self, cx: &mut Cx, event: &Event, scope: &mut Scope) {\n        self.deref.handle_event(cx, event, scope);\n        self.ui_runner().handle(cx, event, scope, self);\n\n        if self.button(id!(attach)).clicked(event.actions()) {\n            let ui = self.ui_runner();\n            Attachment::pick_multiple(move |result| match result {\n                Ok(attachments) => {\n                    ui.defer_with_redraw(move |me, cx, _| {\n                        me.attachment_list_ref().write().attachments.extend(attachments);\n                    });\n                }\n                Err(_) => {}\n            });\n        }\n    }\n}\n```\n\n## SSE Streaming\n\n```rust\n\u002F\u002F\u002F Parse SSE byte stream into message stream\npub fn parse_sse\u003CS, B, E>(s: S) -> impl Stream\u003CItem = Result\u003CString, E>>\nwhere\n    S: Stream\u003CItem = Result\u003CB, E>>,\n    B: AsRef\u003C[u8]>,\n{\n    \u002F\u002F Split on \"\\n\\n\", extract \"data:\" content\n    \u002F\u002F Filter comments and [DONE] messages\n}\n\n\u002F\u002F Usage in BotClient::send\nfn send(&mut self, ...) -> BoxPlatformSendStream\u003C...> {\n    let stream = stream! {\n        let response = client.post(url).send().await?;\n        let events = parse_sse(response.bytes_stream());\n\n        for await event in events {\n            let completion: Completion = serde_json::from_str(&event)?;\n            content.text.push_str(&completion.delta.content);\n            yield ClientResult::new_ok(content.clone());\n        }\n    };\n    Box::pin(stream)\n}\n```\n\n## Best Practices\n\n1. **Use PlatformSend for cross-platform**: Same code works on native and WASM\n2. **Use spawn() not tokio::spawn**: Platform-agnostic task spawning\n3. **Use AbortOnDropHandle**: Cancel tasks when widget drops\n4. **Use ThreadToken for non-Send on WASM**: Thread-local storage with token access\n5. **Use Slot for custom content**: Allow BotClient to provide custom widgets\n6. **Use read()\u002Fwrite() pattern**: Safe borrow access via WidgetRef\n7. **Use UiRunner::defer_with_redraw**: Update widget from async context\n8. **Handle ClientResult partial success**: May have value AND errors\n\n## Reference Files\n\n- `llms.txt` - Complete MolyKit API reference\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n","# MolyKit Skill\n\nBest practices for building AI chat interfaces with Makepad using MolyKit - a toolkit for cross-platform AI chat applications.\n\n**Source codebase**: `\u002FUsers\u002Fzhangalex\u002FWork\u002FProjects\u002FFW\u002Frobius\u002Fmoly\u002Fmoly-kit`\n\n## When to Use\nUse this skill when:\n- Building AI chat interfaces with Makepad\n- Integrating OpenAI or other LLM APIs\n- Implementing cross-platform async for native and WASM\n- Creating chat widgets (messages, prompts, avatars)\n- Handling SSE streaming responses\n- Keywords: molykit, moly-kit, ai chat, bot client, openai makepad, chat widget, sse streaming\n\n## Overview\n\nMolyKit provides:\n- Cross-platform async utilities (PlatformSend, spawn(), ThreadToken)\n- Ready-to-use chat widgets (Chat, Messages, PromptInput, Avatar)\n- BotClient trait for AI provider integration\n- OpenAI-compatible client with SSE streaming\n- Protocol types for messages, bots, and tool calls\n- MCP (Model Context Protocol) support\n\n## Cross-Platform Async Patterns\n\n### PlatformSend - Send Only on Native\n\n```rust\n\u002F\u002F\u002F Implies Send only on native platforms, not on WASM\n\u002F\u002F\u002F - On native: implemented by types that implement Send\n\u002F\u002F\u002F - On WASM: implemented by ALL types\npub trait PlatformSend: PlatformSendInner {}\n\n\u002F\u002F\u002F Boxed future type for cross-platform use\npub type BoxPlatformSendFuture\u003C'a, T> = Pin\u003CBox\u003Cdyn PlatformSendFuture\u003COutput = T> + 'a>>;\n\n\u002F\u002F\u002F Boxed stream type for cross-platform use\npub type BoxPlatformSendStream\u003C'a, T> = Pin\u003CBox\u003Cdyn PlatformSendStream\u003CItem = T> + 'a>>;\n```\n\n### Platform-Agnostic Spawning\n\n```rust\n\u002F\u002F\u002F Runs a future independently\n\u002F\u002F\u002F - Uses tokio on native (requires Send)\n\u002F\u002F\u002F - Uses wasm-bindgen-futures on WASM (no Send required)\npub fn spawn(fut: impl PlatformSendFuture\u003COutput = ()> + 'static);\n\n\u002F\u002F Usage\nspawn(async move {\n    let result = fetch_data().await;\n    Cx::post_action(DataReady(result));\n    SignalToUI::set_ui_signal();\n});\n```\n\n### Task Cancellation with AbortOnDropHandle\n\n```rust\n\u002F\u002F\u002F Handle that aborts its future when dropped\npub struct AbortOnDropHandle(AbortHandle);\n\n\u002F\u002F Usage - task cancelled when widget dropped\n#[rust]\ntask_handle: Option\u003CAbortOnDropHandle>,\n\nfn start_task(&mut self) {\n    let (future, handle) = abort_on_drop(async move {\n        \u002F\u002F async work...\n    });\n    self.task_handle = Some(handle);\n    spawn(async move { let _ = future.await; });\n}\n```\n\n### ThreadToken for Non-Send Types on WASM\n\n```rust\n\u002F\u002F\u002F Store non-Send value in thread-local, access via token\npub struct ThreadToken\u003CT: 'static>;\n\nimpl\u003CT> ThreadToken\u003CT> {\n    pub fn new(value: T) -> Self;\n    pub fn peek\u003CR>(&self, f: impl FnOnce(&T) -> R) -> R;\n    pub fn peek_mut\u003CR>(&self, f: impl FnOnce(&mut T) -> R) -> R;\n}\n\n\u002F\u002F Usage - wrap non-Send type for use across Send boundaries\nlet token = ThreadToken::new(non_send_value);\nspawn(async move {\n    token.peek(|value| {\n        \u002F\u002F use value...\n    });\n});\n```\n\n## BotClient Trait\n\n### Implementing AI Provider Integration\n\n```rust\npub trait BotClient: Send {\n    \u002F\u002F\u002F Send message with streamed response\n    fn send(\n        &mut self,\n        bot_id: &BotId,\n        messages: &[Message],\n        tools: &[Tool],\n    ) -> BoxPlatformSendStream\u003C'static, ClientResult\u003CMessageContent>>;\n\n    \u002F\u002F\u002F Get available bots\u002Fmodels\n    fn bots(&self) -> BoxPlatformSendFuture\u003C'static, ClientResult\u003CVec\u003CBot>>>;\n\n    \u002F\u002F\u002F Clone for passing around\n    fn clone_box(&self) -> Box\u003Cdyn BotClient>;\n}\n\n\u002F\u002F Usage\nlet client = OpenAIClient::new(\"https:\u002F\u002Fapi.openai.com\u002Fv1\".into());\nclient.set_key(\"sk-...\")?;\nlet context = BotContext::from(client);\n```\n\n### BotContext - Sharable Wrapper\n\n```rust\n\u002F\u002F\u002F Sharable wrapper with loaded bots for sync UI access\npub struct BotContext(Arc\u003CMutex\u003CInnerBotContext>>);\n\nimpl BotContext {\n    pub fn load(&mut self) -> BoxPlatformSendFuture\u003CClientResult\u003C()>>;\n    pub fn bots(&self) -> Vec\u003CBot>;\n    pub fn get_bot(&self, id: &BotId) -> Option\u003CBot>;\n    pub fn client(&self) -> Box\u003Cdyn BotClient>;\n}\n\n\u002F\u002F Usage\nlet mut context = BotContext::from(client);\nspawn(async move {\n    if let Err(errors) = context.load().await.into_result() {\n        \u002F\u002F handle errors\n    }\n    Cx::post_action(BotsLoaded);\n});\n```\n\n## Protocol Types\n\n### Message Structure\n\n```rust\npub struct Message {\n    pub from: EntityId,         \u002F\u002F User, System, Bot(BotId), App\n    pub metadata: MessageMetadata,\n    pub content: MessageContent,\n}\n\npub struct MessageContent {\n    pub text: String,           \u002F\u002F Main content (markdown)\n    pub reasoning: String,      \u002F\u002F AI reasoning\u002Fthinking\n    pub citations: Vec\u003CString>, \u002F\u002F Source URLs\n    pub attachments: Vec\u003CAttachment>,\n    pub tool_calls: Vec\u003CToolCall>,\n    pub tool_results: Vec\u003CToolResult>,\n}\n\npub struct MessageMetadata {\n    pub is_writing: bool,       \u002F\u002F Still being streamed\n    pub created_at: DateTime\u003CUtc>,\n}\n```\n\n### Bot Identification\n\n```rust\n\u002F\u002F\u002F Globally unique bot ID: \u003Clen>;\u003Cid>@\u003Cprovider>\npub struct BotId(Arc\u003Cstr>);\n\nimpl BotId {\n    pub fn new(id: &str, provider: &str) -> Self;\n    pub fn id(&self) -> &str;       \u002F\u002F provider-local id\n    pub fn provider(&self) -> &str; \u002F\u002F provider domain\n}\n\n\u002F\u002F Example: BotId::new(\"gpt-4\", \"api.openai.com\")\n\u002F\u002F -> \"5;gpt-4@api.openai.com\"\n```\n\n## Widget Patterns\n\n### Slot Widget - Runtime Content Replacement\n\n```rust\nlive_design! {\n    pub Slot = {{Slot}} {\n        width: Fill, height: Fit,\n        slot = \u003CView> {}  \u002F\u002F default content\n    }\n}\n\n\u002F\u002F Usage - replace content at runtime\nlet mut slot = widget.slot(id!(content));\nif let Some(custom) = client.content_widget(cx, ...) {\n    slot.replace(custom);\n} else {\n    slot.restore();  \u002F\u002F back to default\n    slot.default().as_standard_message_content().set_content(cx, &content);\n}\n```\n\n### Avatar Widget - Text\u002FImage Toggle\n\n```rust\nlive_design! {\n    pub Avatar = {{Avatar}} \u003CView> {\n        grapheme = \u003CRoundedView> {\n            visible: false,\n            label = \u003CLabel> { text: \"P\" }\n        }\n        dependency = \u003CRoundedView> {\n            visible: false,\n            image = \u003CImage> {}\n        }\n    }\n}\n\nimpl Widget for Avatar {\n    fn draw_walk(&mut self, cx: &mut Cx2d, ...) -> DrawStep {\n        if let Some(avatar) = &self.avatar {\n            match avatar {\n                Picture::Grapheme(g) => {\n                    self.view(id!(grapheme)).set_visible(cx, true);\n                    self.view(id!(dependency)).set_visible(cx, false);\n                    self.label(id!(label)).set_text(cx, &g);\n                }\n                Picture::Dependency(d) => {\n                    self.view(id!(dependency)).set_visible(cx, true);\n                    self.view(id!(grapheme)).set_visible(cx, false);\n                    self.image(id!(image)).load_image_dep_by_path(cx, d.as_str());\n                }\n            }\n        }\n        self.deref.draw_walk(cx, scope, walk)\n    }\n}\n```\n\n### PromptInput Widget\n\n```rust\n#[derive(Live, Widget)]\npub struct PromptInput {\n    #[deref] deref: CommandTextInput,\n    #[live] pub send_icon: LiveValue,\n    #[live] pub stop_icon: LiveValue,\n    #[rust] pub task: Task,           \u002F\u002F Send or Stop\n    #[rust] pub interactivity: Interactivity,\n}\n\nimpl PromptInput {\n    pub fn submitted(&self, actions: &Actions) -> bool;\n    pub fn reset(&mut self, cx: &mut Cx);\n    pub fn set_send(&mut self);\n    pub fn set_stop(&mut self);\n    pub fn enable(&mut self);\n    pub fn disable(&mut self);\n}\n```\n\n### Messages Widget - Conversation View\n\n```rust\n#[derive(Live, Widget)]\npub struct Messages {\n    #[deref] deref: View,\n    #[rust] pub messages: Vec\u003CMessage>,\n    #[rust] pub bot_context: Option\u003CBotContext>,\n}\n\nimpl Messages {\n    pub fn set_messages(&mut self, messages: Vec\u003CMessage>, scroll_to_bottom: bool);\n    pub fn scroll_to_bottom(&mut self, cx: &mut Cx, triggered_by_stream: bool);\n    pub fn is_at_bottom(&self) -> bool;\n}\n```\n\n## UiRunner Pattern for Async-to-UI\n\n```rust\nimpl Widget for PromptInput {\n    fn handle_event(&mut self, cx: &mut Cx, event: &Event, scope: &mut Scope) {\n        self.deref.handle_event(cx, event, scope);\n        self.ui_runner().handle(cx, event, scope, self);\n\n        if self.button(id!(attach)).clicked(event.actions()) {\n            let ui = self.ui_runner();\n            Attachment::pick_multiple(move |result| match result {\n                Ok(attachments) => {\n                    ui.defer_with_redraw(move |me, cx, _| {\n                        me.attachment_list_ref().write().attachments.extend(attachments);\n                    });\n                }\n                Err(_) => {}\n            });\n        }\n    }\n}\n```\n\n## SSE Streaming\n\n```rust\n\u002F\u002F\u002F Parse SSE byte stream into message stream\npub fn parse_sse\u003CS, B, E>(s: S) -> impl Stream\u003CItem = Result\u003CString, E>>\nwhere\n    S: Stream\u003CItem = Result\u003CB, E>>,\n    B: AsRef\u003C[u8]>,\n{\n    \u002F\u002F Split on \"\\n\\n\", extract \"data:\" content\n    \u002F\u002F Filter comments and [DONE] messages\n}\n\n\u002F\u002F Usage in BotClient::send\nfn send(&mut self, ...) -> BoxPlatformSendStream\u003C...> {\n    let stream = stream! {\n        let response = client.post(url).send().await?;\n        let events = parse_sse(response.bytes_stream());\n\n        for await event in events {\n            let completion: Completion = serde_json::from_str(&event)?;\n            content.text.push_str(&completion.delta.content);\n            yield ClientResult::new_ok(content.clone());\n        }\n    };\n    Box::pin(stream)\n}\n```\n\n## Best Practices\n\n1. **Use PlatformSend for cross-platform**: Same code works on native and WASM\n2. **Use spawn() not tokio::spawn**: Platform-agnostic task spawning\n3. **Use AbortOnDropHandle**: Cancel tasks when widget drops\n4. **Use ThreadToken for non-Send on WASM**: Thread-local storage with token access\n5. **Use Slot for custom content**: Allow BotClient to provide custom widgets\n6. **Use read()\u002Fwrite() pattern**: Safe borrow access via WidgetRef\n7. **Use UiRunner::defer_with_redraw**: Update widget from async context\n8. **Handle ClientResult partial success**: May have value AND errors\n\n## Reference Files\n\n- `llms.txt` - Complete MolyKit API reference\n\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n",{"name":5,"risk":24,"source":25,"description":26},"unknown","community","CRITICAL: Use for MolyKit AI chat toolkit. Triggers on:\nBotClient, OpenAI, SSE streaming, AI chat, molykit,\nPlatformSend, spawn(), ThreadToken, cross-platform async,\nChat widget, Messages, PromptInput, Avatar, LLM\n","main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Fmolykit",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill molykit",{"tool":42,"command":43},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill molykit",{"tool":45,"command":46},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill molykit","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Fmolykit\u002FSKILL.md",true,[],[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include \"automate Slack app\", \"control VS Code\", \"interact with Discord app\", \"test this Electron app\", \"connect to desktop app\", or any task requiring automation of a native Electron application.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]