apps/docs/skills/provider-patterns/SKILL.md
Configure per-provider behavior, understand streaming quirks, and use the 7-hook adapter system for optimal performance across LLM providers.
npx skillsauth add tylerjrbuell/reactive-agents-ts provider-patternsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce a builder with the correct provider + model + any provider-specific configuration; know which providers need special handling for streaming and tool calls.
// Anthropic — highest quality, native FC, prompt caching
const agent = await ReactiveAgents.create()
.withProvider("anthropic")
.withModel("claude-sonnet-4-6")
.withReasoning({ defaultStrategy: "adaptive" })
.withTools()
.build();
// Local Ollama model
const agent = await ReactiveAgents.create()
.withProvider("ollama")
.withModel("qwen2.5:7b")
.withReasoning({ defaultStrategy: "reactive", maxIterations: 6 })
.withTools({ allowedTools: ["web-search"] })
.build();
| Provider | Best for | Key notes |
|----------|----------|-----------|
| "anthropic" | Production, highest quality | Native FC, prompt caching, streaming |
| "openai" | GPT-4o, broad compatibility | Native FC, streaming |
| "gemini" | Multimodal, long context | Native FC; functionResponse.name quirk |
| "ollama" | Local, privacy-first | Tool calls arrive on chunk.done |
| "litellm" | Proxy routing, cost optimization | OpenAI-compatible; use for Groq, OpenRouter, etc. |
| "test" | Unit tests, CI | Returns deterministic mock responses |
.withProvider("anthropic")
.withModel({ model: "claude-opus-4-6", thinking: true })
// Enables extended thinking — model reasons before responding
// Higher quality on complex reasoning tasks; adds latency and cost
// Groq, OpenRouter, Bedrock, Vertex — all through LiteLLM
.withProvider("litellm")
.withModel("groq/llama-3.1-70b-versatile")
// Model name format: "provider/model-name" as per LiteLLM docs
.withProvider("ollama")
.withModel("llama3:8b")
.withCircuitBreaker({
failureThreshold: 3, // open after 3 consecutive failures
cooldownMs: 30_000, // wait 30s before half-open probe
halfOpenRequests: 1,
})
.withRateLimiting({ requestsPerMinute: 10 })
.withModel({ model: "gpt-4o", temperature: 0.2 }) // more deterministic
.withModel({ model: "claude-sonnet-4-6", temperature: 0.9 }) // more creative
These hooks run automatically and adapt prompts/behavior for each provider's strengths:
| Hook | Method name | What it does |
|------|-------------|-------------|
| taskFraming | adapter.frameTask(task, tier) | Wraps task in provider-optimal framing |
| toolGuidance | adapter.injectToolGuidance(prompt) | Injects provider-specific tool-use instructions |
| continuationHint | adapter.getContinuationHint(lastMsg) | Tells model to continue after tool results |
| errorRecovery | adapter.getErrorRecoveryPrompt(error) | Recovery prompt on tool errors |
| synthesisPrompt | adapter.getSynthesisPrompt(context) | Final answer synthesis guidance |
| qualityCheck | adapter.checkQuality(output, task) | Post-step quality assessment |
| systemPromptPatch | adapter.patchSystemPrompt(base) | Provider-specific system prompt additions |
Adapter selection is automatic via selectAdapter(capabilities, tier). Each provider (Anthropic, OpenAI, Gemini, Ollama) has an adapter with specialized implementations.
| Method | Key params | Notes |
|--------|-----------|-------|
| .withProvider(p) | "anthropic"\|"openai"\|"gemini"\|"ollama"\|"litellm"\|"test" | Required |
| .withModel(m) | string \| { model, thinking?, temperature? } | thinking: true = extended reasoning |
| .withCircuitBreaker(cfg?) | { failureThreshold?, cooldownMs?, halfOpenRequests? } | Auto-retry with backoff |
| .withRateLimiting(cfg) | { requestsPerMinute?, tokensPerMinute?, maxConcurrent? } | |
"groq" and "openrouter" are not valid provider names — use "litellm" with the appropriate model prefixfunctionResponse.name must use msg.toolName, not hard-coded "tool" — framework handles this but custom tool parsers must follow the same patternchunk.done, not during the stream — don't parse mid-stream chunks for tool callsstreamEvent, not helper events (inputJson fires before contentBlock in streaming FC)thinking: true requires a model that supports extended thinking — verify model capability before enabling"provider/model" format — check LiteLLM docs for exact namesdevelopment
Orient to the Reactive Agents framework, understand the builder API shape, and select the right capability skills for your task.
testing
Enable output verification (hallucination detection, semantic entropy, self-consistency), add post-run verification steps, and run LLM-scored evals across 5 quality dimensions.
data-ai
Configure the 4-layer memory system with SQLite/FTS5/vec storage for persistent agent knowledge that survives sessions.
testing
Set per-request, per-session, daily, and monthly spend limits, configure rate limiting and circuit breakers, and isolate costs per user or tenant.