openclaw - ✅(Solved) Fix [Bug]: [Bug] Skills scanner ignores subdirectories under ~/.openclaw/skills/ [2 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#56915Fetched 2026-04-08 01:46:03
View on GitHub
Comments
0
Participants
1
Timeline
6
Reactions
0
Author
Participants
Timeline (top)
cross-referenced ×3labeled ×2referenced ×1

Steps to reproduce: 把 skill 放 ~/.openclaw/skills/coze/koze-retrieval/SKILL.md,运行 openclaw skills list — 不显示 Expected behavior: 递归扫描所有子目录 Actual behavior: 只扫描根目录 Version: 2026.3.28

Root Cause

Steps to reproduce: 把 skill 放 ~/.openclaw/skills/coze/koze-retrieval/SKILL.md,运行 openclaw skills list — 不显示 Expected behavior: 递归扫描所有子目录 Actual behavior: 只扫描根目录 Version: 2026.3.28

Fix Action

Fixed

PR fix notes

PR #56929: fix(skills): discover nested managed skill directories

Description (problem / solution / changelog)

Summary

  • recursively discover skill directories under managed/workspace skill roots instead of only loading immediate children
  • preserve root containment checks for every discovered skill directory and SKILL.md file
  • add coverage for grouped skill layouts like ~/.openclaw/skills/coze/koze-retrieval/SKILL.md

Testing

  • git commit hook checks (pnpm check + oxlint) passed during commit

Fixes #56915

Changed files

  • src/agents/skills.loadworkspaceskillentries.test.ts (modified, +17/-0)
  • src/agents/skills/workspace.ts (modified, +62/-8)

PR #56938: fix: recursively scan skill subdirectories under ~/.openclaw/skills/

Description (problem / solution / changelog)

Summary

The skills scanner was not recursively scanning subdirectories under ~/.openclaw/skills/, causing skills installed in nested paths (e.g. ~/.openclaw/skills/coze/skill-name/SKILL.md) to be invisible.

Root Cause

The loadSkills function in src/agents/skills/workspace.ts only iterated immediate child directories of the skills root and checked whether each child contained a SKILL.md. Directories used as vendor/namespace groupings (e.g. ~/.openclaw/skills/coze/) that do not themselves have a SKILL.md were silently skipped, so any skills nested inside them were never discovered.

Changes

  • Added collectSkillDirsRecursive() helper in workspace.ts that walks the skills directory tree up to MAX_SKILL_SCAN_DEPTH (4) levels deep, returning relative paths for every directory that contains a SKILL.md.
  • Updated the skill loading loop to iterate over these recursively-discovered candidates instead of only the immediate children.
  • Updated refresh.ts watcher globs to include nested SKILL.md patterns (*/*/SKILL.md, */*/*/SKILL.md, /*/*/*/*/SKILL.md) so hot-reload also works for nested skills.

Testing

Existing tests pass. The fix preserves all existing security hardening (path containment checks via resolveContainedSkillPath) and size/count limits.

Fixes openclaw/openclaw#56915

Changed files

  • src/agents/skills/refresh.ts (modified, +5/-0)
  • src/agents/skills/workspace.ts (modified, +54/-6)
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

Steps to reproduce: 把 skill 放 ~/.openclaw/skills/coze/koze-retrieval/SKILL.md,运行 openclaw skills list — 不显示 Expected behavior: 递归扫描所有子目录 Actual behavior: 只扫描根目录 Version: 2026.3.28

Steps to reproduce

Steps to reproduce: 把 skill 放 ~/.openclaw/skills/coze/koze-retrieval/SKILL.md,运行 openclaw skills list — 不显示 Expected behavior: 递归扫描所有子目录 Actual behavior: 只扫描根目录 Version: 2026.3.28

Expected behavior

Steps to reproduce: 把 skill 放 ~/.openclaw/skills/coze/koze-retrieval/SKILL.md,运行 openclaw skills list — 不显示 Expected behavior: 递归扫描所有子目录 Actual behavior: 只扫描根目录 Version: 2026.3.28

Actual behavior

Steps to reproduce: 把 skill 放 ~/.openclaw/skills/coze/koze-retrieval/SKILL.md,运行 openclaw skills list — 不显示 Expected behavior: 递归扫描所有子目录 Actual behavior: 只扫描根目录 Version: 2026.3.28

OpenClaw version

2026.3.28

Operating system

Ubuntu

Install method

npm

Model

/

Provider / routing chain

/

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

To fix the issue of openclaw skills list not recursively scanning all subdirectories, we need to modify the directory scanning logic in the openclaw codebase.

Step 1: Update the skills Command

We need to update the skills command to recursively scan all subdirectories. We can achieve this by using a recursive directory traversal function.

Step 2: Modify the skills.js File

In the skills.js file, update the list function to use a recursive directory traversal function. Here's an example code snippet:

const fs = require('fs');
const path = require('path');

// ...

list: async () => {
  const skillsDir = path.join(process.env.HOME, '.openclaw', 'skills');
  const skills = [];

  function traverseDir(dir) {
    fs.readdirSync(dir).forEach(file => {
      const filePath = path.join(dir, file);
      if (fs.statSync(filePath).isDirectory()) {
        traverseDir(filePath);
      } else if (file === 'SKILL.md') {
        skills.push(filePath);
      }
    });
  }

  traverseDir(skillsDir);
  console.log(skills);
}

Step 3: Test the Update

Run the openclaw skills list command to verify that it now recursively scans all subdirectories.

Verification

To verify that the fix worked, run the following command:

openclaw skills list

This should display a list of all SKILL.md files in the ~/.openclaw/skills directory and its subdirectories.

Extra Tips

  • Make sure to update the openclaw package to the latest version using npm update openclaw.
  • If you encounter any issues during the update process, refer to the openclaw documentation for troubleshooting guides.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

Steps to reproduce: 把 skill 放 ~/.openclaw/skills/coze/koze-retrieval/SKILL.md,运行 openclaw skills list — 不显示 Expected behavior: 递归扫描所有子目录 Actual behavior: 只扫描根目录 Version: 2026.3.28

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING