← スキル一覧に戻る

ui-embed
by maneeshanif
⭐ 0🍴 0📅 2025年12月7日
SKILL.md
name: ui-embed description: Embed the chatbot UI inside Docusaurus and connect it to the FastAPI RAG backend. Use when building chat components, handling streaming responses, or integrating chat widgets into MDX pages.
UI Embed Skill
Instructions
-
Build component
- Create React chat panel (
ChatbotPanel.tsx) with:- Message list
- Input field
- Mode toggle (RAG vs Selected Text)
- Source list display
- Handle streaming responses (EventSource/fetch reader)
- Include loading and error UI states
- Create React chat panel (
-
API client
- Create fetch helpers for
/queryand/query/selected - Include page metadata (module/week/title) for logging
- Debounce/trim inputs; enforce max length
- Create fetch helpers for
-
Integration
- Add to
src/theme/Layoutor dedicatedChatpage - Optionally show floating button
- Provide MDX shortcode to drop chat in specific chapters
- Add to
-
UX and accessibility
- Basic console logging for failures
- Friendly fallback messages
- Focus management, keyboard submit
- Readable contrast
Examples
// ChatbotPanel.tsx
import React, { useState } from 'react';
export function ChatbotPanel({ apiUrl }: { apiUrl: string }) {
const [messages, setMessages] = useState([]);
const [input, setInput] = useState('');
const [mode, setMode] = useState<'rag' | 'selected'>('rag');
// ... implementation
}
{/* In any MDX page */}
import { ChatbotPanel } from '@site/src/components/ChatbotPanel';
<ChatbotPanel apiUrl={process.env.API_URL} />
Definition of Done
- Widget renders in Docusaurus dev build; can query backend
- Selected-text path sends provided text and returns grounded answer
- Error/loading states visible; minimal styling but responsive
- Integration steps documented for future pages
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です