Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
aj-geddes avatar

Cross Platform Compatibility

  • 430 installs
  • 305 repo stars
  • Updated March 4, 2026
  • aj-geddes/useful-ai-prompts

cross-platform-compatibility is an agent skill that audits applications for Windows, macOS, Linux, iOS, and Android path, shell, API, and build-target compatibility before release.

About

cross-platform-compatibility is an aj-geddes/useful-ai-prompts agent skill for writing and auditing code that works across Windows, macOS, and Linux desktop environments plus mobile considerations. It covers platform-independent path construction with Node path and os modules, environment and architecture detection, platform-specific dependencies, shell command portability, line endings, file permissions, process management, character encoding, and cross-platform build configuration. The skill ships quick-start TypeScript examples contrasting hardcoded C:\ and /home paths with path.join and path.resolve patterns, plus 11 reference guides in references/ including file-path-handling, platform-detection, shell-commands, and testing-across-platforms. Developers reach for cross-platform-compatibility when building CLI tools, desktop apps, or release pipelines that must not break on path separators, shells, or OS-specific APIs across target platforms.

  • Multi-OS checklist
  • Path and shell differences
  • Native API gap analysis
  • CI matrix recommendations

Cross Platform Compatibility by the numbers

  • 430 all-time installs (skills.sh)
  • Ranked #638 of 2,153 Testing & QA skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/aj-geddes/useful-ai-prompts --skill cross-platform-compatibility

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs430
repo stars305
Last updatedMarch 4, 2026
Repositoryaj-geddes/useful-ai-prompts

How do you write cross-platform file paths in Node?

Audit apps for Windows, macOS, Linux, iOS, and Android compatibility—paths, shells, native APIs, fonts, and build targets—before release.

Who is it for?

Developers shipping CLI tools or Node.js apps that must run on Windows, macOS, and Linux without hardcoded paths or shell assumptions.

Skip if: Single-platform iOS-only or web-only projects with no OS-specific filesystem or shell concerns.

When should I use this skill?

Code uses hardcoded paths, platform-specific shell commands, or must be validated across Windows, macOS, Linux, iOS, and Android targets before release.

What you get

Platform-safe path patterns, OS detection snippets, shell portability fixes, and reference guide pointers for encoding and build config.

  • Portable path and shell patterns
  • Platform detection snippets
  • Compatibility audit checklist

By the numbers

  • Includes 11 reference guides in the references/ directory

Files

SKILL.mdMarkdownGitHub ↗

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";

// Platform-independent path construction
const configPath = path.join(os.homedir(), "config", "app.json");
const dataPath = path.join(process.cwd(), "data", "users.txt");

// Resolve relative paths
const absolutePath = path.resolve("./config/settings.json");

// Get path components
const dirname = path.dirname("/path/to/file.txt"); // '/path/to'
const basename = path.basename("/path/to/file.txt"); // 'file.txt'
const extname = path.extname("/path/to/file.txt"); // '.txt'

// Normalize paths (handle .. and .)
const normalized = path.normalize("/path/to/../file.txt"); // '/path/file.txt'

Reference Guides

Detailed implementations in the references/ directory:

GuideContents
File Path HandlingFile Path Handling
Platform DetectionPlatform Detection
Line EndingsLine Endings
Environment VariablesEnvironment Variables
Shell CommandsShell Commands
File PermissionsFile Permissions
Process ManagementProcess Management
Platform-Specific DependenciesPlatform-Specific Dependencies
Testing Across PlatformsTesting Across Platforms
Character EncodingCharacter Encoding
Build ConfigurationBuild Configuration

Best Practices

✅ DO

  • Use path.join() or path.resolve() for paths
  • Use os.EOL for line endings
  • Detect platform at runtime when needed
  • Test on all target platforms
  • Use optionalDependencies for platform-specific modules
  • Handle file permissions gracefully
  • Use shell escaping for user input
  • Normalize line endings in text files
  • Use UTF-8 encoding by default
  • Document platform-specific behavior
  • Provide fallbacks for platform-specific features
  • Use CI/CD to test on multiple platforms

❌ DON'T

  • Hardcode file paths with backslashes or forward slashes
  • Assume Unix-only features (signals, permissions, symlinks)
  • Ignore Windows-specific quirks (drive letters, UNC paths)
  • Use platform-specific commands without fallbacks
  • Assume case-sensitive file systems
  • Forget about different line endings
  • Use platform-specific APIs without checking
  • Hardcode environment variable access patterns
  • Ignore character encoding issues

Related skills

FAQ

Which platforms does cross-platform-compatibility cover?

cross-platform-compatibility addresses Windows, macOS, and Linux desktop portability—with guidance on paths, shells, permissions, encodings, and dependencies—and supports auditing iOS and Android build-target concerns before release.

What is the core path guidance?

cross-platform-compatibility replaces hardcoded C:\ or /home/user paths with Node path.join, path.resolve, and os.homedir() so configuration and data files resolve correctly on every supported operating system.

Where are detailed implementations?

cross-platform-compatibility links 11 reference guides under references/, covering file-path-handling, platform-detection, shell-commands, line-endings, testing-across-platforms, and build-configuration topics.

Testing & QAfrontendtesting

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.