[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7ESKA02HQYCH3SA8B9C36MW":3,"skill-same:01M7ESKA02HQYCH3SA8B9C36MW":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":25,"commitSha":26,"skillDirectory":27,"forksCount":28,"repositoryHtmlUrl":29,"repositoryHomepageUrl":6,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M7ESKA02HQYCH3SA8B9C36MW","langchain-pro",null,"LangChain guidance — chains, agents, tools, RAG pipelines, LangGraph, evaluation, and production hardening.","TanNhatCMS\u002Fjarvis","TanNhatCMS","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F113796420?v=4","01M753MV17KG5CD3152G3WQEQY","KietNT","01M7EKEDYVYQ6PWVJJMZ911VMX",0,"MIT","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-langchain-pro\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: langchain-pro\ndescription: LangChain guidance — chains, agents, tools, RAG pipelines, LangGraph, evaluation, and production hardening.\ncategory: development\n---\n\n## Overview\n\nLangChain is the framework for LLM applications: chains (composable LLM calls), agents (LLMs using tools), RAG pipelines, and LangGraph (stateful, controllable agent workflows). The ecosystem moves fast — today's best practice is LangGraph for agents, LCEL (LangChain Expression Language) for chains, and skepticism toward anything magical.\n\nThis skill covers building LLM apps that work in production: prompt management, structured output, tool design, RAG done right, LangGraph agents, evaluation, and the hardening (cost, latency, reliability) that separates demos from products.\n\n## When to use\n\n- Building RAG applications.\n- Creating agents with tools.\n- Choosing between chains, agents, and LangGraph.\n- Getting structured output from LLMs.\n- Evaluating LLM application quality.\n- Debugging LangChain\u002FLangGraph apps (LangSmith).\n- Productionizing LLM apps (cost, latency, reliability).\n\n## Core concepts\n\n- **LCEL (runnables).** The composition language: `prompt | model | parser` — pipe-based chains with streaming, batching, and async built in. Prefer LCEL over legacy Chain classes; it's the stable core.\n- **Prompts as code.** `ChatPromptTemplate` with variables, system\u002Fhuman message structure, few-shot examples — versioned in git, not hidden in strings. Prompt changes are code changes: review and test them.\n- **Structured output.** `with_structured_output(PydanticModel)` — constrained generation into schemas; the bridge from LLM text to application logic. Always validate; models still make schema mistakes under pressure.\n- **Tools.** Python functions with clear names, descriptions, and typed args (`@tool`) — the agent's hands. Tool design determines agent success: narrow, well-described, idempotent where possible, with useful error messages.\n- **Agents vs chains.** Chains: fixed sequence (predictable, cheap, debuggable). Agents: LLM decides tool calls dynamically (flexible, expensive, less predictable). Start with chains; graduate to agents when the workflow genuinely needs dynamic decisions.\n- **LangGraph.** Stateful agent workflows as graphs: nodes (LLM calls, tools), edges (conditional routing), persistent state, human-in-the-loop interrupts. The answer to \"my agent is uncontrollable\" — explicit control flow with LLM flexibility.\n- **Memory.** Conversation state: short-term (message history, summarized when long), long-term (vector\u002Fpersistent stores). LangGraph's checkpointing gives durable, resumable agent state — threads that survive restarts.\n- **RAG.** Retrieve-then-generate: chunk documents → embed → vector store → retrieve top-k → stuff into prompt → generate. The unglamorous truth: chunking quality and retrieval evaluation matter more than the LLM choice.\n- **Retrieval tuning.** Chunk size\u002Foverlap, hybrid search (dense + BM25), reranking (cross-encoders), metadata filtering, query rewriting — each a lever; evaluate retrieval (hit rate, MRR) independently of generation.\n- **Evaluation.** LLM-as-judge (with rubrics, not vibes), deterministic checks (schema validity, citation presence), golden datasets, regression sets on prompt changes. LangSmith datasets + evaluators; eval before every prompt\u002Fmodel change.\n- **Streaming.** Token streaming for UX (`.stream()`\u002F`.astream()`), streaming with structured output and tool calls — latency perception matters as much as latency.\n- **Cost\u002Flatency control.** Model selection per task (small for classification, large for reasoning), caching (exact + semantic), batching, max-tokens limits, timeout\u002Fretry policies. Log tokens per request; set budgets.\n- **Reliability.** Retries with backoff, fallbacks (model → model), validation of outputs, circuit breakers on tool failures, human-in-the-loop for consequential actions. LLM apps fail in creative ways — design for it.\n- **Observability (LangSmith).** Traces of every run: prompts, tool calls, latencies, tokens, errors. Non-negotiable for debugging agents — without traces you're guessing.\n- **Security.** Prompt injection awareness (untrusted content in context), tool allowlisting, output validation, no sensitive data in prompts to third-party APIs, least-privilege tools (an agent's tools are its attack surface).\n\n## Practical workflow\n\n1. **Start with the simplest chain.** Prompt → model → parser in LCEL; prove value before adding agents:\n   ```python\n   from langchain_core.prompts import ChatPromptTemplate\n   from langchain_core.output_parsers import StrOutputParser\n\n   prompt = ChatPromptTemplate.from_messages([\n       (\"system\", \"You are a support analyst. Answer only from the context.\"),\n       (\"human\", \"Context:\\n{context}\\n\\nQuestion: {question}\"),\n   ])\n   chain = prompt | model | StrOutputParser()\n   ```\n2. **Add structured output.** Pydantic schemas for anything downstream consumes; validate and handle validation failures explicitly.\n3. **Build RAG deliberately.** Chunk thoughtfully (semantic boundaries, overlap), evaluate retrieval separately, add reranking before blaming the LLM:\n   ```python\n   from langchain_core.runnables import RunnablePassthrough\n\n   rag = (\n       {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n       | prompt | model | StrOutputParser()\n   )\n   ```\n4. **Graduate to LangGraph for agents.** Explicit nodes\u002Fedges\u002Fstate; human-in-the-loop interrupts for consequential steps; checkpointing for durability.\n5. **Design tools well.** Narrow scope, great descriptions, typed args, informative errors — then test the agent's tool selection on realistic inputs.\n6. **Evaluate continuously.** Golden dataset + LLM-judge with rubrics + deterministic checks; run evals on every prompt\u002Fmodel change; track regressions.\n7. **Harden for production.** Timeouts, retries, fallbacks, token budgets, output validation, LangSmith tracing, cost dashboards. Load-test the agent paths, not just the model calls.\n8. **Secure the surface.** Treat retrieved\u002Funtrusted content as data, not instructions; least-privilege tools; audit what the agent can do before exposing it.\n\n## Common pitfalls\n\n- **Agents for chain problems** — dynamic tool-calling where a fixed pipeline works; cost and flakiness for nothing.\n- **Unevaluated RAG** — blaming the LLM for retrieval failures; measure retrieval separately.\n- **Bad chunking** — arbitrary splits destroying context; semantic boundaries + overlap.\n- **No evals** — prompt changes by vibes; golden datasets + judges.\n- **Unbounded agent loops** — no step limits or timeouts; cap iterations, add circuit breakers.\n- **Ignoring token costs** — no budgets or logging; cost per request tracked from day one.\n- **No tracing** — debugging agents blind; LangSmith (or equivalent) from the start.\n- **Over-powerful tools** — agents with destructive tools and no confirmation; least privilege + human-in-the-loop.\n- **Prompt injection naivety** — untrusted content treated as instructions; validate and sandbox.\n- **Legacy Chain classes** — deprecated abstractions; LCEL and LangGraph are the current core.\n- **No structured output** — regex-parsing LLM text; schemas + validation.\n- **Streaming ignored** — 30s of silence; stream tokens for perceived latency.\n- **Model maximalism** — largest model for every subtask; right-size per step.\n","## Overview\n\nLangChain is the framework for LLM applications: chains (composable LLM calls), agents (LLMs using tools), RAG pipelines, and LangGraph (stateful, controllable agent workflows). The ecosystem moves fast — today's best practice is LangGraph for agents, LCEL (LangChain Expression Language) for chains, and skepticism toward anything magical.\n\nThis skill covers building LLM apps that work in production: prompt management, structured output, tool design, RAG done right, LangGraph agents, evaluation, and the hardening (cost, latency, reliability) that separates demos from products.\n\n## When to use\n\n- Building RAG applications.\n- Creating agents with tools.\n- Choosing between chains, agents, and LangGraph.\n- Getting structured output from LLMs.\n- Evaluating LLM application quality.\n- Debugging LangChain\u002FLangGraph apps (LangSmith).\n- Productionizing LLM apps (cost, latency, reliability).\n\n## Core concepts\n\n- **LCEL (runnables).** The composition language: `prompt | model | parser` — pipe-based chains with streaming, batching, and async built in. Prefer LCEL over legacy Chain classes; it's the stable core.\n- **Prompts as code.** `ChatPromptTemplate` with variables, system\u002Fhuman message structure, few-shot examples — versioned in git, not hidden in strings. Prompt changes are code changes: review and test them.\n- **Structured output.** `with_structured_output(PydanticModel)` — constrained generation into schemas; the bridge from LLM text to application logic. Always validate; models still make schema mistakes under pressure.\n- **Tools.** Python functions with clear names, descriptions, and typed args (`@tool`) — the agent's hands. Tool design determines agent success: narrow, well-described, idempotent where possible, with useful error messages.\n- **Agents vs chains.** Chains: fixed sequence (predictable, cheap, debuggable). Agents: LLM decides tool calls dynamically (flexible, expensive, less predictable). Start with chains; graduate to agents when the workflow genuinely needs dynamic decisions.\n- **LangGraph.** Stateful agent workflows as graphs: nodes (LLM calls, tools), edges (conditional routing), persistent state, human-in-the-loop interrupts. The answer to \"my agent is uncontrollable\" — explicit control flow with LLM flexibility.\n- **Memory.** Conversation state: short-term (message history, summarized when long), long-term (vector\u002Fpersistent stores). LangGraph's checkpointing gives durable, resumable agent state — threads that survive restarts.\n- **RAG.** Retrieve-then-generate: chunk documents → embed → vector store → retrieve top-k → stuff into prompt → generate. The unglamorous truth: chunking quality and retrieval evaluation matter more than the LLM choice.\n- **Retrieval tuning.** Chunk size\u002Foverlap, hybrid search (dense + BM25), reranking (cross-encoders), metadata filtering, query rewriting — each a lever; evaluate retrieval (hit rate, MRR) independently of generation.\n- **Evaluation.** LLM-as-judge (with rubrics, not vibes), deterministic checks (schema validity, citation presence), golden datasets, regression sets on prompt changes. LangSmith datasets + evaluators; eval before every prompt\u002Fmodel change.\n- **Streaming.** Token streaming for UX (`.stream()`\u002F`.astream()`), streaming with structured output and tool calls — latency perception matters as much as latency.\n- **Cost\u002Flatency control.** Model selection per task (small for classification, large for reasoning), caching (exact + semantic), batching, max-tokens limits, timeout\u002Fretry policies. Log tokens per request; set budgets.\n- **Reliability.** Retries with backoff, fallbacks (model → model), validation of outputs, circuit breakers on tool failures, human-in-the-loop for consequential actions. LLM apps fail in creative ways — design for it.\n- **Observability (LangSmith).** Traces of every run: prompts, tool calls, latencies, tokens, errors. Non-negotiable for debugging agents — without traces you're guessing.\n- **Security.** Prompt injection awareness (untrusted content in context), tool allowlisting, output validation, no sensitive data in prompts to third-party APIs, least-privilege tools (an agent's tools are its attack surface).\n\n## Practical workflow\n\n1. **Start with the simplest chain.** Prompt → model → parser in LCEL; prove value before adding agents:\n   ```python\n   from langchain_core.prompts import ChatPromptTemplate\n   from langchain_core.output_parsers import StrOutputParser\n\n   prompt = ChatPromptTemplate.from_messages([\n       (\"system\", \"You are a support analyst. Answer only from the context.\"),\n       (\"human\", \"Context:\\n{context}\\n\\nQuestion: {question}\"),\n   ])\n   chain = prompt | model | StrOutputParser()\n   ```\n2. **Add structured output.** Pydantic schemas for anything downstream consumes; validate and handle validation failures explicitly.\n3. **Build RAG deliberately.** Chunk thoughtfully (semantic boundaries, overlap), evaluate retrieval separately, add reranking before blaming the LLM:\n   ```python\n   from langchain_core.runnables import RunnablePassthrough\n\n   rag = (\n       {\"context\": retriever | format_docs, \"question\": RunnablePassthrough()}\n       | prompt | model | StrOutputParser()\n   )\n   ```\n4. **Graduate to LangGraph for agents.** Explicit nodes\u002Fedges\u002Fstate; human-in-the-loop interrupts for consequential steps; checkpointing for durability.\n5. **Design tools well.** Narrow scope, great descriptions, typed args, informative errors — then test the agent's tool selection on realistic inputs.\n6. **Evaluate continuously.** Golden dataset + LLM-judge with rubrics + deterministic checks; run evals on every prompt\u002Fmodel change; track regressions.\n7. **Harden for production.** Timeouts, retries, fallbacks, token budgets, output validation, LangSmith tracing, cost dashboards. Load-test the agent paths, not just the model calls.\n8. **Secure the surface.** Treat retrieved\u002Funtrusted content as data, not instructions; least-privilege tools; audit what the agent can do before exposing it.\n\n## Common pitfalls\n\n- **Agents for chain problems** — dynamic tool-calling where a fixed pipeline works; cost and flakiness for nothing.\n- **Unevaluated RAG** — blaming the LLM for retrieval failures; measure retrieval separately.\n- **Bad chunking** — arbitrary splits destroying context; semantic boundaries + overlap.\n- **No evals** — prompt changes by vibes; golden datasets + judges.\n- **Unbounded agent loops** — no step limits or timeouts; cap iterations, add circuit breakers.\n- **Ignoring token costs** — no budgets or logging; cost per request tracked from day one.\n- **No tracing** — debugging agents blind; LangSmith (or equivalent) from the start.\n- **Over-powerful tools** — agents with destructive tools and no confirmation; least privilege + human-in-the-loop.\n- **Prompt injection naivety** — untrusted content treated as instructions; validate and sandbox.\n- **Legacy Chain classes** — deprecated abstractions; LCEL and LangGraph are the current core.\n- **No structured output** — regex-parsing LLM text; schemas + validation.\n- **Streaming ignored** — 30s of silence; stream tokens for perceived latency.\n- **Model maximalism** — largest model for every subtask; right-size per step.\n",{"name":5,"category":24,"description":7},"development","main","af388a77c2fe5e0b4fd879cca4300a0ffa9a6579","skills\u002Fams-langchain-pro",1,"https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis","https:\u002F\u002Fgithub.com\u002FTanNhatCMS","https:\u002F\u002Fmrkiet.name.vn","2026-11-07 14:23:08",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add TanNhatCMS\u002Fjarvis --skill langchain-pro",{"tool":39,"command":40},"bunx","bunx skills add TanNhatCMS\u002Fjarvis --skill langchain-pro",{"tool":42,"command":43},"pnpm","pnpm dlx skills add TanNhatCMS\u002Fjarvis --skill langchain-pro","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fams-langchain-pro\u002FSKILL.md",true,[],[48,55,63,70,77,84],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M7EWYJR0J8DARY7E59Z6Y9MV","web-scrape","Turn web pages into LLM-ready markdown via the Firecrawl API (renders JS, anti-bot handling). Use when browser_open\u002Ffetch fails on JS-heavy pages, or when you need clean markdown\u002Fstructured extraction from a site. Requires FIRECRAWL_API_KEY.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fweb-scrape\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":59,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7EWYBN5P6F2AJG3FR24T9BP","design-taste-frontend","tasteskill v2, the anti-slop frontend skill. Art direction for websites, distilled from a study of 247 curated gallery sites (One Page Love, Awwwards Sites of the Day). Deals researched directions (idea, composition, type, palette, photographs, section blueprints) from a library, enforces a strict no-slop house style with a real-browser inspector, and runs a look-and-fix loop on screenshots. Use this whenever you build, design, redesign, restyle, polish or review a landing page, marketing site, portfolio, product page, one-pager, hero or any public-facing web page, in any stack (HTML\u002FCSS, React, Next.js, Vue, Svelte, Astro, Tailwind) — also when the user says a page looks generic, templated, \"AI-made\", sloppy, or asks to make it look designed, premium, award-level or less like every other site. Not for dashboards or app screens.","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FLICENSE","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Ftaste-design\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7EWY8FQFNQ2GB7NZZWGSSDX","test-driven-development","Use when implementing any feature or bugfix, before writing implementation code","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-tdd\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7EWY5SHBFRH1HDHVWM9K7TV","systematic-debugging","Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-debugging\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7EWY3NM0Z0JAKS7HDZ24K66","requesting-code-review","Use when completing tasks, implementing major features, or before merging to verify work meets requirements","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-code-review\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7EWY0WRMWX4M9ZFY0WKC593","brainstorming","You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).","https:\u002F\u002Fgithub.com\u002FTanNhatCMS\u002Fjarvis\u002Fblob\u002Fmain\u002Fskills\u002Fsuperpowers-brainstorming\u002FSKILL.md",[],[]]