Skip to content
Back to skills

Cross Platform Path Handler

ASecurity

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

  • 1,760 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 2, 2026
ai-agentstypescriptbashbackend

Works with

  • cli
  • mcp

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 2, 2026

npx -y skills add a5c-ai/babysitter --skill cross-platform-path-handler --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Cross Platform Path Handler?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Cross Platform Path Handler
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/a5c-ai-cross-platform-path-handler-babysitter/badge)](https://www.skillsdirectory.com/skills/a5c-ai-cross-platform-path-handler-babysitter)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: cross-platform-path-handler
description: Generate cross-platform path handling utilities for Windows, macOS, and Linux compatibility in CLI applications.
allowed-tools: Read, Write, Edit, Bash, Glob, Grep
graph:
  domains: [domain:software-engineering]
  specializations: [specialization:cli-mcp-development]
  skillAreas: [skill-area:cli-design, skill-area:mcp-server-implementation, skill-area:cross-platform-desktop]
  roles: [role:backend-engineer, role:platform-engineer]
  workflows: [workflow:feature-development]
  topics: [topic:developer-experience]

---

# 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

Files in this skill

  • README.md485 B
  • SKILL.md2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…