### Install and Setup ClawBack Source: https://github.com/sene1337/clawback/blob/main/README.md Instructions for installing the ClawBack skill into an OpenClaw workspace and initializing the required regression logs and local state tracking surfaces. ```bash git clone https://github.com/sene1337/clawback.git skills/clawback bash skills/clawback/scripts/setup.sh bash skills/clawback/scripts/init-ops-state.sh ``` -------------------------------- ### Daily Log Example Source: https://github.com/sene1337/clawback/blob/main/references/operating-discipline.md An example of a daily log entry for the 'openclaw-voice' project, summarizing recent work, key fixes, and pending tasks, referencing commit hashes for specific changes. ```markdown ### openclaw-voice - Two-way voice working: Piper TTS + Whisper STT, Safari frontend (`a2b1f09`..`b8d9e12`) - Key fixes: AudioContext user gesture init, 48→16kHz resampling for Whisper - Pending: LaunchAgent for auto-start, VAD chunk size fix ``` -------------------------------- ### Initialize ClawBack Environment Source: https://context7.com/sene1337/clawback/llms.txt Bootstraps the ClawBack environment by creating the regression log and initializing the local-only ops-state repository. This setup is required for tracking runtime-state manifests and enforcing safety guardrails. ```bash cd ~/workspace bash skills/clawback/scripts/setup.sh bash scripts/init-ops-state.sh bash scripts/init-ops-state.sh --ops-state /path/to/custom/ops-state bash scripts/init-ops-state.sh --dry-run ``` -------------------------------- ### Install Pre-Commit Guardrails Source: https://github.com/sene1337/clawback/blob/main/references/ops-state.md This bash script installs or re-installs the pre-commit guardrails for the ops-state repository. These guardrails enforce policies such as keeping the ops-state repository local-only and preventing the staging of sensitive or disallowed file types. ```bash bash scripts/pre-commit-guard.sh --install ~/.openclaw/ops-state ``` -------------------------------- ### Example Git Commit Hashes Source: https://github.com/sene1337/clawback/blob/main/references/operating-discipline.md Illustrates a clean git log with descriptive commit messages, showing individual fixes and features. This format aids in debugging and reverting specific changes. ```text e3ce305 fix: Safari AudioContext — init on user gesture, not on chunk arrival a2b1f09 feat: replace Chatterbox with Piper TTS — 30x faster 6fc28af fix: resample 48kHz→16kHz for Whisper, cast float64→float32 b8d9e12 feat: add LaunchAgent for auto-start on boot ``` -------------------------------- ### Initialize Dual-Surface Ops-State Source: https://github.com/sene1337/clawback/blob/main/SKILL.md Sets up the dual-surface environment by initializing the workspace and the local-only ops-state repository for managing runtime manifests. ```bash bash scripts/setup.sh bash scripts/init-ops-state.sh ``` -------------------------------- ### Initialize New Skill Git Repo (Bash) Source: https://github.com/sene1337/clawback/blob/main/references/skill-publishing.md This bash script initializes a new Git repository for a skill, adds a remote origin, stages all changes, and commits them with an initial message. This is used when a skill directory in the workspace does not yet have its own Git repository. ```bash cd workspace/skills/ git init git remote add origin git add -A git commit -m "init: sync local repo with workspace skill" ``` -------------------------------- ### Initialize Ops-State Repository Source: https://github.com/sene1337/clawback/blob/main/references/ops-state.md This bash script initializes the local ops-state git repository. It is used to set up the necessary directory structure and configurations for managing runtime state. ```bash bash scripts/init-ops-state.sh ``` -------------------------------- ### Run Pre-Publish Release Check Script Source: https://github.com/sene1337/clawback/blob/main/references/versioning.md Executes a script to validate release readiness. It checks for missing or invalid VERSION files, ensures CHANGELOG.md updates, verifies skill file changes against versioning, and confirms version increments relative to a base reference. ```bash bash scripts/release-check.sh [base-ref] ``` -------------------------------- ### Check Skill Repo Compliance (Bash) Source: https://github.com/sene1337/clawback/blob/main/references/skill-publishing.md This bash script iterates through all skill directories in the workspace to check if they are initialized as Git repositories and have a remote origin configured. It helps identify skills that need to be set up as standalone repositories before publishing. ```bash for d in workspace/skills/*/; do name=$(basename "$d") if [ -d "$d/.git" ]; then remote=$(cd "$d" && git remote get-url origin 2>/dev/null || echo 'no remote set') echo "✅ $name → $remote" else echo "❌ $name — no .git" fi done ``` -------------------------------- ### Manage Runtime State Checkpoints Source: https://github.com/sene1337/clawback/blob/main/SKILL.md Create, list, or dry-run checkpoints of runtime surfaces. This ensures state can be safely captured before performing risky operations. ```bash bash scripts/state-checkpoint.sh --name "before live queue migration" bash scripts/state-checkpoint.sh --path ~/.openclaw/lcm.db --path ~/.openclaw/agents/main/sessions bash scripts/state-checkpoint.sh --manifest-only --name "inventory only" bash scripts/state-checkpoint.sh --dry-run ``` -------------------------------- ### Manage Git Worktrees with Clawback Scripts Source: https://github.com/sene1337/clawback/blob/main/README.md This script provides functionality to create, list, and remove Git worktrees. It helps isolate development branches and manage parallel work efficiently. The 'create' command takes a branch name, 'list' shows existing worktrees, and 'path' returns the directory of a specific worktree. The 'remove' command can also prune the associated local branch. ```bash bash skills/clawback/scripts/worktree.sh create feat-branch-name bash skills/clawback/scripts/worktree.sh list cd "$(bash skills/clawback/scripts/worktree.sh path feat-branch-name)" ``` ```bash bash skills/clawback/scripts/worktree.sh remove feat-branch-name --prune-branch ``` -------------------------------- ### Create Runtime State Checkpoint Source: https://github.com/sene1337/clawback/blob/main/references/ops-state.md This bash script creates a checkpoint of the current runtime state. It allows users to save the state with a descriptive name for later restoration. The checkpoint includes manifests and other relevant state information. ```bash bash scripts/state-checkpoint.sh --name "before queue migration" ``` -------------------------------- ### Perform Checkpoints and Rollbacks Source: https://github.com/sene1337/clawback/blob/main/README.md Commands to create checkpoints before risky operations and perform rollbacks if failures occur, which automatically logs the failure to the regression file. ```bash bash skills/clawback/scripts/checkpoint.sh "reason for checkpoint" bash skills/clawback/scripts/rollback.sh "what broke" "why" "principle tested" ``` -------------------------------- ### Restore Runtime State Source: https://github.com/sene1337/clawback/blob/main/SKILL.md Restore the system to a previously recorded checkpoint. Includes dry-run capabilities and mandatory confirmation for actual restoration. ```bash bash scripts/state-restore.sh --dry-run bash scripts/state-restore.sh --yes-restore ``` -------------------------------- ### Perform Release Checks with Clawback Script Source: https://github.com/sene1337/clawback/blob/main/README.md This script verifies versioning and changelog discipline before publishing skill changes. It checks against a specified baseline branch (e.g., origin/main) to ensure compliance with release rules. ```bash bash skills/clawback/scripts/release-check.sh origin/main ``` -------------------------------- ### Perform Rollback with Regression Logging Source: https://context7.com/sene1337/clawback/llms.txt Reverts the workspace to a specific checkpoint while documenting the failure in the regression log. Requires details on what broke, why, and the violated principle to ensure agent learning. ```bash bash scripts/rollback.sh a1b2c3d \ "npm update broke TypeScript compilation" \ "dependency version conflict between typescript and eslint" \ "verify build before committing dependency changes" bash scripts/rollback.sh a1b2c3d \ "deleted production config file" \ "glob pattern was too broad" \ "always dry-run destructive file operations" \ --prompted ``` -------------------------------- ### Daily Log Markdown Format Source: https://github.com/sene1337/clawback/blob/main/references/operating-discipline.md Defines the structured markdown format for daily project logs, including sections for changes, blockers, and next steps, with a recommendation to reference commit hashes for details. ```markdown ### Project Name - What changed (reference commit hashes for detail) - What's blocked - What's next ``` -------------------------------- ### Gitignore Baseline Configuration Source: https://github.com/sene1337/clawback/blob/main/references/operating-discipline.md A standard .gitignore file content listing common files and directories to be ignored by git, such as log files, compiled code, and environment variables. ```gitignore *.log logs/ *.pyc __pycache__/ node_modules/ .env *.secret *.key data/ ``` -------------------------------- ### Create Pre-Risk Checkpoint Source: https://github.com/sene1337/clawback/blob/main/SKILL.md Executes a checkpoint script to save the current state before performing risky operations. Returns a commit hash for potential rollback. ```bash bash scripts/checkpoint.sh "reason for checkpoint" ``` -------------------------------- ### Manage Runtime State Source: https://github.com/sene1337/clawback/blob/main/README.md Commands for capturing and restoring out-of-workspace runtime state using the ops-state surface, allowing for safe manipulation of external configuration or session files. ```bash bash skills/clawback/scripts/state-checkpoint.sh --name "before live queue migration" bash skills/clawback/scripts/state-restore.sh --dry-run ``` -------------------------------- ### Create Workspace Checkpoint Source: https://context7.com/sene1337/clawback/llms.txt Creates a git checkpoint by committing workspace changes before executing risky operations. It returns the commit hash to be used as a potential rollback point. ```bash bash scripts/checkpoint.sh "before npm update" bash scripts/checkpoint.sh "before removing legacy modules" bash scripts/checkpoint.sh "safety check" CHECKPOINT=$(bash scripts/checkpoint.sh "before config migration") echo "Rollback point: $CHECKPOINT" ``` -------------------------------- ### Inspect Skill Archive Contents (Bash) Source: https://github.com/sene1337/clawback/blob/main/references/skill-publishing.md This bash command inspects the contents of a packaged skill archive (`.skill` file) to ensure that no version control system internals, specifically `.git/` directories, have been included. This is a crucial step before release to prevent accidental exposure of VCS data. ```bash unzip -l tmp/.skill | grep -E '\.git/' && echo 'FAIL: .git leaked' || echo 'OK: clean' ``` -------------------------------- ### Perform Standard Git Commit Source: https://github.com/sene1337/clawback/blob/main/SKILL.md Standard procedure for committing changes after a logical unit of work. Ensures the workspace is clean and follows conventional commit standards. ```bash cd "$(git rev-parse --show-toplevel)" git add -A git commit -m "type: what changed — why" ``` -------------------------------- ### Dry-Run Runtime State Restore Source: https://github.com/sene1337/clawback/blob/main/references/ops-state.md This bash script performs a dry run of restoring the runtime state from a specified checkpoint. It verifies the checksums and simulates the restore process without making any actual changes, allowing for verification before a full restore. ```bash bash scripts/state-restore.sh --dry-run ``` -------------------------------- ### Changelog Entry Format Source: https://github.com/sene1337/clawback/blob/main/references/versioning.md Specifies the required format for changelog entries using Markdown. It includes version number, date, and categorized sections for Added, Changed, Fixed, Removed, and Security updates. ```markdown ## [X.Y.Z] - YYYY-MM-DD ### Added - ... ### Changed - ... ### Fixed - ... ``` -------------------------------- ### Manage Git Worktrees Source: https://github.com/sene1337/clawback/blob/main/SKILL.md Create and manage isolated worktrees for parallel development or risky refactors. This avoids direct manipulation of the main workspace. ```bash bash scripts/worktree.sh create feat-branch-name bash scripts/worktree.sh list bash scripts/worktree.sh path feat-branch-name cd "$(bash scripts/worktree.sh path feat-branch-name)" bash scripts/worktree.sh remove --prune-branch ``` -------------------------------- ### Revert and Force Push for Sensitive Data (Bash) Source: https://github.com/sene1337/clawback/blob/main/references/skill-publishing.md These bash commands are part of the rollback protocol for when sensitive data is accidentally pushed to GitHub. The first command reverts the last commit, and the second command force-pushes to remove the commit from history, assuming it contained credentials or private data. ```bash # Immediately revert git revert HEAD && git push origin main # If the commit contained credentials or private data, force-push to remove history git reset --hard HEAD~1 && git push --force origin main ``` -------------------------------- ### Subagent AGENTS.md Snippet Source: https://github.com/sene1337/clawback/blob/main/references/operating-discipline.md A concise rule for AGENTS.md defining responsibilities: subagents handle file writing, while the main session manages git commits, quality review, and log entries. ```text Subagents write/save files only. Main session owns all git commits, quality review, and log entries. ``` -------------------------------- ### Execute Rollback and Regression Logging Source: https://github.com/sene1337/clawback/blob/main/SKILL.md Revert to a specific commit hash when failures occur. This script cleans up untracked files and logs the regression in the continuous improvement documentation. ```bash bash scripts/rollback.sh "what broke" "why it broke" "which principle it tests" [--prompted] ``` -------------------------------- ### Remove Tracked File from Git Source: https://github.com/sene1337/clawback/blob/main/references/operating-discipline.md Bash commands to remove a file from git tracking while keeping it in the working directory and updating the .gitignore file to prevent future tracking. ```bash git rm --cached path/to/file.log echo "path/to/file.log" >> .gitignore git commit -m "chore: remove tracked log file, update .gitignore" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.