# How Reverse-Skill Manages Cross-Platform Scripts: Windows, Linux, and Kali Routing

> Discover how Reverse-Skill manages cross-platform scripts on Windows, Linux, and Kali by isolating logic into PowerShell and Bash files, routed by a master dispatcher.

- Repository: [ZhaoXu/reverse-skill](https://github.com/zhaoxuya520/reverse-skill)
- Tags: how-to-guide
- Published: 2026-08-21

---

**Reverse-Skill isolates platform-specific logic into dedicated shell scripts, using PowerShell `.ps1` files for Windows and Bash `.sh` files for Linux/macOS and Kali, with a master-route dispatcher handling OS detection and task delegation.**

The open-source reverse-skill repository implements a polyglot scripting architecture that allows security professionals to run identical task hints across heterogeneous environments. Rather than forcing a single language abstraction, the project natively embraces each platform's preferred shell—PowerShell on Windows and Bash on Unix-like systems—while maintaining unified routing logic. This approach ensures that reverse-skill scripts leverage native tooling without cross-shell compatibility layers.

## Platform-Specific Script Architecture

### Windows PowerShell Implementation (`.ps1`)

The Windows implementation resides in `skills/scripts/` and uses the `.ps1` extension exclusively. The entry point `skills/scripts/master-route.ps1` parses command-line arguments and imports helper functions from `skills/scripts/lib/HostRuntime.ps1` to detect the runtime environment. Individual task scripts such as `case-init.ps1`, `bootstrap-reverse.ps1`, and `test-routing.ps1` execute using native PowerShell cmdlets and Windows Management Instrumentation (WMI).

### Linux and macOS Bash Implementation (`.sh`)

For Unix-like systems, reverse-skill provides Bash equivalents in the same `skills/scripts/` directory with `.sh` extensions. The [`skills/scripts/master-route.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/scripts/master-route.sh) script mirrors the PowerShell routing logic but uses POSIX-compliant shell commands. Supporting scripts including [`case-init.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/case-init.sh), [`bootstrap-reverse.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/bootstrap-reverse.sh), and [`test-routing.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/test-routing.sh) utilize standard GNU coreutils and procfs for system introspection.

### Kali Linux Specialization

Kali Linux receives separate treatment under `kali/scripts/` to accommodate penetration testing workflows. The [`kali/scripts/bootstrap-reverse.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/kali/scripts/bootstrap-reverse.sh) file serves as the specialized entry point, accompanied by utilities like [`refresh-tool-index.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/refresh-tool-index.sh) and [`quick-setup.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/quick-setup.sh). This segregation allows reverse-skill to handle Kali's unique package repositories and pre-installed security toolchains without polluting the generic Linux script paths.

## The Master-Route Routing Logic

The routing mechanism centers on platform detection and task delegation. On Windows, `HostRuntime.ps1` defines helper functions that query the operating system version and PowerShell execution environment. The Bash implementation employs similar environment variable checks within [`master-route.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/master-route.sh) to distinguish Linux from macOS.

When a user invokes a task hint, the master-route script validates the platform runtime and forwards the hint to the appropriate handler. This abstraction layer ensures that adding support for new operating systems requires only a new script file and a minimal update to the routing logic, without modifying individual task implementations.

## Directory Structure and File Organization

The repository organizes scripts by platform to eliminate path confusion:

- **Windows**: `skills/scripts/*.ps1` (master-route.ps1, case-init.ps1, bootstrap-reverse.ps1, test-routing.ps1)
- **Linux/macOS**: `skills/scripts/*.sh` (master-route.sh, case-init.sh, bootstrap-reverse.sh, test-routing.sh)
- **Kali**: `kali/scripts/*.sh` (bootstrap-reverse.sh, refresh-tool-index.sh, quick-setup.sh)

The [`AGENTS.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/AGENTS.md) file documents this hierarchy and enumerates precise invocation commands for each platform, ensuring users execute the correct interpreter with appropriate execution policies.

## Executing Tasks by Platform

### Running Tasks on Windows

Execute tasks using PowerShell with explicit execution policy bypass to accommodate unsigned scripts:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File skills/scripts/master-route.ps1 -Hint "enumerate processes"

```

The `-Hint` parameter accepts the task identifier and routes to the appropriate handler script.

### Running Tasks on Linux or macOS

Invoke the Bash master-route with the `--hint` flag (note the double-dash syntax differing from PowerShell):

```bash
bash skills/scripts/master-route.sh --hint "enumerate processes"

```

### Kali-Specific Bootstrapping

For Kali environments, use the dedicated bootstrap script that initializes the tool index:

```bash
bash kali/scripts/bootstrap-reverse.sh

```

## Summary

- **Reverse-Skill** manages cross-platform complexity by isolating implementations into native shell scripts rather than using abstraction frameworks.
- **Windows** uses PowerShell (`.ps1`) with `HostRuntime.ps1` providing OS detection helpers.
- **Linux and macOS** use Bash (`.sh`) with equivalent routing in [`master-route.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/master-route.sh).
- **Kali Linux** maintains a separate `kali/scripts/` directory for specialized penetration testing workflows.
- The **master-route** pattern centralizes platform detection while delegating to platform-specific handlers.
- All routing commands and parameters are documented in [`AGENTS.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/AGENTS.md).

## Frequently Asked Questions

### How does reverse-skill determine which script to run on my operating system?

The `master-route` script detects your platform using runtime checks—`HostRuntime.ps1` functions on Windows and environment variable queries in Bash on Linux/macOS. Once detected, it forwards your task hint to the appropriate platform-specific script without requiring manual platform flags from the user.

### Can I run reverse-skill scripts on Windows without changing execution policies?

No. The Windows implementation requires bypassing the default execution policy because the scripts are not signed. The documented command `powershell -NoProfile -ExecutionPolicy Bypass -File skills/scripts/master-route.ps1` explicitly allows local unsigned scripts to run for the current session only.

### Why does Kali Linux have separate scripts instead of using the generic Linux versions?

Kali Linux maintains distinct package repositories, pre-installed security toolchains, and filesystem conventions that differ from standard Debian distributions. The `kali/scripts/` directory contains specialized bootstrapping logic in files like [`bootstrap-reverse.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/bootstrap-reverse.sh) and [`refresh-tool-index.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/refresh-tool-index.sh) that interact specifically with Kali's tool index and offensive security configurations, avoiding conflicts with generic Linux deployments.

### Where is the cross-platform routing logic documented?

The [`AGENTS.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/AGENTS.md) file at the repository root serves as the authoritative reference for the routing scheme. It specifies exact command syntax, parameter names (`-Hint` vs `--hint`), and execution requirements for Windows, Linux, macOS, and Kali platforms.