windows-compatibility

Fix Windows-incompatible filenames, timestamps, git commands, and path handling.

209|27|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/dotnet/maui-labs --skill windows-compatibility-dotnet
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: windows-compatibility
Source: https://github.com/dotnet/maui-labs/tree/main/src/Comet/.copilot/skills/windows-compatibility
Command: npx skills add https://github.com/dotnet/maui-labs --skill windows-compatibility-dotnet

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents cross-platform failures caused by Windows-incompatible filename, timestamp, git, and path assumptions, saving you from broken tooling and flaky automation.

Core Features & Use Cases

  • Filnames & timestamps safety: Avoid illegal colon characters in Windows filenames by using a centralized safe timestamp format.
  • Reliable git command patterns: Prevent unreliable behavior from using git -C with Windows paths by switching to a cd-first workflow.
  • Safe commit message handling: Avoid PowerShell/newline pitfalls by committing with a message file instead of embedding newlines in -m.
  • Correct working-directory resolution: Ensure repo-relative operations work by never assuming CWD is the repo root and by using proper path resolution.

What you can use it for

  • CI and local automation scripts that create logs, timestamps, and commit artifacts on Windows, macOS, and Linux.
  • Tooling that invokes git, writes commit messages, and constructs file paths from JS/Node or similar environments.

Quick Start

Ask an AI agent to update your Windows runner scripts and JS code so they use safe timestamps without colons, run git after changing directories (no git -C), and build paths with path.join()/path.resolve() while deriving the repo root reliably.

Frequently Asked Questions about windows-compatibility

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

FAQPage Schema
Why do my git commands fail when automating commits on Windows?

Git automation on Windows often fails when using the `git -C` flag with local paths or embedding multiline commit messages in `-m`. Switching to a `cd`-first workflow and using a temp file with the `-F` flag resolves these cross-platform command invocation issues.

How do I format timestamps for filenames safely across Windows, macOS, and Linux?

To format timestamps for filenames safely across Windows, macOS, and Linux, you must remove colon characters. Using a centralized safe timestamp format without colons prevents illegal character errors when generating cross-platform build artifacts.

What is the best way to handle file paths in Node.js CI automation scripts?

The best way to handle file paths in CI automation scripts is to use `path.join()` or `path.resolve()` and derive the repo root reliably. Never assume the current working directory is the repo root to ensure operations run consistently across different operating systems.

Does PowerShell break git commit messages with multiple lines?

Yes, PowerShell can break git commit messages with multiple lines due to newline handling pitfalls. To avoid this, write your commit message to a temporary file and pass it to git using the `-F` flag instead of the `-m` flag.

How to make cross-platform build scripts run consistently on Windows runners?

To make cross-platform build scripts run consistently on Windows runners, update your tooling to use safe timestamps without colons, avoid `git -C` by changing directories first, and resolve repo-relative paths using proper utilities like `path.join()`.

When should I avoid using the git -C flag in my CI pipelines?

You should avoid using the `git -C` flag in CI pipelines when working with Windows paths to prevent unreliable behavior. Instead, use a `cd`-first workflow to change into the target directory before running your git operations.