aj-geddes avatar

Cross Platform Compatibility

Handles the annoying bits of making code work across Windows, macOS, and Linux. Covers path construction with path.join(), platform detection, line endings, environment variables, and file permissions. The reference guides break down everything from shell command execution to testing strategies across platforms. Honestly, if you've ever hardcoded a backslash in a file path or wondered why your CI passes on Linux but fails on Windows, this will save you time. It's comprehensive without being overwhelming, and the do/don't lists are practical. Worth having around before you ship anything meant to run on multiple operating systems.

skills.sh installs
484
GitHub stars
379
last updated
Aug 21, 2026

Install

$ npx -y skills add aj-geddes/useful-ai-prompts --skill cross-platform-compatibility --agent claude-code

Installs into .claude/skills of the current project.

Files

Cross-Platform Compatibility

Table of Contents

Overview

Comprehensive guide to writing code that works seamlessly across Windows, macOS, and Linux. Covers file path handling, environment detection, platform-specific features, and testing strategies.

When to Use

  • Building applications for multiple operating systems
  • Handling file system operations
  • Managing platform-specific dependencies
  • Detecting operating system and architecture
  • Working with environment variables
  • Building cross-platform CLI tools
  • Dealing with line endings and character encodings
  • Managing platform-specific build processes

Quick Start

Minimal working example:

// ❌ BAD: Hardcoded paths with platform-specific separators
const configPath = "C:\\Users\\user\\config.json"; // Windows only
const dataPath = "/home/user/data.txt"; // Unix only

// ✅ GOOD: Use path module
import path from "path";
import os from "os";

Sponsors

Details

Repository
github.com/aj-geddes/useful-ai-prompts
Categories
Testing & QA, AI & Agent Building
First seen
Jun 3, 2026

More from aj-geddes/useful-ai-prompts

All 258
1davila7 avatarskill-creatordavila7/claude-code-templatesCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an e484skills.sh installs
2josiahsiegel avatarbash-masterjosiahsiegel/claude-plugin-marketplaceExpert bash/shell scripting across environments where Bash is available (Linux, macOS, Git Bash on Windows, WSL, containers). This is a Bash-focused skill - it 462skills.sh installs
3ejirocodes avatarnestjs-best-practicesejirocodes/agent-skillsNestJS 11+ best practices for enterprise Node.js applications with TypeScript. Use when writing, reviewing, or refactoring NestJS controllers, services, modules460skills.sh installs
4openclaudia avataremail-subject-linesopenclaudia/openclaudia-skillsGenerate, evaluate, and A/B test email subject lines for maximum open rates. Includes formulas for curiosity, urgency, personalization, and more. Trigger phrase458skills.sh installs
5postman-devrel avatarpostmanpostman-devrel/agent-skillsFull API lifecycle management through Postman. Sync OpenAPI specs to collections, generate typed client code, run API tests, create mock servers, publish docume458skills.sh installs
6davila7 avatarcode-reviewdavila7/claude-code-templatesPerform code reviews following Sentry engineering practices. Use when reviewing pull requests, examining code changes, or providing feedback on code quality. Co457skills.sh installs