How to Use MASTER-ROUTING.md for Primary Skill Selection in reverse-skill
Run skills/scripts/master-route.ps1 with a task hint to automatically select the highest-priority skill directory via MASTER-ROUTING.md's execution contract.
The MASTER-ROUTING.md file in the zhaoxuya520/reverse-skill repository serves as the central routing contract that determines which skill directory should be opened first for any given reverse-engineering task. This markdown contract works in conjunction with a PowerShell automation script to parse natural language hints, evaluate them against a priority table of R identifiers (R0 through R38), and output a deterministic PRIMARY skill path.
Understanding the Routing Chain
MASTER-ROUTING.md defines the execution flow that governs how the repository handles incoming tasks. According to the "读序" section in lines 100-106 of the source file, the complete routing chain follows this sequence:
RULES.md → MASTER-ROUTING.md → PRIMARY SKILL.md
→ (optional) routing.md → tool-index.md → bootstrap → ACT
The execution contract (defined in lines 5-13) requires the router to output three critical components: the PRIMARY skill path, a short rationale for the selection, and the next SKILL.md file to open. This contract ensures that every reverse-engineering or pentest workflow starts in the most appropriate skill area based on keyword detection and priority ordering.
How the Routing Algorithm Works
The PowerShell implementation in skills/scripts/master-route.ps1 implements the logic defined in MASTER-ROUTING.md. The algorithm processes task hints through the following steps:
-
Normalize input: The script converts the user hint to lowercase (
$t) in lines 9-10 to ensure case-insensitive matching. -
Pattern matching: Lines 100-149 contain a series of regex tests that map keywords in the hint to one or more R identifiers (e.g., "APK" maps to R1, "Windows AD" maps to R24).
-
Priority resolution: The script deduplicates matches into
$uniq, then walks a hard-coded priority list ($priority) in lines 156-161 to select the first matching ID as the PRIMARY skill. -
Confidence assignment: The script assigns high confidence if only one R identifier matches, medium if several match (lines 63-70), and low when falling back to R0 (generic reverse-engineering).
-
Route scope generation: The script writes a
route-scope.mdreport containing the timestamp, hint, primary ID and label, confidence level, secondary skill list, and execution notes (lines 96-108).
The R to path mapping is handled by the $map table in lines 12-53 of master-route.ps1, which translates identifiers like R2 to relative paths such as skills/mobile-reverse/SKILL.md.
Practical Usage Examples
Basic Command-Line Routing
To route a task about Android reverse-engineering, execute the PowerShell script with a descriptive hint:
powershell -File skills\scripts\master-route.ps1 -Hint "Analyze an APK, check for packer signatures"
The script outputs a colored console summary:
PRIMARY -> skills/apk-reverse/SKILL.md
Label: APK reverse | confidence: high
Wrote C:\repo\work\master-route-20230801-154200\route-scope.md
ACTION: Open PRIMARY SKILL.md now and execute ACTION REQUIRED.
The generated route-scope.md contains the structured routing decision:
# reverse-skill Master route (PRIMARY)
- created: 2023-08-01T15:42:00.0000000Z
- hint: Analyze an APK, check for packer signatures
- primary: R1
- primary_label: APK reverse
- primary_skill: skills/apk-reverse/SKILL.md
- confidence: high
- secondary: (none)
## MUST open next
1. skills/MASTER-ROUTING.md
2. skills/apk-reverse/SKILL.md
Handling Multi-Keyword Tasks
When a hint matches multiple patterns, the router selects the highest-priority match and lists others as secondary skills:
powershell -File skills\scripts\master-route.ps1 `
-Hint "Collect network traffic (pcap) from a Windows AD environment and look for Kerberos tickets"
This returns R24 (Windows AD) as the PRIMARY with medium confidence, while R21 (protocol reverse) is listed as a secondary skill because the hint matches both AD-related and PCAP-related patterns in the regex tests.
Fallback to Generic Reverse Engineering
If the hint contains no strong keywords, the router defaults to R0:
powershell -File skills\scripts\master-route.ps1 -Hint "Investigate an unknown binary"
The script selects the general reverse-engineering skill (R0) and adds a note to open routing.md for the full keyword matrix (lines 66-68 of master-route.ps1), allowing manual skill selection when automated routing lacks confidence.
Understanding the Route-Scope Output
The route-scope.md file generated by case-init.ps1 serves as the audit trail for routing decisions. This markdown file contains:
- Primary skill: The selected R identifier, human-readable label, and relative path to the
SKILL.mdfile - Confidence level: Indicates routing certainty based on keyword match uniqueness
- Secondary skills: All other matched R identifiers (apart from PRIMARY) for later reference
- Next steps: Ordered list of files to open, starting with
MASTER-ROUTING.mdfollowed by the primarySKILL.md
Open the indicated primary SKILL.md file and follow the ACTION REQUIRED steps inside to begin the actual reverse-engineering workflow.
Key Files in the Routing Pipeline
| File | Purpose |
|---|---|
skills/MASTER-ROUTING.md |
Human-readable contract containing the priority table (R0-R38) and execution steps |
skills/scripts/master-route.ps1 |
PowerShell implementation of the keyword detection and priority algorithm |
skills/scripts/case-init.ps1 |
Initializes cases after routing and writes the route-scope.md report |
skills/ops/routing.md |
Full keyword matrix consulted when the router falls back to R0 |
skills/tool-index.md |
Central index of external tools referenced by all skills |
ops/IDENTITY.md |
Defines the router's operational identity and constraints |
Summary
- MASTER-ROUTING.md acts as the central execution contract that maps natural language task hints to specific skill directories using R identifiers (R0-R38).
- The
master-route.ps1script automates this selection by scanning hints for keywords, deduplicating matches, and selecting the highest-priority match from the hard-coded priority list. - Confidence levels (high, medium, low) indicate match certainty, with automatic fallback to R0 (generic reverse-engineering) when no strong keywords are detected.
- The route-scope.md output file provides an auditable record of routing decisions and specifies the exact
SKILL.mdfiles to open next. - This routing pipeline ensures deterministic, reproducible skill selection for reverse-engineering workflows in the
reverse-skillrepository.
Frequently Asked Questions
What happens if multiple R identifiers match my task hint?
When multiple patterns match, the script assigns medium confidence and selects the identifier that appears first in the hard-coded $priority array (lines 156-161 of master-route.ps1). All other matched IDs are listed as "secondary" skills in the route-scope.md output for potential later use, but only the PRIMARY skill is activated initially.
How do I add a new skill to the MASTER-ROUTING.md priority table?
To add a new skill, you must update three components: add the new R identifier to the priority table in MASTER-ROUTING.md (lines 47-90), create the corresponding regex pattern in master-route.ps1 (lines 100-149), and add the mapping entry to the $map table (lines 12-53) that points to your new SKILL.md file path.
Can I use MASTER-ROUTING.md without the PowerShell script?
Yes. The MASTER-ROUTING.md file is human-readable and contains the full priority table with matching conditions (lines 47-90). You can manually scan the priority list (R1-R38, R0) and select the first identifier that matches your task characteristics, then open the corresponding SKILL.md file directly.
What is the difference between R0 and the other routing identifiers?
R0 represents the generic reverse-engineering fallback skill used when the master-route.ps1 script detects no strong keyword matches (lines 66-68). Unlike specialized identifiers (R1-R38) that map to specific domains like APK reverse or Windows AD, R0 indicates broad applicability and triggers a recommendation to consult ops/routing.md for the full keyword matrix to find more specific guidance.
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 →