No slash command · from ork-extras
Provides patterns for LLM integration including function calling, SSE streaming, local inference with Ollama, and LoRA/QLoRA fine-tuning. Useful when implementing tool use, streaming responses, or multi-provider LLM APIs.
Ships in ork-extras. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Patterns for integrating LLMs into production applications: tool use, streaming, local inference, and fine-tuning. Each category has individual rule files in rules/ loaded on-demand.
| Category | Rules | Impact | When to Use |
|---|---|---|---|
| Function Calling | 3 | CRITICAL | Tool definitions, parallel execution, input validation |
| Streaming | 3 | HIGH | SSE endpoints, structured streaming, backpressure handling |
| Local Inference | 3 | HIGH | Ollama setup, model selection, GPU optimization |
| Fine-Tuning | 3 | HIGH | LoRA/QLoRA training, dataset preparation, evaluation |
| Context Optimization | 2 | HIGH | Window management, compression, caching, budget scaling |
| Evaluation | 2 | HIGH | LLM-as-judge, RAGAS metrics, quality gates, benchmarks |
| Prompt Engineering | 4 | HIGH | CoT, few-shot, versioning, DSPy optimization, ReAct, cost optimization |
Total: 20 rules across 7 categories
# Function calling: strict mode tool definition
tools = [{
"type": "function",
"function": {
"name": "search_documents",
"description": "Search knowledge base",
"strict": True,
"parameters": {
"type": "object",
"properties": {
"query": {"type": "string", "description": "Search query"},
"limit": {"type": "integer", "description": "Max results"}
},
"required": ["query", "limit"],
"additionalProperties": False
}
}
}]
# Streaming: SSE endpoint with FastAPI
@app.get("/chat/stream")
async def stream_chat(prompt: str):
async def generate():
async for token in async_stream(prompt):
yield {"event": "token", "data": token}
yield {"event": "done", "data": ""}
return EventSourceResponse(generate())
# Local inference: Ollama with LangChain
llm = ChatOllama(
model="deepseek-r1:70b",
base_url="http://localhost:11434",
temperature=0.0,
num_ctx=32768,
)
# Fine-tuning: QLoRA with Unsloth
model, tokenizer = FastLanguageModel.from_pretrained(
model_name="unsloth/Meta-Llama-3.1-8B",
max_seq_length=2048, load_in_4bit=True,
)
model = FastLanguageModel.get_peft_model(model, r=16, lora_alpha=32)
Enable LLMs to use external tools and return structured data. Use strict mode schemas (2026 best practice) for reliability. On Claude keep the tools array stable across turns so the prompt cache holds; add tools mid-session with an inline tool_addition (beta inline-tools-2026-09-15, Claude API only, available on Sonnet 5.5 but not on Sonnet 5) instead of swapping subsets (https://platform.claude.com/docs/en/build-with-claude/mid-conversation-system-messages#mid-conversation-tool-changes). For large tool sets, use a non-deferred tool search tool with defer_loading: true on the rest, never defer_loading alone (a request cannot have every tool deferred). Forced tool_choice (any or a named tool) returns a 400 on Sonnet 5.5, Opus 5.5, Fable 5.1 and Mythos 5.1; use auto with strict: true tools. Validate all inputs with Pydantic/Zod, and return errors as tool results.
calling-tool-definition.md -- Strict mode schemas, OpenAI/Anthropic formats, LangChain bindingcalling-parallel.md -- Parallel tool execution, asyncio.gather, strict mode constraintscalling-validation.md -- Input validation, error handling, tool execution loopsDeliver LLM responses in real-time for better UX. Use SSE for web, WebSocket for bidirectional. Handle backpressure with bounded queues.
streaming-sse.md -- FastAPI SSE endpoints, frontend consumers, async iteratorsstreaming-structured.md -- Streaming with tool calls, partial JSON parsing, chunk accumulationstreaming-backpressure.md -- Backpressure handling, bounded buffers, cancellationRun LLMs locally with Ollama for cost savings (93% vs cloud), privacy, and offline development. Pre-warm models, use provider factory for cloud/local switching.
local-ollama-setup.md -- Installation, model pulling, environment configurationlocal-model-selection.md -- Model comparison by task, hardware profiles, quantizationlocal-gpu-optimization.md -- Apple Silicon tuning, keep-alive, CI integrationCustomize LLMs with parameter-efficient techniques. Fine-tune ONLY after exhausting prompt engineering and RAG. Requires 1000+ quality examples.
tuning-lora.md -- LoRA/QLoRA configuration, Unsloth training, adapter mergingtuning-dataset-prep.md -- Synthetic data generation, quality validation, deduplicationtuning-evaluation.md -- DPO alignment, evaluation metrics, anti-patternsManage context windows, compression, and attention-aware positioning. Optimize for tokens-per-task.
context-window-management.md -- Five-layer architecture, anchored summarization, compression triggerscontext-caching.md -- Just-in-time loading, budget scaling, probe evaluation, CC 2.1.32+Evaluate LLM outputs with multi-dimension scoring, quality gates, and benchmarks.
evaluation-metrics.md -- LLM-as-judge, RAGAS metrics, hallucination detectionevaluation-benchmarks.md -- Quality gates, batch evaluation, pairwise comparisonDesign, version, and optimize prompts for production LLM applications.
prompt-design.md -- Chain-of-Thought, few-shot learning, pattern selection guideprompt-testing.md -- Langfuse versioning, DSPy optimization, A/B testing, self-consistencyprompt-react-pattern.md -- ReAct loop for tool-using agents, thought-action-observation formatprompt-optimization.md -- Token reduction, cost optimization, model tiering, prompt spec formatThese topics are covered by their vendors' own documentation. This skill points
at them instead of teaching them; the rules above keep only our floors, ceilings
and scars. Our delta on all of it is in references/ork-delta.md.
| Topic | First-party source |
|---|---|
| Strict-mode tool schemas, structured outputs | https://platform.openai.com/docs/guides/function-calling |
Anthropic input_schema / tool_use | https://docs.claude.com/en/docs/agents-and-tools/tool-use/overview |
| SSE client mechanics, reconnection, cancellation | https://developer.mozilla.org/en-US/docs/Web/API/EventSource |
| LoRA / QLoRA config, target modules, adapter merging | https://huggingface.co/docs/peft/developer_guides/lora |
| Unsloth training loop, 4-bit loading | https://docs.unsloth.ai/get-started/fine-tuning-llms-guide |
| DPO, preference pairs, beta tuning, RLHF comparison | https://huggingface.co/docs/trl/dpo_trainer |
| SFT dataset formats (Alpaca, ChatML) | https://huggingface.co/docs/trl/sft_trainer |
| Embedding similarity for dataset dedup | https://sbert.net/ |
| Fine-tune vs prompt vs RAG decision framework | https://platform.openai.com/docs/guides/optimizing-llm-accuracy |
| Vendor token pricing (never hardcode it here) | https://platform.openai.com/docs/pricing |
references/ork-delta.md -- our delta: scars, house ceilings, retired-file provenancereferences/model-selection.md -- local model comparison by task and hardwarescripts/create-lora-config.md -- LoRA config scaffold with auto-detected model type| Decision | Recommendation |
|---|---|
| Tool schema mode | strict: true (2026 best practice) |
| Tool count | Load roughly 5-15 up front; defer the rest behind a non-deferred tool search tool |
| Streaming protocol | SSE for web, WebSocket for bidirectional |
| Buffer size | 50-200 tokens |
| Local model (reasoning) | deepseek-r1:70b |
| Local model (coding) | qwen2.5-coder:32b |
| Fine-tuning approach | LoRA/QLoRA (try prompting first) |
| LoRA rank | 16-64 typical |
| Training epochs | 1-3 (more risks overfitting) |
| Context compression | Anchored iterative (60-80%) |
| Compress trigger | 70% utilization, target 50% |
| Judge model | claude-haiku-5-5 (cost tier), gpt-5.5, or gemini-3.8-flash (Google's GA general-purpose model and a third vendor for the different-model rule; price lives in models.vocab.json, not here) |
| Quality threshold | 0.7 production, 0.6 drafts |
| Few-shot examples | 3-5 diverse, representative |
| Prompt versioning | Langfuse with labels |
| Auto-optimization | DSPy MIPROv2 |
ork-extras:rag-retrieval -- Embedding patterns, when RAG is better than fine-tuningagent-loops -- Multi-step tool use with reasoningllm-evaluation -- Evaluate fine-tuned and local modelslangfuse-observability -- Track training experimentsKeywords: tool, function, define tool, tool schema, function schema, strict mode, parallel tools Solves:
Keywords: streaming, SSE, Server-Sent Events, real-time, backpressure, token stream Solves:
Keywords: Ollama, local, self-hosted, model selection, GPU, Apple Silicon Solves:
Keywords: LoRA, QLoRA, fine-tune, DPO, synthetic data, PEFT, alignment Solves:
checklists/fine-tuning-decision.md (opens in a new tab)checklists/streaming-checklist.md (opens in a new tab)checklists/tool-checklist.md (opens in a new tab)metadata.json (opens in a new tab)references/model-selection.md (opens in a new tab)references/ork-delta.md (opens in a new tab)rules/_sections.md (opens in a new tab)rules/_template.md (opens in a new tab)rules/calling-parallel.md (opens in a new tab)rules/calling-tool-definition.md (opens in a new tab)rules/calling-validation.md (opens in a new tab)rules/context-caching.md (opens in a new tab)rules/context-window-management.md (opens in a new tab)rules/evaluation-benchmarks.md (opens in a new tab)rules/evaluation-metrics.md (opens in a new tab)rules/local-gpu-optimization.md (opens in a new tab)rules/local-model-selection.md (opens in a new tab)rules/local-ollama-setup.md (opens in a new tab)rules/prompt-design.md (opens in a new tab)rules/prompt-optimization.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub yonatangross/orchestkit --plugin ork-extras33 skills in this plugin
/accessibilityWCAG 2.2 accessibility patterns: keyboard focus management, React Aria, cognitive inclusion, native HTML-first. Use when implementing screen reader support, keyboard navigation, ARIA patterns, focus traps, accessible components, or reduced motion./agent-orchestrationAgent orchestration patterns for agentic loops, multi-agent coordination, and alternative frameworks. Use when building autonomous agent loops, coordinating multiple agents, evaluating CrewAI/AutoGen/Swarm, or orchestrating multi-step scenarios./ai-ui-generationAI UI generation with json-render, v0.app, Stitch, Bolt, and Cursor: prompt engineering, review checklists, design system conformance, CI gates. Use when generating UI components with AI tools, reviewing AI-generated code, or rendering MCP visual output./animation-motion-designAnimation patterns with Motion (formerly Framer Motion) and the View Transitions API. Use when implementing component animations, page transitions, micro-interactions, gesture-driven UIs, or prefers-reduced-motion support./async-jobsAsync job processing patterns for background tasks, Celery workflows, task scheduling, retry strategies, and distributed task execution. Use when implementing background job processing, task queues, or scheduled task systems./audit-activationAudits sub-agent activation from telemetry: attempted, started, completed, unattributed spawns, and zero-start agents. Use when agents feel under-used or before pruning the catalog.Other plugins' skills for the same job