# What Is the Role of the Top-Level SKILL.md in the Patent-Disclosure-Skill Architecture?

> Discover the critical role of the top-level SKILL.md in the patent-disclosure-skill architecture. Learn how it routes intents and defines skill metadata for the repository.

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

---

**The top-level [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) serves as the central routing manifest and master dispatcher for the entire patent-disclosure-skill repository, defining skill metadata and mapping user intents to sub-skill entry points.**

In the `handsomestWei/patent-disclosure-skill` repository, the top-level [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) file functions as the architectural backbone that enables the platform to expose, route, and execute patent-related automation skills. This file adheres to the Instagit skill specification and acts as the single source of truth for how the system interprets user requests and delegates work to specialized sub-modules.

## SKILL.md as the Master Routing Manifest

The primary responsibility of the top-level [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) is **orchestrating intent-based routing** across six distinct patent workflow capabilities. According to the "路由" (routing) section in the source file, this document is explicitly designated as the **"子技能路由入口"**—the sub-skill routing entry point where the runtime first resolves which specialized module to invoke.

The file establishes this through three structural components:

- **Metadata header** (lines 1-8): Declares the skill name, description, version, and platform invocation settings required for discovery.
- **Capability table** (lines 14-21): Maps each high-level user intent to its corresponding sub-skill's [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) path.
- **Environment conventions** (lines 43-49): Specifies shared runtime parameters including output directories, language defaults, and script paths that all sub-skills inherit.

## Routing Table and Capability Mapping

The capability table within [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) implements a direct intent-to-path mapping for six patent workflows:

| User Intent | Sub-Skill Path |
|-------------|----------------|
| 交底 (disclosure) | [`skills/patent-disclosure/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/SKILL.md) |
| 申请文件 (application documents) | [`skills/patent-application/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-application/SKILL.md) |
| 检索 (search) | [`skills/patent-search/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-search/SKILL.md) |
| 解读 (interpretation) | [`skills/patent-reader/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-reader/SKILL.md) |
| 审查答复 (OA response) | [`skills/patent-oa/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-oa/SKILL.md) |
| 政策简报 (policy brief) | [`skills/patent-exam-policy/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-exam-policy/SKILL.md) |

This declarative approach allows the platform to dynamically load the appropriate sub-skill without hardcoding paths in the runtime itself.

## Environment Conventions and Shared Configuration

Beyond routing, the top-level [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) enforces **cross-cutting operational standards** through its environment configuration section. These conventions ensure consistent behavior across all sub-skills:

- Standardized output directory structures
- Default language settings for generated documents
- Relative paths to shared utility scripts

By centralizing these parameters, the architecture eliminates configuration drift and reduces the operational burden on individual sub-skill developers.

## Practical Implementation Example

The routing mechanism can be implemented by parsing the YAML structure of [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) and resolving intents at runtime:

```python
import yaml
import pathlib

def load_skill_manifest(repo_root: pathlib.Path) -> dict:
    """Parse the top-level SKILL.md as YAML routing manifest."""
    skill_path = repo_root / "SKILL.md"
    with open(skill_path, "r", encoding="utf-8") as f:
        return yaml.safe_load(f)

def resolve_intent_route(manifest: dict, intent: str) -> str | None:
    """Extract sub-skill entry point from capability table."""
    capabilities = manifest.get("capabilities", {})
    for cap in capabilities:
        if cap.get("name") == intent:
            return cap.get("entry_point")
    return None

# Usage

manifest = load_skill_manifest(pathlib.Path("."))
sub_skill_path = resolve_intent_route(manifest, "检索")
print(f"Resolved to: {sub_skill_path}")  # skills/patent-search/SKILL.md

```

## Sub-Skill Architecture Overview

Each mapped path points to an independent sub-skill with its own encapsulated [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md), following the same specification format but implementing domain-specific logic:

- [`skills/patent-disclosure/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/SKILL.md) — Technical disclosure drafting workflow
- [`skills/patent-application/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-application/SKILL.md) — Patent application document generation
- [`skills/patent-search/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-search/SKILL.md) — Bibliographic and prior art search
- [`skills/patent-reader/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-reader/SKILL.md) — Patent text analysis and summarization
- [`skills/patent-oa/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-oa/SKILL.md) — Office Action response preparation
- [`skills/patent-exam-policy/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-exam-policy/SKILL.md) — Examination policy brief generation

This modular design allows independent development, testing, and deployment of each patent workflow while maintaining unified discovery and invocation semantics through the top-level manifest.

## Summary

- The top-level [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) in `handsomestWei/patent-disclosure-skill` is the **central routing manifest** that declares skill metadata and capability mappings.
- It implements **intent-based routing** through a declarative capability table pointing to six specialized sub-skills.
- The **"路由" section** explicitly designates this file as the sub-skill routing entry point for the platform runtime.
- **Environment conventions** defined here ensure consistent output handling and shared resource paths across all sub-modules.

## Frequently Asked Questions

### How does the platform know which sub-skill to execute?

The platform parses the capability table in the top-level [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) and matches the user's intent string against the `name` field of each capability entry. The corresponding `entry_point` value provides the relative path to the sub-skill's own [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) file, which the runtime then loads and executes.

### Can sub-skills override the environment conventions from the top-level SKILL.md?

Sub-skills inherit the base environment conventions but may define additional or overriding parameters in their own [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) files. The platform typically merges these configurations with the top-level defaults, allowing specialization while maintaining baseline consistency.

### What happens if a user intent does not match any capability in the table?

The source analysis indicates that unmatched intents would fall outside the defined routing scope. Platform implementations typically handle this through fallback behaviors—either returning an error to the user, invoking a default sub-skill, or delegating to a general-purpose handler depending on the Instagit runtime configuration.