一键导入
commits
Commit ledger for tracking VM snapshots. Use when recording, querying, or managing Vers VM commit history — golden images, infra snapshots, rollback points.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Commit ledger for tracking VM snapshots. Use when recording, querying, or managing Vers VM commit history — golden images, infra snapshots, rollback points.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Always register VM snapshots in the commit ledger. Use when committing/snapshotting VMs, before destroying VMs, during deploys, or when creating golden images. Ensures no snapshot goes untracked.
Generate a magic login link for the agent-services dashboard UI. Use when the user wants to access the dashboard, needs a login link, says "magic link," or asks for UI access.
Shared task board for coordinating work across agents. Use when creating, assigning, tracking, or querying tasks in a swarm.
Deploy a branch to a preview VM for zero-risk change review. Snapshot infra, clone it, deploy the branch on the clone, share the link. Production untouched. Use for ALL UI changes, feature demos, and PR reviews.
Append-only work log for agent sessions. Use when recording what happened, what was decided, and what's next — the log is for the next session's orchestrator.
Deploy agent-services to the infra VM. Use when shipping new code, restarting services, or rolling back a broken deploy. Covers pre-deploy snapshot, pull/build/restart, smoke tests, and rollback.
| name | commits |
| description | Commit ledger for tracking VM snapshots. Use when recording, querying, or managing Vers VM commit history — golden images, infra snapshots, rollback points. |
Tracks VM snapshots (commits) so agents can answer questions like "what was the last golden image?" or "which commit had the working Node.js install?" The Vers API has no "list my commits" endpoint, so this ledger fills that gap.
vers_vm_commit — record the commit so it's discoverable latergolden, stable, broken, etc.VERS_INFRA_URL env var points to the infra VM (e.g., http://abc123.vm.vers.sh:3000). All endpoints below are relative to this base URL.
curl -X POST "$VERS_INFRA_URL/commits" \
-H "Content-Type: application/json" \
-d '{
"commitId": "abc123-commit-id",
"vmId": "abc123-vm-id",
"label": "golden-v5",
"agent": "orchestrator",
"tags": ["golden", "stable"],
"metadata": {"nodeVersion": "22", "piVersion": "0.52.9"}
}'
Returns 201 with the full entry (including generated id and timestamp). Returns 409 if commitId is already recorded.
Fields: commitId (required), vmId (required), label (optional — human-readable name), agent (optional — who made the commit), tags (optional — array of strings), metadata (optional — arbitrary key/value data).
# All commits (newest first)
curl "$VERS_INFRA_URL/commits"
# Filter by tag
curl "$VERS_INFRA_URL/commits?tag=golden"
# Filter by agent
curl "$VERS_INFRA_URL/commits?agent=orchestrator"
# Filter by label
curl "$VERS_INFRA_URL/commits?label=infra"
# Filter by source VM
curl "$VERS_INFRA_URL/commits?vmId=abc123-vm-id"
# Filter by time (ISO timestamp)
curl "$VERS_INFRA_URL/commits?since=2026-02-10T00:00:00Z"
# Combine filters
curl "$VERS_INFRA_URL/commits?tag=golden&agent=orchestrator"
Returns { commits: [...], count: N }. Results are sorted newest first.
curl "$VERS_INFRA_URL/commits/abc123-commit-id"
Returns the commit entry or 404.
curl -X DELETE "$VERS_INFRA_URL/commits/abc123-commit-id"
Returns { deleted: true } or 404.
Every time you snapshot a VM, record it in the ledger:
# 1. Commit the VM via Vers API
COMMIT_ID=$(vers_vm_commit --vmId $VM_ID)
# 2. Record in the ledger
curl -X POST "$VERS_INFRA_URL/commits" \
-H "Content-Type: application/json" \
-d "{
\"commitId\": \"$COMMIT_ID\",
\"vmId\": \"$VM_ID\",
\"label\": \"golden-v5\",
\"agent\": \"orchestrator\",
\"tags\": [\"golden\", \"stable\"]
}"
Tag golden images so you can find the latest one:
# Find the latest golden image
curl -s "$VERS_INFRA_URL/commits?tag=golden" | jq '.commits[0]'
# Find all stable golden images
curl -s "$VERS_INFRA_URL/commits?tag=golden&tag=stable"
# Mark a golden image as broken (delete and re-record, or just record a new one)
curl -X DELETE "$VERS_INFRA_URL/commits/old-broken-commit"
Before doing something that might break the VM, commit and record:
# Snapshot as a rollback point
curl -X POST "$VERS_INFRA_URL/commits" \
-H "Content-Type: application/json" \
-d '{
"commitId": "'$COMMIT_ID'",
"vmId": "'$VM_ID'",
"label": "pre-deploy-backup",
"agent": "lt-infra",
"tags": ["backup", "rollback-point"]
}'
# What snapshots did lt-infra make today?
curl -s "$VERS_INFRA_URL/commits?agent=lt-infra&since=2026-02-10T00:00:00Z" | jq '.commits[] | {commitId, label, timestamp}'
# Find the last known-good infra snapshot
curl -s "$VERS_INFRA_URL/commits?label=infra&tag=stable" | jq '.commits[0].commitId'
# List old commits and delete ones no longer needed
curl -s "$VERS_INFRA_URL/commits" | jq '.commits[] | {commitId, label, timestamp}'
# Delete a stale entry
curl -X DELETE "$VERS_INFRA_URL/commits/old-commit-id"
Use consistent tags so queries work across agents:
| Tag | Meaning |
|---|---|
golden | Golden image — ready to branch workers/lieutenants from |
stable | Known working state |
broken | Known broken — don't use |
wip | Work in progress, not yet validated |
backup | Safety snapshot before a risky operation |
rollback-point | Explicit rollback target |
interface CommitEntry {
id: string; // ULID (auto-generated)
commitId: string; // Vers commit ID (from vers_vm_commit)
vmId: string; // Vers VM ID that was committed
timestamp: string; // ISO timestamp (auto-generated)
label?: string; // Human-readable name
agent?: string; // Who made the commit
tags?: string[]; // Categorization tags
metadata?: Record<string, unknown>; // Arbitrary extra data
}
Commits are persisted in data/commits.jsonl (append-only JSONL). Each line is one JSON entry. Deletes trigger a full rewrite.