Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
직접 명령은 검토 Prompt를 거치지 않습니다. 실행하기 전에 소스를 확인하세요.
npx skills add https://github.com/tomevault-io/skills-registry --skill langchain명령은 한 줄로 유지됩니다. 복사하기 전에 가로로 스크롤해 전체 내용을 확인하세요.
로컬 사본을 원하시나요? SkillsMP에서 현재 제공할 수 있는 파일을 다운로드하세요.
SKILL.md 표시 중
SOC 직업 분류 기준
| name | langchain |
| description | | Use when this capability is needed. |
from langchain_anthropic import ChatAnthropic
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.output_parsers import StrOutputParser
model = ChatAnthropic(model="claude-sonnet-4-20250514")
prompt = ChatPromptTemplate.from_messages([
("system", "You are a helpful assistant specialized in {topic}."),
("human", "{question}"),
])
# Pipe syntax
chain = prompt | model | StrOutputParser()
result = chain.invoke({"topic": "Python", "question": "Explain decorators"})
# Streaming
async for chunk in chain.astream({"topic": "Python", "question": "Explain decorators"}):
print(chunk, end="")
import { ChatAnthropic } from '@langchain/anthropic';
import { ChatPromptTemplate } from '@langchain/core/prompts';
import { StringOutputParser } from '@langchain/core/output_parsers';
const model = new ChatAnthropic({ model: 'claude-sonnet-4-20250514' });
const prompt = ChatPromptTemplate.fromMessages([
['system', 'You are a helpful assistant specialized in {topic}.'],
['human', '{question}'],
]);
const chain = prompt.pipe(model).pipe(new StringOutputParser());
const result = await chain.invoke({ topic: 'TypeScript', question: 'Explain generics' });
from langchain_community.vectorstores import Chroma
from langchain_anthropic import ChatAnthropic
from langchain_openai import OpenAIEmbeddings
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.runnables import RunnablePassthrough
# Setup
embeddings = OpenAIEmbeddings()
vectorstore = Chroma(persist_directory="./chroma_db", embedding_function=embeddings)
retriever = vectorstore.as_retriever(search_kwargs={"k": 4})
prompt = ChatPromptTemplate.from_template("""
Answer based on the context. If unsure, say so.
Context: {context}
Question: {question}
""")
chain = (
{"context": retriever | format_docs, "question": RunnablePassthrough()}
| prompt
| ChatAnthropic(model="claude-sonnet-4-20250514")
| StrOutputParser()
)
answer = chain.invoke("How does authentication work?")
from langchain_core.tools import tool
from langchain_anthropic import ChatAnthropic
from langgraph.prebuilt import create_react_agent
@tool
def search_database(query: str) -> str:
"""Search the product database by query."""
results = db.search(query)
return json.dumps(results)
@tool
def calculate_price(product_id: str, quantity: int) -> float:
"""Calculate total price for a product and quantity."""
product = db.get_product(product_id)
return product.price * quantity
model = ChatAnthropic(model="claude-sonnet-4-20250514")
agent = create_react_agent(model, [search_database, calculate_price])
result = agent.invoke({"messages": [("human", "Find laptop prices and calculate cost for 5 units")]})
from pydantic import BaseModel, Field
class ExtractedInfo(BaseModel):
name: str = Field(description="Person's name")
email: str = Field(description="Email address")
sentiment: str = Field(description="positive, negative, or neutral")
structured_model = model.with_structured_output(ExtractedInfo)
result = structured_model.invoke("John (john@example.com) loves the product!")
# ExtractedInfo(name='John', email='john@example.com', sentiment='positive')
from langchain_community.document_loaders import PyPDFLoader, WebBaseLoader
from langchain_text_splitters import RecursiveCharacterTextSplitter
# Load
docs = PyPDFLoader("document.pdf").load()
# Split
splitter = RecursiveCharacterTextSplitter(chunk_size=1000, chunk_overlap=200)
chunks = splitter.split_documents(docs)
# Store in vectorstore
vectorstore = Chroma.from_documents(chunks, embeddings, persist_directory="./db")
| Anti-Pattern | Fix |
|---|---|
Legacy LLMChain API | Use LCEL pipe syntax |
| No streaming for user-facing | Always stream with astream |
| Huge chunks in RAG | Use 500-1000 char chunks with 200 overlap |
| No retrieval evaluation | Track retrieval quality with LangSmith |
| Agent without tool descriptions | Write clear docstrings — LLM uses them |
| Embedding model mismatch | Same embedding model for indexing and querying |
Source: claude-dev-suite/claude-dev-suite — distributed by TomeVault.