Skip to content

Orphan checks fail using forwardslash as a path separator on Windows #63

@nathanjmcdougall

Description

@nathanjmcdougall

What happened?

The orphan checking logic (CheckOrphanFiles) gives false positives on Windows due to differences between the native OS file separator (backslash) versus the conventional separator for markdown (forwardslash).

What did you expect?

I would have expected no warning about unreferenced files in this case, since references/other.md is present in the skill; even though it is using forward slashes this should be considered acceptable

How to reproduce

Set up a dir with a skill like so:

.agents/skills/
└── example-skill/
    ├── references/other.md
    └── SKILL.md

Where SKILL.md contains:

---
name: example-skill
description: Example skill
---
See references/other.md.

Then this will fail with a warning:

skill-validator check --strict .agents/skills

Giving the output:

Details
skill-validator check --strict .agents/skills

Validating skill: C:\Users\namc\Temp\faw\.agents\skills\example-skill

Structure
  ✓ SKILL.md found
  ⚠ potentially unreferenced file: references\other.md — agents may not discover this file without an explicit reference in SKILL.md or a referenced file

Frontmatter
  ✓ name: "example-skill" (valid)
  ✓ description: (13 chars)

Markdown
  ✓ no unclosed code fences found

Tokens
  SKILL.md body:        7 tokens
  references\other.md:  0 tokens
  ───────────────────────────────────────
  Total:                7 tokens

Content Analysis
  Word count:               9
  Code block ratio:         0.00
  Imperative ratio:         0.00
  Information density:      0.00
  Instruction specificity:  0.00
  Sections: 0  |  List items: 0  |  Code blocks: 0

References Content Analysis
  Word count:               0
  Code block ratio:         0.00
  Imperative ratio:         0.00
  Information density:      0.00
  Instruction specificity:  0.00
  Sections: 0  |  List items: 0  |  Code blocks: 0

Contamination Analysis
  Contamination level: low (score: 0.00)
  Scope breadth: 0

References Contamination Analysis
  Contamination level: low (score: 0.00)
  Scope breadth: 0

Result: 1 warning

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

1 skill validated: all passed
Total: 1 warning

Environment

  • skill-validator version: v1.5.2 (commit 1fe10b0)
  • Go version: o version go1.25.9 windows/amd64
  • OS: Windows 11 Enterprise 24H2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions