state-snapshot-instrumenter — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited state-snapshot-instrumenter (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
This skill instruments programs to capture snapshots of key program states at runtime. Snapshots include variable values, memory state, call stacks, and execution context, saved in structured JSON format for analysis, debugging, reproduction, and verification.
# 1. Add markers to your code
# def my_function(x):
# __SNAPSHOT__("my_function:start")
# result = x * 2
# __SNAPSHOT__("my_function:end")
# return result
# 2. Instrument the code
python scripts/instrument_python.py my_program.py --mode manual
# 3. Run instrumented program
python my_program_instrumented.py
# Snapshots saved to snapshots.json
# 4. Analyze snapshots
python scripts/analyze_snapshots.py snapshots.json --list# 1. Add markers to your code
# int main() {
# __SNAPSHOT__("main:start");
# int x = 10;
# __SNAPSHOT__("main:end");
# return 0;
# }
# 2. Instrument the code
python scripts/instrument_c.py program.c --mode manual
# 3. Compile with runtime
gcc program_instrumented.c scripts/snapshot_runtime.c -o program -rdynamic
# 4. Run and analyze
./program
python scripts/analyze_snapshots.py snapshots.json --list# 1. Add markers to your code
# public static void main(String[] args) {
# __SNAPSHOT__("main:start");
# int x = 10;
# __SNAPSHOT__("main:end");
# }
# 2. Instrument the code
python scripts/instrument_java.py Program.java --mode manual
# 3. Compile and run
cp scripts/SnapshotRuntime.java snapshot/
javac snapshot/SnapshotRuntime.java
javac Program_instrumented.java
java Program_instrumented
# 4. Analyze
python scripts/analyze_snapshots.py snapshots.json --listAdd explicit __SNAPSHOT__("location") markers at specific points in your code.
Python:
def process_data(items):
__SNAPSHOT__("process_data:entry")
result = []
for item in items:
__SNAPSHOT__("loop_iteration")
result.append(item * 2)
__SNAPSHOT__("process_data:exit")
return resultC/C++:
int calculate(int x, int y) {
__SNAPSHOT__("calculate:entry");
int result = x + y;
__SNAPSHOT__("calculate:exit");
return result;
}Java:
public int calculate(int x, int y) {
__SNAPSHOT__("calculate:entry");
int result = x + y;
__SNAPSHOT__("calculate:exit");
return result;
}Instrument:
python scripts/instrument_python.py file.py --mode manual
python scripts/instrument_c.py file.c --mode manual
python scripts/instrument_java.py file.java --mode manualAutomatically instrument all function/method entry and exit points.
python scripts/instrument_python.py file.py --mode auto
python scripts/instrument_c.py file.c --mode auto
python scripts/instrument_java.py file.java --mode autoThis captures state at every function boundary without manual markers.
Python:
# Manual mode
python scripts/instrument_python.py input.py --mode manual -o output.py
# Automatic mode
python scripts/instrument_python.py input.py --mode auto -o output.py
# In-place modification
python scripts/instrument_python.py input.py --mode manual --inplaceC/C++:
# Instrument
python scripts/instrument_c.py input.c --mode manual -o output.c
# Compile with runtime
gcc output.c scripts/snapshot_runtime.c -o program -rdynamic
# Run with custom output file
SNAPSHOT_OUTPUT=my_snapshots.json ./programJava:
# Instrument
python scripts/instrument_java.py Input.java --mode manual -o Output.java
# Setup runtime
cp scripts/SnapshotRuntime.java snapshot/
javac snapshot/SnapshotRuntime.java
# Compile and run
javac Output.java
SNAPSHOT_OUTPUT=my_snapshots.json java OutputList all snapshots:
python scripts/analyze_snapshots.py snapshots.json --listShow detailed snapshot:
python scripts/analyze_snapshots.py snapshots.json --show 5View execution timeline:
python scripts/analyze_snapshots.py snapshots.json --timelineTrack variable changes:
python scripts/analyze_snapshots.py snapshots.json --track-var "user_id"Compare two snapshots:
python scripts/analyze_snapshots.py snapshots.json --compare 10 20Filter snapshots:
# By location
python scripts/analyze_snapshots.py snapshots.json --filter-location "main"
# By type
python scripts/analyze_snapshots.py snapshots.json --filter-type "function_entry"Python:
import snapshot_runtime
# Disable snapshots temporarily
snapshot_runtime.disable()
# ... performance-critical code ...
snapshot_runtime.enable()
# Set custom output file
snapshot_runtime.set_output_file("custom.json")
# Manually save snapshots
snapshot_runtime.save_snapshots()C/C++:
#include "snapshot_runtime.h"
snapshot_disable();
// ... performance-critical code ...
snapshot_enable();
snapshot_finalize(); // Manually saveJava:
import snapshot.SnapshotRuntime;
SnapshotRuntime.disable();
// ... performance-critical code ...
SnapshotRuntime.enable();
SnapshotRuntime.setOutputFile("custom.json");
SnapshotRuntime.saveSnapshots();Capture comprehensive state to understand complex bugs:
See references/use_cases.md for detailed debugging workflows.
Extract exact inputs and state to reproduce failures:
See references/use_cases.md for reproduction workflows.
Generate execution traces for verification tools:
See references/use_cases.md for verification workflows.
Example instrumented programs are provided in assets/:
example_python.py - Python example with manual snapshotsexample_c.c - C example with manual snapshotsexample_java.java - Java example with manual snapshotsAll snapshots are saved in unified JSON format:
{
"format_version": "1.0",
"language": "python",
"total_snapshots": 5,
"snapshots": [
{
"snapshot_id": 1,
"timestamp": "2026-02-17T19:30:45",
"location": "main:start",
"type": "manual",
"call_stack": [...],
"local_variables": {...}
}
]
}See assets/snapshot_schema.json for the complete JSON schema.
SNAPSHOT_OUTPUT environment variable~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.