write-error-divergence

write-error-divergence is a skill for Claude Code, Codex from PlamenTSV/plamen. It costs 32 tokens per session (611 once invoked), scanned A, original, MIT.

A code-audit skill for file and database writes that update stored data alongside metadata, indexes, caches, or checkpoints. It checks whether these parts agree when a write fails.

In plain words
What is it for?
It is for reviewing file writes, database transactions, batches, commits, cache updates, indexes, temporary files, renames, flushes, and recovery paths.
Why use it?
It helps prevent a program from reporting success or advancing its metadata when the actual data was not saved. Such mismatches can appear after a crash or restart.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit It is for reviewing file writes, database transactions, batches, commits, cache updates, indexes, temporary files, renames, flushes, and recovery paths.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/plamentsv/plamen/write-error-divergence
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add PlamenTSV/plamen --skill write-error-divergence
Clone the repo
git clone --depth 1 https://github.com/PlamenTSV/plamen

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for write-error-divergence

README.md
[![agentmods](https://agentmods.dev/badge/skills/plamentsv/plamen/write-error-divergence/github.svg)](https://agentmods.dev/skills/plamentsv/plamen/write-error-divergence)
Your own site
<a href="https://agentmods.dev/skills/plamentsv/plamen/write-error-divergence"><img src="https://agentmods.dev/badge/skills/plamentsv/plamen/write-error-divergence/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for write-error-divergence

Your own site · 80×15
<a href="https://agentmods.dev/skills/plamentsv/plamen/write-error-divergence"><img src="https://agentmods.dev/badge/skills/plamentsv/plamen/write-error-divergence.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 32 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 611 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00032 $0.00611
Opus 5 $0.00016 $0.00305
Sonnet 5 $0.00006 $0.00122
Haiku 4.5 $0.00003 $0.00061

Measured 6d ago against content hash 71e0d6f5113f, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

write-error-divergence scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

agents/skills/injectable/l1/write-error-divergence/SKILL.md · 49 lines

How it starts

The opening of the file, as written. The whole thing — 49 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Injectable Skill: Write Error Divergence

L1 trigger: STORAGE or DATABASE_TX flag OR file/DB write APIs detected (write_all, fs::write, rename, flush, commit, put, insert, batch, transaction) Inject Into: depth-state-trace, depth-edge-case Language: Go and Rust Finding prefix: [WED-N]

Purpose

Node clients often pair durable writes with in-memory metadata, indexes, caches, or database transactions. If metadata advances before the durable write succeeds, restart or reorg behavior can diverge from the actual persisted state.

1. Write Unit Enumeration

For each storage path, enumerate the logical write unit:

Write Unit Data Write Metadata/Index Update Error Check Rollback/Cleanup Verdict

Include:

  • block/header/transaction persistence;
  • cache metadata, expiry timestamps, indices, checkpoints, migration markers;
  • database transactions and batches;
  • file writes that use temp files, rename, flush, fsync, or parent-directory fsync.

2. Required Checks

For each write unit:

  • Metadata-before-data: metadata, cache state, or checkpoint markers must not advance before the durable write succeeds.
  • Success-after-side-effect: Ok(()), HTTP success, or actor success messages must be returned only after the write and required flush/commit complete.
  • Commit-before-check: database transactions must not commit when the closure or inner operation returned an error.
  • Partial write: short writes, interrupted writes, rename failures, flush/fsync failures, and parent-directory fsync failures must be handled consistently.
  • Rollback/cleanup: failed writes must either roll back metadata or leave an explicit repair/retry marker.
  • Restart trace: trace what a node observes after restart if the write fails at each boundary.

Tag evidence as [WED-METADATA-BEFORE-DATA:{file}:{line}], [WED-COMMIT-BEFORE-CHECK:{file}:{line}], [WED-SUCCESS-BEFORE-WRITE:{file}:{line}], or [WED-RESTART-DIVERGE:{file}:{line}].

Read the full file on GitHub · 49 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 49 lines · 32 tokens per session scan A 71e0d6f5113f

Subscribe to this mod's changes

write-error-divergence is a skill published in the GitHub repository PlamenTSV/plamen (295 stars, last pushed 2d ago), licensed MIT. It adds 32 tokens to every session and 611 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.

Related

Other skills, from other repositories

postgresql-indexing

PostgreSQL indexing best practices for Prowler: index design, partial indexes, partitioned table indexing, EXPLAIN ANALYZE validation, concurrent operations, monitoring, and maintenance. Trigger: When creating or modifying PostgreSQL indexes, analyzing query performance with EXPLAIN, debugging slow queries, reviewing…

prowler-cloud/prowler · 108 tokens

triage-issues

Triage GitHub issues in the googleapis/mcp-toolbox repo: propose the correct labels (type / priority / product / status), check for duplicates, verify a bug has enough info to act on, and draft a triage comment. Use whenever a maintainer asks you to triage, label, categorize, prioritize, or "look at" an issue (or a…

googleapis/mcp-toolbox · 164 tokens

gh-aw

Create and maintain GitHub Agentic Workflows (gh-aw) for Prowler. Trigger: When creating agentic workflows, modifying gh-aw frontmatter, configuring safe-outputs, setting up MCP servers in workflows, importing Copilot Custom Agents, or debugging gh-aw compilation.

prowler-cloud/prowler · 59 tokens

graphjin-eval

Create, extend, run, baseline, and diagnose GraphJin agent evaluations through the graphjin eval CLI.

dosco/graphjin · 27 tokens

axiom-audit-grdb-performance

Use when the user mentions GRDB performance review, slow GRDB queries, app-group database setup audit, a ValueObservation that stopped updating, or pre-release GRDB scan.

CharlesWiltgen/Axiom · 43 tokens

byted-bytehouse-slow-query

A ByteHouse tool for finding slow database queries, examining how they run, and suggesting ways to improve them.

bytedance/agentkit-samples · 74 tokens