# What Is the Purpose of SKILL.md in the Patent Disclosure Skill Repository?

> Discover the purpose of SKILL.md in the patent disclosure skill repository. It defines skill metadata, routing, and permissions for efficient module management.

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

---

**SKILL.md functions as the declarative manifest file that defines metadata, routing tables, and execution permissions for each skill module within the handsomestWei/patent-disclosure-skill repository.**

The [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) files serve as the backbone of this modular AI skill architecture, eliminating hard-coded configuration by describing capabilities in YAML front-matter. Located at both the repository root and within individual sub-directories, these files enable the conversational AI runtime to automatically discover available tools, route user intents to the correct handlers, and enforce security constraints without modifying Python source code.

## Root Level Manifest and Intent Routing

At the repository root, [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) defines the global skill package metadata including **name**, **description**, **version**, and the critical **routing table**. This top-level manifest maps Chinese user intents to specific sub-skill entry points:

- **交底** (disclosure) → [`skills/patent-disclosure/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/SKILL.md)
- **检索** (search) → [`skills/patent-search/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-search/SKILL.md)
- **解读** (reading) → [`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)

The content of this root manifest acts as the single source of truth for the AI router to determine which entry point to invoke based on natural language input.

## Sub-Skill Metadata and Constraints

Inside each sub-directory, a sibling [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) provides granular metadata for that specific capability. According to the repository structure found in `skills/patent-disclosure`, `skills/patent-search`, `skills/patent-reader`, `skills/patent-oa`, and `skills/patent-exam-policy`, these files declare:

- **name** and **description** for UI display and discovery
- **argument-hint** to guide parameter collection
- **allowed-tools** restricting execution to specific operations (**Read**, **Write**, **Edit**, **Grep**, **Glob**, **WebSearch**, **Bash**)
- **pre-execution checks** for validation logic

This declarative approach allows the runtime loader to automatically expose capabilities while enforcing constraints without embedding logic in Python scripts.

## Implementing Dynamic Skill Loading

The YAML front-matter structure enables programmatic discovery of skill capabilities. The runtime parses these files to build the execution context:

```python
import yaml, pathlib, json

def load_skill_meta(root, sub):
    path = pathlib.Path(root) / sub / "SKILL.md"
    with open(path) as f:
        # The file is a YAML front-matter block followed by markdown.

        # yaml.safe_load extracts the header.

        meta = yaml.safe_load(f)
    return meta

# Usage

root = "/cache/repos/github.com/handsomestWei/patent-disclosure-skill/main"
disclosure_meta = load_skill_meta(root, "skills/patent-disclosure")
print(json.dumps(disclosure_meta, ensure_ascii=False, indent=2))

```

This pattern ensures that adding new patent processing capabilities requires only creating a new sub-directory with a [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) file, not modifying the core loader logic.

## Intent Routing Logic

The routing mechanism uses the root manifest to dispatch requests to the appropriate sub-skill implementation:

```python
import re, pathlib, yaml

def route_intent(intent):
    # Load the top-level manifest

    top_path = pathlib.Path("/cache/repos/github.com/handsomestWei/patent-disclosure-skill/main/SKILL.md")
    with open(top_path) as f:
        manifest = yaml.safe_load(f)

    # Simple mapping defined in the manifest table (lines 14-20)

    table = {
        "交底": "skills/patent-disclosure/SKILL.md",
        "检索": "skills/patent-search/SKILL.md",
        "解读": "skills/patent-reader/SKILL.md",
        "审查答复": "skills/patent-oa/SKILL.md",
        "政策简报": "skills/patent-exam-policy/SKILL.md",
    }
    for key, md_path in table.items():
        if re.search(key, intent):
            return md_path
    return None

# Example call

print(route_intent("我要进行专利检索"))

# → skills/patent-search/SKILL.md

```

This implementation decouples the conversational interface from the specific skill implementations, allowing the repository to function as a self-describing skill suite.

## Summary

- **SKILL.md** acts as a declarative configuration file that describes what each skill does and how it should be invoked.
- The **root manifest** maintains the routing table that maps user intents (交底, 检索, 解读, 审查答复, 政策简报) to specific sub-skill paths like [`skills/patent-disclosure/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-disclosure/SKILL.md).
- **Sub-skill manifests** specify execution constraints including **allowed-tools** and argument hints, ensuring safe operation.
- This architecture enables automatic skill discovery and validation without hard-coding capabilities into the Python runtime.

## Frequently Asked Questions

### What information does the root SKILL.md contain compared to sub-skill files?

The root [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) defines the overall package metadata—**name**, **description**, **version**—and the **routing table** that maps Chinese user intents to sub-skill paths. Sub-skill [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) files contain specific capability metadata such as **argument-hint**, **allowed-tools**, and **pre-execution checks** for their respective domains like patent disclosure or OA response drafting.

### Which tools can be restricted via the allowed-tools field in SKILL.md?

According to the repository configuration, the **allowed-tools** field can restrict execution permissions to specific operations including **Read**, **Write**, **Edit**, **Grep**, **Glob**, **WebSearch**, and **Bash**. This ensures each skill operates within its defined security boundaries.

### How does the AI determine which sub-skill to invoke?

The AI loads the root [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) manifest and matches the user's natural language input against the routing table keywords (交底 for disclosure, 检索 for search, etc.). Once matched, it routes the request to the corresponding [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) path (e.g., [`skills/patent-search/SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/skills/patent-search/SKILL.md)) to load that sub-skill's specific metadata and execution parameters.

### Why use YAML front-matter in SKILL.md instead of JSON configuration?

Using **YAML front-matter** allows [`SKILL.md`](https://github.com/handsomestWei/patent-disclosure-skill/blob/main/SKILL.md) to serve dual purposes: it remains human-readable documentation while being machine-parseable. The YAML header contains structured metadata for the runtime, while the remaining Markdown content can provide extended documentation for developers, creating a self-documenting configuration system.