windows-compatibility

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.

16 stars

Best use case

windows-compatibility is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

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.

Teams using windows-compatibility should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/windows-compatibility/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/cli-automation/windows-compatibility/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/windows-compatibility/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How windows-compatibility Compares

Feature / Agentwindows-compatibilityStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

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.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Windows Compatibility Skill

<identity>
You are an expert at writing cross-platform code that works correctly on Windows systems running Git Bash.
</identity>

## 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 directory | `mkdir -p path/to/dir` | `mkdir path\to\dir` | `New-Item -ItemType Directory` |
| Check if exists  | `[ -d "path" ] && ...` | `if exist path ...` | `Test-Path path`               |
| Remove directory | `rm -rf path/to/dir`   | `rmdir /s /q path`  | `Remove-Item -Recurse`         |
| List files       | `ls -la`               | `dir`               | `Get-ChildItem`                |

### File Operations

| Task              | ✅ Correct (Bash)                        | ❌ Wrong (CMD)     | ❌ Wrong (PowerShell) |
| ----------------- | ---------------------------------------- | ------------------ | --------------------- |
| Create empty file | `touch file.txt` or `echo "" > file.txt` | `echo. > file.txt` | `New-Item file.txt`   |
| Copy file         | `cp src dest`                            | `copy src dest`    | `Copy-Item`           |
| Move file         | `mv src dest`                            | `move src dest`    | `Move-Item`           |
| Delete file       | `rm file.txt`                            | `del file.txt`     | `Remove-Item`         |
| Read file         | `cat file.txt`                           | `type file.txt`    | `Get-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 conditional | `if [ condition ]; then ... fi`  | `if 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

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

### ✅ Bash Equivalent

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

### ❌ Touch Command Failure Handling

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

### ✅ Portable Alternative

```bash
# 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:

```javascript
// 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:**

```bash
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.

Related Skills

powershell-windows

16
from diegosouzapw/awesome-omni-skill

PowerShell Windows patterns. Critical pitfalls, operator syntax, error handling.

ado-windows-git-bash-compatibility

16
from diegosouzapw/awesome-omni-skill

Windows and Git Bash compatibility guidance for Azure Pipelines. Covers path conversion issues, shell detection in pipeline scripts, MINGW/MSYS path handling, Windows agent configuration, cross-platform script patterns, and troubleshooting common Windows-specific pipeline failures.

windows

16
from diegosouzapw/awesome-omni-skill

Note: Qwen 3 coder is a 30B parameter model requiring at least 24GB of VRAM to run smoothly. More is required for longer context lengths.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

mcp-create-declarative-agent

16
from diegosouzapw/awesome-omni-skill

Skill converted from mcp-create-declarative-agent.prompt.md

MCP Architecture Expert

16
from diegosouzapw/awesome-omni-skill

Design and implement Model Context Protocol servers for standardized AI-to-data integration with resources, tools, prompts, and security best practices

mathem-shopping

16
from diegosouzapw/awesome-omni-skill

Automatiserar att logga in på Mathem.se, söka och lägga till varor från en lista eller recept, hantera ersättningar enligt policy och reservera leveranstid, men lämnar varukorgen redo för manuell checkout.

math-modeling

16
from diegosouzapw/awesome-omni-skill

本技能应在用户要求"数学建模"、"建模比赛"、"数模论文"、"数学建模竞赛"、"建模分析"、"建模求解"或提及数学建模相关任务时使用。适用于全国大学生数学建模竞赛(CUMCM)、美国大学生数学建模竞赛(MCM/ICM)等各类数学建模比赛。

matchms

16
from diegosouzapw/awesome-omni-skill

Mass spectrometry analysis. Process mzML/MGF/MSP, spectral similarity (cosine, modified cosine), metadata harmonization, compound ID, for metabolomics and MS data processing.

managing-traefik

16
from diegosouzapw/awesome-omni-skill

Manages Traefik reverse proxy for local development. Use when routing domains to local services, configuring CORS, checking service health, or debugging connectivity issues.

managing-skills

16
from diegosouzapw/awesome-omni-skill

Install, find, update, and manage agent skills. Use when the user wants to add a new skill, search for skills that do something, check if skills are up to date, or update existing skills. Triggers on: install skill, add skill, get skill, find skill, search skill, update skill, check skills, list skills.

manage-agents

16
from diegosouzapw/awesome-omni-skill

Create, modify, and manage Claude Code subagents with specialized expertise. Use when you need to "work with agents", "create an agent", "modify an agent", "set up a specialist", "I need an agent for [task]", or "agent to handle [domain]". Covers agent file format, YAML frontmatter, system prompts, tool restrictions, MCP integration, model selection, and testing.