Add android-project-full-audit and local-worker-handoff skills; sync scaffold skill

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Neil Bantoc 2026-11-03 19:03:54 -08:00
parent 216cf3478d
commit 59fc08fa5f
27 changed files with 1064 additions and 11 deletions

View file

@ -0,0 +1,47 @@
---
name: local-worker-handoff
description: Claude Code only — never use from OpenCode or any session already running on a local model. Hand off a self-contained, token-heavy task (e.g. reading and filing a batch of files) to a headless Claude Code worker running on a locally hosted model instead of an Anthropic model. Use when another skill or the user wants to offload bulk work to the local LLM to save tokens. Backends are configured per machine in ~/.claude/local-workers.json; always check availability first and fall back to built-in subagents when no backend is reachable.
---
# Local Worker Handoff
> **Claude Code only.** This skill starts `claude -p` processes to move work *off* Anthropic models. If you are running in OpenCode, or on a locally hosted model, stop: use your native subagents instead.
Runs a prompt as a separate `claude -p` process whose API traffic goes to a local, Anthropic-compatible server (e.g. vLLM ≥ 0.10 with `/v1/messages`). The calling session stays on its normal model and acts as orchestrator + reviewer.
Server details live **only** in `~/.claude/local-workers.json` (or `$LOCAL_WORKERS_CONFIG`). Do not copy URLs, model names or keys into prompts, other skills, or files in a project.
```json
{ "default": "name",
"backends": { "name": { "base_url": "http://host:8000", "model": "served-model-id",
"api_key_file": "~/path/to/key", "max_parallel": 2 } } }
```
`W="$SKILL_DIR/scripts/worker.sh"`
## 1. Check before every handoff session
```bash
bash $W check # or: bash $W check <backend>
```
Exit 0 → proceed. Non-zero, or no config file → **do not retry or debug the server**; tell the user in one line that the local backend is unavailable and fall back to the caller's default (normally built-in `Agent` subagents). Re-check before each wave if the session is long.
## 2. Write a self-contained prompt file
The worker starts cold: no conversation context, no skills loaded on its behalf. Put everything in the prompt file (in the scratchpad): absolute paths, the exact procedure, the exact commands it may run, and the expected final reply (keep it short — you read it). Local models are weaker at long, loose instructions: number the steps and give command templates verbatim.
## 3. Run
```bash
bash $W run --prompt-file <file> --out <result.json> --cwd <dir> \
--allow "Read Grep Glob Bash(bash /abs/path/helper.sh:*)"
```
- `--allow` is the worker's whole tool allowlist. Grant the narrowest set: read tools plus specific helper scripts. Agent/Write/Edit/web tools are always disallowed — workers report through helper scripts or their final reply.
- For parallel workers, start up to the backend's `max_parallel` runs as separate background Bash commands (`run_in_background: true`), one per prompt file. More than that just queues on the GPU.
- The final reply prints to stdout; full JSON (turns, errors) is in `--out`, stderr in `<out>.stderr`. The reported `costUSD` is a placeholder price for an unrecognised model — local runs cost nothing.
## 4. Verify — always
Local-model output is untrusted until checked. Before using a worker's results, spot-check a sample against the source (the caller skill says how). If a worker's output is wrong or thin, redo that unit with a built-in subagent or yourself, and tell the user which units were redone.