Agent skill

cross-platform-path-handler

Generate cross-platform path handling utilities for Windows, macOS, and Linux compatibility in CLI applications.

Stars 514
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/a5c-ai/babysitter/tree/main/library/specializations/cli-mcp-development/skills/cross-platform-path-handler

SKILL.md

Cross-Platform Path Handler

Generate cross-platform path handling utilities.

Capabilities

  • Normalize path separators
  • Handle home directory expansion
  • Create platform-specific path utilities
  • Configure config directory locations
  • Handle UNC paths on Windows
  • Generate path manipulation helpers

Generated Patterns

TypeScript Path Utilities

typescript
import 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);
}

Target Processes

  • cross-platform-cli-compatibility
  • configuration-management-system
  • cli-application-bootstrap

Expand your agent's capabilities with these related and highly-rated skills.

a5c-ai/babysitter

gsd-tools

Central utility skill for GSD operations. Provides config parsing, slug generation, timestamps, path operations, and orchestrates calls to other specialized skills. Acts as the unified entry point that the original gsd-tools.cjs provided via its lib/ modules (commands, config, core, init).

514 31
Explore
a5c-ai/babysitter

model-profile-resolution

Resolve model profile (quality/balanced/budget) at orchestration start and map agents to specific models. Enables cost/quality tradeoffs by selecting appropriate AI models for each agent role.

514 31
Explore
a5c-ai/babysitter

verification-suite

Plan structure validation, phase completeness checks, reference integrity verification, and artifact existence confirmation. Provides the structured verification layer ensuring GSD artifacts are well-formed and complete.

514 31
Explore
a5c-ai/babysitter

state-management

STATE.md reading, writing, and field-level updates. Provides cross-session state persistence via .planning/STATE.md with structured fields for current task, completed phases, blockers, decisions, and quick tasks.

514 31
Explore
a5c-ai/babysitter

git-integration

Git commit patterns, formats, and conventions for GSD methodology. Provides atomic commits per task, structured commit messages, planning file commits, branch management, and milestone tag operations.

514 31
Explore
a5c-ai/babysitter

frontmatter-parsing

YAML frontmatter parsing and manipulation for .planning/ documents. Provides read, write, update, query, and validation operations on frontmatter blocks in GSD markdown artifacts.

514 31
Explore

Didn't find tool you were looking for?

Be as detailed as possible for better results