os-awareness

Detects the user's operating system and selects correct shell commands and path conventions.

Updated Sep 17, 2026
One-click install
npx skills add https://github.com/bramanda48/skills --skill os-awareness-bramanda48
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: os-awareness
Source: https://github.com/bramanda48/skills/tree/main/skills/os-awareness
Command: npx skills add https://github.com/bramanda48/skills --skill os-awareness-bramanda48

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? AI assistants often generate shell commands that fail because they assume the wrong operating system, shell, or tool availability. This Skill detects the user's platform (Windows, Linux, macOS, or WSL) and ensures every command, script, and file operation uses the correct native tools and conventions. ## Core Features & Use Cases - OS Detection: Identifies the platform via uname, environment signals, or path patterns, and asks the user when uncertain. - Verified Command Mappings: Provides cross-platform equivalents for file operations, text processing, networking, process management, and scheduling across bash/zsh, PowerShell, and cmd.exe. - Platform References: Loads detailed per-OS references covering BSD vs GNU differences, PowerShell idioms, cmd.exe gotchas, and deprecated commands. - Use Case: When asked to "find all log files containing errors" on a Windows machine, the agent outputs Select-String or findstr instead of a failing grep -r command. ## Quick Start Ask the agent to write a shell command or script for your task, and it will first detect your operating system and then generate the correct platform-specific commands.

Frequently Asked Questions about os-awareness

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make AI-generated shell commands work on Windows?

Detect the OS first, then use native Windows tools: PowerShell cmdlets like Get-ChildItem and Select-String, or cmd.exe commands like dir and findstr. Avoid assuming bash tools like grep or ls exist on Windows.

What is the PowerShell equivalent of grep?

Select-String is the PowerShell equivalent of grep. Use Select-String -Pattern "text" -Path file for single files, or add -Recurse with a path wildcard for recursive searches. In cmd.exe, use findstr instead.

Why does sed -i fail on macOS but work on Linux?

macOS ships BSD sed, which requires a backup suffix argument: sed -i '' 's/a/b/' file. GNU sed on Linux accepts sed -i without the empty quotes. Install gnu-sed via Homebrew for Linux-compatible behavior.

Can I use Linux commands on Windows with WSL?

Yes, WSL provides a full Linux environment where bash commands work natively. Windows drives are accessible at /mnt/c/, and Windows executables can be called with the .exe suffix from within WSL.

How do I write a script that runs on multiple operating systems?

Prefer Python or Node.js, which abstract OS differences through libraries like pathlib and shutil. If shell scripts are required, write two versions: a .sh file for bash and a .ps1 file for PowerShell, and never hardcode paths.