# How the Main Router in SKILL.md Directs Patent-Disclosure Skill Requests

> Discover how the main router in SKILL.md manages patent disclosure skill requests by inspecting commands, validating targets, and dispatching to sub-skills.

- Repository: [handsomestWei/patent-disclosure-skill](https://github.com/handsomestWei/patent-disclosure-skill)
- Tags: internals
- Published: 2026-09-08

---

**The main router in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) acts as a policy gatekeeper that inspects user commands, validates explicit sub-skill targeting, enforces package isolation, and dispatches requests to the appropriate sub-skill's own [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) file.**

The [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) file at the root of the **handsomestWei/patent-disclosure-skill** repository serves as the central routing engine for the entire patent-disclosure skill suite. Understanding how this main router in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) works is essential for extending the system or integrating it with client applications. The router implements a strict six-step verification flow that guarantees predictable behavior and prevents cross-skill contamination.

## Intent Recognition and Capability Matching

The router begins by inspecting the user's intent against a **capability table** defined in the root [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) (lines 16-22). Each row in this table maps a specific trigger phrase to a target sub-skill entry file.

When a request arrives with the `Read` intent, the router matches the command string against trigger phrases such as `/patent-disclosure`, `/patent-application`, `/patent-search`, `/patent-docket`, `/patent-oa`, or `/patent-exam-policy`. Upon finding a match, the router identifies the corresponding entry [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) path (e.g., [`skills/patent-disclosure/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/SKILL.md)) that should handle the request.

## Explicit Naming Requirements for High-Level Workflows

For complex workflows including **application file generation**, **docket orchestration**, **policy brief creation**, and **Office Action (OA) responses**, the router enforces a strict explicit naming rule (lines 27-33 in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md)).

If the user invokes a high-level command without explicitly naming the target sub-skill, the router aborts the flow immediately. Instead of proceeding with ambiguous context, it returns a prompt requiring the user to specify which sub-skill they intend to invoke. This prevents accidental execution of resource-intensive workflows like full patent application generation.

## Read-Only Shortcuts for Patent Documents

The router implements a priority shortcut for **read-only flows** (lines 28-30). When the input consists of a patent number (e.g., `CN1234567A`) or a PDF file reference, and the intent is classified as "read", the router bypasses the standard disclosure workflow entirely.

In this scenario, the request is immediately forwarded to [`skills/patent-reader/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-reader/SKILL.md) without traversing the disclosure steps. This optimization ensures that document summarization and analysis tasks execute with minimal latency and without triggering unnecessary disclosure protocols.

## Cross-Package Isolation Guards

To maintain clean architectural boundaries, the router enforces a **cross-package call prohibition** (lines 26-27). The system bans any import of tools or utilities from sibling sub-skill packages. Each sub-skill must rely exclusively on its own local copies of prompts, tools, and helper functions.

This isolation guard prevents side effects where one sub-skill's configuration might inadvertently alter another's behavior. When the router dispatches to [`skills/patent-application/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-application/SKILL.md), that sub-skill operates in a sealed environment using only its bundled resources.

## Dispatch and Post-Routing Validation

Once the router validates the command and confirms explicit naming (where required), it performs a `Read` operation on the selected sub-skill's [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) file. Control then transfers completely to that sub-skill, which manages its own detailed workflow—whether that involves the eight-step disclosure process, four-document application bundle generation, or docket orchestration.

After the sub-skill completes execution, the router performs **post-routing checks** (lines 48-53). It verifies that all required outputs are written to the designated `outputs/` subdirectory (e.g., `outputs/patent-application/`, `outputs/docket/`) and confirms that no prohibited side-effects have occurred outside the skill's sandbox.

## Practical Routing Examples

The following Python examples demonstrate how client applications interact with the router's decision flow:

```python

# Triggering the full Disclosure workflow

request = {
    "intent": "Read",
    "command": "/patent-disclosure",
    "args": {"project_path": "/my/patent_project"}
}
router.handle(request)  # Dispatches to skills/patent-disclosure/SKILL.md

```

```python

# Direct read of a patent PDF bypasses disclosure steps

request = {
    "intent": "Read",
    "command": "CN1234567A",
    "args": {}
}
router.handle(request)  # Shortcuts directly to skills/patent-reader/SKILL.md

```

```python

# Blocked request due to missing explicit naming

request = {
    "intent": "Read",
    "command": "/policy-brief"
}
router.handle(request)  # Router aborts and prompts for explicit skill name

```

## Sub-Skill Architecture and File Structure

The router manages dispatch to seven specialized sub-skills, each contained in its own directory under `skills/`:

- [`skills/patent-disclosure/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/SKILL.md) – Handles the end-to-end disclosure process (steps 1-8)
- [`skills/patent-application/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-application/SKILL.md) – Generates the four-document application bundle (claims, specification, abstract, drawings)
- [`skills/patent-docket/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-docket/SKILL.md) – Orchestrates full docket workflows (disclosure through application) in a single pass
- [`skills/patent-search/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-search/SKILL.md) – Performs bibliographic searches and constructs search queries
- [`skills/patent-reader/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-reader/SKILL.md) – Reads patent PDFs and produces plain-language summaries
- [`skills/patent-oa/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-oa/SKILL.md) – Supports Office Action response drafting
- [`skills/patent-exam-policy/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-exam-policy/SKILL.md) – Generates policy briefs and examination policy updates

Each sub-skill maintains its own isolated [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) that defines granular workflow steps, while the root [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) maintains the high-level routing matrix that binds trigger commands to these files.

## Summary

- The main router in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) implements a six-step verification flow: intent matching, explicit naming enforcement, read-only shortcut evaluation, cross-package isolation checks, sub-skill dispatch, and post-execution validation.
- High-level workflows require explicit sub-skill naming; ambiguous commands are rejected with clarification prompts.
- Patent numbers and PDF inputs trigger immediate routing to the Reader skill, bypassing disclosure workflows entirely.
- Strict package isolation prevents sub-skills from importing tools from sibling directories, ensuring clean architectural boundaries.
- All sub-skills route through dedicated [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) files located in `skills/patent-{name}/` directories, with outputs strictly confined to `outputs/patent-{name}/` subdirectories.

## Frequently Asked Questions

### What happens if I invoke a patent command without specifying the sub-skill name?

The router blocks the execution and returns a prompt asking you to explicitly name the target sub-skill. According to the routing logic in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) (lines 27-33), high-level workflows such as application generation or policy brief creation require unambiguous targeting to prevent accidental resource consumption.

### Can sub-skills share utility functions or tools across packages?

No. The router explicitly bans cross-package imports (lines 26-27 in [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md)). Each sub-skill must maintain its own local copy of utilities, prompts, and tools. This design prevents side effects and ensures that modifications to one sub-skill cannot inadvertently break others.

### How does the router handle patent numbers versus workflow commands?

When the router detects a patent number (e.g., `CN1234567A`) or PDF reference with a `Read` intent, it immediately shortcuts to [`skills/patent-reader/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-reader/SKILL.md) without invoking the disclosure workflow. This read-only optimization (lines 28-30) ensures document analysis occurs with minimal overhead compared to full disclosure processing.

### Where does the router store outputs after a sub-skill completes execution?

The router enforces a strict output convention requiring all generated files to reside in `outputs/patent-{subskill}/` directories (lines 48-53). For example, application documents must appear under `outputs/patent-application/`, while docket outputs belong in `outputs/docket/`. The router validates these locations during post-routing checks.