refactor: move shims from templates/ to scripts/ and drop legacy shims

- Remove 4 legacy shim files; only the unified coinhunter_shim.py remains
- Move the remaining shim from templates/ to scripts/ per skill best practices
- Update all docs (README, CLAUDE, shim-templates) to reference scripts/
This commit is contained in:
2026-04-16 03:03:25 +08:00
parent c07b9c1ae5
commit e75c54ca12
8 changed files with 18 additions and 101 deletions

View File

@@ -19,11 +19,8 @@ The actual trading CLI is an **external dependency**: the `coinhunter` package o
- `review-template.md` — Hourly review report structure.
- `scam-signals.md` — Red flags and classification guidance for meme-coin evaluation.
- `auto-trading-guide.md` — Legacy-oriented guide for deploying `auto_trader.py` and Binance API setup.
- `templates/` — Thin shim scripts meant to be copied to your platform's scripts directory (e.g. `~/.hermes/scripts/` or `~/.openclaw/scripts/`). Each shim invokes the installed `coinhunter` CLI:
- `coinhunter_precheck_shim.py`Runs `coinhunter pre`.
- `coinhunter_external_gate_shim.py` — Runs `coinhunter gate`.
- `coinhunter_review_context_shim.py` — Runs `coinhunter review`.
- `rotate_external_gate_log_shim.py` — Runs `coinhunter rotate-log`.
- `scripts/` — Thin shim scripts meant to be copied to your platform's scripts directory (e.g. `~/.hermes/scripts/` or `~/.openclaw/scripts/`). Currently contains:
- `coinhunter_shim.py`Unified cross-platform shim that runs any `coinhunter` subcommand (`pre`, `gate`, `review`, `rotate-log`).
There is no `pyproject.toml`, `Makefile`, or test suite in this repository.
@@ -32,7 +29,7 @@ There is no `pyproject.toml`, `Makefile`, or test suite in this repository.
### Skill vs runtime separation
- **Skill code/docs** live in this repository.
- **Private user state** lives under `~/.coinhunter/` (positions, balances, logs, reviews, cache, gate state). Never commit user data into this repo.
- **Platform cron scripts** are copied from `templates/` to your runtime's scripts directory (e.g. `~/.hermes/scripts/` or `~/.openclaw/scripts/`) and invoke the installed `coinhunter` CLI.
- **Platform cron scripts** are copied from `scripts/` to your runtime's scripts directory (e.g. `~/.hermes/scripts/` or `~/.openclaw/scripts/`) and invoke the installed `coinhunter` CLI.
### Low-cost trigger architecture
The framework is designed to minimize LLM invocations:
@@ -73,21 +70,15 @@ When modifying or adding trading scripts, these safeguards from `SKILL.md` must
coinhunter --version
```
- **Validate a shim after editing:**
- **Validate the shim after editing:**
```bash
python3 -m py_compile templates/coinhunter_precheck_shim.py
python3 -m py_compile scripts/coinhunter_shim.py
```
- **Copy shims to your platform's scripts directory:**
- **Copy the shim to your platform's scripts directory:**
```bash
# Unified shim (recommended)
cp templates/coinhunter_shim.py ~/.hermes/scripts/coinhunter_shim.py
# or: cp templates/coinhunter_shim.py ~/.openclaw/scripts/coinhunter_shim.py
# Legacy individual shims (Hermes backward compatibility)
cp templates/coinhunter_precheck_shim.py ~/.hermes/scripts/coinhunter_precheck.py
cp templates/coinhunter_external_gate_shim.py ~/.hermes/scripts/coinhunter_external_gate.py
cp templates/coinhunter_review_context_shim.py ~/.hermes/scripts/coinhunter_review_context.py
cp scripts/coinhunter_shim.py ~/.hermes/scripts/coinhunter_shim.py
# or: cp scripts/coinhunter_shim.py ~/.openclaw/scripts/coinhunter_shim.py
```
- **Inspect user state:**