# How to Execute the Master Routing Script on Windows: A Complete PowerShell Guide

> Execute the master routing script on Windows using PowerShell 5.1+. Learn to bypass execution policy and use the Hint parameter for automatic security task routing.

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

---

**Run `master-route.ps1` from PowerShell 5.1+ with `-ExecutionPolicy Bypass` and a `-Hint` parameter to route security tasks to the correct skill automatically.**

The **master routing script** in the `zhaoxuya520/reverse-skill` repository is the central dispatcher for security automation workflows. This PowerShell script analyzes task hints, matches them against keyword rules in [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json), and generates a [`route-scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/route-scope.md) manifest that tells downstream tools which skill to execute. Understanding how to execute the master routing script on Windows correctly ensures your security tasks reach the right automation modules without manual guesswork.

## What the Master Routing Script Does

At its core, `skills/scripts/master-route.ps1` serves as an intelligent router with no hard-coded logic. It relies entirely on external configuration to make routing decisions.

### Core Components

| Component | Location | Purpose |
|-----------|----------|---------|
| **Master routing script** | `skills/scripts/master-route.ps1` | Parses hints, scores matches, selects PRIMARY skill, outputs manifest |
| **Routing configuration** | [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json) | Single source of truth for keywords, priorities, and fallback rules |
| **Work root resolver** | `skills/scripts/lib/WorkRoot.ps1` | Determines where to place output files |
| **Generated manifest** | `work/master-route-<timestamp>/route-scope.md` | Records selected skill, confidence, and next actions |

### Execution Flow in `master-route.ps1`

The script processes your task through eight distinct stages (lines 7-98):

1. **Input parsing** (lines 7-15) – Accepts `-Hint`, optional `-OutDir` and `-ProjectRoot`
2. **Config loading** (lines 22-33) – Reads [`routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.json) as structured data
3. **Keyword matching** (lines 35-52) – Applies `must`, `mustAll`, and `exclude` regex rules
4. **Scoring and priority resolution** (lines 54-88) – Calculates match confidence, applies priority ordering
5. **Fallback handling** (lines 90-98) – Uses `fallbackId` when no route matches
6. **Output directory resolution** – Creates timestamped folder under `work/`
7. **Manifest generation** (lines 39-66) – Writes [`route-scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/route-scope.md) with PRIMARY skill details
8. **User feedback** (lines 71-76) – Prints selected skill path and confidence level

## Prerequisites for Running on Windows

Before executing the master routing script, verify your environment meets these requirements:

- **PowerShell 5.1 or newer** – Required for JSON parsing and filesystem operations
- **Execution policy bypass capability** – The script is unsigned and requires explicit policy override
- **Repository cloned locally** – The `skills/` directory must exist relative to your working path

Check your PowerShell version:

```powershell
$PSVersionTable.PSVersion

```

## Basic Execution: Running the Master Routing Script

The simplest invocation requires only a task hint describing what you want to accomplish.

### Minimal Command

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\skills\scripts\master-route.ps1 -Hint "enumerate active directory users"

```

**Parameter breakdown:**

- `-NoProfile` – Prevents user profile scripts from interfering
- `-ExecutionPolicy Bypass` – Allows unsigned script execution for this session only
- `-File .\skills\scripts\master-route.ps1` – Path to the routing entry point
- `-Hint "..."` – Natural language description of your security task

### What Happens After Execution

The script outputs a selection summary and the path to [`route-scope.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/route-scope.md):

```

PRIMARY: skills/active-directory/user-enum
Confidence: 0.92
Manifest: C:\reverse-skill\work\master-route-20241012-153045\route-scope.md

ACTION: Open PRIMARY SKILL.md now and execute ACTION REQUIRED.

```

## Advanced Execution Options

### Specify a Custom Output Directory

By default, the script creates a timestamped folder under `work/`. Override this with `-OutDir`:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\skills\scripts\master-route.ps1 `
  -Hint "detect suspicious network traffic" `
  -OutDir "C:\Temp\incident-response\routing"

```

### Manually Set the Project Root

If automatic detection fails, provide `-ProjectRoot`:

```powershell
powershell -NoProfile -ExecutionPolicy Bypass -File .\skills\scripts\master-route.ps1 `
  -Hint "collect forensic evidence from disk image" `
  -ProjectRoot "D:\Tools\reverse-skill"

```

This parameter directly feeds into `WorkRoot.ps1` (lines 13-18), which determines where the `skills/` directory lives.

## Verifying and Using the Generated Manifest

After execution, inspect the routing decision:

```powershell
Get-Content .\work\master-route-20241012-153045\route-scope.md

```

The manifest contains:

- **PRIMARY** skill path and confidence score
- **SECONDARY** candidates with lower scores
- **HINT** as provided for audit trails
- **ACTION REQUIRED** with specific next steps

Downstream automation reads this file to invoke the correct skill module.

## Routing Configuration Reference

The [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json) file controls all matching behavior. Each route entry defines:

```json
{
  "id": "active-directory/user-enum",
  "keywords": {
    "must": ["active directory", "ad", "users"],
    "mustAll": ["enumerate", "list"],
    "exclude": ["linux", "local"]
  },
  "priority": 1,
  "skillPath": "skills/active-directory/user-enum"
}

```

The script applies these rules at lines 35-52, counting matches and resolving ties via the `priority` array order (lines 54-88).

## Troubleshooting Common Issues

| Symptom | Cause | Solution |
|---------|-------|----------|
| "Cannot load script" error | Execution policy blocking | Add `-ExecutionPolicy Bypass` |
| [`routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.json) not found | Wrong working directory | Run from repository root or use `-ProjectRoot` |
| No PRIMARY skill selected | Hint matches no routes | Check [`routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.json) keywords; verify case-insensitive matching |
| Output folder not created | Missing `work/` directory | The script auto-creates this; check permissions |

## Summary

- **Execute the master routing script on Windows** using PowerShell 5.1+ with `-ExecutionPolicy Bypass` and a descriptive `-Hint`
- The script lives at `skills/scripts/master-route.ps1` and depends on [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json) for all routing decisions
- Output goes to `work/master-route-<timestamp>/route-scope.md` by default, or a custom path via `-OutDir`
- The generated manifest specifies the PRIMARY skill path, confidence score, and required next actions
- No routing logic is hard-coded; all behavior is configurable through JSON

## Frequently Asked Questions

### What PowerShell version do I need to run the master routing script?

PowerShell 5.1 or newer is required. The script uses `ConvertFrom-Json` and modern filesystem APIs that earlier versions lack. Verify with `$PSVersionTable.PSVersion`.

### Can I run the script without changing my execution policy permanently?

Yes. The `-ExecutionPolicy Bypass` parameter applies only to the current session. Your system policy remains unchanged after the script completes.

### Where does the routing script get its matching rules?

All rules live in [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json). The `master-route.ps1` script contains zero hard-coded routes—it loads and evaluates this JSON file at runtime (lines 22-33).

### What happens if my hint doesn't match any defined routes?

The script falls back to a `fallbackId` specified in [`routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.json) (lines 90-98). This ensures every hint receives a routing decision even when keyword matching fails.