Logo Multi Platform Dev

Multi Platform Dev

Cộng đồng
Omar-Obando
multi-platform-dev

Use when developing cross-platform applications that must work on Windows, Linux, and macOS. Covers shell command differences, path handling, line endings, file permissions, package managers, environment detection, platform-specific build tools, and testing strategies. Ensures code works everywhere without platform assumptions.

Tổng quan

Nhà phát hànhOmar-Obando
Kho mãqwen-orchestrator
Tên kỹ năngmulti-platform-dev
Sao
53
Bản fork
13
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được Omar-Obando công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Multi Platform Dev trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/multi-platform-dev
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Omar-Obando/qwen-orchestrator.git /tmp/qwen-orchestrator
mkdir -p .claude/skills
cp -r /tmp/qwen-orchestrator/skills/multi-platform-dev .claude/skills/multi-platform-dev
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Multi Platform Dev trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Multi Platform Dev ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Multi Platform Dev với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Multi-Platform Development Skill — Cross-Platform Compatibility

Overview

This skill provides comprehensive guidance for developing applications that work across Windows, Linux, and macOS. It covers shell command differences, path handling, line endings, file permissions, package managers, environment detection, platform-specific build tools, and testing strategies. Essential for avoiding the "works on my machine" problem.

When to Use

Use this skill when:

  • Writing shell scripts that must run on Windows, Linux, and macOS
  • Handling file paths across different operating systems
  • Managing line endings (CRLF vs LF) in cross-platform projects
  • Setting file permissions portably
  • Detecting the current platform in code
  • Configuring package managers for different OS
  • Building cross-platform CI/CD pipelines
  • Writing cross-platform test scripts
  • Handling environment variables across platforms
  • Managing process management differences
  • Configuring cross-platform development environments
  • Writing platform-conditional code
  • Handling cross-platform networking differences
  • Managing cross-platform logging and debugging
  • Creating cross-platform installer packages
  • Writing cross-platform configuration files
  • Handling cross-platform date/time formatting
  • Managing cross-platform locale and encoding
  • Writing cross-platform CLI tools
  • Configuring cross-platform Docker environments

Do NOT use this skill when:

  • Building native OS-specific applications (use platform-specific SDK)
  • Writing kernel-level code (use OS-specific documentation)
  • Developing mobile apps (use mobile-engineer skill)
  • Creating browser-only web apps (use frontend-developer skill)
  • Configuring cloud infrastructure (use terraform-iac or aws-serverless skill)
  • Writing database queries (use database-design skill)
  • Implementing machine learning models (use data-science skill)

Why avoid: Cross-platform concerns are irrelevant for platform-specific or browser-only applications. Focus on the target platform.

Core Concepts

Platform Detection

PlatformNode.jsPythonShellPowerShell
Windowsprocess.platform === 'win32'sys.platform == 'win32'N/A$true
Linuxprocess.platform === 'linux'sys.platform == 'linux'$true$false
macOSprocess.platform === 'darwin'sys.platform == 'darwin'$true$false

Shell Command Differences

OperationLinux/macOS (Bash)Windows (CMD)Windows (PowerShell)
List filesls -ladir /aGet-ChildItem -Force
Change directorycd /pathcd C:\pathSet-Location C:\path
Copy filecp src dstcopy src dstCopy-Item src dst
Copy directorycp -r src dstxcopy src dst /E /ICopy-Item src dst -Recurse
Delete filerm filedel fileRemove-Item file
Delete directoryrm -rf dirrmdir /s /q dirRemove-Item dir -Recurse -Force
Make directorymkdir -p dirmkdir dirNew-Item -ItemType Directory -Path dir
Show current dirpwdcdGet-Location
Search textgrep "pattern" filefindstr "pattern" fileSelect-String "pattern" file
Pipe outputcmd1 | cmd2cmd1 | cmd2cmd1 | cmd2
Redirect outputcmd > filecmd > filecmd > file
Environment var$VAR or ${VAR}%VAR%$env:VAR
Execute script./script.shscript.bat.\script.ps1
Clear screenclearclsClear-Host
Show processps auxtasklistGet-Process
Kill processkill PIDtaskkill /PID PID /FStop-Process -Id PID -Force

Path Handling

javascript
// ✅ GOOD: Cross-platform path handling (Node.js)
const path = require('path');

// Works on all platforms
const filePath = path.join('data', 'files', 'document.txt');
// Windows: data\files\document.txt
// Linux/macOS: data/files/document.txt

// ✅ GOOD: Path separator detection
const separator = path.sep; // '\\' on Windows, '/' on Linux/macOS

// ❌ BAD: Hardcoded paths
const badPath = '/home/user/data/file.txt'; // Fails on Windows
const badPath2 = 'C:\\Users\\user\\data\\file.txt'; // Fails on Linux/macOS
python
# ✅ GOOD: Cross-platform path handling (Python)
from pathlib import Path

# Works on all platforms
file_path = Path('data') / 'files' / 'document.txt'

# ✅ GOOD: Platform detection
import sys
if sys.platform == 'win32':
    print("Windows-specific logic")
elif sys.platform == 'darwin':
    print("macOS-specific logic")
else:
    print("Linux/Unix-specific logic")

# ❌ BAD: Hardcoded paths
bad_path = '/home/user/data/file.txt'  # Fails on Windows

Line Endings

PlatformLine EndingBytesGit Config
WindowsCRLF\r\n (0x0D 0x0A)core.autocrlf=true
Linux/macOSLF\n (0x0A)core.autocrlf=input
git
# .gitconfig (Global settings)
[core]
    autocrlf = input  # Convert CRLF to LF on commit, keep LF on checkout

# .gitattributes (Project settings - commit to repo)
# Text files - normalize to LF
* text=auto

# Specific text files
*.js text
*.ts text
*.py text
*.md text
*.json text
*.yaml text
*.yml text

# Binary files - no conversion
*.png binary
*.jpg binary
*.gif binary
*.woff binary
*.woff2 binary
*.ttf binary

File Permissions

bash
# Linux/macOS: chmod for permissions
chmod 755 script.sh    # rwxr-xr-x (executable)
chmod 644 file.txt     # rw-r--r-- (read/write owner, read others)
chmod 600 secrets.env  # rw------- (read/write owner only)

# Windows: No direct equivalent - use ACLs
# PowerShell: Set-Acl for permissions
icacls file.txt /grant:r "Users:(R)"  # Read for all users
icacls file.txt /grant:r "Administrators:(F)"  # Full control for admins

# Cross-platform solution: Use package manager or installer
# npm: Files in bin/ are marked executable on Linux/macOS
# Python: Use setuptools with scripts= or entry_points=

Cross-Platform Shell Scripts

Bash with Windows Support (Git Bash/WSL)

bash
#!/usr/bin/env bash
set -euo pipefail

# Platform detection
OS="$(uname -s)"
case "${OS}" in
    Linux*)     MACHINE=Linux;;
    Darwin*)    MACHINE=Mac;;
    CYGWIN*)    MACHINE=Cygwin;;
    MINGW*)     MACHINE=MinGW;;
    *)          MACHINE="UNKNOWN:${OS}"
esac

echo "Detected platform: ${MACHINE}"

# Cross-platform path handling
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"

# Cross-platform find
if [[ "${MACHINE}" == "Linux" || "${MACHINE}" == "Mac" ]]; then
    find "${PROJECT_ROOT}/src" -name "*.ts" -type f
else
    # Windows (Git Bash/MinGW)
    find "${PROJECT_ROOT}/src" -name "*.ts" -type f
fi

# Cross-platform process killing
kill_process() {
    local pid=$1
    if [[ "${MACHINE}" == "MinGW" || "${MACHINE}" == "Cygwin" ]]; then
        taskkill //PID "${pid}" //F >/dev/null 2>&1
    else
        kill "${pid}" 2>/dev/null
    fi
}

PowerShell Cross-Platform

powershell
# Cross-platform PowerShell (works on Windows, Linux, macOS)

# Platform detection
$isWindows = $true
$isLinux = $false
$isMacOS = $false

if ($PSVersionTable.PSVersion.Major -ge 6) {
    # PowerShell Core (cross-platform)
    $platform = [System.Runtime.InteropServices.RuntimeInformation]::OSDescription
    $isWindows = $platform -match "Windows"
    $isLinux = $platform -match "Linux"
    $isMacOS = $platform -match "Darwin"
}

# Cross-platform path handling
$projectRoot = $PSScriptRoot
$filePath = Join-Path $projectRoot "data\file.txt"

# Cross-platform file operations
Copy-Item -Path "src\file.txt" -Destination "dst\file.txt" -Force
Remove-Item -Path "temp\*" -Recurse -Force
New-Item -ItemType Directory -Path "new\dir" -Force

# Cross-platform process management
Get-Process -Name "node" | Stop-Process -Force

Node.js Cross-Platform Scripts

javascript
// ✅ GOOD: Cross-platform script (package.json)
{
  "scripts": {
    "dev": "cross-env NODE_ENV=development nodemon src/index.ts",
    "build": "tsc && electron-builder",
    "test": "cross-env NODE_ENV=test jest",
    "start": "node dist/index.js"
  },
  "dependencies": {
    "cross-env": "^7.0.3",
    "cross-spawn": "^7.0.3"
  }
}

// ✅ GOOD: Using cross-spawn for child processes
const spawn = require('cross-spawn');

// Works on all platforms (handles path.exe on Windows)
const child = spawn('npm', ['run', 'build'], { stdio: 'inherit' });

// ❌ BAD: Platform-specific commands
const { exec } = require('child_process');
exec('ls -la');  // Fails on Windows without Git Bash/WSL

Package Managers

Cross-Platform Package Management

Tasknpm/yarn/pnpmpipapt (Debian/Ubuntu)brew (macOS)chocolatey (Windows)
Install packagenpm install pkgpip install pkgsudo apt install pkgbrew install pkgchoco install pkg
Update packagenpm update pkgpip install --upgrade pkgsudo apt update && sudo apt upgrade pkgbrew upgrade pkgchoco upgrade pkg
Remove packagenpm uninstall pkgpip uninstall pkgsudo apt remove pkgbrew uninstall pkgchoco uninstall pkg
List packagesnpm listpip listdpkg --listbrew listchoco list --local-only
Search packagesnpm search querypip search queryapt search querybrew search querychoco search query

Development Environment Setup

bash
# Linux (Ubuntu/Debian)
sudo apt update
sudo apt install -y nodejs npm python3 python3-pip git curl
nvm install --lts

# macOS (Homebrew)
brew install node python git curl
nvm install --lts

# Windows (Chocolatey)
choco install nodejs-lts python git curl
nvm install --lts

# Windows (Scoop)
scoop install nodejs-lts python git curl

Cross-Platform CI/CD

GitHub Actions Matrix

yaml
name: Cross-Platform CI

on: [push, pull_request]

jobs:
  test:
    strategy:
      matrix:
        os: [ubuntu-latest, windows-latest, macos-latest]
        node-version: [18, 20, 22]
    runs-on: ${{ matrix.os }}

    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: ${{ matrix.node-version }}
          cache: 'npm'

      - name: Install dependencies
        run: npm ci

      - name: Run tests
        run: npm test

      - name: Build
        run: npm run build

      - name: Platform-specific tests
        if: matrix.os == 'windows-latest'
        run: npm run test:windows

      - name: Platform-specific tests
        if: matrix.os == 'ubuntu-latest'
        run: npm run test:linux

Cross-Platform Testing Strategy

Platform Detection in Tests

javascript
// Jest test with platform detection
describe('File operations', () => {
  const isWindows = process.platform === 'win32';

  test('should handle paths correctly', () => {
    const path = require('path');
    const testPath = path.join('data', 'test.txt');

    if (isWindows) {
      expect(testPath).toMatch(/\\/);
    } else {
      expect(testPath).toMatch(/\//);
    }
  });

  // Skip tests that don't work on Windows
  test.skipIf(isWindows)('should set file permissions', () => {
    // chmod tests only on Linux/macOS
  });
});

// Python test with platform detection
import unittest
import sys

class TestCrossPlatform(unittest.TestCase):
    def test_path_handling(self):
        from pathlib import Path
        path = Path('data') / 'test.txt'
        self.assertTrue(isinstance(path, Path))

    @unittest.skipIf(sys.platform == 'win32', "Linux/macOS only")
    def test_file_permissions(self):
        # chmod tests only on Linux/macOS
        import os
        os.chmod('test.txt', 0o755)

Production Checklist

Before deploying cross-platform applications:

  • Platform detection implemented
  • Path handling uses platform-agnostic methods
  • Line endings normalized (LF in Git)
  • Shell commands work on all target platforms
  • File permissions handled portably
  • Environment variables accessed correctly
  • Package managers documented for each platform
  • CI/CD tests run on all platforms
  • Platform-specific tests skipped appropriately
  • Documentation includes platform-specific instructions
  • Error messages are platform-agnostic
  • Logging works across platforms
  • Build artifacts are platform-specific when needed
  • Installation scripts work on all platforms
  • Configuration files are platform-agnostic

Real-World Impact

Before this skill:

  • "Works on my machine" bugs
  • Shell scripts failing on Windows
  • Path errors in production
  • Line ending conflicts in Git
  • Platform-specific assumptions in code

After this skill:

  • Cross-platform compatibility from day one
  • Shell scripts working on all platforms
  • Path handling that never fails
  • Clean Git history with normalized line endings
  • Platform-aware code with proper fallbacks

Cross-References

  • docker-containerization - For containerized cross-platform deployment
  • github-actions-cicd - For cross-platform CI/CD pipelines
  • devops-pipeline - For deployment automation
  • testing-strategy - For cross-platform test coverage

References

Câu hỏi thường gặp

Kỹ năng AI Multi Platform Dev làm được gì?

Use when developing cross-platform applications that must work on Windows, Linux, and macOS. Covers shell command differences, path handling, line endings, file permissions, package managers, environment detection, platform-specific build tools, and testing strategies. Ensures code works everywhere without platform assumptions.

Vì sao nên dùng Multi Platform Dev trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Multi Platform Dev là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Multi Platform Dev trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/Omar-Obando/qwen-orchestrator/tree/main/skills/multi-platform-dev. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Multi Platform Dev?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Multi Platform Dev với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Multi Platform Dev với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Multi Platform Dev có miễn phí không?

Có. Kỹ năng này được Omar-Obando phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇