xiaohongshu
xiaohongshu
llm-sdk-guide
U-llm-sdk and claude-only-sdk patterns. Use when working on projects with LLM service, designing LLM integrations, or implementing AI-powered features.
Full skill instructions
Two SDKs for LLM integration:
LLMResultIMPORTANT: These SDKs wrap CLI tools, NOT direct API calls!
SDK Layer (Python)
│
▼
asyncio.create_subprocess_exec() ← Spawns CLI process
│
▼
CLI Execution (e.g., `claude -p "prompt" --mcp-config ...`)
│
▼
Separate Session with own context window
This enables:
--mcp-config)from u_llm_sdk import LLM, LLMConfig
from llm_types import Provider, ModelTier, AutoApproval
config = LLMConfig(
provider=Provider.CLAUDE,
tier=ModelTier.HIGH,
auto_approval=AutoApproval.EDITS_ONLY,
)
async with LLM(config) as llm:
result = await llm.run("Your prompt")
print(result.text)
from claude_only_sdk import ClaudeAdvanced, SessionTemplate
async with ClaudeAdvanced() as client:
result = await client.run_with_template(
"Review src/auth.py",
SessionTemplate.SECURITY_ANALYST,
)
Use mcp_config to run isolated sessions with specific MCP servers:
from claude_only_sdk import ClaudeAdvanced, ClaudeAdvancedConfig
config = ClaudeAdvancedConfig(
mcp_config="./config/serena.mcp.json", # Only Serena MCP loaded
timeout=300.0,
)
async with ClaudeAdvanced(config) as client:
# This runs in separate session with only Serena MCP
result = await client.run("Use Serena to analyze code")
This pattern is useful for:
| Component | Purpose |
|---|---|
LLM / LLMSync | Async/Sync clients |
LLMConfig | Unified configuration |
BaseProvider | Provider abstraction |
InterventionHook | RAG integration protocol |
| Component | Purpose |
|---|---|
ClaudeAdvanced | Extended Claude client |
AgentDefinition | Specialized agent config |
SessionManager | Virtual session injection |
TaskExecutor | Parallel task execution |
AutonomousOrchestrator | Prompt-based parallelization |
async with LLM.auto() as llm: # Claude > Codex > Gemini
result = await llm.run("prompt")
llm = LLM(config).resume(session_id)
async with llm:
result = await llm.run("Continue...")
planner = AgentDefinition(
name="planner",
system_prompt="You are a planning specialist...",
tier=ModelTier.HIGH,
allowed_tools=["Read", "Grep", "Glob"],
)
result: LLMResult
result.text # Response text (may be empty for FILE_EDIT!)
result.files_modified # List[FileChange]
result.commands_run # List[CommandRun]
result.session_id # For continuation
result.result_type # TEXT/CODE/FILE_EDIT/COMMAND/MIXED
For detailed patterns: [references/u-llm-sdk.md] For Claude features: [references/claude-only-sdk.md] For types reference: [references/llm-types.md]
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience