# What Is the Fallback Rule in reverse-skill for Unmatched Tasks?

> Discover the fallback rule in reverse-skill for unmatched tasks. Learn how unmatched tasks trigger a propose-new-skill policy to ensure proper routing and avoid forced fits.

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

---

**When the reverse-skill router encounters a task that does not match any existing entry in the routing table, it does not attempt to force-fit the task into an available skill; instead, it enforces a "propose-new-skill" policy that requires developers to create a new routing entry in [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json).**

The reverse-skill framework governs task delegation through a strict canonical behavior chain documented in [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md). This architecture ensures that skill boundaries remain intact by refusing ambiguous classifications. When the master router fails to locate a matching hint in the configuration, it triggers a specific fallback protocol designed to maintain system integrity while guiding skill extension.

## How the Fallback Rule Works

The fallback mechanism is explicitly defined in the **Routing Decisions** section of [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md) (lines 171-176). According to the source code, the rule states:

> "Route not matched → do NOT force‑fit into existing skill, propose new skill creation"

This directive prevents the framework from misrouting ambiguous or novel tasks into inappropriate skill pipelines. Instead of heuristic matching or fuzzy assignment, the system halts execution and prompts for explicit configuration updates.

### The "Propose-New-Skill" Policy

When triggered, the fallback rule initiates the following chain of events:

1. **Recognition** – The [`master-route.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/master-route.sh) script queries [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json) and finds zero matches for the provided task hint.
2. **Intervention** – The router outputs a warning: `"⚠️ No matching route – please create a new skill."`
3. **Creation** – The developer must define a new skill directory, populate it with a [`SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/SKILL.md) descriptor, and register the route.
4. **Validation** – The routing table is updated, and the tool index is refreshed to incorporate any new dependencies.

This policy ensures that every task flows through an explicitly defined workflow rather than an inferred or approximated path.

## Implementing the Fallback Workflow

When the fallback rule activates, developers must execute a specific sequence to integrate the new task type. Below is the canonical procedure for handling an unmatched task.

### Running the Master Router

First, invoke the primary entry point to confirm the route miss:

```bash
bash skills/scripts/master-route.sh --hint "analyse unknown-file.xyz"

```

If the hint `"analyse unknown-file.xyz"` does not exist in [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json), the script will print the fallback warning and exit without executing any skill logic.

### Creating a New Skill Stub

Next, create the skill directory and metadata. For example, to handle a "binary-obfuscation" task:

```bash
mkdir -p skills/binary-obfuscation

cat > skills/binary-obfuscation/SKILL.md <<'EOF'

# Binary Obfuscation

## Description

Detect and de‑obfuscate custom binary packers.

## Workflow

1. Identify packer → 2. Unpack → 3. Analyse → 4. Report
EOF

```

### Updating the Routing Configuration

Finally, register the new skill in the routing table using `jq`:

```bash
jq '.routes += [{"hint":"binary-obfuscation","skill":"binary-obfuscation"}]' \
    skills/config/routing.json > tmp && mv tmp skills/config/routing.json

```

After updating the configuration, refresh the shared tool index if the new skill introduces additional dependencies:

```bash
bash skills/scripts/refresh-tool-index.sh

```

## Key Files Involved in the Fallback Mechanism

The fallback rule is implemented across four critical components:

- **[`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md)** – Contains the canonical behavior chain and the explicit fallback directive at lines 171-176.
- **[`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json)** – The single source of truth for route mappings; edited whenever a fallback occurs.
- **[`skills/scripts/master-route.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/scripts/master-route.sh)** – The primary router that enforces the fallback logic by consulting [`routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.json).
- **[`skills/scripts/refresh-tool-index.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/scripts/refresh-tool-index.sh)** – Updates the shared tool registry after new skill creation.

## Summary

- The **fallback rule** in reverse-skill triggers when a task hint cannot be matched in [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json).
- The framework **explicitly prohibits** force-fitting unmatched tasks into existing skills.
- Developers must follow the **"propose-new-skill"** policy by creating a skill directory and updating the routing table.
- The canonical behavior is documented in **[`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md)** and enforced by **[`master-route.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/master-route.sh)**.
- New skills require both a **[`SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/SKILL.md)** descriptor and an entry in **[`routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.json)**.

## Frequently Asked Questions

### What happens if I try to force an unmatched task into an existing skill?

The reverse-skill framework strictly prevents this behavior. According to [`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md), the router will refuse to execute and will output a fallback warning instead of routing to the closest match. This design prevents contamination of skill-specific logic with incompatible tasks.

### Where is the fallback rule documented in the source code?

The rule is documented in **[`RULES.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/RULES.md)** within the *Routing Decisions* section, specifically at lines 171-176. The source text explicitly states: "Route not matched → do NOT force‑fit into existing skill, propose new skill creation."

### How do I create a new skill when the fallback triggers?

Create a new directory under `skills/`, add a [`SKILL.md`](https://github.com/zhaoxuya520/reverse-skill/blob/main/SKILL.md) file describing the workflow, then append the route to [`skills/config/routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/config/routing.json) using a JSON manipulation tool like `jq`. Finally, run [`skills/scripts/refresh-tool-index.sh`](https://github.com/zhaoxuya520/reverse-skill/blob/main/skills/scripts/refresh-tool-index.sh) to update dependencies.

### Does the fallback mechanism affect existing routing entries?

No. The fallback rule is non-destructive. It only triggers for unmatched hints and does not modify existing routes in [`routing.json`](https://github.com/zhaoxuya520/reverse-skill/blob/main/routing.json). The framework preserves all current skill mappings while requiring explicit additions for new task types.