# createSkillsMiddleware

> **Function** in `deepagents`

📖 [View in docs](https://reference.langchain.com/javascript/deepagents/middleware/createSkillsMiddleware)

Create backend-agnostic middleware for loading and exposing agent skills.

This middleware loads skills from configurable backend sources and injects
skill metadata into the system prompt. It implements the progressive disclosure
pattern: skill names and descriptions are shown in the prompt, but the agent
reads full SKILL.md content only when needed.

## Signature

```javascript
createSkillsMiddleware(options: SkillsMiddlewareOptions): AgentMiddleware<StateSchema<__type>, undefined, unknown, readonly ClientTool | ServerTool[], readonly []>
```

## Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| `options` | `SkillsMiddlewareOptions` | Yes | Configuration options |

## Returns

`AgentMiddleware<StateSchema<__type>, undefined, unknown, readonly ClientTool | ServerTool[], readonly []>`

AgentMiddleware for skills loading and injection

## Examples

```typescript
const middleware = createSkillsMiddleware({
  backend: new FilesystemBackend({ rootDir: "/" }),
  sources: ["/skills/user/", "/skills/project/"],
});
```

---

[View source on GitHub](https://github.com/langchain-ai/deepagentsjs/blob/d879d1c979abc589c77489154f913db862d4d130/libs/deepagents/src/middleware/skills.ts#L814)