How the Agent Reach skill --install Command Registers with OpenClaw and Claude Code
The agent-reach skill --install command registers Agent Reach as a skill by copying locale-specific SKILL.md files and reference documentation into the runtime-specific skill directories used by OpenClaw, Claude Code, and generic .agents frameworks.
The skill --install command in the Panniantong/Agent-Reach repository automates the registration process for AI agent runtimes. This command detects your system locale, locates compatible agent directories, and installs the necessary skill definitions so that OpenClaw, Claude Code, and other supported frameworks can discover and execute Agent Reach capabilities.
How the skill --install Command Works
The installation logic resides in agent_reach/cli.py, where the _install_skill function orchestrates the registration process across multiple AI agent platforms.
Entry Point and Command Dispatch
When you execute skill --install, the CLI parser invokes _cmd_skill, which immediately delegates to _install_skill【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/cli.py#L46-L58】. This function handles the entire registration workflow without requiring manual configuration.
Locale Detection and Resource Selection
Before copying files, the installer determines which skill definition to use. The _skill_resource_name() function inspects environment variables including AGENT_REACH_LANG, LC_ALL, LC_MESSAGES, and LANG. If any value starts with "en" or "english", the function selects SKILL_en.md; otherwise it defaults to SKILL.md【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/cli.py#L29-L43】.
The _read_skill_markdown() function then loads the selected file from the package's skill/ directory using importlib.resources, with a fallback path for editable installs【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/cli.py#L44-L50】.
Target Directory Resolution
The installer builds an ordered list of candidate directories: .agents, .openclaw, and .claude under the home directory. If the OPENCLAW_HOME environment variable is set, the installer inserts that path at the front of the list, giving precedence to custom OpenClaw installations【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/cli.py#L89-L100】.
File Installation Process
For each existing candidate directory, _copy_skill_dir(target) performs the actual registration:
- Creates or overwrites
agent-reach/SKILL.mdin the target location - Copies all
*.mdfiles from the package'sreferences/folder into the target'sreferences/subdirectory【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/cli.py#L51-L84】
If none of the expected directories exist, the installer creates ~/.agents/skills/agent-reach as a fallback, ensuring generic agents can still discover the skill【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/cli.py#L110-L117】.
Supported AI Agent Runtimes
The command supports three distinct runtime environments through standardized skill directory conventions.
OpenClaw – Discovers skills in ~/.openclaw/skills/ (or $OPENCLAW_HOME/.openclaw/skills/). The runtime loads all subdirectories at startup and makes available any commands defined in SKILL.md.
Claude Code – Monitors ~/.claude/skills/ for skill definitions. By placing the Agent Reach skill files in this location, Claude Code automatically gains access to search, read, and social capabilities.
Generic .agents Runtimes – Community and custom agents that follow the ~/.agents/skills/ convention can also discover the installed skill, with this location serving as the default fallback when specific runtimes are not detected.
Installation Example
Run the following command to register Agent Reach with all detected AI agents on your system:
python -m agent_reach.cli skill --install
Successful output resembles:
Skill installed for OpenClaw: /home/you/.openclaw/skills/agent-reach
Skill installed for Claude Code: /home/you/.claude/skills/agent-reach
Skill installed: /home/you/.agents/skills/agent-reach
To force installation into a specific runtime, manually create the target directory before invoking the command. The installer will detect the existing directory and copy the skill files there.
Key Source Files
| File | Purpose |
|---|---|
agent_reach/cli.py |
Contains _install_skill, _skill_resource_name(), and the command dispatch logic【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/cli.py】 |
agent_reach/skill/SKILL.md |
Default skill definition for non-English locales【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/skill/SKILL.md】 |
agent_reach/skill/SKILL_en.md |
English localization selected for English language settings【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/skill/SKILL_en.md】 |
agent_reach/skill/references/ |
Auxiliary markdown files providing additional context for AI agents【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/skill/references/】 |
Summary
- The
skill --installcommand automates registration for OpenClaw, Claude Code, and generic .agents runtimes by copying skill files to standardized directories. - Locale detection via
_skill_resource_name()ensures the appropriate language version (SKILL_en.mdorSKILL.md) is installed based on environment variables. - The installer prioritizes
OPENCLAW_HOMEwhen resolving OpenClaw installation paths, then falls back to default home directory locations. - If no specific agent directories exist, the command creates
~/.agents/skills/agent-reachto guarantee the skill remains available for future use. - Source implementation resides in
agent_reach/cli.py, with actual skill definitions stored in theagent_reach/skill/package directory.
Frequently Asked Questions
What happens if I don't have OpenClaw or Claude Code installed?
If neither ~/.openclaw/skills/ nor ~/.claude/skills/ exists, the installer creates ~/.agents/skills/agent-reach as a fallback location. This ensures the skill is registered for any generic agent runtime that follows the .agents convention, and you can manually move the files later if you install OpenClaw or Claude Code.
How does the command choose between English and non-English skill files?
The _skill_resource_name() function checks environment variables in this order: AGENT_REACH_LANG, LC_ALL, LC_MESSAGES, and LANG. If any value starts with "en" or "english" (case-insensitive), the installer selects SKILL_en.md; otherwise it uses the default SKILL.md【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/cli.py#L29-L43】.
Can I install the skill to a custom location?
Yes. If you set the OPENCLAW_HOME environment variable, the installer checks $OPENCLAW_HOME/.openclaw/skills/ before standard locations. Alternatively, manually create any of the supported directories (~/.openclaw/skills/, ~/.claude/skills/, or ~/.agents/skills/) before running the command, and the installer will copy the files to all existing locations.
What files are actually copied during installation?
The installer copies two components: the locale-specific SKILL.md (or SKILL_en.md) into an agent-reach/ subdirectory, and all *.md files from the package's references/ folder into a references/ subdirectory within that location【/cache/repos/github.com/Panniantong/Agent-Reach/main/agent_reach/cli.py#L51-L84】.
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:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →