How to Manually Trigger the Routing Process in reverse-skill: Complete CLI Guide

You can manually trigger the routing process in reverse-skill by running either skills/scripts/master-route.sh (Linux/macOS) or skills/scripts/master-route.ps1 (Windows) with a --hint or -Hint argument describing your task.

The reverse-skill framework provides thin, platform-neutral wrapper scripts that let you bypass higher-level orchestration and directly execute the Python routing engine. This approach is ideal for debugging, scripting, or CI/CD pipelines where you need deterministic skill selection based on a textual task hint.

How the Routing Engine Works

The routing system follows a single-source-of-truth architecture centered on a JSON configuration file. When you invoke a wrapper script, it performs three core operations: load and validate routing.json, score all routes against your hint using regex matching, and generate a route-scope.md execution plan.

Routing Configuration (skills/config/routing.json)

All routing logic lives in skills/config/routing.json. This file defines:

  • Route definitions: Each route specifies must, mustAll, and exclude regex patterns
  • Priority ordering: The priority array determines tie-breaking when multiple routes score
  • Fallback handling: The fallbackId (typically R0) catches unmatched hints

The router scores each route by matching your supplied hint against these regexes, then selects the highest-scoring candidate. You can inspect the active rules at skills/config/routing.json.

Router Wrapper Scripts

Two equivalent wrappers invoke the same embedded Python logic:

Platform Script Path Interpreter
Linux/macOS/Kali skills/scripts/master-route.sh Bash → Python
Windows skills/scripts/master-route.ps1 PowerShell → Python

Both scripts perform identical steps:

  1. Locate repository roots and verify routing.json exists
  2. Find the system Python interpreter
  3. Pass configuration path, skills root, project root, output directory, and your hint to embedded Python (lines 54–68 in Bash, lines 54–78 in PowerShell)
  4. Execute routing logic and generate output

The Python code evaluates rules, determines the primary route, builds route-scope.md, and prints a console summary (e.g., PRIMARY -> skills/android-decompiler).

Running the Router on Linux and macOS

The Bash wrapper accepts --hint as a required argument with optional overrides for output directory and project root.

Basic Usage

bash skills/scripts/master-route.sh --hint "Analyze an Android APK for hidden code"

With Custom Output Directory

bash skills/scripts/master-route.sh --hint "Find vulnerable endpoints in a GraphQL API" \
    --out-dir /tmp/my-routing-run --project-root $(pwd)

The script creates a timestamped subdirectory under your specified output directory (default: work/master-route-<timestamp>).

Running the Router on Windows

The PowerShell wrapper requires PowerShell 5.1 or newer and uses -Hint as the primary parameter.

Basic Usage

powershell -File skills/scripts/master-route.ps1 -Hint "Enumerate Active Directory objects"

With Optional Parameters

powershell -File skills/scripts/master-route.ps1 -Hint "Detect malicious macros in Office documents" `
    -OutDir "C:\temp\routing" -ProjectRoot "D:\my-project"

Note the backtick (`) for line continuation in PowerShell.

Understanding the Router Output

Both wrappers produce a route-scope.md report in the output directory with the following sections:

  • Hint: The original task description you provided
  • Primary route: Selected skill module path (e.g., skills/reverse-engineering/apk-analyzer)
  • Confidence level: Score-based confidence indicator
  • Secondary candidates: Lower-scoring alternatives for manual review
  • MUST open next checklist: Links to skills/MASTER-ROUTING.md and the selected skill module

Example output location: work/master-route-20230825-151230/route-scope.md

Customizing the Routing Behavior

To modify how hints map to skills, edit skills/config/routing.json directly. Each route entry supports:

  • must: Regex patterns where at least one must match
  • mustAll: Regex patterns where all must match
  • exclude: Disqualifying patterns that veto a route
  • priority: Integer rank for tie-breaking (higher wins)

Changes take effect immediately on the next wrapper invocation—no rebuild or restart required.

Key Source Files in reverse-skill

Summary

  • Use master-route.sh on Unix systems or master-route.ps1 on Windows to manually trigger routing without UI overhead
  • Provide a task hint with --hint or -Hint to drive regex-based route scoring
  • The router reads skills/config/routing.json as its sole configuration source
  • Output lands in route-scope.md with the selected skill, confidence score, and execution checklist
  • Both wrappers embed the same Python logic, ensuring cross-platform consistency

Frequently Asked Questions

What happens if no route matches my hint?

The router falls back to the fallbackId route defined in routing.json (typically R0, a generic skill placeholder). You can customize this behavior by editing the fallbackId field in the configuration.

Can I run the router without the wrapper scripts?

Yes, but you must replicate the wrapper's environment setup. The embedded Python (lines 54–68 in master-route.sh, lines 54–78 in master-route.ps1) shows the exact import paths and function calls. For most use cases, the wrappers are the supported interface.

Where should I place custom skill modules so the router finds them?

Add skill directories under skills/ and register them in routing.json with appropriate regex patterns. The router scans the skills/ root specified by the --skills-root parameter (default: repository's skills/ directory).

Does the router require internet connectivity?

No. All routing decisions are made locally using routing.json and filesystem introspection. No external API calls occur during route selection.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →