本文へスキップ
Skillpedia
APIとサーバー(バックエンド)42k · #6445

competition-race-condition-state-drift

できること

このツールは、複数の処理が同時に起きたときに発生する問題を再現するのに役立ちます。処理の順番やタイミングによって、誤ったデータや重複した処理といった予想外のエラーがどのように起きるかに注目します。

使う場面

  • ✓処理の順番がエラーの原因になっていると疑うとき。
  • ✓2つの処理が同じデータを同時に変更しようとするとどうなるかを検証したいとき。
  • ✓一時的な失敗によって結果が変わってしまう仕組みを理解したいとき。

スキルのリンク

https://github.com/zhaoxuya520/reverse-skill/blob/main/CTF-Sandbox-Orchestrator/competition-race-condition-state-drift/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/zhaoxuya520/reverse-skill/blob/main/CTF-Sandbox-Orchestrator/competition-race-condition-state-drift/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“同じ口座から2人が同時にお金を引き出そうとしたら何が起きるかを検証したいです。”

毎週5つの新しいスキル。1分で読めます。

仕組み

ツールは、システム内で変更されうる部分(データベースやキャッシュ内のデータなど)を特定します。そのうえで、同時に行われる処理をシミュレーションし、順番やタイミングだけを変えて、予想と異なる結果が起きるかを確認します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Competition Race Condition State Drift

Use this skill only as a downstream specialization after $ctf-sandbox-orchestrator is already active and has established sandbox assumptions, node ownership, and evidence priorities. If that has not happened yet, return to $ctf-sandbox-orchestrator first.

Use this skill when the decisive behavior depends on request timing, async ordering, lock gaps, or stale state.

Reply in Simplified Chinese unless the user explicitly requests English.

Quick Start

  1. Identify mutable state first: rows, cache keys, queue payloads, session fields, counters, or files.
  2. Reproduce with smallest concurrent sequence and fixed timing assumptions.
  3. Capture one baseline run and one racing run with only one variable changed.
  4. Track read, check, write, enqueue, and commit boundaries separately.
  5. Prove final state drift from a clean reset.

Workflow

1. Map Mutable Boundaries

  • Record transaction scope, lock behavior, retry logic, idempotency keys, cache invalidation, and queue handoff.
  • Note where read-check-write is split across requests, workers, or services.
  • Keep each boundary tied to exact timestamps or sequence numbers.

2. Reproduce Timing Window

  • Build deterministic concurrent inputs with controlled delay, duplicate requests, or reordered worker execution.
  • Compare accepted and rejected paths under identical payloads.
  • Record which condition flips when ordering changes.

3. Reduce To Decisive Race Chain

  • Compress to: request A and B ordering -> stale check or lock gap -> conflicting writes -> resulting capability or artifact.
  • State whether root cause is missing lock, weak idempotency, stale cache read, delayed async commit, or retry side effect.
  • If the path becomes queue-dominant, hand off to queue worker drift skill.

Read This Reference

  • Load references/race-condition-state-drift.md for race harness ideas, evidence blocks, and parity checks.

What To Preserve

  • Mutable keys, transaction boundaries, lock behavior, and idempotency markers
  • Timestamped or sequenced traces for baseline and race runs
  • One minimal replayable concurrent sequence proving drift
よくある質問

「状態(ステート)」とは何ですか?

システムがある時点で保持している情報のことです。銀行口座の残高や注文の状況などが例にあたります。

「レースコンディション」とは何ですか?

複数の処理が同時に実行されるとき、結果が処理の正確な順番に依存してしまう問題のことです。

なぜ「順番」が重要なのですか?

多くの処理が同時に行われるシステムでは、処理される順番によって最終的な結果が変わることがあります。順番を制御しないと、エラーが起きる可能性があります。

詳細

作者による元の説明

Internal downstream skill for ctf-sandbox-orchestrator. CTF-sandbox workflow for race windows, ordering bugs, idempotency failures, lock gaps, concurrent worker drift, and state inconsistencies that produce decisive effects. Use when the user asks to reproduce timing-sensitive bugs, concurrent state corruption, duplicate actions, stale reads, or privilege or balance drift caused by request orderin

repo: zhaoxuya520/reverse-skill

人気

GitHubのスター
42k
ランキング
#6445
ライセンス
MIT
更新日
2026/9/22

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル