langchain
Skill20 starsChanged 7 months agoMITView on GitHub
Apply when building LangChain pipelines, LCEL chains, agents, or retrieval-augmented generation systems.
8 other projects use a version of this.
Adopted by
Most recently taken up by
- langchain-ai/docstheir own version, first seen Sep 15, 2026
- svngoku/coding-agents-skillstheir own version, first seen Aug 13, 2026
- Zephyrex21/claude-skills-vettedtheir own version, first seen Aug 9, 2026
- magnus919/agent-skillstheir own version, first seen Jul 21, 2026
- dekoza/oh-my-sloptheir own version, first seen Mar 19, 2026
- Clay-HHK/claude-skillstheir own version, first seen Mar 5, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 8
- langchain-ai/docs★ 424same name
- hoodini/ai-agents-skills★ 281same name
- magnus919/agent-skills★ 109same name
- svngoku/coding-agents-skills★ 11same name
- dekoza/oh-my-slop★ 4same name
- Makiya1202/ai-agents-skills★ 2same name
- Zephyrex21/claude-skills-vetted★ 2same name
- Clay-HHK/claude-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/brainstorming.mdcCursor rule
- .cursor/rules/branch-finishing.mdcCursor rule
- .cursor/rules/code-quality.mdcCursor rule
- .cursor/rules/db-schema.mdcCursor rule
- .cursor/rules/debugging.mdcCursor rule
- .cursor/rules/docker.mdcCursor rule
- .cursor/rules/domain-template.mdcCursor rule
- .cursor/rules/drawio.mdcCursor rule
- .cursor/rules/error-log.mdcCursor rule
- .cursor/rules/fastapi.mdcCursor rule
- .cursor/rules/git-conventions.mdcCursor rule
- .cursor/rules/github-cli.mdcCursor rule
- .cursor/rules/implementation-plan.mdcCursor rule
- .cursor/rules/langchain.mdcCursor rule
- .cursor/rules/python.mdcCursor rule
- .cursor/rules/react.mdcCursor rule
- .cursor/rules/review-deployment.mdcCursor rule
- .cursor/rules/security-review.mdcCursor rule
- .cursor/rules/self-extension-workflow.mdcCursor rule
- .cursor/rules/shell-scripting.mdcCursor rule
- .cursor/rules/svg-check.mdcCursor rule
- .cursor/rules/tdd.mdcCursor rule
- .cursor/rules/typescript.mdcCursor rule
- skill-everythingSkill
- brainstormingSkill
- branch-finishingSkill
- code-qualitySkill
- db-schemaSkill
- debuggingSkill
- dockerSkill
- domain-templateSkill
- drawioSkill
- error-logSkill
- fastapiSkill
- git-conventionsSkill
- github-cliSkill
- implementation-planSkill
- pythonSkill
- reactSkill
- review-deploymentSkill
- security-reviewSkill
- self-extension-workflowSkill
- shell-scriptingSkill
- svg-checkSkill
- tddSkill
- <kebab-case-name>Skill
- typescriptSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
22 rules. 0 are common, 2 are distinctive, and 20 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
20
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 25
Use LCEL pipe syntax: Always use the LCEL pipe operator (|) to compose runnables instead of deprecated constructor-based chain classes …
- Very specific: line 26
Avoid legacy chain imports: Never import from langchain.chains.llm or langchain.chains.sequential.
- Very specific: line 27
Prefer RunnablePassthrough for identity steps: Use RunnablePassthrough to thread context through a chain without mutation rather than …
- Very specific: line 28
Use RunnableParallel for fan-out: Prefer RunnableParallel over manually calling multiple chains and merging dicts.
- Very specific: line 32
Use typed output parsers: Always attach an output parser (PydanticOutputParser, JsonOutputParser, StrOutputParser) to chains that produce …
- Very specific: line 33
Inject format instructions via partial: Use prompt.partial(format_instructions=parser.get_format_instructions()) to bind parser …
- Very specific: line 34
Separate system and human messages: Use ChatPromptTemplate.from_messages([("system", ...), ("human", ...)]) instead of a single …
- Very specific: line 38
Prefer ChatModel over LLM: Always use ChatOpenAI, ChatAnthropic, or equivalent chat-model classes for new code.
- Very specific: line 39
Pin model name explicitly: Never rely on the default model name in a chat model constructor.
- Very specific: line 43
Use RunnableWithMessageHistory for stateful chains: Prefer RunnableWithMessageHistory over manual history management or deprecated …
- Very specific: line 44
Scope memory by session ID: Always pass a session_id key when constructing RunnableWithMessageHistory to prevent cross-user memory leakage …
- Very specific: line 48
Define tools with @tool decorator: Use the @tool decorator (or StructuredTool.from_function) with a typed signature and docstring.
- Very specific: line 49
Use create_tool_calling_agent for modern agents: Prefer create_tool_calling_agent + AgentExecutor over deprecated initialize_agent.
- Very specific: line 50
Cap agent iterations: Always set max_iterations and max_execution_time on AgentExecutor to prevent runaway loops.
- Very specific: line 55
Ensure document loaders are lazy: Prefer .lazy_load() over .load() for large corpora to avoid loading all documents into memory at once.
- Very specific: line 59
Wrap LLM calls with retry: Use .with_retry(stop_after_attempt=3, wait_exponential_jitter=True) on any runnable that calls an external API.
- Very specific: line 60
Set request timeout: Always pass request_timeout (or timeout) to chat model constructors.
- Very specific: line 61
Attach callbacks for observability: Use callbacks=[LangSmithTracer()] or equivalent on chains in production.
- Very specific: line 62
Count tokens before sending: Before sending large contexts, use llm.get_num_tokens(text) or a tiktoken counter to verify the payload fits …
- Distinctive: line 66
Sanitize user input before prompt injection: Never interpolate raw user strings directly into system prompts.
- Distinctive: line 67
Disable dangerous tools in untrusted contexts: Avoid giving agents tools with filesystem or shell access when processing untrusted input.
- Very specific: line 71
Enable semantic caching in dev: Use set_llm_cache(InMemoryCache()) during development and SQLiteCache in staging to avoid redundant API …
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Sub-Skill: LangChain / Agent Framework Conventions
Purpose: Prevent common LangChain mistakes — deprecated chain classes, missing retry/timeout guards, unsafe prompt handling, and unobservable pipelines.
Rules
Chain Construction
- Use LCEL pipe syntax. Always use the LCEL pipe operator (
|) to compose runnables instead of deprecated constructor-based chain classes (LLMChain,SequentialChain,TransformChain). Reference: ERR-2026-026 - Avoid legacy chain imports. Never import from
langchain.chains.llmorlangchain.chains.sequential; uselangchain_core.runnablesandlangchain_core.promptsinstead. - Prefer RunnablePassthrough for identity steps. Use
RunnablePassthroughto thread context through a chain without mutation rather than writing a lambda that returns its input unchanged. - Use RunnableParallel for fan-out. Prefer
RunnableParallelover manually calling multiple chains and merging dicts; it expresses intent and enables parallel execution.
Prompts & Output Parsers
- Use typed output parsers. Always attach an output parser (
PydanticOutputParser,JsonOutputParser,StrOutputParser) to chains that produce structured data; never parse raw LLM strings manually downstream. - Inject format instructions via partial. Use
prompt.partial(format_instructions=parser.get_format_instructions())to bind parser instructions into the prompt template rather than hard-coding them in the template string. - Separate system and human messages. Use
ChatPromptTemplate.from_messages([("system", ...), ("human", ...)])instead of a singlePromptTemplatefor chat models; mixing roles in one string breaks structured output.
Chat Models vs LLMs
- Prefer ChatModel over LLM. Always use
ChatOpenAI,ChatAnthropic, or equivalent chat-model classes for new code; the baseOpenAILLM class is deprecated for most use cases and lacks tool-calling support. - Pin model name explicitly. Never rely on the default model name in a chat model constructor; always pass
model="gpt-4o"(or equivalent) so upgrades are intentional.
Memory & State
- Use RunnableWithMessageHistory for stateful chains. Prefer
RunnableWithMessageHistoryover manual history management or deprecatedConversationChain; it integrates cleanly with LCEL and supports async. - Scope memory by session ID. Always pass a
session_idkey when constructingRunnableWithMessageHistoryto prevent cross-user memory leakage in multi-tenant services.
Tools & Agents
- Define tools with @tool decorator. Use the
@tooldecorator (orStructuredTool.from_function) with a typed signature and docstring; never pass raw callables to an agent without a schema. - Use create_tool_calling_agent for modern agents. Prefer
create_tool_calling_agent+AgentExecutorover deprecatedinitialize_agent; it uses native tool-calling APIs and avoids ReAct string parsing. - Cap agent iterations. Always set
max_iterationsandmax_execution_timeonAgentExecutorto prevent runaway loops; default is unbounded.
Retrieval & Vector Stores
- Use retrieval chains via LCEL. Build RAG pipelines with
retriever | format_docs | prompt | llm | parserrather thanRetrievalQA.from_chain_type; the latter is deprecated and hides the retrieval step. - Ensure document loaders are lazy. Prefer
.lazy_load()over.load()for large corpora to avoid loading all documents into memory at once.
Reliability & Observability
- Wrap LLM calls with retry. Use
.with_retry(stop_after_attempt=3, wait_exponential_jitter=True)on any runnable that calls an external API; never let transient rate-limit errors propagate uncaught. - Set request timeout. Always pass
request_timeout(ortimeout) to chat model constructors; omitting it allows indefinitely hanging requests. - Attach callbacks for observability. Use
callbacks=[LangSmithTracer()]or equivalent on chains in production; never ship a pipeline with no tracing so failures are diagnosable. - Count tokens before sending. Before sending large contexts, use
llm.get_num_tokens(text)or a tiktoken counter to verify the payload fits within the model's context window.
Security
- Sanitize user input before prompt injection. Never interpolate raw user strings directly into system prompts; use a dedicated input variable in the prompt template and validate/strip control characters before binding.
- Disable dangerous tools in untrusted contexts. Avoid giving agents tools with filesystem or shell access when processing untrusted input; scope tool permissions to the minimum required.
Caching & Cost
- Enable semantic caching in dev. Use
set_llm_cache(InMemoryCache())during development andSQLiteCachein staging to avoid redundant API calls and reduce cost during iteration.
See also
skills/python/SKILL.mdskills/error-log/SKILL.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

