Agent skill
ui-embed
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.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/ui-embed
SKILL.md
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
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?