transact-graph-write

transact-graph-write is a skill for Claude Code from ayeshakhalid192007-dev/graph-engineering-crash-course. It costs 51 tokens per session (1,003 once invoked), scanned A, original, MIT.

A transaction-based method for safely writing changes to a shared graph edge in a database. A transaction groups a read and write so the update is checked against the exact version that was read.

In plain words
What is it for?
Use it for concurrent graph updates, version checks, conflict retries, and writes that must preserve each writer’s actual intent.
Why use it?
It prevents one writer from silently overwriting another writer’s newer change and recalculates the intended update after a conflict.

Skill for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions Claude Code.

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.

agentmods
npx agentmods add skills/ayeshakhalid192007-dev/graph-engineering-crash-course/transact-graph-write
Any agent
npx skills add ayeshakhalid192007-dev/graph-engineering-crash-course --skill transact-graph-write
Clone the repo
git clone --depth 1 https://github.com/ayeshakhalid192007-dev/graph-engineering-crash-course

Made for: Claude Code.

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 transact-graph-write

README.md
[![agentmods](https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/transact-graph-write.svg)](https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/transact-graph-write)
Your own site
<a href="https://agentmods.dev/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/transact-graph-write"><img src="https://agentmods.dev/badge/skills/ayeshakhalid192007-dev/graph-engineering-crash-course/transact-graph-write.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,003 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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.00051 $0.01003
Opus 5 $0.00026 $0.00502
Sonnet 5 $0.00010 $0.00201
Haiku 4.5 $0.00005 $0.00100

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

Security

Grade A, and why

transact-graph-write 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 5d 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.

starters/postgres-backed-graph/.claude/skills/transact-graph-write/SKILL.md · 98 lines

How it starts

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

transact-graph-write

Reads a shared edge row's current version before writing to it, commits the write only if that version still matches, and on a rejected write re-reads the row's new state and recomputes the writer's actual intent against it before retrying — never dropping the write and never reapplying stale values.

Instructions

You are a Claude Code skill implementing the postgres-backed-graph pattern. Follow these steps in order:

  1. Read the target edge row's current state inside a transaction, including its version marker — never read the row and decide on a write outside a transaction boundary. Default to the checkout-v2-flag write sequence in this kit's README.md unless given a different one.
  2. Compute the intended write against the version just read, and before committing, check that version still matches the row's current version. If it does, write the new state, increment the version, and commit — all inside the same transaction.
  3. If the version no longer matches — someone else's write committed to this row since this write was computed — do not commit a blind overwrite. Abort this transaction.
  4. On abort, re-read the row's now-current state, and recompute the writer's actual intent against that new state, not against the stale state the first attempt used. The retry must still accomplish what the writer originally meant (e.g. "roll back" is still "roll back"), reapplied to the row as it now stands — never a blind replay of the original write's literal values.
  5. Retry the write as a new transaction against the current version, following the same check-then-commit logic as step 2. If it's rejected again, repeat steps 3–5.
  6. Never let two writers' transactions interleave a partial write to the same row. Every write to a given edge happens as one atomic transaction, from the initial read-and-lock through commit, with nothing else touching that row in between.
  7. Log every committed write with updated_by and updated_at, so a later reader can reconstruct the actual order writes landed in, not just infer it from the final value.
  8. Report, per writer: the version it started from, the version it ended on, the final value it wrote, and whether it committed straight through or needed one or more retries due to a concurrent conflicting write.

Read the full file on GitHub · 98 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. 5d ago First seen · 98 lines · 51 tokens per session scan A e9714ee0efc0

Subscribe to this mod's changes

transact-graph-write is a skill published in the GitHub repository ayeshakhalid192007-dev/graph-engineering-crash-course (5 stars, last pushed 10d ago), licensed MIT. It adds 51 tokens to every session and 1,003 once invoked, about $0.0003 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-08-31.

Related

Other skills, from other repositories

moai-domain-database

Database specialist covering PostgreSQL, MongoDB, Redis, Oracle, and cloud database platforms (Neon, Supabase, Firestore). Use for schema design, query optimization, indexing strategies, data modeling, or cloud database selection. Cloud vendor guide absorbed from moai-platform-database-cloud.

modu-ai/moai-adk · 64 tokens

moai-platform-database-cloud

Cloud database platform specialist covering Neon (serverless PostgreSQL), Supabase (PostgreSQL 16 with real-time), and Firebase Firestore (NoSQL with offline sync). Use when choosing or setting up cloud databases.

modu-ai/moai-adk · 51 tokens

building-agents

Use when building or restructuring an LLM agent — provider adapter, tool calling, structured output, RAG, agent loop, eval gate, cost routing, tracing, MCP server — model-agnostic across OpenAI/Anthropic/Gemini/OSS so a model swap is a config change. NOT vector-store SQL alone (that is postgresdb) or service…

ericrisco/rsc-harness · 85 tokens

mongodb

Use when modeling MongoDB documents (embed versus reference, the 16MB cap, bucket and subset patterns), choosing or fixing indexes (compound order by the ESR rule, partial, TTL, multikey, reading explain), writing aggregation pipelines that stay index-eligible, running multi-document transactions with retry, or…

ericrisco/rsc-harness · 118 tokens

postgresdb

Use when PostgreSQL engine behaviour decides the answer — schema and type design, index choice, reading EXPLAIN on a slow query, zero-downtime DDL and backfills, or ops (roles, RLS, pooling, vacuum, partitioning, PITR). PG16, ORM-agnostic. NOT portable query logic (that is sql), NOT a managed provider's platform…

ericrisco/rsc-harness · 91 tokens

dynamodb

Use when modeling or operating a DynamoDB table: deriving partition/sort keys from access patterns, single-table vs table-per-entity, adding a GSI/LSI, on-demand vs provisioned capacity, or diagnosing hot-partition throttling. NOT relational schema/SQL/EXPLAIN (that is postgresdb), NOT aggregation-pipeline document…

ericrisco/rsc-harness · 82 tokens