一键导入
workspace-backup
Backup and restore SwarmAI workspace (memory, knowledge, projects, config, conversations) to/from a private GitHub repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Backup and restore SwarmAI workspace (memory, knowledge, projects, config, conversations) to/from a private GitHub repository.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Orchestrate the full AIDLC Autonomous Pipeline from a one-sentence requirement to a PR-ready delivery with TDD methodology. DDD drives judgment, SDD produces specs, TDD verifies delivery. Stages: Evaluate, Think, Plan, Build, Review, Test, Deliver, Reflect. Checkpoints on BLOCK or context limits. TRIGGER: "run pipeline", "autonomous pipeline", "pipeline for", "full pipeline". NOT FOR: single stages (use evaluate, deep-research, code-review, qa, deliver directly).
DDD-native autonomous dev loop — judge→execute→reflect on a SINGLE DDD via a bundled, decoupled engine (engine/artifact_cli.py, file-based .artifacts/ state, NO data.db, NO SwarmAI backend). Retains the moat: Gate-2 adversarial-before-commit + the 养成 ladder. DDD-native decouple of SwarmAI's s_autonomous-pipeline engine. TRIGGER: "ddd pipeline", "run the ddd loop", "build in this ddd". NOT FOR: SwarmAI's own multi-project pipeline (that's the native s_autonomous-pipeline).
Package a grown DDD into a distributable capability package — the last step of the DDD lifecycle (cultivate → version → DISTRIBUTE). Human-in-the-loop: reads the DDD's OWN declared reach (aim.json distribution block = the ceiling), confirms which declared target(s) to emit NOW, renders BOTH standard shapes on demand — an internal AIM capabilities package (Config+AIMBuild+agent-spec) and/or an Open-Plugins plugin (.plugin/plugin.json) — runs a fail-closed content-safety scan over the emitted tree, and returns the built package path. Never widens reach by inference; emit ≠ publish. TRIGGER: "distribute this ddd", "package ddd", "ship ddd to kiro/quick/claude code", "publish ddd", "make a plugin from this ddd". NOT FOR: creating/binding a DDD (s_ddd-manager); running the pipeline (s_ddd-pipeline); publishing content/media (s_ddd-pollinate).
Create, list, edit, rename, and delete DDD projects (Domain-Driven Design) — provisions the canonical six-section DDD structure. Each project gets 4 knowledge documents (PRODUCT.md, TECH.md, IMPROVEMENT.md, PROJECT.md) and an .artifacts/ directory for pipeline outputs. TRIGGER: "add project", "new project", "create project", "rename project", "create DDD". NOT FOR: radar-todo use cases.
Estimate token count for files using the bundled script. TRIGGER: "estimate tokens", "count tokens", "token usage", "context window size". DO NOT USE: for manual token math — always run the script.
Full SwarmAI release cycle: preflight checks, version bump, binary build, desktop package, smoke test, and GitHub publish. Supersedes s_release (which only does version bump + tag) by adding build/package/smoke stages. TRIGGER: "release", "cut release", "ship it", "发版". NOT FOR: s_swarm-build, s_release, s_swarm-hive use cases.
| name | workspace-backup |
| disable-model-invocation | true |
| description | Backup and restore SwarmAI workspace (memory, knowledge, projects, config, conversations) to/from a private GitHub repository. |
| tier | lazy |
| platform | all |
Manage workspace backups to a private GitHub repository. Your memory, knowledge, projects, config, and conversation history are backed up daily and can be restored on a new machine.
TRIGGER: "backup workspace", "backup now", "restore workspace", "backup status", "configure backup", "when was last backup", "备份", "恢复workspace". DO NOT USE: for git operations on the swarmai codebase (use workspace-git), for file search (use workspace-finder), or for project CRUD (use ddd-manager).
curl -s "http://localhost:$(cat ~/.swarm-ai/backend.json | python3 -c 'import sys,json;print(json.load(sys.stdin)["port"])')/api/system/backup/status" | python3 -m json.tool
Shows: last_backup timestamp, repo_url, schedule, enabled.
curl -s -X POST "http://localhost:$(cat ~/.swarm-ai/backend.json | python3 -c 'import sys,json;print(json.load(sys.stdin)["port"])')/api/system/backup" | python3 -m json.tool
Exports DB tables, copies config, commits and pushes to GitHub.
curl -s -X PUT "http://localhost:$(cat ~/.swarm-ai/backend.json | python3 -c 'import sys,json;print(json.load(sys.stdin)["port"])')/api/system/backup/config" \
-H "Content-Type: application/json" \
-d '{"repo_url": "https://github.com/USER/REPO.git", "token": "ghp_..."}' | python3 -m json.tool
When the API isn't available (e.g., daemon not running), use Python directly:
import asyncio
from core.backup_manager import BackupManager
# Backup
result = asyncio.run(BackupManager().backup())
print(result)
# Status
print(BackupManager().get_status())
# Restore (on a fresh machine)
async def restore():
mgr = BackupManager()
async for event in mgr.restore(repo_url="https://github.com/USER/REPO.git"):
print(event)
asyncio.run(restore())
| Layer | Content | Size |
|---|---|---|
| L1 (git) | .context/, Knowledge/, Projects/, config | ~240MB |
| L2 (DB dump) | messages, sessions, todos, token_usage, etc. | ~8MB gz |
| L3 (skip) | embeddings, FTS, knowledge_chunks | Rebuilt on restore |
com.swarmai.backup at 3:30 AM dailycom.swarmai.backup)~/.swarm-ai/.backup-token (chmod 600)SWARM_BACKUP_TOKEN env var