Where to Find the Routing Rules for reverse-skill: Complete Guide to skills/config/routing.json
The routing rules for reverse-skill are defined in skills/config/routing.json, a declarative JSON manifest that serves as the single source of truth for mapping user hints to platform-specific skill scripts.
The reverse-skill repository implements a centralized routing architecture that separates dispatch logic from execution logic. Understanding the location and structure of these routing rules is essential for customizing skill invocation behavior or debugging dispatch failures across Windows, Linux, and macOS environments.
The Core Routing Manifest
The authoritative routing configuration resides in skills/config/routing.json. This file contains the complete mapping of user intents (hints) to the specific commands or scripts that should execute on each supported operating system.
JSON Structure and Schema
The manifest organizes routing data hierarchically by hint and platform. Each top-level key represents a user-provided hint (e.g., "pentest", "reverse-engineer"), with nested objects specifying the exact command strings for "windows", "linux", or "macos" platforms.
According to the reverse-skill source code, the structure follows this pattern:
{
"pentest": {
"windows": "powershell.exe -File skills/scripts/pentest.ps1",
"linux": "bash skills/scripts/pentest.sh"
},
"reverse-engineer": {
"linux": "python3 skills/scripts/reverse_engineer.py",
"windows": "python.exe skills/scripts/reverse_engineer.py"
}
}
Because the routing rules are expressed in declarative JSON, they can be version-controlled and updated without touching executable code.
How the Routing System Executes
The platform relies on wrapper scripts to consume the JSON manifest and dispatch commands dynamically at runtime.
Master Route Scripts
The skills/scripts/master-route.sh and skills/scripts/master-route.ps1 files function as the primary entry points for the reverse-skill platform. These scripts perform three critical operations:
- Parse the hint from command-line arguments
- Detect the host operating system
- Query
routing.jsonfor the matching platform-specific command and execute it
Validation and Testing
The integrity of the routing system is maintained by skills/scripts/test-routing.sh and skills/scripts/test-routing.ps1. These automated test harnesses verify that every hint-platform combination defined in the manifest resolves to an existing script file on the filesystem.
Additionally, skills/config/routing-benchmark.json contains benchmark data used by the test suite to ensure routing parity and performance consistency across platforms.
Querying Routing Rules Programmatically
You can inspect and manipulate the reverse-skill routing rules using standard tools without loading the execution framework.
Loading Rules with Python
Access the routing configuration using only the Python standard library:
import json
from pathlib import Path
# Path to the routing manifest inside the repository
routing_path = Path(__file__).parent.parent / "skills" / "config" / "routing.json"
with routing_path.open(encoding="utf-8") as f:
routing = json.load(f)
# Example: retrieve the command for a Linux "reverse-engineer" hint
hint = "reverse-engineer"
platform = "linux"
command = routing.get(hint, {}).get(platform)
print(f"The command for '{hint}' on {platform} is: {command}")
Querying with jq
Extract specific routing rules from the shell using jq for quick inspection:
jq '.["pentest"]["windows"]' skills/config/routing.json
Dynamic Dispatch in Bash
Implement runtime routing in custom scripts by parsing the JSON manifest dynamically:
#!/usr/bin/env bash
# Assume $HINT contains the user-provided hint and $OS is detected earlier
RULES_FILE="skills/config/routing.json"
CMD=$(jq -r --arg h "$HINT" --arg o "$OS" '.[$h][$o]' "$RULES_FILE")
if [[ -z "$CMD" || "$CMD" == "null" ]]; then
echo "No routing rule for hint '$HINT' on OS '$OS'"
exit 1
fi
eval "$CMD"
Summary
- The routing rules for reverse-skill are centralized in
skills/config/routing.json, which functions as the single source of truth for all dispatch decisions. - Master route scripts (
skills/scripts/master-route.shandmaster-route.ps1) consume this manifest to execute platform-appropriate commands based on user hints. - Test harnesses (
test-routing.shandtest-routing.ps1) validate that every configured rule resolves to an existing script file. - The declarative JSON format enables safe modification using standard tools like Python or
jq, with built-in testing to ensure routing consistency across Windows, Linux, and macOS.
Frequently Asked Questions
Where exactly are the reverse-skill routing rules stored?
The routing rules are stored at skills/config/routing.json in the repository root. This file contains the authoritative mapping of user hints (such as "pentest" or "reverse-engineer") to platform-specific command strings for Windows, Linux, and macOS execution environments.
How do I add a new routing rule to reverse-skill?
To add a new routing rule, edit skills/config/routing.json and insert your hint as a top-level key with nested platform keys (e.g., "windows", "linux") containing the exact command strings. After saving, run skills/scripts/test-routing.sh (on Unix systems) or test-routing.ps1 (on Windows) to verify the new mapping points to an existing executable script.
What happens if a hint is not found in routing.json?
If the master route scripts cannot locate a matching hint or platform combination in routing.json, they exit with an error indicating no valid routing rule exists. When implementing custom dispatch logic, always check for null or empty string returns from your JSON query, as demonstrated in the Bash example above, to handle missing routes gracefully.
Can I use the reverse-skill routing system in my own projects?
Yes, the routing system is entirely self-contained. You can import skills/config/routing.json into any application using standard JSON parsing libraries. The simple hint-platform-command schema requires no dependencies on reverse-skill-specific code, making it portable to Python, Go, Node.js, or shell environments.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →