Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate cross-platform path handling utilities for Windows, macOS, and Linux compatibility in CLI applications.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 55% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 9% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 37% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 19% | 0% |
| case-18 | ✗→✓ | ▲ Improved | 44% | 0% |
Generate cross-platform path handling utilities.
typescriptimport path from 'path'; import os from 'os'; import fs from 'fs'; export function normalizePath(p: string): string { return p.replace(/\\/g, '/'); } export function toPlatformPath(p: string): string { return p.split('/').join(path.sep); } export function expandHome(p: string): string { if (p.startsWith('~')) { return path.join(os.homedir(), p.slice(1)); } return p; } export function getConfigDir(appName: string): string { const platform = process.platform; if (platform === 'win32') { return path.join(process.env.APPDATA || '', appName); } if (platform === 'darwin') { return path.join(os.homedir(), 'Library', 'Application Support', appName); } return path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), appName); } export function getDataDir(appName: string): string { const platform = process.platform; if (platform === 'win32') { return path.join(process.env.LOCALAPPDATA || '', appName); } if (platform === 'darwin') { return path.join(os.homedir(), 'Library', 'Application Support', appName); } return path.join(process.env.XDG_DATA_HOME || path.join(os.homedir(), '.local', 'share'), appName); } export function getCacheDir(appName: string): string { const platform = process.platform; if (platform === 'win32') { return path.join(process.env.LOCALAPPDATA || '', appName, 'Cache'); } if (platform === 'darwin') { return path.join(os.homedir(), 'Library', 'Caches', appName); } return path.join(process.env.XDG_CACHE_HOME || path.join(os.homedir(), '.cache'), appName); }
Other measured skills in the registry, with their headline benchmark lift.