agents/skills/injectable/l1/write-error-divergence/SKILL.md
L1 trigger - audits file/database write paths for metadata commits, cache updates, and success returns that diverge when writes fail.
npx skillsauth add plamentsv/plamen write-error-divergenceInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
L1 trigger:
STORAGEorDATABASE_TXflag OR file/DB write APIs detected (write_all,fs::write,rename,flush,commit,put,insert,batch,transaction) Inject Into:depth-state-trace,depth-edge-caseLanguage: Go and Rust Finding prefix:[WED-N]
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.
For each storage path, enumerate the logical write unit:
| Write Unit | Data Write | Metadata/Index Update | Error Check | Rollback/Cleanup | Verdict | |------------|------------|-----------------------|-------------|------------------|---------|
Include:
For each write unit:
Ok(()), HTTP success, or actor success messages must be returned only after the write and required flush/commit complete.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}].
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.
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.
development
Prepare Solidity projects for a security audit — test coverage, test quality, NatSpec docs, code hygiene, dependency health, best-practice enforcement, deployment readiness, and project documentation checks. Generates a scored Audit Readiness Report and optionally runs static analysis. Trigger on: "prepare for audit", "audit readiness", "pre-audit check", "audit prep", "NatSpec check", or any request to review a Solidity codebase before a security review.
development
Launch the Plamen deterministic Web3 security audit pipeline
development
Run the Plamen smart-contract audit wizard in Codex
testing
Launch the Plamen deterministic L1 infrastructure audit pipeline