monorepo-development
Navigate LangChain's Python monorepo packages, package-local uv workflows, validation commands, API stability checks, PR conventions, and docs/model-reference guidance.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- monorepo-development
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Navigate LangChain's Python monorepo packages, package-local uv workflows, validation commands, API stability checks, PR conventions, and docs/model-reference guidance.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/development-workflows.md6.6 KB
- 参考文档references/package-map.md5.3 KB
- 参考文档references/troubleshooting.md5.3 KB
- 脚本scripts/inspect_langchain_package.py5.1 KB
03 SKILL.md 正文
LangChain Monorepo Development
Use this sub-skill when a task changes repository structure, package metadata, public Python APIs, tests, lint/type workflows, documentation examples, or contributor-facing conventions in the LangChain Python monorepo.
Start Here
- Identify the package that owns the change with package-map.md.
- Inspect package metadata safely with inspect_langchain_package.py when you need the package name, version, dependency groups, Python range, local editable sources, or optional extras.
- Run commands from the package directory, not from the repository root, unless development-workflows.md explicitly describes a cross-package command.
- Validate with the narrowest package-local target first, then broaden only if the changed area requires it.
- Use troubleshooting.md when
uv, package roots, dependency groups, public API checks, model IDs, or optional dependencies are unclear.
Package Routing
libs/core: Core primitives and abstractions inlangchain-core; use for base interfaces, schemas, messages, tools, runnables, callbacks, serialization, and API contracts shared across packages.libs/langchain_v1: Actively maintainedlangchainpackage; use for high-level public utilities and agent/application APIs that depend onlangchain-coreand LangGraph.libs/langchain:langchain-classic; treat as legacy/classic surface and avoid new feature work unless the user specifically targets classic behavior or compatibility.libs/text-splitters:langchain-text-splitters; use for text chunking utilities and splitter-specific tests.libs/partners/<provider>: Team-maintained integration packages such as OpenAI, Anthropic, Ollama, DeepSeek, xAI, and others; keep provider-specific behavior here and route deeper provider implementation to the integrations sub-skill if present at../integrations/SKILL.md.libs/standard-tests:langchain-tests; use for standardized conformance tests shared by integrations.libs/model-profiles:langchain-model-profiles; use for model profile data tooling and profile refresh operations.
Default Workflow
cd libs/<package>
uv sync --group test
uv run --group test pytest tests/unit_tests/path/to/test_file.py
make lint_package
make type
Adjust groups by package metadata: use --group lint for lint-only commands, --group typing or --all-groups when mypy needs optional typing dependencies, and add --group test_integration only for explicitly requested integration tests. Do not use pip, poetry, conda, or ad-hoc virtual environments for LangChain package development.
Public API Guardrails
Before changing a public function, class, method, or exported symbol:
- Check whether it is exported from a package
__init__.pyor documented as public. - Search existing tests and examples for positional and keyword usage.
- Preserve existing argument names, positions, defaults, and return types whenever possible.
- Add new parameters as keyword-only, for example
*, new_option: str | None = None. - Add or update deterministic unit tests under the owning package's
tests/unit_tests/tree. - Use Google-style docstrings for public APIs with Args/Returns/Raises where relevant, single backticks for inline code, and type hints in signatures.
Warn the user before making a signature change that could break code written against last week's release.
Validation Signals
Prefer package-local validation from the owning directory:
- Unit tests:
uv run --group test pytest tests/unit_tests/...ormake test TEST_FILE=tests/unit_tests/.... - Lint and formatting check:
make lint_package,make lint_tests, ormake lint_diffwhen the package Makefile supports them. - Formatting fix:
make formatormake format_diffonly after confirming it is appropriate for the task. - Type checking:
make typeor the package's mypy command throughuv run. - Import checks:
make check_importswhere available; package scripts load source files to catch import-time failures. - Version checks:
make check_versionwhere available; these compare package metadata with package-specific version artifacts.
Skip or defer integration tests when they need network credentials, provider services, Docker services, or heavy optional dependencies and the user did not ask for them. Record the skip condition in the handoff.
Documentation and Model References
- Use current generally available model names in docs and examples; verify against provider documentation before introducing or updating model IDs.
- Do not change shipped default model parameters casually because defaults are public behavior.
- For profile data, use the model-profiles workflow in development-workflows.md rather than manually editing generated profile data.
- Keep documentation examples minimal, deterministic, and aligned with the package that owns the API.
Maintainer-Level Package Changes
For adding packages or integrations, keep work at an operational level unless the user explicitly asks for provider-specific implementation:
- Add or update package-local
pyproject.toml,uv.lock, package Makefile, tests, and scripts following existing package patterns. - Wire local editable sources through
[tool.uv.sources]for in-repo dependencies. - Update contributor-facing package labels, release/change detection, and issue dropdown configuration as required by maintainer guidance, but do not deep-link future agents to source workflow files from this skill.
- Route provider-specific behavior, credentials, standard integration tests, and model feature details to the integrations sub-skill if available.
Required References
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).