# MASTER‑ROUTING.md and routing.md in reverse‑skill: Complete Routing Mechanism Guide

> Understand the dual-layer routing system in reverse-skill with MASTER-ROUTING.md and routing.md. Learn how they map tasks to skill modules for efficient reverse-engineering.

- Repository: [ZhaoXu/reverse-skill](https://github.com/zhaoxuya520/reverse-skill)
- Tags: documentation
- Published: 2026-08-30

---

**`MASTER‑ROUTING.md` and [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md) constitute the dual‑layer routing system that maps security and reverse‑engineering task hints to the correct skill modules, with `MASTER‑ROUTING.md` serving as the primary fast path and [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md) providing a three‑axis disambiguation matrix for resolving ambiguous requests.**

The reverse‑skill repository implements a modular architecture where specialized capabilities are isolated into individual skill directories. At the core of this design, `MASTER‑ROUTING.md` and [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md) in the `skills/` directory define the routing protocols that ensure every task hint—whether "APK decompile" or "JS signature analysis"—is systematically directed to the appropriate [`SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/SKILL.md) implementation without executing unrelated or unsafe actions.

## The Primary Routing Contract in MASTER‑ROUTING.md

`MASTER‑ROUTING.md` serves as the **authoritative source** for primary routing decisions. Described in the source as the "PRIMARY 快路径" (fast path), this document contains the execution contract that the `master‑route` scripts (`skills/scripts/master‑route.ps1` and `skills/scripts/master‑route.sh`) must obey strictly.

The file specifies the **priority order** for route resolution, governs the required pre‑routing steps, and defines fallback behavior when a hint lacks a clear mapping. According to lines 8‑13 of `MASTER‑ROUTING.md`, the protocol guarantees that routing occurs *before* any action is taken and mandates that the appropriate skill's [`SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/SKILL.md) is read prior to execution. This prevents accidental invocation of incorrect tooling.

### Integration with Routing Scripts

The Windows and Unix entry points implement the logic dictated by `MASTER‑ROUTING.md`. These scripts first consult [`config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/config/routing.json) to obtain the **PRIMARY** skill path for a given hint. If the JSON entry is unambiguous, the router immediately opens the corresponding [`SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/SKILL.md) file.

## The Three‑Axis Disambiguation Matrix in routing.md

When [`config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/config/routing.json) cannot resolve a user intent uniquely, the system falls back to the detailed lookup table defined in [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md). This document provides a **three‑axis view** that disambiguates requests by correlating **Target Type ↔ User Intent ↔ Toolchain**.

The matrix enumerates concrete mappings such as:
- `APK` → `apk‑reverse/`
- `JS` → `js‑reverse/`

Each entry includes logic for handling ambiguous or novel requests. Lines 7‑13 of [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md) formalize the **"Routing Execution Protocol"** that ensures systematic verification before execution. When the primary JSON mapping points to multiple candidates (e.g., `R4` for DSL VM tasks), the router consults the matrix row—such as line 75 in [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md)—to select the precise skill path based on the detected toolchain (e.g., `anything‑analyzer MCP`).

### Route Not Matched Handling

Lines 79‑86 of [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md) mandate specific behavior for unmatched hints. Rather than forcing a poor fit, the router must propose creating a *new skill* module when no matrix row matches the request. This preserves the repository's integrity by preventing execution of inappropriate reverse‑engineering workflows.

## How the Routing Workflow Executes

The routing mechanism operates through a four‑step pipeline:

1. **Initialize via master‑route** – The user invokes `master‑route.ps1` (Windows) or `master‑route.sh` (Linux/macOS/Kali) with a `<Hint>` parameter describing the task.

2. **Primary JSON lookup** – The script reads [`config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/config/routing.json) to retrieve the PRIMARY skill path. If the entry is clear and singular, execution proceeds directly to that skill's [`SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/SKILL.md).

3. **Matrix disambiguation** – If the JSON entry is ambiguous (multiple skills match the hint), the script falls back to the three‑axis matrix in [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md). The router matches the target type, user intent, and specified toolchain to select the correct module.

4. **Unmatched handling** – When no matrix row corresponds to the hint, the router follows the "Route Not Matched – Handling" procedure and suggests generating a new skill directory rather than selecting an incorrect existing one.

## Practical Code Examples

### Primary Routing on Windows

Execute the master‑route script with a task hint to trigger the primary fast path:

```powershell
powershell -File skills\scripts\master-route.ps1 -Hint "APK decompile"

```

The script queries [`config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/config/routing.json), identifies the primary entry `apk‑reverse/`, and opens `apk‑reverse/SKILL.md` for execution.

### Primary Routing on Linux and macOS

For Unix‑based systems, use the Bash equivalent:

```bash
bash skills/scripts/master-route.sh --hint "JS signature analysis"

```

If the JSON entry for "JS" is ambiguous, the script automatically consults [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md) to decide between `js‑reverse/` or `js‑reverse/jshookmcp` based on the detected toolchain context.

### Fallback Disambiguation with the Matrix

When the hint requires toolchain‑specific resolution, the router uses the three‑axis matrix. For example, a "DSL VM reverse" task with a specific toolchain selection:

```bash
bash skills/scripts/master-route.sh --hint "DSL VM reverse" --toolchain "anything-analyzer"

```

The router reads the matrix row (line 75 in [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md)) and selects `reverse‑engineering/dsl‑vm‑reverse/SKILL.md` instead of the generic mapping.

### Handling Unmatched Hints

For novel tasks without existing mappings, the system proposes skill creation:

```bash
bash skills/scripts/master-route.sh --hint "Quantum-resistant crypto analysis"

```

Following the protocol in [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md) (lines 79‑86), the output indicates: `"No matching skill found. Propose a new skill: quantum‑crypto‑reverse/"`.

### Verifying Routing Coherence

After editing the routing tables, validate that the matrix and JSON remain synchronized:

```powershell
powershell -File skills\scripts\verify-routing-coherence.ps1

```

## Summary

- **`MASTER‑ROUTING.md`** defines the primary fast path and execution contract that `master‑route.ps1` and `master‑route.sh` must follow, ensuring routing precedes all actions.
- **[`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md)** provides the three‑axis disambiguation matrix (Target Type ↔ User Intent ↔ Toolchain) for resolving ambiguous hints when [`config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/config/routing.json) yields multiple candidates.
- The **Routing Execution Protocol** (lines 7‑13 of [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md) and lines 8‑13 of `MASTER‑ROUTING.md`) mandates reading the target [`SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/SKILL.md) before execution to prevent unsafe operations.
- When no match exists, the system follows the **Route Not Matched** procedure (lines 79‑86) to propose new skill creation rather than forcing incorrect matches.
- Use **`verify‑routing‑coherence.ps1`** to validate routing integrity after modifying [`config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/config/routing.json) or [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md).

## Frequently Asked Questions

### What is the difference between MASTER‑ROUTING.md and routing.md in reverse‑skill?

`MASTER‑ROUTING.md` serves as the primary routing contract and fast path, defining how `master‑route.ps1` and `master‑route.sh` must interpret [`config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/config/routing.json) and execute the priority‑ordered routing logic. In contrast, [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md) functions as a secondary disambiguation layer containing the three‑axis matrix used only when the primary JSON mapping cannot uniquely resolve the user intent.

### How does the routing system handle ambiguous task hints?

When [`config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/config/routing.json) returns multiple candidate skills for a hint, the routing scripts fall back to the three‑axis matrix in [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md). This matrix evaluates the intersection of Target Type, User Intent, and Toolchain to select the precise skill module, such as choosing between `js‑reverse/` and `js‑reverse/jshookmcp` based on the detected analysis environment.

### What happens when no skill matches the task hint?

If neither the primary JSON nor the three‑axis matrix contains a matching entry, the router invokes the "Route Not Matched – Handling" protocol defined in lines 79‑86 of [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md). Rather than executing an incorrect skill, the system outputs a proposal to create a new skill directory (e.g., suggesting `quantum‑crypto‑reverse/` for novel cryptographic analysis tasks).

### How can I verify routing coherence after modifications?

Run the `skills/scripts/verify‑routing‑coherence.ps1` script (or its Unix equivalent if available) to ensure that changes to [`config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/config/routing.json) remain synchronized with the disambiguation rules in [`routing.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.md) and the execution contracts in `MASTER‑ROUTING.md`. This verification prevents routing failures caused by mismatched primary and secondary routing layers.