[PR #242] feat(deepagents): support direct skill paths as sources in createSkillsMiddleware #293

Open
opened 2026-06-05 17:22:33 -04:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/deepagentsjs/pull/242
Author: @alvedder
Created: 2/21/2026
Status: 🔄 Open

Base: mainHead: alvedder/skills-direct-path


📝 Commits (1)

  • 99a70d1 feat(deepagents): support direct skill paths as sources in createSkillsMiddleware

📊 Changes

2 files changed (+349 additions, -32 deletions)

View changed files

📝 libs/deepagents/src/middleware/skills.test.ts (+257 -0)
📝 libs/deepagents/src/middleware/skills.ts (+92 -32)

📄 Description

Description

Previously, sources had to be parent directories (e.g. /skills/) whose subdirectories each contained a SKILL.md. Passing a direct skill path (e.g. /skills/my-skill/) had no effect because listSkillsFromBackend scanned for subdirectories inside the source, found none, and returned an empty list.

Real case

The motivating scenario is when a curated list of skills organised as individual directories under a shared directory. Each skill has a clear responsibility, and different skills are intentionally assigned to the orchestrator agent vs. subagents:

// Desired: pass individual skill paths — one per capability
const SHARED_SKILLS = ['/skills/web-research/'];

const ORCHESTRATOR_SKILLS = [
  '/skills/requirement-completeness-validator/',
  '/skills/diff-risk-analyzer/',
];

createDeepAgent({
  skills: [...SHARED_SKILLS, ...ORCHESTRATOR_SKILLS],
  subagents: subagentsConfig.map(agentConfig => ({
    skills: [
      ...SHARED_SKILLS,
      ...agentConfig.skills,
    ]
  }))
});

The workaround would be to create nested directories like this:

skills/
  web-research/
    web-research/
      SKILL.md
  equirement-completeness-validator/
    equirement-completeness-validator/
      SKILL.md
  ...and so on

What's done

Detection is done by inspecting the lsInfo() result of the source directory: if a SKILL.md file appears directly in the listing, the source itself is treated as the skill directory. Otherwise the existing parent-directory scan runs unchanged.

The two modes can be freely mixed in the sources array:

sources: [
  '/skills/',               // parent dir: all subdirs with SKILL.md
  '/skills/my-skill/',      // direct path: SKILL.md at its root
 ]

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/deepagentsjs/pull/242 **Author:** [@alvedder](https://github.com/alvedder) **Created:** 2/21/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `alvedder/skills-direct-path` --- ### 📝 Commits (1) - [`99a70d1`](https://github.com/langchain-ai/deepagentsjs/commit/99a70d1cdc5d91fa6258a913216821895daf41bc) feat(deepagents): support direct skill paths as sources in createSkillsMiddleware ### 📊 Changes **2 files changed** (+349 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `libs/deepagents/src/middleware/skills.test.ts` (+257 -0) 📝 `libs/deepagents/src/middleware/skills.ts` (+92 -32) </details> ### 📄 Description ## Description Previously, sources had to be parent directories (e.g. `/skills/`) whose subdirectories each contained a SKILL.md. Passing a direct skill path (e.g. `/skills/my-skill/`) had no effect because `listSkillsFromBackend` scanned for subdirectories inside the source, found none, and returned an empty list. ## Real case The motivating scenario is when a curated list of skills organised as individual directories under a shared directory. Each skill has a clear responsibility, and different skills are intentionally assigned to the orchestrator agent vs. subagents: ```typescript // Desired: pass individual skill paths — one per capability const SHARED_SKILLS = ['/skills/web-research/']; const ORCHESTRATOR_SKILLS = [ '/skills/requirement-completeness-validator/', '/skills/diff-risk-analyzer/', ]; createDeepAgent({ skills: [...SHARED_SKILLS, ...ORCHESTRATOR_SKILLS], subagents: subagentsConfig.map(agentConfig => ({ skills: [ ...SHARED_SKILLS, ...agentConfig.skills, ] })) }); ``` The workaround would be to create nested directories like this: ``` skills/ web-research/ web-research/ SKILL.md equirement-completeness-validator/ equirement-completeness-validator/ SKILL.md ...and so on ``` ## What's done Detection is done by inspecting the lsInfo() result of the source directory: if a SKILL.md file appears directly in the listing, the source itself is treated as the skill directory. Otherwise the existing parent-directory scan runs unchanged. The two modes can be freely mixed in the sources array: ```ts sources: [ '/skills/', // parent dir: all subdirs with SKILL.md '/skills/my-skill/', // direct path: SKILL.md at its root ] ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-06-05 17:22:33 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/deepagentsjs#293