# How Agent Reach Handles Skill Installation for OpenClaw, Claude Code, and Generic Agents

> Learn how Agent Reach simplifies skill installation for OpenClaw Claude Code and generic agents by automatically deploying skill definitions to the correct directories enhancing your agent development workflow.

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

---

**Agent Reach automatically deploys its skill definitions to platform-specific directories—including `~/.agents/skills`, `~/.openclaw/skills`, and `~/.claude/skills`—by detecting the host environment and copying localized [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md) files via the `_install_skill` helper in [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py).**

The `Panniantong/Agent-Reach` repository provides a unified **skill installation** mechanism that eliminates manual configuration across disparate agent runtimes. By analyzing environment variables and standard directory conventions, the tool ensures that OpenClaw, Claude Code, and generic `.agents`-compatible platforms can discover and load the latest skill definitions without user intervention.

## Platform-Specific Skill Directories and Detection Logic

Agent Reach maintains a hard-coded priority list of three installation targets, iterating through each to determine where the skill should reside:

- **Generic `.agents`**: `~/.agents/skills/agent-reach` (highest priority)
- **OpenClaw**: `~/.openclaw/skills/agent-reach` 
- **Claude Code**: `~/.claude/skills/agent-reach`

The core logic resides in **[`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py)**, specifically within the private `_install_skill` function.

### Dynamic Path Resolution for OpenClaw

When the `OPENCLAW_HOME` environment variable is present, Agent Reach resolves the additional path `$OPENCLAW_HOME/.openclaw/skills` and **prepends** it to the priority list. This guarantees that non-standard OpenClaw installations take precedence over default locations. If the variable is unset, the function falls back to the standard `~/.openclaw/skills` entry.

### Fallback Strategy for Clean Environments

If none of the three platform directories exist on the host system, Agent Reach creates the generic `~/.agents/skills` path automatically and installs the skill there. This ensures the installation succeeds even when no agent runtime is currently detected.

## The Installation Pipeline in agent_reach/cli.py

The `_install_skill` function orchestrates a four-stage pipeline that handles localization, resource loading, and atomic file operations.

### Locale-Aware Skill Selection

Before copying files, the function determines which language variant to install. It invokes `_is_english_locale` to inspect environment variables in the following order:

1. `AGENT_REACH_LANG`
2. `LC_ALL`
3. `LC_MESSAGES`
4. `LANG`

If any of these variables start with `"en"` or `"english"`, the installer selects [`SKILL_en.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL_en.md); otherwise, it defaults to the Chinese-language [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md).

### Resource Loading and File Copying

The `_read_skill_markdown` helper loads skill resources from the package using `importlib.resources.files("agent_reach").joinpath("skill")`. The `_copy_skill_dir` function then executes the following operations:

- Creates the target directory if missing
- Safely removes any existing installation (handling symlinks correctly to avoid breaking the filesystem)
- Writes the selected markdown file as [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md) in the target directory
- Copies every `.md` file from the package's `references/` subdirectory

For each valid platform directory found, the function emits a status message indicating whether the skill was **installed**, **preserved** (already present), or **failed**.

## Installing and Uninstalling Skills

Agent Reach exposes both command-line interfaces and programmatic APIs for managing skill installations.

### CLI Installation Commands

```bash

# Standard installation flow (runs doctor, then installs skills)

agent-reach install

# Explicit skill installation only

agent-reach skill --install

# Force reinstall (overwrites existing files)

agent-reach skill --install --force

```

### Programmatic API

You can invoke the installation logic directly from Python, though these functions are not part of the public API:

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

# Install with automatic locale detection and platform discovery

_install_skill(force=True)

# Remove skill from all detected platform directories

_uninstall_skill()

```

## Uninstallation Process

The `_uninstall_skill` function mirrors the installation logic, iterating over the same three priority paths (including the optional `OPENCLAW_HOME` variant). It recursively removes the entire `agent-reach` directory from each location, safely handling symlinks by unlinking rather than following them. This ensures complete removal without affecting other skill installations.

## Summary

- **Agent Reach** supports three runtime environments: generic `.agents`, OpenClaw, and Claude Code, installing skills to their respective `~/.{platform}/skills/agent-reach` directories.
- The **`_install_skill`** function in [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py) detects English locales via `AGENT_REACH_LANG`, `LC_ALL`, `LC_MESSAGES`, and `LANG` to select between [`SKILL_en.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL_en.md) and [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md).
- **OpenClaw** installations respect the `OPENCLAW_HOME` environment variable, prepending the custom path to the installation priority list.
- The **`_copy_skill_dir`** helper atomically replaces existing installations and copies all files from the `references/` directory.
- **Uninstallation** uses `_uninstall_skill` to clean all known locations simultaneously, handling symlinks safely.

## Frequently Asked Questions

### How does Agent Reach choose between English and Chinese skill definitions?

Agent Reach checks the environment variables `AGENT_REACH_LANG`, `LC_ALL`, `LC_MESSAGES`, and `LANG` in sequence. If any value starts with `"en"` or `"english"`, the installer copies [`SKILL_en.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL_en.md) from the package resources; otherwise, it defaults to the Chinese [`SKILL.md`](https://github.com/Panniantong/Agent-Reach/blob/main/SKILL.md). This logic is encapsulated in the `_is_english_locale` helper within [`agent_reach/cli.py`](https://github.com/Panniantong/Agent-Reach/blob/main/agent_reach/cli.py).

### Can I install the skill to a custom location outside the standard directories?

No, Agent Reach does not support arbitrary installation paths. The tool relies on a hard-coded priority list of platform-specific directories. However, you can influence OpenClaw's target by setting the `OPENCLAW_HOME` environment variable, which causes the installer to prepend `$OPENCLAW_HOME/.openclaw/skills` to the priority list.

### What happens if I have multiple agent platforms installed simultaneously?

Agent Reach installs the skill to **all** detected platform directories concurrently. If your system contains `~/.agents/skills`, `~/.openclaw/skills`, and `~/.claude/skills`, the `_install_skill` function updates each location with the latest skill files and references during a single invocation.

### How do I completely remove the Agent Reach skill from my system?

Run `agent-reach skill --uninstall` or call `_uninstall_skill()` programmatically. This iterates over all known directories (including the `OPENCLAW_HOME` variant if set) and recursively deletes the `agent-reach` skill folder from each location, effectively removing the skill from OpenClaw, Claude Code, and generic agent runtimes simultaneously.