Skip to content

Conversation

@gotalab
Copy link
Owner

@gotalab gotalab commented Dec 21, 2025

Summary

  • Fix Windows path handling in skillport add command
  • Replace path.rsplit("/", 1)[-1] with Path(path).name for cross-platform compatibility

Related: #51

Test plan

  • Existing tests pass
  • Server verification passes
  • Manual test on Windows (reporter can verify)

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings December 21, 2025 10:31
The validation logic used `path.rsplit("/", 1)[-1]` which only splits on
forward slashes. On Windows, paths use backslashes, causing the full
path to be compared against frontmatter.name instead of just the
directory name.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@gotalab gotalab force-pushed the fix/windows-path-validation branch from f442b25 to 1ecc905 Compare December 21, 2025 10:33
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a cross-platform compatibility issue in the skillport add command by replacing Unix-specific path parsing with a platform-agnostic approach using pathlib.Path.

Key Changes:

  • Replaced path.rsplit("/", 1)[-1] with Path(path).name to extract directory names in a cross-platform manner
  • Leverages the already-imported Path class from pathlib (line 6)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

lines = skill.get("lines", 0)
path = skill.get("path", "")
dir_name = path.rsplit("/", 1)[-1] if path else ""
dir_name = Path(path).name if path else ""
Copy link

Copilot AI Dec 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The existing test suite has comprehensive coverage for the validate_skill_record function, but lacks test cases for Windows-style paths. Consider adding a test case that validates the name-directory matching works correctly with Windows paths like 'C:\skills\test-skill' to ensure the cross-platform fix is tested.

Copilot uses AI. Check for mistakes.
@gotalab gotalab merged commit 68b9f2f into main Dec 21, 2025
3 checks passed
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.

2 participants