From aj-geddes-useful-ai-prompts-4
Handles cross-platform compatibility including file paths, environment detection, platform-specific dependencies, and testing across Windows, macOS, and Linux.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aj-geddes-useful-ai-prompts-4:cross-platform-compatibilityThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- [Overview](#overview)
references/build-configuration.mdreferences/character-encoding.mdreferences/environment-variables.mdreferences/file-path-handling.mdreferences/file-permissions.mdreferences/line-endings.mdreferences/platform-detection.mdreferences/platform-specific-dependencies.mdreferences/process-management.mdreferences/shell-commands.mdreferences/testing-across-platforms.mdscripts/scaffold-tests.shtemplates/test-template.jsComprehensive guide to writing code that works seamlessly across Windows, macOS, and Linux. Covers file path handling, environment detection, platform-specific features, and testing strategies.
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'
Detailed implementations in the references/ directory:
| Guide | Contents |
|---|---|
| File Path Handling | File Path Handling |
| Platform Detection | Platform Detection |
| Line Endings | Line Endings |
| Environment Variables | Environment Variables |
| Shell Commands | Shell Commands |
| File Permissions | File Permissions |
| Process Management | Process Management |
| Platform-Specific Dependencies | Platform-Specific Dependencies |
| Testing Across Platforms | Testing Across Platforms |
| Character Encoding | Character Encoding |
| Build Configuration | Build Configuration |
npx claudepluginhub joshuarweaver/cascade-code-languages-misc-1 --plugin aj-geddes-useful-ai-prompts-4Generates professional bash/shell scripts with Google Shell Style Guide compliance, ShellCheck validation, cross-platform support (Linux/macOS/Windows/containers), POSIX compliance, security hardening, error handling, performance optimization, and BATS testing. Useful for automation, DevOps/CI/CD, build scripts, debugging.
Troubleshoots Windows file path errors in Claude Code on Git Bash: backslash vs forward slash issues, Edit/Write/Read tool failures, MINGW resolution, cross-platform conversion.
Provides shell scripting expertise for bash, zsh, POSIX; CLI tools like jq, yq, fd, rg for JSON/YAML processing, file search, automation, error handling, and cross-platform best practices. Useful for CLI commands, pipes, script development.