windows-compatibility

Enforces cross-platform path, timestamp, and git command patterns for Windows, macOS, and Linux.

Updated Jun 2, 2026
One-click install
npx skills add https://github.com/codebytes/btt --skill windows-compatibility-codebytes
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: windows-compatibility
Source: https://github.com/codebytes/btt/tree/main/.squad/templates/skills/windows-compatibility
Command: npx skills add https://github.com/codebytes/btt --skill windows-compatibility-codebytes

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Cross-platform code often breaks on Windows due to platform-specific assumptions: colons in ISO timestamps are illegal in Windows filenames, git -C fails with Windows paths, inline newlines in commit messages fail silently in PowerShell, and case-sensitive path comparisons break on Windows and macOS filesystems. ## Core Features & Use Cases - Safe Filename Timestamps: Mandates a safeTimestamp() utility that replaces colons with hyphens so log files work on Windows. - Reliable Git Workflows: Requires cd before git commands instead of git -C, and temp-file commits with git commit -F instead of inline -m newlines. - Platform-Aware Path Comparison: Provides a TypeScript pattern that lowercases paths on Windows/macOS but preserves case sensitivity on Linux. - Use Case: When writing a Node.js agent that creates timestamped session logs and commits them to git, apply these patterns to avoid silent failures on Windows machines. ## Quick Start Review my Node.js script for Windows compatibility issues with file paths, timestamps, and git commands.

Frequently Asked Questions about windows-compatibility

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create timestamped filenames that work on Windows?

Windows filenames cannot contain colons, so ISO 8601 timestamps like 2026-03-15T05:30:00Z are illegal. Use a safeTimestamp() utility that replaces colons with hyphens, producing 2026-03-15T05-30-00Z, and centralize it instead of inlining replacements.

Why does git -C fail with Windows paths?

git -C is unreliable with Windows paths containing backslashes, spaces, or drive letters. Instead, change directory first with cd and then run git commands, and check git diff --cached --quiet before committing to avoid empty commits.

How do I compare file paths across Windows, macOS, and Linux?

Windows and macOS filesystems are case-insensitive, so lowercase both paths before comparing with startsWith or equality checks. Linux is case-sensitive, so do not lowercase there; gate the behavior on process.platform being win32 or darwin.

Why do multi-line git commit messages fail in PowerShell?

Embedding backtick-n newlines in git commit -m fails silently in PowerShell. Write the message to a temporary file and commit with git commit -F $msgFile, then delete the temp file.

When should I not apply case-insensitive path comparison?

Do not lowercase paths on Linux, where the filesystem is case-sensitive and /Home/ and /home/ are different directories. Case-insensitive comparison only applies to Windows and macOS, typically for security checks like path traversal prevention.