# resilient-coding-agent

Adopt this skill: https://proskills.md/skills/other/cosformula-resilient-coding-agent-skill

Page: https://proskills.md/skills/other/cosformula-resilient-coding-agent-skill
This document is the public skill bundle for that page. It contains SKILL.md and every helper file the catalog carries. No login is required.

## File: SKILL.md
size: 9059
sha: 59bae00748d520263956a34b6de507fc80944916
upstream: https://github.com/cosformula/resilient-coding-agent-skill/blob/HEAD/SKILL.md

````text
---
name: resilient-coding-agent
description: "Run long-running coding agents (Codex, Claude Code, etc.) in tmux sessions that survive orchestrator restarts, with automatic resume on interruption."
metadata:
  openclaw:
    emoji: "🛡️"
    requires:
      bins: [tmux]
      anyBins: [codex, claude, opencode, pi]
---

# Resilient Coding Agent

Long-running coding agent tasks (Codex CLI, Claude Code, OpenCode, Pi) are vulnerable to interruption: orchestrator restarts, process crashes, network drops. This skill decouples the coding agent process from the orchestrator using tmux, and leverages agent-native session resume for recovery.

**Placeholders:** `<task-name>` and `<project-dir>` are filled in by the orchestrator. `<task-name>` must match `[a-z0-9-]` only. `<project-dir>` must be a valid existing directory.

**Temp directory:** Each task uses a secure temp directory created with `mktemp -d`. Store this path as `<tmpdir>` and use it for all task files (prompt, events, session ID, done marker). This avoids predictable filenames and symlink/race conditions. Example: `TMPDIR=$(mktemp -d)` produces something like `/var/folders/xx/.../T/tmp.aBcDeFgH`.

**Prompt safety:** Task prompts are never interpolated into shell commands. Instead, write the prompt to a temp file using the orchestrator's `write` tool (no shell involved), then reference it with `"$(cat $TMPDIR/prompt)"` inside the tmux command. The shell treats command substitution output inside double quotes as a single literal argument, preventing injection. This depends on the orchestrator's `write` tool not invoking a shell; OpenClaw's built-in `write` tool meets this requirement.

**Sensitive output:** tmux scrollback and event log files may contain secrets or API keys from agent output. On shared machines, restrict file permissions (`chmod 600`) and clean up temp directories after task completion.

## Prerequisites

This skill assumes the orchestrator is already configured to use coding agent CLIs (Codex, Claude Code, etc.) for coding tasks instead of native sessions. If the orchestrator is still using `sessions_spawn` for coding work, configure it to prefer coding agents first (e.g., via AGENTS.md or equivalent). See the `coding-agent` skill for setup.

## When to Use This

Use this pattern when:
- The task is expected to take **more than 5 minutes**
- The orchestrator might restart during execution
- You want fire-and-forget execution with completion notification

For quick tasks under 5 minutes, running the agent directly is fine.

## Start a Task

Create a tmux session with a descriptive name. Use the agent prefix (`codex-`, `claude-`, etc.) for easy identification.

### Codex CLI

```bash
# Step 1: Create secure temp directory
TMPDIR=$(mktemp -d)
chmod 700 "$TMPDIR"

# Step 2: Write prompt to file (use orchestrator's write tool, not echo/shell)
# File: $TMPDIR/prompt

# Step 3: Launch in tmux (pass TMPDIR via env)
tmux new-session -d -s codex-<task-name> -e "TASK_TMPDIR=$TMPDIR"
tmux send-keys -t codex-<task-name> 'cd <project-dir> && set -o pipefail && codex exec --full-auto --json "$(cat $TASK_TMPDIR/prompt)" | tee $TASK_TMPDIR/events.jsonl && echo "__TASK_DONE__"' Enter

# Step 4: Capture this task's Codex session ID; resume --last is unsafe with concurrent tasks.
# Uses jq for reliable JSON parsing (falls back to grep if jq unavailable).
until [ -s "$TMPDIR/codex-session-id" ]; do
  if command -v jq &>/dev/null; then
    jq -r 'select(.thread_id) | .thread_id' "$TMPDIR/events.jsonl" 2>/dev/null | head -n 1 > "$TMPDIR/codex-session-id"
  else
    grep -oE '"thread_id":"[^"]+"' "$TMPDIR/events.jsonl" 2>/dev/null | head -n 1 | cut -d'"' -f4 > "$TMPDIR/codex-session-id"
  fi
  sleep 1
done
```

### Claude Code

```bash
# Create secure temp directory and write prompt to $TMPDIR/prompt first
TMPDIR=$(mktemp -d) && chmod 700 "$TMPDIR"
tmux new-session -d -s claude-<task-name> -e "TASK_TMPDIR=$TMPDIR"
tmux send-keys -t claude-<task-name> 'cd <project-dir> && claude -p "$(cat $TASK_TMPDIR/prompt)" && echo "__TASK_DONE__"' Enter
```

### OpenCode / Pi

```bash
# Create secure temp directory and write prompt to $TMPDIR/prompt first
TMPDIR=$(mktemp -d) && chmod 700 "$TMPDIR"

# OpenCode
tmux new-session -d -s opencode-<task-name> -e "TASK_TMPDIR=$TMPDIR"
tmux send-keys -t opencode-<task-name> 'cd <project-dir> && opencode run "$(cat $TASK_TMPDIR/prompt)" && echo "__TASK_DONE__"' Enter

# Pi (separate temp dir)
TMPDIR=$(mktemp -d) && chmod 700 "$TMPDIR"
tmux new-session -d -s pi-<task-name> -e "TASK_TMPDIR=$TMPDIR"
tmux send-keys -t pi-<task-name> 'cd <project-dir> && pi -p "$(cat $TASK_TMPDIR/prompt)" && echo "__TASK_DONE__"' Enter
```

### Completion Notification (Optional)

Chain a notification command after the agent so you know when it finishes. Use `;` before `echo "__TASK_DONE__"` so the marker prints even if the notification command fails:

```bash
# Generic: touch a marker file
tmux send-keys -t codex-<task-name> 'cd <project-dir> && codex exec --full-auto "$(cat $TASK_TMPDIR/prompt)" && touch $TASK_TMPDIR/done; echo "__TASK_DONE__"' Enter

# macOS: system notification
tmux send-keys -t codex-<task-name> 'cd <project-dir> && codex exec --full-auto "$(cat $TASK_TMPDIR/prompt)" && osascript -e "display notification \"Task done\" with title \"Codex\""; echo "__TASK_DONE__"' Enter

# OpenClaw: system event (immediate wake)
tmux send-keys -t codex-<task-name> 'cd <project-dir> && codex exec --full-auto "$(cat $TASK_TMPDIR/prompt)" && openclaw system event --text "Codex done: <task-name>" --mode now; echo "__TASK_DONE__"' Enter
```

## Monitor Progress

```bash
# Check if the session is still running
tmux has-session -t codex-<task-name> 2>/dev/null && echo "running" || echo "finished/gone"

# Read recent output (last 200 lines)
tmux capture-pane -t codex-<task-name> -p -S -200

# Read the full scrollback
tmux capture-pane -t codex-<task-name> -p -S -
```

Check progress when:
- The user asks for a status update
- You want to proactively report milestones

## Health Monitoring

For long-running tasks, use an active monitor loop instead of only checking on demand.

Periodic check flow:
1. Run `tmux has-session -t <agent-task>` to confirm the tmux session still exists.
2. Run `tmux capture-pane -t <agent-task> -p -S -<N>` to capture recent output.
3. Detect likely agent exit by checking the last `N` lines for:
   - Shell prompt returned (for example, a line ending in `$ `, `% `, or `> `)
   - Exit indicators (`exit code`, `status <non-zero>`, `exited`)
   - No completion marker (`__TASK_DONE__`)
4. If crash is detected, run the agent-native resume command in the same tmux session.

Use a done marker in your start command so the monitor can distinguish normal completion from crashes:

```bash
tmux send-keys -t codex-<task-name> 'cd <project-dir> && codex exec --full-auto "$(cat $TASK_TMPDIR/prompt)" && echo "__TASK_DONE__"' Enter
```

For Codex tasks, save the session ID to `$TMPDIR/codex-session-id` when the task starts (see **Codex CLI** above). The monitor reads that file to resume the exact task session.

The orchestrator should run this check loop periodically (every 3-5 minutes, via cron or a background timer). On consecutive failures, double the interval (3m, 6m, 12m, ...) and reset when the agent is running normally. Stop after 5 hours wall-clock.

## Recovery After Interruption

For automated crash detection and retries, use **Health Monitoring** above.
Keep this section as a manual fallback when you need to intervene directly:

```bash
# Codex (prefer explicit session ID from $TMPDIR/codex-session-id)
tmux send-keys -t codex-<task-name> 'codex exec resume <session-id> "Continue the previous task"' Enter

# Claude Code
tmux send-keys -t claude-<task-name> 'claude --resume' Enter

# OpenCode
tmux send-keys -t opencode-<task-name> 'opencode run "Continue"' Enter

# Pi: no native resume; re-run the task prompt manually
```

## Cleanup

After a task completes, kill the tmux session:

```bash
tmux kill-session -t codex-<task-name>
```

List all coding agent tmux sessions:

```bash
tmux list-sessions 2>/dev/null | grep -E '^(codex|claude|opencode|pi)-'
```

## Naming Convention

Tmux sessions use the pattern `<agent>-<task-name>`:

- `codex-refactor-auth`
- `claude-review-pr-42`
- `codex-bus-sim-physics`

Keep names short, lowercase, hyphen-separated.

## Checklist

Before starting a long task:

1. Pick tmux over direct execution (if task > 5 min)
2. Name the tmux session with the agent prefix
3. Optionally chain a completion notification
4. Tell the user: task content, tmux session name, estimated duration
5. Monitor via `tmux capture-pane` on request

## Limitations

- tmux sessions do not survive a **machine reboot** (tmux itself is killed). For reboot-resilient tasks, the coding agent's native resume (`codex exec resume <session-id>`, `claude --resume`) is the recovery path.
- Interactive approval prompts inside tmux require manual `tmux attach` or `tmux send-keys`. Use `--full-auto` / `--yolo` / `-p` flags when possible.
````

## File: README.md
size: 4419
sha: 0a46d5c3e099f5155feb9ee8619f5d354e4ee167
upstream: https://github.com/cosformula/resilient-coding-agent-skill/blob/HEAD/README.md

````text
# Resilient Coding Agent

[![ClawHub](https://img.shields.io/badge/ClawHub-resilient--coding--agent-blue)](https://clawhub.com/cosformula/resilient-coding-agent)
[![Version](https://img.shields.io/badge/version-0.2.0-green)](https://clawhub.com/cosformula/resilient-coding-agent)
[![GitHub stars](https://img.shields.io/github/stars/cosformula/resilient-coding-agent-skill)](https://github.com/cosformula/resilient-coding-agent-skill)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![CI](https://github.com/cosformula/resilient-coding-agent-skill/actions/workflows/ci.yml/badge.svg)](https://github.com/cosformula/resilient-coding-agent-skill/actions/workflows/ci.yml)
[![Publish](https://github.com/cosformula/resilient-coding-agent-skill/actions/workflows/clawhub-publish.yml/badge.svg)](https://github.com/cosformula/resilient-coding-agent-skill/actions/workflows/clawhub-publish.yml)

Run long-running coding agents (Codex CLI, Claude Code, OpenCode, Pi) in tmux sessions that survive orchestrator restarts, with periodic health checks and automatic resume on interruption.

## Problem

AI coding agents running long tasks (refactors, full codebase reviews, complex builds) get killed when the orchestrator process restarts. You lose progress, get no completion notification, and have to start over.

## Solution

Decouple the coding agent from the orchestrator by running it in a tmux session. The agent keeps running regardless of what happens to the orchestrator. A monitor loop can check health with `tmux has-session` and `tmux capture-pane`, detect likely crashes, and trigger native resume commands in the same tmux session.

## Features

- Runs coding agents in `tmux` sessions so tasks survive orchestrator restarts
- Supports periodic health monitoring (`tmux has-session` + `tmux capture-pane`)
- Detects likely agent exits from shell-prompt return and exit indicators in recent output
- Auto-recovers with native resume commands (`codex exec resume <session-id>`, `claude --resume`, `opencode run "Continue"`)
- Supports completion notifications via marker files, system events, or webhooks

## Supported Agents

- **Codex CLI** (with `codex exec resume` for recovery)
- **Claude Code** (with `claude --resume` for recovery)
- **OpenCode**
- **Pi Coding Agent**

## Install

### Via npx skills (any agent)

```bash
npx skills add cosformula/resilient-coding-agent-skill
```

### Via ClawHub (OpenClaw)

```bash
clawhub install resilient-coding-agent
```

### Manual

```bash
git clone https://github.com/cosformula/resilient-coding-agent-skill.git
```

## Quick Start

```bash
# Start a long Codex task in tmux
SESSION="codex-refactor"
TMPDIR=$(mktemp -d) && chmod 700 "$TMPDIR"

# Write prompt (in practice, use orchestrator's write tool)
echo "Refactor auth module" > "$TMPDIR/prompt"

tmux new-session -d -s "$SESSION" -e "TASK_TMPDIR=$TMPDIR"
tmux send-keys -t "$SESSION" 'cd ~/project && set -o pipefail && codex exec --full-auto --json "$(cat $TASK_TMPDIR/prompt)" | tee $TASK_TMPDIR/events.jsonl && openclaw system event --text "Codex done: auth refactor" --mode now; echo "__TASK_DONE__"' Enter

# Save this task's Codex session ID (safer than resume --last when multiple tasks run)
until [ -s "$TMPDIR/codex-session-id" ]; do
  if command -v jq &>/dev/null; then
    jq -r 'select(.thread_id) | .thread_id' "$TMPDIR/events.jsonl" 2>/dev/null | head -n 1 > "$TMPDIR/codex-session-id"
  else
    grep -oE '"thread_id":"[^"]+"' "$TMPDIR/events.jsonl" 2>/dev/null | head -n 1 | cut -d'"' -f4 > "$TMPDIR/codex-session-id"
  fi
  sleep 1
done

# Check progress
tmux capture-pane -t "$SESSION" -p -S -100

# If Codex crashes, resume this exact session
CODEX_SESSION_ID="$(cat "$TMPDIR/codex-session-id")"
tmux send-keys -t "$SESSION" "codex exec resume $CODEX_SESSION_ID \"Continue the refactor\"" Enter

# Or run the monitor script for automated crash detection + resume
./scripts/monitor.sh "$SESSION" codex
```

## Requirements

- `tmux` installed
- At least one coding agent CLI (codex, claude, opencode, or pi)
- `bash` for the health-monitor script (`scripts/monitor.sh`)

## Compatibility

- **macOS / Linux**: Fully supported. Install tmux via package manager.
- **Windows**: Requires WSL. Native Windows is not supported (no tmux).
- **Shell**: Health monitoring detects bash (`$ `), zsh (`% `), and fish (`> `) prompts.

## License

MIT, Copyright cosformula
````

## File: scripts/monitor.sh
size: 4400
sha: 81b324c460748c7c5e8164bfac641bd3a7d10b6f
upstream: https://github.com/cosformula/resilient-coding-agent-skill/blob/HEAD/scripts/monitor.sh

```text
#!/usr/bin/env bash
#
# Monitor a coding agent running in a tmux session.
# Detects crashes (shell prompt return, exit indicators) and auto-resumes
# using the agent's native resume command.
#
# Usage:
#   ./scripts/monitor.sh <tmux-session> <agent>
#
#   tmux-session  Name of the tmux session (e.g. codex-refactor)
#   agent         One of: codex, claude, opencode, pi
#
# For Codex, expects a session ID file at /tmp/<session>.codex-session-id
# (created during task start; see SKILL.md for details).
#
# Retry: 3min base, doubles on each consecutive failure, resets when agent
# is running normally. Stops after 5 hours wall-clock.

set -uo pipefail

SESSION="${1:?Usage: monitor.sh <tmux-session> <agent>}"
AGENT="${2:?Usage: monitor.sh <tmux-session> <agent>}"

# Validate agent at startup
case "$AGENT" in
  codex|claude|opencode|pi) ;;
  *) echo "Unsupported agent: $AGENT (must be codex, claude, opencode, or pi)" >&2; exit 1 ;;
esac

# Sanitize session name: only allow alphanumeric, dash, underscore, dot
if ! printf '%s' "$SESSION" | grep -Eq '^[A-Za-z0-9._-]+$'; then
  echo "Invalid session name: $SESSION (only alphanumeric, dash, underscore, dot allowed)" >&2
  exit 1
fi

CODEX_SESSION_FILE="/tmp/${SESSION}.codex-session-id"
RETRY_COUNT=0
START_TS="$(date +%s)"
DEADLINE_TS=$(( START_TS + 18000 ))  # 5 hours wall-clock

while true; do
  NOW_TS="$(date +%s)"
  if [ "$NOW_TS" -ge "$DEADLINE_TS" ]; then
    echo "Retry timeout reached (5h wall-clock). Stopping monitor."
    break
  fi

  INTERVAL=$(( 180 * (2 ** RETRY_COUNT) ))

  # Cap sleep so we don't overshoot the 5h deadline
  REMAINING=$(( DEADLINE_TS - NOW_TS ))
  if [ "$INTERVAL" -gt "$REMAINING" ]; then
    INTERVAL="$REMAINING"
  fi

  # Capture tmux pane; if session disappeared between has-session and capture,
  # treat it as session gone rather than crashing the script.
  if tmux has-session -t "$SESSION" 2>/dev/null; then
    OUTPUT="$(tmux capture-pane -t "$SESSION" -p -S -120 2>/dev/null)" || {
      echo "tmux session $SESSION disappeared during capture. Stopping monitor."
      break
    }
    RECENT="$(printf '%s\n' "$OUTPUT" | tail -n 40)"

    if printf '%s\n' "$RECENT" | grep -q "__TASK_DONE__"; then
      echo "Task completed normally."
      break
    fi

    # Detect shell prompt return. Only match lines that are ONLY a prompt
    # (user@host indicators or bare shell markers) to avoid false positives
    # from agent output containing "> " or "$ " mid-line.
    PROMPT_BACK=0
    EXIT_HINT=0
    LAST_LINE="$(printf '%s\n' "$RECENT" | grep -v '^$' | tail -n 1)"
    printf '%s\n' "$LAST_LINE" | grep -Eq '^[^[:space:]]*[$%#>] $' && PROMPT_BACK=1
    # Match explicit exit indicators, not substrings like "HTTP status 200"
    printf '%s\n' "$RECENT" | grep -Eiq '(exit code [0-9]|exited with|exit status [1-9])' && EXIT_HINT=1

    if [ "$PROMPT_BACK" -eq 1 ] || [ "$EXIT_HINT" -eq 1 ]; then
      RETRY_COUNT=$(( RETRY_COUNT + 1 ))

      case "$AGENT" in
        codex)
          if [ -s "$CODEX_SESSION_FILE" ]; then
            CODEX_SESSION_ID="$(cat "$CODEX_SESSION_FILE")"
            # Validate session ID format (UUID-like alphanumeric + dashes)
            if ! printf '%s' "$CODEX_SESSION_ID" | grep -Eq '^[A-Za-z0-9_-]+$'; then
              echo "Invalid Codex session ID format: $CODEX_SESSION_ID"
              break
            fi
            echo "Crash detected. Resuming Codex session $CODEX_SESSION_ID (retry #$RETRY_COUNT)"
            tmux send-keys -t "$SESSION" "codex exec resume ${CODEX_SESSION_ID} \"Continue the previous task\"" Enter
          else
            echo "Missing Codex session ID file: $CODEX_SESSION_FILE"
            break
          fi
          ;;
        claude)
          echo "Crash detected. Resuming Claude Code (retry #$RETRY_COUNT)"
          tmux send-keys -t "$SESSION" 'claude --resume' Enter
          ;;
        opencode)
          echo "Crash detected. Resuming OpenCode (retry #$RETRY_COUNT)"
          tmux send-keys -t "$SESSION" 'opencode run "Continue"' Enter
          ;;
        pi)
          echo "Pi has no resume command. Manual restart required. Stopping monitor."
          break
          ;;
      esac
    else
      RETRY_COUNT=0  # agent is running normally, reset backoff
      INTERVAL=180
    fi
  else
    echo "tmux session $SESSION no longer exists. Stopping monitor."
    break
  fi
  sleep "$INTERVAL"
done
```

## File: .clawhubignore
size: 285
sha: a3af62142c4aedf91bbd0848f03dc57545492f2d
upstream: https://github.com/cosformula/resilient-coding-agent-skill/blob/HEAD/.clawhubignore

```text
.git/
.github/

# Runtime / deps
node_modules/
.venv/
__pycache__/

# Build artifacts
build/
dist/

# Data / temp
data/
tmp/
.cache/

# OS/editor
.DS_Store
Thumbs.db
*.log

# Tests
tests/

# Scripts (excluded to avoid VirusTotal behavioral tags)
scripts/

# GitHub-only docs
README.md
```

## File: .github/workflows/ci.yml
size: 579
sha: 491babf0c2982f7abb4915f4965faa7660a9ba29
upstream: https://github.com/cosformula/resilient-coding-agent-skill/blob/HEAD/.github/workflows/ci.yml

```text
name: CI

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  package-check:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Verify publish dir
        run: |
          set -euo pipefail
          OUT=/tmp/skill
          rm -rf "$OUT" && mkdir -p "$OUT"
          rsync -a --delete --exclude-from=.clawhubignore ./ "$OUT/"
          echo "Publish files:"; find "$OUT" -type f -maxdepth 3 -print
          test ! -f "$OUT/README.md"
          test ! -d "$OUT/tests"
          test ! -d "$OUT/.github"
          test -f "$OUT/SKILL.md"
```

## File: .github/workflows/clawhub-publish.yml
size: 1864
sha: 0e8abfde306e99aa7cc4278d9b28604c7a30aea5
upstream: https://github.com/cosformula/resilient-coding-agent-skill/blob/HEAD/.github/workflows/clawhub-publish.yml

```text
name: Publish to ClawHub

on:
  workflow_dispatch:
    inputs:
      version:
        description: "Semver version (e.g. 0.1.0)"
        required: true
      changelog:
        description: "Changelog text"
        required: true
        default: "Update"
      tags:
        description: "Comma-separated tags"
        required: false
        default: "latest"
  push:
    tags:
      - "v*"

jobs:
  publish:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Build publish dir
        run: |
          set -euo pipefail
          OUT=/tmp/skill
          rm -rf "$OUT" && mkdir -p "$OUT"
          rsync -a --delete --exclude-from=.clawhubignore ./ "$OUT/"
          test -f "$OUT/SKILL.md"
          find "$OUT" -maxdepth 3 -type f -print

      - name: Install & login ClawHub
        env:
          CLAWHUB_TOKEN: ${{ secrets.CLAWHUB_TOKEN }}
        run: |
          npm i -g clawhub@latest
          clawhub login --token "$CLAWHUB_TOKEN" --no-browser
          clawhub whoami

      - name: Publish
        env:
          EVENT_NAME: ${{ github.event_name }}
          REF_NAME: ${{ github.ref_name }}
          INPUT_VERSION: ${{ inputs.version }}
          INPUT_CHANGELOG: ${{ inputs.changelog }}
          INPUT_TAGS: ${{ inputs.tags }}
        run: |
          set -euo pipefail
          if [[ "$EVENT_NAME" == "workflow_dispatch" ]]; then
            VERSION="$INPUT_VERSION"
            CHANGELOG="$INPUT_CHANGELOG"
            TAGS="$INPUT_TAGS"
          else
            VERSION="${REF_NAME#v}"
            CHANGELOG="Release ${REF_NAME}"
            TAGS="latest"
          fi
          clawhub publish /tmp/skill \
            --slug resilient-coding-agent \
            --name "Resilient Coding Agent" \
            --version "$VERSION" \
            --changelog "$CHANGELOG" \
            --tags "$TAGS"
```

## File: .github/workflows/release.yml
size: 1043
sha: 9f505a5e5a85fa7370225f2f4fc99966b3e8d058
upstream: https://github.com/cosformula/resilient-coding-agent-skill/blob/HEAD/.github/workflows/release.yml

```text
name: Release

on:
  push:
    tags:
      - "v*"

permissions:
  contents: write

jobs:
  release:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Build skill package
        run: |
          set -euo pipefail
          OUT=/tmp/skill-pkg
          rm -rf "$OUT" && mkdir -p "$OUT"
          rsync -a --delete --exclude-from=.clawhubignore ./ "$OUT/"
          test -f "$OUT/SKILL.md"

          SKILL_NAME=$(basename "$GITHUB_REPOSITORY" | sed 's/-skill$//')
          VERSION="${GITHUB_REF_NAME#v}"
          ARCHIVE="${SKILL_NAME}-${VERSION}.tar.gz"
          tar -czf "/tmp/${ARCHIVE}" -C "$OUT" .
          echo "ARCHIVE=/tmp/${ARCHIVE}" >> "$GITHUB_ENV"
          echo "SKILL_NAME=${SKILL_NAME}" >> "$GITHUB_ENV"
          echo "VERSION=${VERSION}" >> "$GITHUB_ENV"

      - name: Create GitHub Release
        uses: softprops/action-gh-release@v2
        with:
          name: "${{ env.SKILL_NAME }} v${{ env.VERSION }}"
          generate_release_notes: true
          files: ${{ env.ARCHIVE }}
```

## File: .gitignore
size: 51
sha: f54c20883aed5fbc9fca12c98f9e0965153dd133
upstream: https://github.com/cosformula/resilient-coding-agent-skill/blob/HEAD/.gitignore

```text
node_modules/
data/
tmp/
*.log
.DS_Store
.clawhub/
```

## File: LICENSE
size: 1067
sha: d21997902a0bd6473824e4170b45ae5752c0134b
upstream: https://github.com/cosformula/resilient-coding-agent-skill/blob/HEAD/LICENSE

```text
MIT License

Copyright (c) 2026 cosformula

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
