59 lines
1.9 KiB
Markdown
59 lines
1.9 KiB
Markdown
---
|
|
name: @@NAME@@
|
|
description: @@DESCRIPTION@@
|
|
---
|
|
|
|
# @@TITLE@@
|
|
|
|
@@DESCRIPTION@@
|
|
|
|
## Command
|
|
|
|
The skill is on `PATH` as `@@NAME@@` (via the skill-alias installer).
|
|
|
|
```bash
|
|
@@NAME@@ --help # all subcommands
|
|
@@NAME@@ run <target> # FILL IN — the skill's main job
|
|
@@NAME@@ send <title> --body "…" # FILL IN — example JSON POST with retries
|
|
```
|
|
|
|
Global flags go **before** the subcommand:
|
|
|
|
| flag | effect |
|
|
|-------------------|-----------------------------------------------------|
|
|
| `--json` | result as a single JSON object on stdout (parseable) |
|
|
| `-v`, `--verbose` | progress chatter on stderr |
|
|
|
|
### `run` — ordered steps
|
|
|
|
`--step` is repeatable and **order-preserving**, taking `KIND:VALUE` pairs
|
|
(`wait`, `click`, `type`, `shot`):
|
|
|
|
```bash
|
|
@@NAME@@ run https://example.test --step wait:#app --step click:.more --step shot:out.png
|
|
```
|
|
|
|
## Output
|
|
|
|
stdout is the result, stderr is the chatter — so `@@NAME@@ --json run …` pipes
|
|
cleanly into `jq`. Exit codes: `0` success, `1` handled failure (one line on
|
|
stderr, never a traceback), `2` usage error.
|
|
|
|
## Configuration
|
|
|
|
Private defaults (tokens, hosts) are read from the gitignored `.env.claude` at
|
|
the repo root — `@@ENVPREFIX@@_URL` for the `send` example. Nothing is hardcoded.
|
|
|
|
## Implementation
|
|
|
|
- `scripts/@@NAME@@.sh` — thin bash shim; carries the `# @alias:` header the
|
|
alias installer scans for. Keep it.
|
|
- `scripts/@@PKG@@.py` — all logic. A [PEP 723](https://peps.python.org/pep-0723/)
|
|
uv script: the `# /// script` header declares `click` + `requests`, and
|
|
`uv run` builds/caches the venv on first run. No install step, nothing added
|
|
to the system Python.
|
|
- `scripts/test_@@PKG@@.py` — click `CliRunner` smoke tests; run it directly.
|
|
|
|
After editing the skill's name, run `scripts/install-skill-aliases.sh` from the
|
|
repo root to refresh the `@@NAME@@` alias on `PATH`.
|