Agent Skillsspacedriveapp/spacebot › async-state-safety

async-state-safety

GitHub

防止异步和状态路径中的竞态回归。通过定义终端状态、转换守卫及幂等性,处理取消、超时、重试等场景,确保状态安全与并发一致性。

.agents/skills/async-state-safety/SKILL.md spacedriveapp/spacebot

Trigger Scenarios

worker lifecycle cancellation retrigger behavior state machine delivery receipts timeouts race conditions

Install

npx skills add spacedriveapp/spacebot --skill async-state-safety -g -y
More Options

Non-standard path

npx skills add https://github.com/spacedriveapp/spacebot/tree/main/.agents/skills/async-state-safety -g -y

Use without installing

npx skills use spacedriveapp/spacebot@async-state-safety

指定 Agent (Claude Code)

npx skills add spacedriveapp/spacebot --skill async-state-safety -a claude-code -g -y

安装 repo 全部 skill

npx skills add spacedriveapp/spacebot --all -g -y

预览 repo 内 skill

npx skills add spacedriveapp/spacebot --list

SKILL.md

Frontmatter
{
    "name": "async-state-safety",
    "description": "This skill should be used when the user asks to change \"worker lifecycle\", \"cancellation\", \"retrigger behavior\", \"state machine\", \"delivery receipts\", \"timeouts\", or \"race conditions\". Enforces explicit async\/state invariants and targeted race-safe verification."
}

Async State Safety

Goal

Prevent race regressions in async and stateful paths.

Required Invariants

  • Define valid terminal states before coding.
  • Define allowed state transitions before coding.
  • Keep terminal transitions idempotent.
  • Ensure duplicate events cannot double-apply terminal effects.
  • Ensure retries do not corrupt state.

Race Checklist

  • Cancellation racing completion
  • Timeout racing completion
  • Retry racing ack/receipt update
  • Concurrent updates to the same worker/channel record
  • Missing-handle and stale-handle behavior

Implementation Checklist

  • Add or update transition guards.
  • Keep error handling explicit and structured.
  • Preserve status/event emission on all terminal branches.
  • Document why each race path converges safely.

Verification Checklist

  • Run targeted tests for each touched race path.
  • Add at least one negative-path test for terminal convergence.
  • Add at least one idempotency test where applicable.
  • Run broad gate checks after targeted checks pass.

Handoff Requirements

  • Terminal states and transition matrix
  • Race windows analyzed
  • Targeted commands and outcomes
  • Residual risks and follow-up tests

Version History

  • ac52277 Current 2026-07-05 14:56

Same Skill Collection

.agents/skills/commit-all/SKILL.md
.agents/skills/messaging-adapter-parity/SKILL.md
.agents/skills/pr-gates/SKILL.md
.agents/skills/pr-slicer/SKILL.md
.agents/skills/prompt-review/SKILL.md
.agents/skills/provider-integration-checklist/SKILL.md
.agents/skills/release-bump-changelog/SKILL.md
.agents/skills/review-fix-loop/SKILL.md
.agents/skills/writing-guide/SKILL.md
skills/builtin/wiki-writing/SKILL.md
skills/builtin/workspace-organization/SKILL.md

Metadata

Files
0
Version
34b1647
Hash
6ba620de
Indexed
2026-07-05 14:56

inicio - Wiki
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-17 21:53
浙ICP备14020137号-1 $mapa de visitantes$