Skip to content

feat(deepagents): support direct skill paths as sources in createSkillsMiddleware#242

Open
Alexei Vedernikov (alvedder) wants to merge 1 commit intolangchain-ai:mainfrom
alvedder:alvedder/skills-direct-path
Open

feat(deepagents): support direct skill paths as sources in createSkillsMiddleware#242
Alexei Vedernikov (alvedder) wants to merge 1 commit intolangchain-ai:mainfrom
alvedder:alvedder/skills-direct-path

Conversation

@alvedder
Copy link
Copy Markdown
Contributor

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
 ]

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Feb 21, 2026

⚠️ No Changeset found

Latest commit: 99a70d1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant