# How the Skill Command Registers Agent Reach with AI Agents

> Learn how the skill command registers Agent Reach with AI agents like .agents and OpenClaw. Discover how it enables automatic routing of research requests to the Agent Reach CLI.

- Repository: [Pnant/Agent-Reach](https://github.com/Panniantong/Agent-Reach)
- Tags: how-to-guide
- Published: 2026-06-21

---

**The `skill` command registers Agent Reach by copying the [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md) description file into the skill directories of supported AI agent frameworks—including `.agents`, OpenClaw, and Claude Code—enabling automatic routing of research requests to the Agent Reach CLI.**

The `skill` sub-command in the **Agent Reach** CLI automates integration with popular AI agent ecosystems by managing the deployment of skill definition files. According to the Panniantong/Agent-Reach source code, this command handles both installation and uninstallation across multiple platforms using a priority-based directory selection system.

## Supported AI Agent Frameworks and Directory Priority

The command targets three specific skill directories in order of precedence:

- **`~/.agents/skills`** – Generic ".agents" framework (highest priority)
- **`~/.openclaw/skills`** – OpenClaw ecosystem (Claude Code's predecessor)
- **`~/.claude/skills`** – Claude Code skill system (third priority)

If none of these directories exist, the CLI creates `~/.agents/skills/agent-reach` by default. This priority order ensures that the most generic framework receives the installation when multiple agents are present, while still supporting legacy OpenClaw and modern Claude Code installations.

## Loading Skill Resources from the Package

In [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py), the installation process begins by loading packaged skill resources using `importlib.resources.files("agent_reach").joinpath("skill")` (lines 352-368). The implementation handles both standard and editable installs by falling back to a relative path within the source tree when the package is installed in development mode.

The command performs locale-aware file selection: if the user's locale is English, it prefers [`SKILL_en.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL_en.md); otherwise, it falls back to the default [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md). Both files reside in the `agent_reach/skill/` directory alongside a `references/` folder containing supporting documentation.

## Copying Files to Agent Directories

The `_copy_skill_dir(target)` function (lines 371-389) performs the actual installation by:

1. Creating the `agent-reach` subfolder in the target directory
2. Writing the selected markdown file
3. Recursively copying the `references/` directory if present
4. Clearing any previous installation to prevent stale files

The main installation logic iterates over the `skill_dirs` list in priority order (lines 413-438), using the first existing directory it encounters. This ensures that Agent Reach registers itself with exactly one agent framework per installation, avoiding conflicts while maintaining flexibility across environments.

## Uninstalling the Skill

The `--uninstall` flag triggers the `_uninstall_skill` function (lines 444-470), which walks the same three directories in reverse order, removing the `agent-reach` folder (or symlink) from each location if present. This provides complete cleanup across all supported ecosystems without requiring the user to manually delete files from multiple locations.

## Practical Usage Examples

Install the skill for the first available agent framework:

```bash
agent-reach skill --install

```

Remove the skill from all known agent directories:

```bash
agent-reach skill --uninstall

```

Programmatically manage the skill installation from Python:

```python
from agent_reach.cli import _install_skill, _uninstall_skill

# Install the skill (writes SKILL.md into the appropriate directories)

_install_skill()

# Uninstall the skill from all locations

_uninstall_skill()

```

## Summary

- **Three ecosystem support**: The command targets `.agents`, OpenClaw, and Claude Code directories in order of priority.
- **Priority-based selection**: Uses the first existing directory from the predefined list, defaulting to `~/.agents/skills` if none exist.
- **Locale-aware deployment**: Automatically selects [`SKILL_en.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL_en.md) for English locales or [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md) for other languages.
- **Atomic installation**: The `_copy_skill_dir` function clears previous installations before copying new files to prevent stale resources.
- **Complete uninstallation**: The `--uninstall` flag removes the skill from all three potential directories in a single operation.

## Frequently Asked Questions

### Which AI agents are compatible with the Agent Reach skill command?

The skill command supports three AI agent ecosystems: the generic ".agents" framework (highest priority), OpenClaw (Claude Code's predecessor), and Claude Code. The command checks for the presence of `~/.agents/skills`, `~/.openclaw/skills`, and `~/.claude/skills` in that specific order, installing to the first location found.

### What files does the skill command actually install?

The command installs the [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md) (or [`SKILL_en.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL_en.md) for English locales) file and the entire `references/` directory from `agent_reach/skill/` into an `agent-reach` subfolder within the target agent's skills directory. These files contain the routing table and trigger definitions that tell the host agent when to invoke Agent Reach capabilities.

### How does the command handle different system languages?

The implementation checks the system locale during installation (lines 353-369 in [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py)). If the locale indicates English, the command copies [`SKILL_en.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL_en.md) instead of the default [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md). This ensures that AI agents receive skill descriptions in the appropriate language for the user's environment.

### Can I install the skill programmatically without using the CLI?

Yes. The internal functions `_install_skill()` and `_uninstall_skill()` are importable from `agent_reach.cli` and can be called directly from Python code. This allows applications to manage Agent Reach registration without shelling out to the command line, though the CLI remains the recommended interface for most users.