askill
windows-compatibility

windows-compatibilitySafety 90Repository

Guidelines for working on Windows with Git Bash. Use bash/POSIX syntax for shell commands, not CMD or PowerShell syntax, since the Bash tool runs through Git Bash.

0 stars
1.2k downloads
Updated 2/5/2026

Package Files

Loading files...
SKILL.md

Windows Compatibility Skill

Critical Rule: Bash Tool Uses Git Bash

The Bash tool runs commands through Git Bash (/usr/bin/bash), NOT Windows CMD or PowerShell.

This means:

  • Use bash/POSIX syntax for all shell commands
  • Do NOT use Windows CMD syntax (if not exist, copy, del)
  • Do NOT use PowerShell syntax (Remove-Item, New-Item)

Command Syntax Reference

Directory Operations

Task✅ Correct (Bash)❌ Wrong (CMD)❌ Wrong (PowerShell)
Create directorymkdir -p path/to/dirmkdir path\to\dirNew-Item -ItemType Directory
Check if exists[ -d "path" ] && ...if exist path ...Test-Path path
Remove directoryrm -rf path/to/dirrmdir /s /q pathRemove-Item -Recurse
List filesls -ladirGet-ChildItem

File Operations

Task✅ Correct (Bash)❌ Wrong (CMD)❌ Wrong (PowerShell)
Create empty filetouch file.txt or echo "" > file.txtecho. > file.txtNew-Item file.txt
Copy filecp src destcopy src destCopy-Item
Move filemv src destmove src destMove-Item
Delete filerm file.txtdel file.txtRemove-Item
Read filecat file.txttype file.txtGet-Content

Conditional Operations

Task✅ Correct (Bash)❌ Wrong (CMD)
If directory exists[ -d "path" ] && echo "exists"if exist path\ echo exists
If file exists[ -f "file" ] && echo "exists"if exist file echo exists
Multi-line conditionalif [ condition ]; then ... fiif condition ( ... )

Path Handling

  • Use forward slashes in bash: .claude/context/memory/
  • Git Bash auto-converts Windows paths, but prefer forward slashes
  • Quote paths with spaces: "path with spaces/file.txt"

Common Mistakes to Avoid

❌ Windows CMD Multi-line If

# WRONG - Git Bash cannot parse this
if not exist "path" mkdir "path"
if not exist "other" mkdir "other"

✅ Bash Equivalent

# CORRECT - Use bash syntax
mkdir -p path other
# Or with explicit check:
[ -d "path" ] || mkdir -p path

❌ Touch Command Failure Handling

# WRONG - touch may not exist on Windows, fails silently
touch file.txt 2>/dev/null

✅ Portable Alternative

# CORRECT - echo works everywhere in bash
echo "" > file.txt
# Or use mkdir -p for directories (never fails if exists)
mkdir -p path/to/dir

Node.js Cross-Platform Tips

When writing JavaScript/Node.js code:

// Use path.join() for cross-platform paths
const filePath = path.join(__dirname, 'subdir', 'file.txt');

// Use fs.mkdir with recursive option
fs.mkdirSync(dirPath, { recursive: true });

// Check platform if needed
if (process.platform === 'win32') {
  // Windows-specific handling
}

Memory Protocol (MANDATORY)

Before starting:

cat .claude/context/memory/learnings.md

After completing: Record any new patterns or exceptions discovered.

ASSUME INTERRUPTION: Your context may reset. If it's not in memory, it didn't happen.

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

95/100Analyzed 2/13/2026

A high-quality, comprehensive reference guide for ensuring Windows compatibility by enforcing Bash/POSIX syntax within Git Bash. It features clear comparison tables for commands, specific code examples for common operations, and cross-platform Node.js tips.

90
98
90
95
95

Metadata

Licenseunknown
Version2.0.0
Updated2/5/2026
Publishermajiayu000

Tags

llmtesting