- Home
- Skills
- Agents & Orchestration
- Protect Shared Ledgers and Git Trees Across AI Agents
More screenshots
Works with the AI Agents you already use
Protect Shared Ledgers and Git Trees Across AI Agents
Lock shared YAML/JSONL ledger writes, reject row loss and out-of-scope edits, and check staged commits against a declared file scope, so several AI agents can share one repository without silently losing work.
$25
Protect Shared Ledgers and Git Trees Across AI Agents
Example session with this skill installed
python3 scripts/safe_ledger_write.py --ledger examples/sample_ledger.yaml --candidate examples/sample_ledger_bad_patch.yaml --only task-002 --dry-run --format text
- Read your context and instructions
- Compiled the protect shared ledgers
LedgerGuard: sample_ledger.yaml | before_rows=4 | after_rows=3 | status=REJECTED
Violations
- [row-count-decreased] row_count dropped from 4 to 3 (missing: task-004).
- [outside-only-scope] non-target row modified: task-001 (allowed only: task-002).
Action: dry-run rejected candidate; original ledger untouched.
Connects securely to your tools. The creator never sees your data.
About this skill
For teams running multiple Claude Code or Codex agents on the same repository and shared YAML/JSONL ledgers. It helps prevent silent row drops, zero-byte overwrites, accidental git stash sweeps across teammates' uncommitted files, and cross-task commit pollution.
What you get
- Six practical guides: concurrency failure modes, protected ledger writes, shared Git trees, baseline handoff checks, test harnesses, and integration limits.
scripts/safe_ledger_write.py: lock, validate, snapshot, and atomically replace a candidate JSON, JSONL, or simple YAML list ledger. Supports--only,--dry-run, and--recover-latest.scripts/git_scope_audit.py: inspect staged or committed paths against declared file patterns and optional added-symbol names.templates/block_shared_stash_hook.py: a Claude Code PreToolUse hook that reads the realtool_nameandtool_input.commandfields and blocks mutating stash commands.- Integration templates (
safe_ledger_patch_example.py,git_precommit_scope_check.sh,settings_hooks_snippet.json) and a regression test suite that uses real Git repositories and concurrent writer processes.
Quick start
Run the dry-run example from the package folder:
python3 scripts/safe_ledger_write.py --ledger examples/sample_ledger.yaml --candidate examples/sample_ledger_bad_patch.yaml --only task-002 --dry-run --format text
It rejects the candidate: the row count drops from 4 to 3 and a row outside the allowed scope is modified. The original ledger stays untouched.
Limits
The controls reduce accidental loss under local POSIX file locking and declared-scope checks. They depend on cooperating writers, they do not merge conflicting edits to the same record, and they do not guarantee locks on every network filesystem. The Git scope audit works on staged or committed diffs, and its symbol mode is a simple declaration check, not a language parser. Shell hooks are defense in depth: obfuscated commands such as eval need platform permission controls as well.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Agents & Orchestration.
Depends on cooperating writers, local POSIX advisory file locks, and explicitly declared scopes; locking is not guaranteed on every network filesystem. It does not merge conflicting edits to the same record or decide which of two different edits to one row is correct. The Git scope audit checks staged or committed diffs, and its symbol mode is a simple declaration check, not a language parser. The shell hook is defense in depth: obfuscated commands such as eval need platform permission controls as well.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed today
- Software
Python 3.9+
Git