saga-orchestration
為分散式服務設計 saga 工作流程
分散式工作流程在步驟無法協調或回滾不乾淨時會失敗。本技能提供清晰的 saga 模式和模板,用於協調步驟和補償,以實現可靠的多服務交易。
下載技能 ZIP
在 Claude 中上傳
前往 設定 → 功能 → 技能 → 上傳技能
開啟並開始使用
測試它
正在使用「saga-orchestration」。 Design an order fulfillment saga with compensations and timeouts.
預期結果:
- Steps: reserve inventory, process payment, create shipment, send confirmation.
- Compensations: release inventory, refund payment, cancel shipment.
- Timeout policy: fail step after 5 minutes and start compensation.
- Events: SagaStepCompleted, SagaStepFailed, SagaCompensationCompleted.
正在使用「saga-orchestration」。 Compare orchestration and choreography for payment processing.
預期結果:
- Orchestration: central orchestrator sends commands, receives responses.
- Choreography: services emit events, others subscribe and react.
- Orchestration benefits: explicit flow, easier debugging, clear ownership.
- Choreography benefits: loose coupling, no single point of failure.
正在使用「saga-orchestration」。 How do I handle a saga step that never completes?
預期結果:
- Implement per-step timeouts in the orchestrator.
- On timeout, mark step as failed and trigger compensation.
- Use scheduled tasks to check step status periodically.
- Log timeout events for monitoring and alerting.
安全審計
安全Pure documentation skill containing code templates for saga pattern implementation. Contains no executable code, filesystem access, network calls, or command execution. All static findings are false positives triggered by documentation text containing technical terminology that scanners incorrectly flag as cryptographic terms, C2 indicators, or shell commands.
風險因素
品質評分
你能建構什麼
訂單履行流程
設計具有補償步驟和失敗處理的多服務訂單工作流程。
長時間審批流程
為具有超時和回滾行為的審批工作流程建立模型。
Saga 模式審查
讓團隊在編排與事件驅動的取捨上達成共識。
試試這些提示
Design a saga orchestration for checkout with inventory, payment, and shipping steps. Include compensations and state transitions.
Extend a saga orchestrator with per step timeouts and failure handling. Describe how timeouts trigger compensation.
Provide a choreography based saga for order processing and list event names and handlers.
Draft a saga plan for a multi stage onboarding flow with retries, compensations, and audit logging guidance.
最佳實務
- Make steps idempotent for safe retries
- Design compensations for every irreversible action
- Use correlation IDs for cross service tracing
避免
- Assume steps complete instantly
- Skip compensation testing
- Tightly couple services with direct calls
常見問題
Is this compatible with Claude, Codex, and Claude Code?
What are the limits of this skill?
How do I integrate with my message bus?
Does this skill access my data or secrets?
What should I check if steps never complete?
How does this compare to choreography only?
開發者詳情
作者
wshobson授權
MIT
儲存庫
https://github.com/wshobson/agents/tree/main/plugins/backend-development/skills/saga-orchestration引用
main
檔案結構
📄 SKILL.md