Skip to content

Commit 0513b28

Browse files
committed
docs: update crabbox skill guidance
1 parent 418d7af commit 0513b28

1 file changed

Lines changed: 41 additions & 9 deletions

File tree

.agents/skills/crabbox/SKILL.md

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ pnpm crabbox:run -- --help | sed -n '1,120p'
3131
- Check `.crabbox.yaml` for repo defaults, but override provider explicitly.
3232
Even if config still says AWS, maintainer validation should normally pass
3333
`--provider blacksmith-testbox`.
34+
- If a warm direct-provider lease smells stale, retry with `--full-resync`
35+
(alias `--fresh-sync`) before replacing the lease. This resets the remote
36+
workdir, skips the fingerprint fast path, reseeds Git when possible, and
37+
uploads the checkout from scratch.
3438
- For live/provider bugs, use the configured secret workflow before downgrading
3539
to mocks. Copy only the exact needed key into the remote process environment
3640
for that one command. Do not print it, do not sync it as a repo file, and do
@@ -163,7 +167,13 @@ Use these on debugging runs before inventing ad hoc logging:
163167
executing it, then forwards only allowlisted names. `--allow-env` is
164168
repeatable and comma-separated. Profile values override ambient allowlisted
165169
env values for that run. Direct POSIX, WSL2, and native Windows runs are
166-
supported; delegated providers are not.
170+
supported; delegated providers are not. Crabbox probes the uploaded profile
171+
remotely and prints redacted presence/length metadata before the command.
172+
- `--env-helper <name>`: with `--env-from-profile` on POSIX SSH targets,
173+
persists `.crabbox/env/<name>` and `.crabbox/env/<name>.env` so follow-up
174+
commands on the same lease can run through `./.crabbox/env/<name> <command>`.
175+
Use only on leases you control; the profile stays until cleanup, lease reset,
176+
or `--full-resync`.
167177
- `--script <file>` / `--script-stdin`: upload a local script into
168178
`.crabbox/scripts/` and execute it on the remote box. Shebang scripts execute
169179
directly on POSIX; scripts without a shebang run through `bash`. Native
@@ -173,12 +183,19 @@ Use these on debugging runs before inventing ad hoc logging:
173183
fresh remote checkout of the GitHub PR. Bare numbers use the current repo's
174184
GitHub origin. Add `--apply-local-patch` only when the current local
175185
`git diff --binary HEAD` should be applied on top of that PR checkout.
186+
- `--full-resync` / `--fresh-sync`: reset a stale direct-provider workdir
187+
before syncing. Use after sync fingerprints look wrong, SSH times out before
188+
sync, or rsync watchdog output suggests it. It is redundant with
189+
`--fresh-pr`, incompatible with `--no-sync`, and unsupported by delegated
190+
providers.
176191
- `--capture-stdout <path>` / `--capture-stderr <path>`: write remote streams to
177192
local files and keep binary/noisy output out of retained logs. Parent
178193
directories must already exist. These are direct-provider only.
179194
- `--capture-on-fail`: on non-zero direct-provider exits, downloads
180195
`.crabbox/captures/*.tar.gz` with `test-results`, `playwright-report`,
181196
`coverage`, JUnit XML, and nearby logs. Treat as secret-bearing until reviewed.
197+
- `--keep-on-failure`: leave a failed one-shot lease alive for live debugging
198+
until idle/TTL expiry. Useful on direct providers and delegated one-shots.
182199
- `--timing-json`: final machine-readable timing. Add
183200
`echo CRABBOX_PHASE:install`, `CRABBOX_PHASE:test`, etc. in long shell
184201
commands; direct providers and Blacksmith Testbox both report them as
@@ -200,9 +217,10 @@ pnpm crabbox:run -- --provider aws \
200217
```
201218

202219
Do not pass `--capture-*`, `--download`, `--checksum`, `--force-sync-large`, or
203-
`--sync-only` to delegated providers. Also do not pass `--script*` or
204-
`--fresh-pr` there. Crabbox rejects these because the provider owns sync or
205-
command transport.
220+
`--sync-only` to delegated providers. Also do not pass `--script*`,
221+
`--fresh-pr`, `--full-resync`, or `--env-helper` there. Crabbox rejects these
222+
because the provider owns sync or command transport. `--keep-on-failure` is OK
223+
for delegated one-shots when you need to inspect a failed lease.
206224

207225
## Efficient Bug E2E Verification
208226

@@ -250,6 +268,8 @@ Keep it efficient:
250268
- Use `--fresh-pr <pr>` when validating an upstream PR in isolation from the
251269
local dirty tree. Add `--apply-local-patch` only when testing a local fixup on
252270
top of that PR.
271+
- Use `--full-resync` before replacing a warmed direct-provider lease when the
272+
remote workdir or sync fingerprint appears stale.
253273
- Use one-shot Crabbox for a single proof; use a reusable Testbox only when
254274
several commands must share built images, installed packages, or live state.
255275
- Prefer `OPENCLAW_CURRENT_PACKAGE_TGZ` with Docker/package lanes when testing a
@@ -345,10 +365,17 @@ Useful WebVNC commands:
345365

346366
```sh
347367
../crabbox/bin/crabbox webvnc --provider hetzner --id <cbx_id-or-slug> --open
348-
../crabbox/bin/crabbox webvnc --provider hetzner --id <cbx_id-or-slug> --daemon --open
349-
../crabbox/bin/crabbox webvnc --provider hetzner --id <cbx_id-or-slug> --status
350-
../crabbox/bin/crabbox webvnc --provider hetzner --id <cbx_id-or-slug> --stop
351-
../crabbox/bin/crabbox screenshot --provider hetzner --id <cbx_id-or-slug> --output desktop.png
368+
../crabbox/bin/crabbox webvnc daemon start --provider hetzner --id <cbx_id-or-slug> --open
369+
../crabbox/bin/crabbox webvnc daemon status --provider hetzner --id <cbx_id-or-slug>
370+
../crabbox/bin/crabbox webvnc daemon stop --provider hetzner --id <cbx_id-or-slug>
371+
../crabbox/bin/crabbox webvnc status --provider hetzner --id <cbx_id-or-slug>
372+
../crabbox/bin/crabbox webvnc reset --provider hetzner --id <cbx_id-or-slug> --open
373+
../crabbox/bin/crabbox desktop doctor --provider hetzner --id <cbx_id-or-slug>
374+
../crabbox/bin/crabbox desktop click --provider hetzner --id <cbx_id-or-slug> --x 640 --y 420
375+
../crabbox/bin/crabbox desktop paste --provider hetzner --id <cbx_id-or-slug> --text "user@example.com"
376+
../crabbox/bin/crabbox desktop key --provider hetzner --id <cbx_id-or-slug> ctrl+l
377+
../crabbox/bin/crabbox artifacts collect --id <cbx_id-or-slug> --all --output artifacts/<slug>
378+
../crabbox/bin/crabbox artifacts publish --dir artifacts/<slug> --pr <number>
352379
```
353380

354381
`desktop launch --webvnc --open` is usually the nicest one-shot: it starts the
@@ -383,7 +410,9 @@ Common Crabbox-only failures:
383410
- Sync/timing bug: add `--debug --timing-json`; capture the final JSON and the
384411
printed Actions URL. Large sync warnings now include top source directories
385412
by file count and a hint to update `.crabboxignore` / `sync.exclude`; inspect
386-
those before reaching for `--force-sync-large`.
413+
those before reaching for `--force-sync-large`. Quiet rsync watchdogs and SSH
414+
timeouts now print `next_action=` hints; follow them, usually `--full-resync`
415+
first and a fresh lease second.
387416
- Cleanup uncertainty: run `blacksmith testbox list` and stop only boxes you
388417
created.
389418
- Testbox queued/capacity pressure: do not convert a broad changed gate or full
@@ -525,7 +554,10 @@ crabbox run --id <lease> --shell -- 'DISPLAY=:99 xdotool search --onlyvisible --
525554
crabbox status --id <id-or-slug> --wait
526555
crabbox inspect --id <id-or-slug> --json
527556
crabbox sync-plan
557+
crabbox history --limit 20
528558
crabbox history --lease <id-or-slug>
559+
crabbox attach <run_id>
560+
crabbox events <run_id> --json
529561
crabbox logs <run_id>
530562
crabbox results <run_id>
531563
crabbox cache stats --id <id-or-slug>

0 commit comments

Comments
 (0)