finalizelisted
Install: claude install-skill terrylica/cc-skills
# /asciinema-tools:finalize
Finalize orphaned asciinema recordings: stop running processes gracefully, compress, and push to the orphan branch.
> **Self-Evolving Skill**: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
## Arguments
| Argument | Description |
| -------------- | ------------------------------------------ |
| `file` | Specific .cast file to finalize |
| `--all` | Finalize all unhandled .cast files |
| `--force` | Use SIGKILL if graceful stop fails |
| `--no-push` | Skip pushing to orphan branch (local only) |
| `--keep-local` | Keep local .cast after compression |
## Workflow
1. **Discovery**: Find running asciinema processes and unhandled .cast files
2. **Selection**: AskUserQuestion for which files to process
3. **Stop**: Gracefully stop running processes (SIGTERM → SIGINT → SIGKILL)
4. **Verify**: Check file integrity after stop
5. **Compress**: zstd compress .cast files
6. **Push**: Push to orphan branch (if configured)
7. **Cleanup**: Remove local .cast (optional)
## Execution
### Phase 1: Discovery
```bash
/usr/bin/env bash << 'DISCOVER_EOF'
echo "=== Running asciinema processes ==="
PROCS=$(ps aux | grep -E "asciinema rec" | grep -v grep)
if [[ -n "$PROCS" ]]; then
echo "$PROCS" | while read -r line; do
PI