windows-compatibility

Normalize timestamps, git commands, and path handling for cross-platform scripts.

Updated Mar 18, 2022
One-click install
npx skills add https://github.com/mpaulosky/dotfiles --skill windows-compatibility-mpaulosky
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: windows-compatibility
Source: https://github.com/mpaulosky/dotfiles/tree/main/.copilot/skills/windows-compatibility
Command: npx skills add https://github.com/mpaulosky/dotfiles --skill windows-compatibility-mpaulosky

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents cross-platform failures caused by OS-specific path and command assumptions by standardizing timestamps, git usage patterns, and path handling across Windows, macOS, and Linux.

Core Features & Use Cases

  • Safe Timestamps: Centralizes timestamp formatting with a safeTimestamp() pattern that replaces colons with hyphens to avoid illegal filenames on Windows.
  • Reliable Git Workflows: Recommends changing directories before running git, checking for staged changes with git diff --cached --quiet, and writing commit messages to a temporary file used with git commit -F to avoid PowerShell and Windows pitfalls.
  • Robust Path Handling: Advises using path.join() or path.resolve() instead of manual separator concatenation and avoiding git -C on Windows paths.
  • Use Case: Apply these patterns when running Squad automation, CI pipelines, or local developer scripts across Windows, macOS, and Linux to avoid silent failures, illegal filenames, and unreliable git behavior.

Quick Start

Update repository automation to replace git -C calls with explicit cd then git commands and to use a safeTimestamp() utility for filenames.

Frequently Asked Questions about windows-compatibility

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

FAQPage Schema
How do I prevent cross-platform git workflow errors in Windows PowerShell automation?

Prevent cross-platform git workflow errors by changing directories before running git commands, checking staged changes with git diff --cached --quiet, and writing commit messages to a temporary file used with git commit -F to avoid PowerShell pitfalls.

Why do ISO timestamps cause illegal filename errors on Windows?

ISO timestamps cause illegal filename errors on Windows because colons are invalid characters in NTFS filenames. Sanitize ISO timestamps by replacing colons with hyphens using a safeTimestamp() utility to ensure cross-platform path compatibility.

What is the best way to handle file paths reliably across Windows, macOS, and Linux?

Handle file paths reliably across Windows, macOS, and Linux by using path.join() or path.resolve() utilities for path construction instead of manual separator concatenation, which prevents failures caused by OS-specific path separators.

Does using git -C cause silent failures on Windows file paths?

Using git -C can cause silent failures on Windows file paths due to shell behavior differences. Avoid git -C by changing directories explicitly first, then running git commands to ensure reliable cross-platform execution.

How do I standardize timestamps and paths for CI pipelines running on multiple operating systems?

Standardize timestamps and paths for CI pipelines by centralizing timestamp formatting to replace colons with hyphens and using path utilities for construction, preventing illegal filenames and path errors across Windows, macOS, and Linux.

How do I check for staged changes before running git commit in cross-platform scripts?

Check for staged changes before running git commit in cross-platform scripts by using the git diff --cached --quiet command, which prevents empty commits and avoids shell-specific syntax issues across Windows, macOS, and Linux.