home / skills / openclaw / skills / bobagent-git-sync

bobagent-git-sync skill

/skills/bobdevibecoder/bobagent-git-sync

This skill automatically syncs local workspace changes to the remote GitHub repository, ensuring up-to-date backups after significant edits.

npx playbooks add skill openclaw/skills --skill bobagent-git-sync

Review the files below or copy the command above to add this skill to your agents.

Files (2)
SKILL.md
728 B
---
name: git-sync
description: Automatically syncs local workspace changes to the remote GitHub repository. Use after significant changes or periodically.
tags: [git, sync, backup, version-control]
---

# Git Sync Skill

Automatically syncs local workspace changes to the remote GitHub repository.
Designed to be called by PCEC cycles or after significant changes.

## Tools

### git_sync
Commit and push changes.

- **message** (optional): Commit message. Defaults to "Auto-sync: Routine evolution update".

## Safety
- Uses `.gitignore` and `pre-commit` hooks (ADL-compliant) to prevent secret leakage.
- Checks if there are changes before committing.

## Implementation
Wrapper around `git add . && git commit && git push`.

Overview

This skill automatically syncs local workspace changes to a remote GitHub repository. It is implemented in Python and designed to be invoked after significant edits or on scheduled cycles. The goal is reliable, low-effort backups and version continuity for active development.

How this skill works

The skill stages changed files, creates a commit with a configurable message, and pushes the commit to the configured remote branch. It first checks for any changes to avoid empty commits, and relies on .gitignore and pre-commit hooks to reduce the risk of committing secrets. A default commit message is used when none is provided.

When to use it

  • After completing a significant code change or feature branch update.
  • At the end of an automated PCEC or CI cycle to persist workspace state.
  • Before switching tasks to capture the current working state.
  • Periodically as a scheduled backup to ensure continuous archival.
  • When you want minimal manual overhead for routine commits and pushes.

Best practices

  • Keep a meaningful commit message when changes are logically grouped; the skill provides a default for quick syncs.
  • Maintain an up-to-date .gitignore to prevent tracking of secrets, large binaries, and generated files.
  • Use pre-commit hooks to run linters and secret scanners before commits are created.
  • Verify remote and branch settings once so automated pushes go to the intended repository.
  • Run the skill in contexts with correct credentials and network access to avoid push failures.

Example use cases

  • Automatically archive all skill versions after a development cycle to the GitHub archive repository.
  • Trigger a workspace snapshot at the end of a daily work session to preserve progress.
  • Integrate into scheduled jobs that periodically push incremental backups from ephemeral environments.
  • Use after bulk edits or migrations to ensure remote history reflects local changes.
  • Attach to automated pipelines that require a reliable push step after testable transformations.

FAQ

What happens if there are no changes to commit?

The skill detects the absence of changes and skips creating a commit or pushing, avoiding empty commits.

How does the skill avoid accidentally committing secrets?

It respects .gitignore and is designed to run pre-commit hooks including secret scanners to help prevent leaks before commits are made.