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:
25
CLAUDE.md
25
CLAUDE.md
@@ -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:**
|
||||
|
||||
27
README.md
27
README.md
@@ -103,27 +103,14 @@ Create your initial `positions.json`:
|
||||
|
||||
### 4. Deploy the shims
|
||||
|
||||
**Option A — unified shim (recommended for new setups and cross-platform):**
|
||||
|
||||
Copy the single unified shim into your platform's scripts directory. It accepts the subcommand as its first argument:
|
||||
Copy the unified shim into your platform's scripts directory. It accepts the subcommand as its first argument:
|
||||
|
||||
```bash
|
||||
# Hermes
|
||||
cp templates/coinhunter_shim.py ~/.hermes/scripts/coinhunter_shim.py
|
||||
cp scripts/coinhunter_shim.py ~/.hermes/scripts/coinhunter_shim.py
|
||||
|
||||
# OpenClaw
|
||||
cp templates/coinhunter_shim.py ~/.openclaw/scripts/coinhunter_shim.py
|
||||
```
|
||||
|
||||
**Option B — legacy shims (existing Hermes users, unchanged behavior):**
|
||||
|
||||
The original individual shims are still provided for backward compatibility:
|
||||
|
||||
```bash
|
||||
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 templates/rotate_external_gate_log_shim.py ~/.hermes/scripts/rotate_external_gate_log.py
|
||||
cp scripts/coinhunter_shim.py ~/.openclaw/scripts/coinhunter_shim.py
|
||||
```
|
||||
|
||||
### 5. Configure the platform cron job
|
||||
@@ -207,12 +194,8 @@ coinhunter/
|
||||
├── README.md # You are here
|
||||
├── SKILL.md # Full framework spec + gate blueprint
|
||||
├── CLAUDE.md # Guidance for Claude Code
|
||||
├── templates/ # Platform cron shims (call the installed coinhunter CLI)
|
||||
│ ├── coinhunter_shim.py # Unified cross-platform shim (recommended)
|
||||
│ ├── coinhunter_precheck_shim.py
|
||||
│ ├── coinhunter_external_gate_shim.py
|
||||
│ ├── coinhunter_review_context_shim.py
|
||||
│ └── rotate_external_gate_log_shim.py
|
||||
├── scripts/ # Platform cron shims (call the installed coinhunter CLI)
|
||||
│ └── coinhunter_shim.py # Unified cross-platform shim
|
||||
└── references/
|
||||
├── short-term-trading-framework.md
|
||||
├── review-template.md
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
These files are tiny compatibility shims for cron-based platforms (Hermes, OpenClaw, etc.) that expect scripts under a scripts directory such as `~/.hermes/scripts/` or `~/.openclaw/scripts/`.
|
||||
|
||||
## Unified shim (recommended)
|
||||
## Unified shim
|
||||
|
||||
`templates/coinhunter_shim.py` is the cross-platform wrapper. It takes the subcommand as its first argument and delegates to the installed `coinhunter` CLI:
|
||||
`scripts/coinhunter_shim.py` is the cross-platform wrapper. It takes the subcommand as its first argument and delegates to the installed `coinhunter` CLI:
|
||||
|
||||
```bash
|
||||
cp templates/coinhunter_shim.py ~/.hermes/scripts/coinhunter_shim.py
|
||||
cp scripts/coinhunter_shim.py ~/.hermes/scripts/coinhunter_shim.py
|
||||
# or
|
||||
cp templates/coinhunter_shim.py ~/.openclaw/scripts/coinhunter_shim.py
|
||||
cp scripts/coinhunter_shim.py ~/.openclaw/scripts/coinhunter_shim.py
|
||||
```
|
||||
|
||||
Usage examples:
|
||||
@@ -18,16 +18,7 @@ Usage examples:
|
||||
- `coinhunter_shim.py review`
|
||||
- `coinhunter_shim.py rotate-log`
|
||||
|
||||
## Legacy shims (backward compatibility)
|
||||
|
||||
The original individual shims are still provided for existing Hermes users who already have them deployed. Their behavior is unchanged:
|
||||
|
||||
- `templates/coinhunter_precheck_shim.py` -> `~/.hermes/scripts/coinhunter_precheck.py`
|
||||
- `templates/coinhunter_external_gate_shim.py` -> `~/.hermes/scripts/coinhunter_external_gate.py`
|
||||
- `templates/coinhunter_review_context_shim.py` -> `~/.hermes/scripts/coinhunter_review_context.py`
|
||||
- `templates/rotate_external_gate_log_shim.py` -> `~/.hermes/scripts/rotate_external_gate_log.py`
|
||||
|
||||
The real business logic lives in the external `coinhunter` CLI package (installed from PyPI). These shims only delegate to it.
|
||||
The real business logic lives in the external `coinhunter` CLI package (installed from PyPI). This shim only delegates to it.
|
||||
|
||||
The user runtime data stays under:
|
||||
- `~/.coinhunter/`
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Hermes cron shim: runs coinhunter external-gate via CLI."""
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
BIN = shutil.which("coinhunter") or shutil.which("coinhunter.exe")
|
||||
if not BIN:
|
||||
print("error: coinhunter CLI not found in PATH. Install with: pipx install coinhunter", file=sys.stderr)
|
||||
sys.exit(127)
|
||||
|
||||
sys.exit(subprocess.run([BIN, "gate", *sys.argv[1:]]).returncode)
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Hermes cron shim: runs coinhunter precheck via CLI."""
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
BIN = shutil.which("coinhunter") or shutil.which("coinhunter.exe")
|
||||
if not BIN:
|
||||
print("error: coinhunter CLI not found in PATH. Install with: pipx install coinhunter", file=sys.stderr)
|
||||
sys.exit(127)
|
||||
|
||||
sys.exit(subprocess.run([BIN, "pre", *sys.argv[1:]]).returncode)
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Hermes cron shim: runs coinhunter review-context via CLI."""
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
BIN = shutil.which("coinhunter") or shutil.which("coinhunter.exe")
|
||||
if not BIN:
|
||||
print("error: coinhunter CLI not found in PATH. Install with: pipx install coinhunter", file=sys.stderr)
|
||||
sys.exit(127)
|
||||
|
||||
sys.exit(subprocess.run([BIN, "review", *sys.argv[1:]]).returncode)
|
||||
@@ -1,12 +0,0 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Hermes cron shim: runs coinhunter rotate-log via CLI."""
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
BIN = shutil.which("coinhunter") or shutil.which("coinhunter.exe")
|
||||
if not BIN:
|
||||
print("error: coinhunter CLI not found in PATH. Install with: pipx install coinhunter", file=sys.stderr)
|
||||
sys.exit(127)
|
||||
|
||||
sys.exit(subprocess.run([BIN, "rotate-log", *sys.argv[1:]]).returncode)
|
||||
Reference in New Issue
Block a user