Agent skill

Fastly Kv Concurrent Write Retry

by divinevideo in divinevideo/divine-mobile

Fix intermittent 500 errors with "Failed to store" in Fastly KV Store during concurrent writes.

MPL-2.0Auto-check passed

Install Fastly Kv Concurrent Write Retry

skills CLI
$ npx skills add divinevideo/divine-mobile --skill fastly-kv-concurrent-write-retry -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install divinevideo/divine-mobile fastly-kv-concurrent-write-retry --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/divinevideo/divine-mobile.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/fastly-kv-concurrent-write-retry .claude/skills/fastly-kv-concurrent-write-retry && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
fastly-kv-concurrent-write-retry
GitHub stars
266
Token cost
~995 tokens
SKILL.md length
237 words
Files
1
Skills in repo
103
Repo updated
First seen
Licence
MPL-2.0

At a glance

Fix intermittent 500 errors with "Failed to store" in Fastly KV Store during concurrent writes.

  • Works in 4 steps: Re-read on each retry - The fresh read… → Check for duplicates - Avoid adding the… → Log retries - Helps debug if issues… → …
  • Batch operations fail with ~10-20% error rate
  • SKILL.md covers Problem, Context / Trigger Conditions, Solution and Verification, plus 3 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Fastly Kv Concurrent Write Retry is an agent skill from divinevideo/divine-mobile. Fix intermittent 500 errors with "Failed to store" in Fastly KV Store during concurrent writes. Use when: (1) Batch operations fail with ~10-20% error rate, (2) Error contains "Failed to store list" or similar KV write failures, (3) Multiple requests updating the same KV key simultaneously, (4) Read-modify-write pattern without locking. The fix is adding a retry loop that re-reads before each write attempt.

Its SKILL.md is about 1000 tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

The licence is MPL-2.0.

When your agent uses it

  • Batch operations fail with ~10-20% error rate
  • Error contains Failed to store list
  • Similar KV write failures
  • Multiple requests updating the same KV key simultaneously

Example prompts

  • “Failed to store”
  • “Failed to store list”
  • “/fastly-kv-concurrent-write-retry”

Workflow steps

4 steps, taken from the first numbered list in SKILL.md.

  1. Re-read on each retry - The fresh read picks up changes from concurrent writes
  2. Check for duplicates - Avoid adding the same item twice
  3. Log retries - Helps debug if issues persist
  4. Limit retries - 5 attempts is usually sufficient

What it can do on your machine

Read from SKILL.md and the folder at commit 6487b05. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are rust and json).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • developer.fastly.com

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Fastly Kv Concurrent Write Retry loads about 995 tokens when it runs. Until then it costs about 111 tokens; SKILL.md has 237 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~111
When it runs · the whole SKILL.md, loaded when a task matches
~995

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from divinevideo/divine-mobile at commit 6487b05, republished under its MPL-2.0 licence (© divinevideo). 237 words, ~995 tokens.

Download SKILL.mdSave it as .claude/skills/fastly-kv-concurrent-write-retry/SKILL.md (or your agent's skills folder).
name
fastly-kv-concurrent-write-retry
description
Fix intermittent 500 errors with "Failed to store" in Fastly KV Store during concurrent writes. Use when: (1) Batch operations fail with ~10-20% error rate, (2) Error contains "Failed to store list" or similar KV write failures, (3) Multiple requests updating the same KV key simultaneously, (4) Read-modify-write pattern without locking. The fix is adding a retry loop that re-reads before each write attempt.
author
Claude Code
version
1.0.0
date
2026-01-28

Fastly KV Store Concurrent Write Race Condition

Problem

When multiple concurrent requests perform read-modify-write operations on the same Fastly KV Store key, writes can fail with intermittent 500 errors. This commonly occurs during batch uploads where each request updates a shared list or counter.

Context / Trigger Conditions

  • Error message contains "Failed to store list:" or similar KV write failure
  • ~10-20% failure rate during concurrent operations
  • Multiple requests from the same user/session updating shared state
  • Pattern: read key → modify data → write key without any locking

Example error:

json
{"error":"Failed to store list:"}

Solution

Add a retry loop that re-reads the data before each write attempt:

rust
/// Add item to list with retry for concurrent writes
pub fn add_to_list(key: &str, item: &str) -> Result<()> {
    // Retry up to 5 times for concurrent write conflicts
    for attempt in 0..5 {
        // Re-read current state on each attempt
        let mut items = get_list(key)?;

        if items.contains(&item.to_string()) {
            return Ok(()); // Already exists, done
        }

        items.push(item.to_string());

        match put_list(key, &items) {
            Ok(()) => return Ok(()),
            Err(e) if attempt < 4 => {
                eprintln!("[KV] Retry {} for list update: {}", attempt + 1, e);
                // Re-read picks up concurrent writes
                continue;
            }
            Err(e) => return Err(e),
        }
    }

    Err(Error::new("Max retries exceeded for list update"))
}

Key points:

  1. Re-read on each retry - The fresh read picks up changes from concurrent writes
  2. Check for duplicates - Avoid adding the same item twice
  3. Log retries - Helps debug if issues persist
  4. Limit retries - 5 attempts is usually sufficient

Verification

  • Batch operations that previously failed ~16% should now succeed ~100%
  • Retry log messages ([KV] Retry N for...) indicate the mechanism is working
  • If still failing after 5 retries, there may be a deeper issue

Example

Before (race condition):

rust
pub fn add_to_user_list(pubkey: &str, hash: &str) -> Result<()> {
    let mut hashes = get_user_blobs(pubkey)?;  // Read
    if !hashes.contains(&hash) {
        hashes.push(hash.to_string());         // Modify
        put_user_list(pubkey, &hashes)?;       // Write - CONFLICT!
    }
    Ok(())
}

After (with retry):

rust
pub fn add_to_user_list(pubkey: &str, hash: &str) -> Result<()> {
    for attempt in 0..5 {
        let mut hashes = get_user_blobs(pubkey)?;
        if hashes.contains(&hash) {
            return Ok(());
        }
        hashes.push(hash.to_string());
        match put_user_list(pubkey, &hashes) {
            Ok(()) => return Ok(()),
            Err(e) if attempt < 4 => continue,
            Err(e) => return Err(e),
        }
    }
    Err(Error::new("Max retries exceeded"))
}

Notes

  • Fastly Compute doesn't have sleep(), so retries happen immediately
  • The re-read is what provides the "delay" by picking up concurrent changes
  • Consider using atomic operations if available (Fastly KV doesn't support CAS)
  • For high-contention scenarios, consider sharding the key space
  • This pattern also applies to remove operations (read-filter-write)

References

© divinevideo, MPL-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .agents/skills/fastly-kv-concurrent-write-retry of divinevideo/divine-mobile.

Open the folder on GitHubat commit 6487b05

Compare with similar skills

Fastly Kv Concurrent Write Retry next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Fastly Kv Concurrent Write Retry compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Fastly Kv Concurrent Write Retry this skilldivinevideo/divine-mobile266—~995Automated safety check: PassMPL-2.0
MoviePilot Failed Transfer Retryjxxghp/MoviePilot12k—~584Automated safety check: PassGPL-3.0
Agent App Storeruvnet/ruflo74k2 repos~1kAutomated safety check: PassMIT
App Store Optimizationalirezarezvani/claude-skills28k1 repos~4.2kAutomated safety check: PassMIT
Swift Concurrency 6 2affaan-m/ECC276k4 repos~2kAutomated safety check: PassMIT
Eas App Storessickn33/agentic-awesome-skills47k1 repos~1.9kAutomated safety check: PassMIT

Similar skills

  • Retries failed MoviePilot video and music transfer records one verified group at a time, keeping retry evidence and re-identifying only legacy records that were actually deleted.

    12k GitHub stars~584 tokensUpdated today
    Productivity & AutomationAuto-check passed
  • Agent App Store

    ruvnet/ruflo

    Agent skill for app-store - invoke with $agent-app-store. An agent skill from ruvnet/ruflo.

    74k GitHub starsUsed in 2 repos~1k tokens
    MobileAuto-check passed
  • App Store Optimization

    alirezarezvani/claude-skills

    App Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store.

    28k GitHub starsUsed in 1 repo~4.2k tokens
    Marketing & SEOAuto-check passed
  • Swift 6.2 Approachable Concurrency — single-threaded by default, @concurrent for explicit background offloading, isolated conformances for main actor types.

    276k GitHub starsUsed in 4 repos~2k tokens
    DevelopmentAuto-check passed
  • Eas App Stores

    sickn33/agentic-awesome-skills

    Curated upstream guidance for Eas App Stores; use when the workflow matches the user goal.

    47k GitHub starsUsed in 1 repo~1.9k tokens
    MobileAuto-check passed
  • App Store Changelog

    sickn33/agentic-awesome-skills

    Generate user-facing App Store release notes from git history since the last tag.

    47k GitHub starsUsed in 2 repos~831 tokens
    DevelopmentAuto-check passed

More from divinevideo/divine-mobile

All 103 skills in this repo
  • Fix ArgoCD ExternalSecret deployment failing with "namespace X is not permitted in project Y".

    266 GitHub stars~931 tokensUpdated today
    Auto-check passed
  • Art Direct

    divinevideo/divine-mobile

    Art direction for any content — reads text, PDF, Word, HTML, PPT, then proposes 2-3 creative directions with photography style, mood, and visual language.

    266 GitHub stars~4.8k tokensUpdated today
    Auto-check passed
  • Async Await Null Race Condition

    divinevideo/divine-mobile

    Fix "Null check operator used on a null value" errors when an object is set to null during an async await.

    266 GitHub stars~881 tokensUpdated today
    Auto-check passed
  • AWS V4 Signing Custom Headers Gcs

    divinevideo/divine-mobile

    Add custom metadata headers (x-amz-meta-) to AWS v4 signed requests for GCS S3-compatible API.

    266 GitHub stars~1k tokensUpdated today
    Auto-check passed
  • Bash Herestring Newline Secrets

    divinevideo/divine-mobile

    Fix password/secret authentication failures caused by trailing newlines when creating Google Cloud secrets (or similar) with bash here-strings.

    266 GitHub stars~791 tokensUpdated today
    Auto-check passed
  • Fix silent video/media processing failures caused by URL extraction code that filters on file extensions (.mp4, .webm, .webp).

    266 GitHub stars~1.1k tokensUpdated today
    Auto-check passed

Questions about Fastly Kv Concurrent Write Retry

What does Fastly Kv Concurrent Write Retry do?

Fix intermittent 500 errors with "Failed to store" in Fastly KV Store during concurrent writes. Fastly Kv Concurrent Write Retry is an agent skill from divinevideo/divine-mobile. Fix intermittent 500 errors with "Failed to store" in Fastly KV Store during concurrent writes.

When should I use Fastly Kv Concurrent Write Retry?

Fastly Kv Concurrent Write Retry fits situations like: batch operations fail with ~10-20% error rate; error contains Failed to store list; similar KV write failures; multiple requests updating the same KV key simultaneously.

How do I install Fastly Kv Concurrent Write Retry in Claude Code?

Run `npx skills add divinevideo/divine-mobile --skill fastly-kv-concurrent-write-retry -a claude-code`. Or copy the skill folder (.agents/skills/fastly-kv-concurrent-write-retry in divinevideo/divine-mobile) into .claude/skills/fastly-kv-concurrent-write-retry in your project. Claude Code loads it when a task matches its description.

How do I install Fastly Kv Concurrent Write Retry in Codex?

Run `npx skills add divinevideo/divine-mobile --skill fastly-kv-concurrent-write-retry -a codex`. Or copy the skill folder (.agents/skills/fastly-kv-concurrent-write-retry in divinevideo/divine-mobile) into .agents/skills/fastly-kv-concurrent-write-retry in your project. Codex loads it when a task matches its description.

Can I use Fastly Kv Concurrent Write Retry in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add divinevideo/divine-mobile --skill fastly-kv-concurrent-write-retry -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/fastly-kv-concurrent-write-retry, .gemini/skills/fastly-kv-concurrent-write-retry, .github/skills/fastly-kv-concurrent-write-retry and .opencode/skills/fastly-kv-concurrent-write-retry in your project.

What does Fastly Kv Concurrent Write Retry need to run?

SKILL.md names no scripts, command-line tools or credentials: Fastly Kv Concurrent Write Retry is instructions for the agent only.

Does Fastly Kv Concurrent Write Retry access the network?

SKILL.md names 1 domain. As links in the text: developer.fastly.com. This is read from the text; nothing was executed.

Is Fastly Kv Concurrent Write Retry safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Fastly Kv Concurrent Write Retry use?

Fastly Kv Concurrent Write Retry is published under the MPL-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Fastly Kv Concurrent Write Retry use?

About 995 tokens (SKILL.md is roughly 4k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Fastly Kv Concurrent Write Retry?

Skills that share tags, products or a category with Fastly Kv Concurrent Write Retry: MoviePilot Failed Transfer Retry (jxxghp/MoviePilot, 12k stars), Agent App Store (ruvnet/ruflo, 74k stars), App Store Optimization (alirezarezvani/claude-skills, 28k stars) and Swift Concurrency 6 2 (affaan-m/ECC, 276k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Fastly Kv Concurrent Write Retry?

divinevideo (a GitHub organization) maintains it in divinevideo/divine-mobile, which has 266 GitHub stars. The repository holds 103 skills in this directory. The repository was last updated on October 9, 2026.

Source: divinevideo/divine-mobile on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.