windows-compatibility

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

1|Updated Jul 7, 2026
One-click install
npx skills add https://github.com/seiggy/maf-copilot-studio-demo --skill windows-compatibility-seiggy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: windows-compatibility
Source: https://github.com/seiggy/maf-copilot-studio-demo/tree/main/.squad/templates/skills/windows-compatibility
Command: npx skills add https://github.com/seiggy/maf-copilot-studio-demo --skill windows-compatibility-seiggy

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 case-insensitive filesystems. ## Core Features & Use Cases - Filename & Timestamp Safety: Mandates a safeTimestamp() utility that replaces colons with hyphens so log files and artifacts are valid on Windows. - Git Command Patterns: Requires cd before git commands instead of git -C, and temp-file-based commit messages via git commit -F instead of inline -m newlines. - Platform-Aware Path Comparison: Provides a TypeScript pattern that lowercases paths on Windows and macOS before comparison, while preserving case sensitivity on Linux. - Use Case: When writing a Node.js tool that creates timestamped log files and commits changes to git, apply these patterns to prevent silent failures for Windows users. ## Quick Start Review my Node.js script for Windows compatibility issues with filenames, git commands, and path comparisons.

Frequently Asked Questions about windows-compatibility

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

FAQPage Schema
How do I create Windows-safe filenames from ISO timestamps?

Replace colons with hyphens using a centralized utility like safeTimestamp(), which converts 2026-03-15T05:30:00Z to 2026-03-15T05-30-00Z. Colons are illegal in Windows filenames, so never inline .toISOString() directly into file paths.

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, then run git commands, and check git diff --cached --quiet before committing to avoid empty commits.

How do I compare file paths on case-insensitive filesystems?

Check process.platform for win32 or darwin and lowercase both paths before comparing with startsWith. Linux filesystems are case-sensitive, so do not lowercase there. This matters for path traversal checks and rootDir confinement.

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

Backtick-n newlines inside git commit -m fail silently in PowerShell. Write the message to a temp file with Set-Content and commit using git commit -F $msgFile, then remove the temp file.

When should I not assume the current working directory is the repo root?

Never assume CWD is the repo root in cross-platform scripts. Use an explicit team root from the spawn prompt or run git rev-parse --show-toplevel, and build paths with path.join() or path.resolve() instead of string concatenation.