How Skill Installation Works for OpenClaw and Claude Code in Agent-Reach

Agent-Reach installs its reusable skill into platform-specific directories by detecting your system's locale, selecting the appropriate markdown file, and copying the skill bundle to the first existing agent directory among OpenClaw, Claude Code, or generic .agents configurations.

The Agent-Reach repository provides a cross-platform skill registration system that enables seamless integration with multiple AI agent platforms. Understanding how the agent-reach skill --install command functions requires examining the implementation in agent_reach/cli.py, where the private helper _install_skill() (lines 342-440) orchestrates the entire installation process.

Platform-Specific Skill Directories

Agent-Reach supports three distinct agent platforms, each expecting skills in a specific location:

  • Generic agents (.agents): ~/.agents/skills/agent-reach
  • OpenClaw: ~/.openclaw/skills/agent-reach (or ${OPENCLAW_HOME}/.openclaw/skills/agent-reach if the OPENCLAW_HOME environment variable is set)
  • Claude Code: ~/.claude/skills/agent-reach

When OPENCLAW_HOME is defined, its path takes precedence and is inserted at the front of the candidate list, ensuring the OpenClaw installation wins over the default location (lines 12-22).

The Locale-Aware File Selection Process

The installation begins by determining which language version of the skill documentation to deploy. The function inspects locale-related environment variables—including AGENT_REACH_LANG, LC_ALL, LC_MESSAGES, and LANG—to detect English settings (lines 53-62).

If any of these variables indicate an English locale, the installer uses SKILL_en.md; otherwise, it falls back to SKILL.md. This ensures users receive context documentation in their preferred language.

Loading Skill Resources

The system attempts to load skill files using Python's importlib.resources.files("agent_reach").joinpath("skill") mechanism. However, when the package runs in editable mode, this approach may fail, triggering a fallback to Path(__file__).resolve().parent / "skill" (lines 84-90). This dual-path strategy ensures reliable resource loading regardless of installation method.

Copying the Skill Directory

Once resources are located, the _copy_skill_dir(target) function executes the actual installation (lines 71-99). This routine:

  1. Creates or clears the destination folder
  2. Writes the selected SKILL.md file based on locale detection
  3. Copies all reference files from skill/references/ (including web, video, social, search, dev, and career documentation)

Installation Priority and Path Resolution

The installer builds a prioritized list of candidate skill roots and iterates through them in sequence (lines 28-31). For each existing directory, it invokes _copy_skill_dir() and emits a console message indicating which platform received the skill.

If none of the known skill roots exist, the function creates the generic-agent path at ~/.agents/skills/agent-reach and attempts the copy there as a fallback (lines 34-38).

Uninstalling the Skill

The _uninstall_skill() function (lines 444-476) handles removal by deleting the entire agent-reach directory from each known skill root across all three platforms. This ensures clean removal regardless of where the skill was initially installed.

Practical Usage Examples

Install the skill for whichever platform you have configured:

agent-reach skill --install

Force installation for the generic .agents platform on a fresh system:

mkdir -p ~/.agents/skills
agent-reach skill --install

Remove the skill from all platforms:

agent-reach skill --uninstall

Summary

  • Agent-Reach supports three agent platforms: Generic .agents, OpenClaw, and Claude Code, each with distinct installation paths.
  • The _install_skill() function in agent_reach/cli.py handles locale detection to choose between SKILL_en.md and SKILL.md.
  • Resource loading uses importlib.resources with a fallback for editable installations.
  • The installer follows a priority sequence (checking existing directories first) and creates a fallback in ~/.agents if no platform directories exist.
  • Uninstallation via _uninstall_skill() removes the skill from all detected platform directories simultaneously.

Frequently Asked Questions

How does Agent-Reach decide which language version of the skill to install?

The installer checks environment variables AGENT_REACH_LANG, LC_ALL, LC_MESSAGES, and LANG in sequence. If any indicate an English locale, it deploys SKILL_en.md; otherwise, it uses the default SKILL.md. This logic resides in lines 53-62 of agent_reach/cli.py.

Can I install the skill to a custom OpenClaw directory?

Yes. Set the OPENCLAW_HOME environment variable to your preferred base path. The installer checks this variable first and constructs the skill path as ${OPENCLAW_HOME}/.openclaw/skills/agent-reach, overriding the default ~/.openclaw location.

What happens if I have multiple agent platforms installed?

The installer iterates through all existing platform directories and copies the skill to each one. It prioritizes existing directories over creating new ones, and only falls back to creating the generic ~/.agents/skills/agent-reach path if no platform directories are found.

Does the uninstall command remove files from all platforms?

Yes. The _uninstall_skill() function (lines 444-476) removes the agent-reach directory from every known skill root simultaneously, including OpenClaw, Claude Code, and generic .agents locations, ensuring complete cleanup across your system.

Have a question about this repo?

These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:

Share the following with your agent to get started:
curl -s "https://instagit.com/install.md"

Works with
Claude Codex Cursor VS Code OpenClaw Any MCP Client

Maintain an open-source project? Get it listed too →