htooayelwinict/claude-config
Overview
This skill provides expert guidance for building LLM applications using the LangChain framework, covering chains, prompts, memory, retrievers, tools, and integrations. It focuses on modern LCEL patterns, prompt templates, structured outputs, streaming, and best practices to produce robust, maintainable pipelines. Use it to accelerate development and avoid common pitfalls when composing LLM components.
How this skill works
The skill inspects common LangChain building blocks and shows concrete code patterns: chat model initialization, ChatPromptTemplate usage, LCEL pipe composition, output parsers, memory wrappers, retrievers for RAG, and tool binding. It demonstrates synchronous and asynchronous invocation, streaming, parallel and branching runnables, and patterns for structured outputs and fallbacks. Examples include creating retrievers with vectorstores, adding message history, and wrapping chains with callbacks and caching.
When to use it
- When composing LLM pipelines with LangChain’s LCEL pipe syntax (|) instead of legacy Chain classes.
- When implementing RAG workflows using vectorstores, retrievers, and context prompts.
- When you need structured output parsing and pydantic-based validation from model responses.
- When adding streaming, async invocation, or real-time output to UIs or services.
- When binding external tools or building ToolNodes for tool-enabled agent flows.
Best practices
- Prefer LCEL pipe syntax for readable, composable chains and use RunnableParallel/RunnableBranch for concurrency and branching.
- Use ChatPromptTemplate and MessagesPlaceholder for consistent prompt construction and conversation history injection.
- Adopt Pydantic/Json output parsers to enforce structured outputs and reduce downstream parsing errors.
- Enable streaming (.stream()) and async methods (.ainvoke(), .astream()) for responsive apps and concurrent workloads.
- Add callbacks, logging, and caching for observability and performance; wrap chains with fallbacks for resilience.
Example use cases
- Build a question-answering service that retrieves docs with FAISS, formats context into a rag_prompt, and returns structured answers.
- Implement a chat assistant that preserves session history using RunnableWithMessageHistory and ChatMessageHistory.
- Create a tool-enabled agent that uses @tool functions for search and calculation, then binds them to a chat model.
- Deploy a streaming story generator or long-form content composer using .stream() and incremental UI updates.
- Compose parallel data transformations (summarization + translation) with RunnableParallel to reduce latency.
FAQ
Use LCEL pipe syntax (|) for clearer composition and better support for runnables like RunnableParallel and RunnableBranch.
How do I ensure model output is machine-readable?
Use JsonOutputParser or PydanticOutputParser to enforce schemas and validate responses before downstream processing.
5 skills
This skill helps you build LLM apps with LangChain by guiding chains, prompts, memory, retrievers, and tools.
This skill helps you design and maintain tests across PHP, Python, and JS using TDD with Pest, pytest, Vitest, and Playwright.
This skill helps planners create clear, step-by-step implementation plans with acceptance criteria using MCP helpers for efficient project execution.
This skill helps you design and manage stateful, multi-agent workflows with LangGraph, enabling dynamic routing, memory, and subgraph architectures.
This skill audits code for OWASP vulnerabilities and provides actionable security reviews for pre-deployment and authentication checks.