Skip to content
Back to skills

agent-checkpoint

ASecurity

Ultra-efficient, zero-data-loss pre-edit snapshotting, SemVer classification, and token-optimized dual-ledger audit trail (v2.0) for autonomous AI coding agents. Triggers on: agent-checkpoint, checkpoint, snapshot, audit trail, versioning, edit file, refactor, trackback, history, revision log, rollback, diff version.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 6, 2026
ai-agentsgonoderailsgitapi

Works with

  • api

Security analysis

A100/100

Pro scans all 10 files and shows the line behind each finding

Scanned October 7, 2026

npx -y skills add ainullm/agent-checkpoint --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of agent-checkpoint?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for agent-checkpoint
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ainullm-agent-checkpoint/badge)](https://www.skillsdirectory.com/skills/ainullm-agent-checkpoint)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: agent-checkpoint
description: >-
  Ultra-efficient, zero-data-loss pre-edit snapshotting, SemVer classification,
  and token-optimized dual-ledger audit trail (v2.0) for autonomous AI coding agents.
  Triggers on: agent-checkpoint, checkpoint, snapshot, audit trail, versioning, edit file,
  refactor, trackback, history, revision log, rollback, diff version.
---

# Agent-Checkpoint Protocol (v2.0 Turbo)

A universal, zero-dependency safety and provenance protocol for autonomous AI coding and research agents, optimized for **minimum token consumption** and **clean hierarchical storage**.

## Core Directives

1. **Zero Data Loss (Pre-Edit Archiving):** Never modify, refactor, or overwrite an existing file without archiving its exact prior state.
2. **Hierarchical File Bucketing (Clean Storage):**
   Every tracked file receives its own isolated directory inside `.snapshots/` matching its relative project path:
   ```text
   .snapshots/<relative_filepath>/
   ├── manifest.json            # Sharded local index (< 40 tokens read)
   ├── v1.0.0.<ext>             # Pristine pre-edit snapshot
   └── v1.1.0.<ext>
   ```
3. **Sliding Window Retention ($K = 5$ Versions Max):**
   To strictly bound disk space, each file bucket retains at most **5 latest snapshot versions**. When creating version 6, the agent automatically prunes the oldest physical snapshot file and updates the bucket's `manifest.json`.
4. **Token-Optimized Dual-Ledger Synchronization:**
   - **Sharded Local Index (`.snapshots/<filepath>/manifest.json`):** AI reads *only* this file's version state ($O(1)$ token overhead: ~30–50 tokens), avoiding global scans.
   - **Micro-Changelog Stream (`REVISION_LOG.md`):** Append-only compact table stream. **Never re-read previous log history** into context.
5. **Universal Scope & Guardrails:**
   - Full text/code coverage across 100+ extensions (`.py`, `.ts`, `.go`, `.rs`, `.cpp`, `.md`, `.json`, `.yaml`, etc.).
   - Tabular files (`.csv`, `.tsv`, `.jsonl`) are snapshotted ONLY if $\le 1\text{ MB}$. Files $> 1\text{ MB}$ log metadata only.
   - Strictly exclude binary models (`.pt`, `.onnx`, `.safetensors`), archives (`.zip`), and caches (`node_modules/`, `venv/`, `__pycache__/`, `.git/`).

---

## Standard Directory Layout

```text
[Project_Root]/
├── .snapshots/                          # Historical snapshots directory
│   ├── auth_service.py/                 # Isolated bucket per file
│   │   ├── manifest.json                # Local version registry (< 40 tokens)
│   │   ├── v1.0.0.py                    # Archived pre-edit snapshot
│   │   └── v1.1.0.py
│   └── src/routes/api.ts/               # Preserves nested structure
│       ├── manifest.json
│       └── v1.0.0.ts
├── REVISION_LOG.md                      # Append-only compact Markdown table
├── auth_service.py                      # Active working file
└── src/routes/api.ts
```

---

## Operating Procedures (SOP)

### Workflow 1: File Modification & Checkpointing (Fast-Path)

Whenever instructed to modify, refactor, or update an existing file:

1. **Step 1: Check Local Bucket (`.snapshots/<filepath>/manifest.json`)**
   - If bucket or file does not exist: treat as initial version (`v1.0.0`).
   - If exists: read latest version from the local `manifest.json` (< 40 tokens).

2. **Step 2: Classify SemVer Impact**
   - **MAJOR:** Breaking architectural shift, interface overhaul.
   - **MINOR:** Additive features, new endpoints/functions.
   - **PATCH:** Bug fix, refactor, parameter tuning, typo.

3. **Step 3: Capture Pre-Edit Snapshot & Apply Retention ($K \le 5$)**
   - Ensure directory `.snapshots/<filepath>/` exists.
   - Copy current active file to `.snapshots/<filepath>/v<OLD_VERSION>.<ext>`.
   - *Sliding Window Check:* If total snapshot files in bucket $> 5$, delete the oldest snapshot.

4. **Step 4: Apply Modification to Active File**
   - Apply user's requested edit on the active file.

5. **Step 5: Synchronize Dual-Ledger (Micro-Log Stream)**
   - Update `.snapshots/<filepath>/manifest.json`:
     ```json
     [
       {"version": "v1.1.0", "snapshot": "v1.0.0.py", "impact": "MINOR", "ts": "2026-10-07T03:45:00+07:00", "summary": "Added JWT refresh token"}
     ]
     ```
   - Append 1 line to `REVISION_LOG.md` without reading previous entries:
     ```markdown
     | 2026-10-07 03:45 | v1.1.0 | MINOR | auth_service.py | v1.0.0.py | Added JWT refresh token |
     ```

---

### Workflow 2: Deep Trackback & Semantic Diff

When requested to review or compare past revisions:
1. Read `.snapshots/<filepath>/manifest.json` to identify available snapshot versions.
2. Load target snapshot (e.g. `.snapshots/<filepath>/v1.0.0.<ext>`) and active file.
3. Present concise Before vs After comparison highlighting algorithmic or interface changes.

---

### Workflow 3: Instant Rollback / Recovery

When requested to revert or restore an earlier version:
1. Locate target snapshot in `.snapshots/<filepath>/v<TARGET_VERSION>.<ext>`.
2. Take safety snapshot of the *current* state (ensuring work-in-progress is never lost).
3. Overwrite active file with content from the snapshot.
4. Append 1-line rollback event to `REVISION_LOG.md`.

Files in this skill

  • README.id.md18.9 KB
  • SKILL.md6.1 KB
  • adapters/.cursorrules1 KB
  • adapters/.windsurfrules601 B
  • adapters/AGENTS.md1.2 KB
  • adapters/CLAUDE.md775 B
  • adapters/agent-checkpoint.mdc1.2 KB
  • adapters/copilot-instructions.md592 B
  • examples/REVISION_LOG.md980 B
  • examples/data_pipeline.py626 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…