380cfd565d
SKILL.md (per the skill-writing guide): - description rewritten trigger-first: 调研/全网调研/帮我调研/research lead the text (the owner's own phrasing "去全网调研" previously had NO matching trigger word — the exact undertrigger the guide warns about); platform keywords front-loaded against the 1536-char truncation - standing rules added: probe `doctor --json` active_backend before acting on multi-backend platforms, announce which skill/backend is in use, follow the documented retry chains, compose multi-platform research - quick commands updated to the new reality: bili-cli for bilibili search, Reddit/xiaohongshu moved to a "login-backed platforms" section - SKILL_en.md: same description surgery + the actively harmful stale advice removed (anonymous reddit .json curl, yt-dlp for bilibili) README / README_en: - tagline gains the capability-layer subline: backends are chosen, installed and health-checked for us to swap — the user never notices - "设计理念" reframed from scaffolding to capability layer (selection / install / doctor / routing); channels diagram now shows ordered backend lists; selection table split into primary + fallback columns with the live-test rationale per row - platform table: honest rows for bilibili (bili-cli, yt-dlp retired), Reddit (no zero-config path), xiaohongshu (OpenCLI / mcp / legacy) Version 1.5.0 across pyproject / __init__ / CLAUDE.md / test fixture. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2.2 KiB
2.2 KiB
CLAUDE.md
Project
Agent Reach — Python CLI + library that gives AI agents read/search access to 13 internet platforms. Positioning: installer + doctor + config tool. NOT a wrapper — after install, agents call upstream tools directly. Repo: github.com/Panniantong/Agent-Reach | License: MIT | Version: 1.5.0
Commands
pip install -e .— Dev installpytest tests/ -v— All testspytest tests/test_cli.py -v— CLI tests onlybash test.sh— Full integration test (creates venv, installs, runs doctor + channel tests)python -m agent_reach.cli doctor— Run diagnosticspython -m agent_reach.cli install --env=auto— Auto-configure
Structure
agent_reach/cli.py— CLI entry point (argparse)agent_reach/core.py— Core read/search routing logicagent_reach/config.py— Config management (YAML, env vars)agent_reach/doctor.py— Diagnostics engineagent_reach/channels/— One file per platform (twitter.py, reddit.py, youtube.py, etc.)agent_reach/channels/base.py— Base channel class (all channels inherit from this)agent_reach/integrations/mcp_server.py— MCP server integrationagent_reach/skill/— OpenClaw skill filesagent_reach/guides/— Usage guidestests/— pytest testsconfig/mcporter.json— MCP tool config
Conventions
- Python 3.10+ with type hints
- Each channel is a single file in
channels/, inherits fromBaseChannel - Channel contract: must implement
can_handle(url),read(url),search(query),check()methods - Use
logurufor logging,richfor CLI output - Commit format:
type(scope): message(one commit = one thing) - All upstream tool calls go through public API/CLI, never hack internals
Rules
- NEVER modify upstream open source projects' source code
- Agent Reach is a "glue layer" — only route and call, don't reimagine
- Version in THREE places must match:
pyproject.toml,__init__.py,tests/test_cli.py - Always new branch for changes, PR to main, never push to main directly
- Run
pytest tests/ -vbefore committing — all tests must pass - Cookie-based auth (Twitter, XHS): use Cookie-Editor export method only, no QR scan
- XHS login: Cookie-Editor browser export only (QR will hang)