# Understanding SKILL.md in Agent Reach AI Agent Tool Selection

> Discover how SKILL.md in Agent Reach AI dynamically maps user requests to CLI tools. Understand its vital role in agent tool selection for flexible, intelligent automation. Learn more now!

- Repository: [Pnant/Agent-Reach](https://github.com/Panniantong/Agent-Reach)
- Tags: internals
- Published: 2026-07-15

---

**SKILL.md serves as the central skill definition file that maps natural-language user requests to specific downstream CLI tools and commands, enabling Agent Reach AI agents to dynamically route requests without hard-coded logic.**

The [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md) file in the Panniantong/Agent-Reach repository functions as the single source of truth for AI-agent tool selection. Located at [`agent_reach/skill/SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/skill/SKILL.md), this configuration file defines intents, trigger keywords, and routing tables that instruct the agent exactly which commands to execute for any given user request. The file ships with the package as verified in [`.github/workflows/pytest.yml`](https://github.com/Panniantong/Agent-Reach/blob/main/.github/workflows/pytest.yml), ensuring consistent behavior across installations.

## What is SKILL.md?

SKILL.md is a markdown-based skill definition file that bridges natural language understanding and tool execution in the Agent Reach framework. The file lives at [`agent_reach/skill/SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/skill/SKILL.md) and is packaged with the distribution, ensuring every installation includes the latest routing configuration.

The document consists of two critical sections: a YAML frontmatter header containing intent definitions and trigger keywords, followed by a routing table that links each intent category to specific reference markdown files containing executable commands.

## How SKILL.md Drives AI Agent Tool Selection

### Intent Detection Through YAML Triggers

The top-level YAML header in SKILL.md defines the **intent detection** system. It specifies trigger keywords that map user utterances to specific action categories. According to the source code at lines 22-38, the file defines intents such as "research", "search", "social", "career", "dev", "web", "video", and "finance", each associated with specific Chinese and English trigger phrases.

```yaml

# agent_reach/skill/SKILL.md (YAML header)

triggers:
  - research: 调研/全网调研/帮我调研/研究一下/research/深入了解
  - search: 搜/查/找/search/搜索/查一下/帮我搜/看看大家怎么说
  - social: 发/推/tweet/分享/社交/发布

```

When a user sends a request like "帮我调研 AI trends" (help me research AI trends), the Agent Reach core logic matches the trigger keywords against the utterance to classify the intent as "research".

### The Routing Table Architecture

Below the YAML header, SKILL.md contains a **routing table** that links each intent category to reference documentation files. As shown in lines 60-69 of the source, these references point to markdown files in the `references/` directory, such as [`references/social.md`](https://github.com/Panniantong/Agent-Reach/blob/main/references/social.md) or [`references/search.md`](https://github.com/Panniantong/Agent-Reach/blob/main/references/search.md).

Each reference file enumerates platform-specific CLI commands the agent should execute. For example, [`references/social.md`](https://github.com/Panniantong/Agent-Reach/blob/main/references/social.md) defines commands for Twitter, XHS (Xiaohongshu), Reddit, and BiliBili, while [`references/search.md`](https://github.com/Panniantong/Agent-Reach/blob/main/references/search.md) defines web search commands using backends like Exa.

```bash

# From references/search.md

mcporter call 'exa.web_search_exa(query="AI research trends", num_results=10)'

# From references/social.md  

twitter search "AI research trends" -n 10

```

## Technical Implementation in Agent Reach

### Core Module Integration

The [`agent_reach/core.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/core.py) module implements the logic that reads and parses SKILL.md. At line 28, the core loads the skill definition using `importlib.resources`:

```python

# agent_reach/core.py (line 28)

from importlib import resources
skill_text = resources.read_text('agent_reach.skill', 'SKILL.md')

```

The core module parses the YAML header to extract triggers, matches incoming user requests against these patterns, and then looks up the appropriate reference markdown to determine the exact CLI call.

### CLI Management Commands

The [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py) module provides commands to install or remove SKILL.md in user skill directories, allowing developers to customize the routing behavior while maintaining the default configuration as a fallback.

### Validation and Testing

The repository includes tests in [`tests/test_skill_command.py`](https://github.com/Panniantong/Agent-Reach/blob/main/tests/test_skill_command.py) that verify SKILL.md is correctly installed and readable, ensuring the routing logic remains functional across different installation methods such as pip and wheel distributions.

## SKILL.md in Action: Execution Flow

When an Agent Reach-enabled bot receives a request, the execution follows this exact sequence:

1. **Intent Classification**: The core module parses SKILL.md and compares user input against the `triggers` list to identify the category (research, search, social, etc.).

2. **Reference Lookup**: Based on the matched intent, the system retrieves the corresponding reference file (e.g., [`references/research.md`](https://github.com/Panniantong/Agent-Reach/blob/main/references/research.md)).

3. **Command Resolution**: The agent extracts the specific CLI command for the target platform from the reference file.

4. **Execution**: The command runs via the appropriate backend—OpenCLI, platform-specific CLIs, or direct API calls.

This architecture ensures that adding support for new platforms requires only updating the reference markdown files and SKILL.md triggers, without modifying Python source code.

## Summary

- **SKILL.md** at [`agent_reach/skill/SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/skill/SKILL.md) serves as the central configuration defining how Agent Reach AI agents select and invoke tools.

- The **YAML header** maps natural language triggers to intent categories (research, search, social, dev, etc.), enabling flexible intent detection.

- The **routing table** links intents to reference markdown files containing platform-specific CLI commands.

- The **core module** ([`agent_reach/core.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/core.py)) reads SKILL.md at line 28 to dynamically determine tool selection at runtime.

- **CLI commands** in [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py) manage SKILL.md installation and customization in user environments.

## Frequently Asked Questions

### Where is SKILL.md located in the Agent Reach repository?

SKILL.md resides at [`agent_reach/skill/SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/skill/SKILL.md) within the Panniantong/Agent-Reach repository. This file is packaged with the distribution and shipped to users during installation, as verified by the wheel tests in [`.github/workflows/pytest.yml`](https://github.com/Panniantong/Agent-Reach/blob/main/.github/workflows/pytest.yml).

### How does the agent know which tool to call based on SKILL.md?

The agent processes SKILL.md in three distinct steps. First, it matches user input against trigger keywords defined in the YAML header to identify the intent category. Then it consults the reference markdown file specified in the routing table to retrieve the exact CLI command for execution.

### Can I customize SKILL.md for my specific use case?

Yes. While SKILL.md ships with the package as the default configuration, the [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py) module provides commands to install custom SKILL.md files into user skill directories. This allows developers to add new intents, modify trigger keywords, or define additional reference files without altering the core package source code.

### What platforms and tools does SKILL.md support?

According to the routing table in SKILL.md and the corresponding reference files, the system supports platforms including Twitter, XHS (Xiaohongshu), Reddit, BiliBili, YouTube, and various search engines via backends like Exa. The dev category includes tools for development workflows, while the finance category handles financial data queries.