Skip to content

Fix skill.md detection on Windows (path separator in filter) - #11

Open
Iammcqwory wants to merge 1 commit into
addyosmani:mainfrom
Iammcqwory:fix/windows-skill-md-detection
Open

Fix skill.md detection on Windows (path separator in filter)#11
Iammcqwory wants to merge 1 commit into
addyosmani:mainfrom
Iammcqwory:fix/windows-skill-md-detection

Conversation

@Iammcqwory

Copy link
Copy Markdown

Problem

On Windows, the Capability Signaling (skill-md) check always scores 0/10, even when the project contains a valid skill.md.

walkDir() in src/utils.js builds paths with join() from node:path, which produces backslash-separated paths on Windows (e.g. docs\skill.md). The skill-file filter in src/checkers/skill-md.js then does:

const name = f.split('/').pop().toLowerCase();

Since the path contains no forward slashes on Windows, split('/') returns the whole path as a single element, so name ends up as e.g. docs\skill.md and never equals skill.md / skills.md or starts with skill-. Every skill file is filtered out and the checker reports "No skill.md files found."

Reproduction (Windows)

  1. On Windows 11, run npx agentic-seo audit <dir> against any project containing a skill.md (or against this repo's own test fixture test/fixtures/good-site).
  2. Capability Signaling reports No skill.md files found. and scores 0/10, while the same command on macOS/Linux finds the file and scores normally.

The existing test skill-md checker > should pass for good-site with skill.md also fails when the suite is run on Windows.

Fix

Split on both separators when extracting the basename:

const name = f.split(/[\\/]/).pop().toLowerCase();

I audited the rest of src/ for the same pattern — this is the only place a filesystem path is split on '/' (other split() usages operate on robots.txt content, CLI flags, and message strings, and relativePath() correctly uses path.relative).

Verification

Full test suite passes on Windows 11 after the fix: 42/42 tests pass, including the previously failing skill-md checker test.

🤖 Generated with Claude Code

walkDir() builds file paths with node:path join(), which uses
backslashes on Windows. The skill-file filter in skill-md.js split
paths on '/' only, so the extracted filename was the entire path
(e.g. 'docs\skill.md') and never matched skill.md / skills.md /
skill-*. As a result the Capability Signaling check always scored
0/10 on Windows even when skill files were present.

Split on both separators so the basename is extracted correctly on
all platforms.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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