Skip to content
Security
Skill

/write-error-divergence

L1 trigger - audits file/database write paths for metadata commits, cache updates, and success returns that diverge when writes fail.

From plugin
plamen
31596 skills9 agents4 commands

Claude Code

$ npx -y skills add PlamenTSV/plamen --skill write-error-divergence --agent claude-code

SKILL.md

write-error-divergence.SKILL.md
name: "write-error-divergence"
description: "L1 trigger - audits file/database write paths for metadata commits, cache updates, and success returns that diverge when writes fail."

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}]`.

3. Non-Finding Rules

Do not report internal best-practice issues unless a failed write can produce stale reads, corrupted state, replay, permanent data loss, fork-choice divergence, or a liveness failure after restart.

4. Output

Use normal finding format. If no finding exists, still emit the write-unit table with file:line evidence for each safe rollback or commit path.

Read more
@plamentsv
Ships withplamen

Autonomous Web3 security auditor for Claude Code and OpenAI Codex CLI. Orchestrates 18-100 AI agents across 40+ phases to produce audit reports with verified PoC exploits — for smart contracts and L1 node-client infrastructure.

31596 skills9 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
315
Star history of PlamenTSV/plamen on GitHub, a chart by star-history.com

Other skills on plamen.

ability-analysis

ability-analysis

Trigger Pattern Always (Aptos Move) - foundational security check - Inject Into Breadth agents, depth agents

@plamentsv@plamentsvInstall Skill
bit-shift-safety

bit-shift-safety

Trigger Pattern Always (Aptos Move) - Move VM aborts on shift = bit width - Inject Into Breadth agents, depth-edge-case

@plamentsv@plamentsvInstall Skill
centralization-risk

centralization-risk

Trigger Protocol has privileged roles (admin, operator, governance, resource account owner) - Covers Single points of failure,…

@plamentsv@plamentsvInstall Skill
cross-chain-timing

cross-chain-timing

Trigger Pattern wormhole|layerzero|ccip|bridge|cross_chain|vaa|guardian|emitter|relay|remote_chain|payload|nonce.sequence -…

@plamentsv@plamentsvInstall Skill
dependency-audit

dependency-audit

Trigger EXTERNAL_LIB flag detected (protocol uses third-party Move dependencies) - Used by Breadth agents, depth-external

@plamentsv@plamentsvInstall Skill

More skills from other plugins.

api-security

api-security

Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…

@zhaoxuya520@zhaoxuya520Install Skill
nemoclaw-user-guide

nemoclaw-user-guide

Find official NemoClaw documentation for installation, configuration, operation, or troubleshooting. Also handles requested docs…

@nvidia@nvidiaInstall Skill

Questions about write-error-divergence.

Which coding agents can use write-error-divergence?
write-error-divergence installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.