Skills

Purpose and Scope

Skills are reusable capability packages for agents. In the LangChain and Deep Agents documentation, a skill is a directory that contains a SKILL.md file plus optional supporting material such as scripts, reference documentation, templates, and assets. The agent receives only a summary at startup, then reads the full instructions or supporting files when the user task makes that skill relevant. This page explains that authoring pattern and connects it to the repository evidence available here: a language parser compatibility module that exposes JavaScript segmentation for document loading workflows.

The practical problem skills solve is context management. Instead of placing every schema, workflow, policy, and codebase convention into an agent’s system prompt, a project can keep those materials in separate directories and let the agent discover them on demand. The official SQL assistant tutorial calls this progressive disclosure: metadata is visible early, core instructions are loaded only when selected, and detailed resources remain outside the context window until needed. That pattern is especially useful for large organizations, multi-domain assistants, and code agents that need different bodies of knowledge for different tasks.

Core Primitives

A skill directory has one required file: SKILL.md. That file starts with YAML frontmatter containing at least a name and description, followed by markdown instructions. The name gives the capability a stable identity, while the description is the short startup summary that helps the agent decide whether to load it. The markdown body should explain when to use the skill, what procedure to follow, which tools or references are relevant, and what outputs are expected. Supporting files can hold longer schemas, examples, scripts, templates, or reference pages that should not always be loaded.

Skills differ from memory and tools even though they can work with both. Memory is persistent context about preferences, conventions, or learned project facts that may be loaded across sessions. Tools are executable capabilities that an agent can call. Skills sit between those ideas: they package task-specific instructions and resources, and those instructions may tell the agent which tools to use. A skill can describe how to inspect LangGraph docs, how to write SQL for a business vertical, or how to apply a team’s release workflow without hard-coding all details into the base prompt.

A minimal skill shape looks like this:

skills/
  langgraph-docs/
    SKILL.md
    references/
    scripts/
    assets/
---
name: langgraph-docs
description: Use this skill for requests related to LangGraph documentation.
---
 
# langgraph-docs
 
## Overview
 
Use this skill to fetch and select relevant LangGraph documentation before answering implementation questions.

Relevant Source Files

  • libs/langchain/langchain_classic/document_loaders/parsers/language/javascript.py — exposes the classic JavaScriptSegmenter import path through a dynamic deprecated-import lookup, which is relevant when skills or ingestion workflows need to process JavaScript source or documentation through LangChain document-loader components.

System-to-Code Mapping

The targeted repository file is not a skill runtime implementation; it is a compatibility module in langchain_classic for JavaScript language parsing. It imports create_importer, declares a DEPRECATED_LOOKUP entry for JavaScriptSegmenter, builds _import_attribute, and implements module-level __getattr__ so callers can still access JavaScriptSegmenter through the classic path while the implementation lives in langchain_community.document_loaders.parsers.language.javascript. The public surface is declared through __all__ = ["JavaScriptSegmenter"]. Sources: libs/langchain/langchain_classic/document_loaders/parsers/language/javascript.py

That mapping matters for skills because skill packages often contain reference files that must be searched, chunked, or transformed before an agent can use them effectively. For example, a project may maintain a coding skill with JavaScript examples, API snippets, or migration notes. A loader pipeline that segments language-specific files can produce cleaner documents for retrieval, summaries, or agent-readable references. The compatibility shim preserves an older import path while delegating implementation to the community loader package, so existing classic LangChain ingestion code can keep working while users migrate to newer package boundaries. Sources: libs/langchain/langchain_classic/document_loaders/parsers/language/javascript.py

ConcernSkill authoring viewRepository grounding
Discoverabilitydescription tells the agent when to load the skillThe parser module exposes a stable public name through __all__
On-demand loadingFull instructions and resources stay out of context until needed__getattr__ resolves the segmenter dynamically when requested
ReuseSkills can be shared across agents and projectsThe deprecated lookup keeps older code paths usable across package changes
Supporting resourcesSkills may include docs, scripts, and templatesJavaScript segmentation can support processing code-oriented reference material

Authoring Flow

Start by creating a top-level skills/ directory in the application or backend that owns the agent. Each child directory should represent one capability, not a broad knowledge dump. Good names are domain-specific, such as sales-sql, inventory-sql, release-runbook, or langgraph-docs. Write the description as routing metadata: it should be concise, specific, and written from the agent’s perspective. If two skills have overlapping descriptions, the agent has less signal when deciding what to load, so split or clarify them before adding more resources.

Next, write the SKILL.md body as operational guidance. Include the task boundaries, the step-by-step workflow, validation rules, and examples of successful outputs. If the skill needs large context, place that material in supporting files and tell the agent when to read each one. For a SQL assistant, the startup prompt might include only the skill names and descriptions, while the complete table schema and business metrics definitions live in per-domain files. For a documentation assistant, the skill can instruct the agent to fetch an index, choose relevant pages, and then read only those pages.

Implementation Details and Constraints

Skills are most effective when they are treated as productized agent capabilities rather than miscellaneous prompt snippets. Keep each skill independently reviewable, versionable, and owned by the team that understands the domain. Prefer small, explicit files over one large document, because progressive disclosure depends on the agent being able to select the right layer of detail. If a skill includes scripts, document the expected inputs, outputs, and safety assumptions. If it includes templates, explain when to use them and what fields must be filled before returning a result.

When a skill contains code-oriented reference material, consider how the material will be loaded and segmented. The JavaScript parser compatibility module shows a LangChain pattern for preserving public imports while moving concrete implementation into a specialized package. That same separation is useful in skill systems: the skill can remain a stable authoring interface, while ingestion, parsing, retrieval, or execution details evolve behind it. For JavaScript-heavy skills, language-aware segmentation can help prevent examples and functions from being split in ways that reduce retrieval quality. Sources: libs/langchain/langchain_classic/document_loaders/parsers/language/javascript.py

Testing Signals and Next Steps

Validate a skill by asking the agent both matching and non-matching questions. A matching question should cause the agent to identify the skill from its description, load the SKILL.md body, and consult any supporting resources named by the instructions. A non-matching question should not load the skill unnecessarily. For database, compliance, or deployment skills, add review tasks that check whether the agent follows the prescribed workflow and whether it cites or applies the right resource files rather than relying on generic model knowledge.

As a next step, design one small skill around a real recurring workflow and keep its description narrow. Add only the supporting files needed for that workflow, then test whether the agent can discover the skill without seeing the full content upfront. If the skill needs project facts that should always be present, pair it with memory or startup instructions. If it needs executable behavior, pair it with tools. If it needs source or documentation ingestion, use LangChain document-loading and parsing components as part of the preparation pipeline.