[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7F0AXPEFH4W8EZZZAXAHDNK":3,"skill-same:01M7F0AXPEFH4W8EZZZAXAHDNK":56},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":6,"ownerHtmlUrl":28,"ownerBlogUrl":29,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M7F0AXPEFH4W8EZZZAXAHDNK","saga-orchestration",null,"Implement saga patterns for distributed transactions and cross-aggregate workflows. Use this skill when implementing distributed transactions across microservices where 2PC is unavailable, designing compensating actions for failed order workflows that span inventory, payment, and shipping services, building event-driven saga coordinators for travel booking systems that must roll back hotel, flight, and car rental reservations atomically, or debugging stuck saga states in production where compensation steps never complete.","shotcowboystyle\u002Fag-skills","shotcowboystyle","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F62471?v=4","01M7EZTCFCZJ6K3MYW8BPM4X6R","Curtis Blanton","01M7EZTCG1S5M04J90A931X9BX",0,"MIT","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fbackend-development\u002Fskills\u002Fsaga-orchestration\u002FSKILL.md",[],[],"2026-11-16 10:05:34",false,"---\nname: saga-orchestration\ndescription: Implement saga patterns for distributed transactions and cross-aggregate workflows. Use this skill when implementing distributed transactions across microservices where 2PC is unavailable, designing compensating actions for failed order workflows that span inventory, payment, and shipping services, building event-driven saga coordinators for travel booking systems that must roll back hotel, flight, and car rental reservations atomically, or debugging stuck saga states in production where compensation steps never complete.\n---\n\n# Saga Orchestration\n\nPatterns for managing distributed transactions and long-running business processes without two-phase commit.\n\n## Inputs and Outputs\n\n**What you provide:**\n- Service boundaries and ownership (which service owns which step)\n- Transaction requirements (which steps must be atomic, which can be eventual)\n- Failure modes for each step (transient vs. permanent, retry policy)\n- SLA requirements per step (informs timeout configuration)\n- Existing event\u002Fmessaging infrastructure (Kafka, RabbitMQ, SQS, etc.)\n\n**What this skill produces:**\n- Saga definition with ordered steps, action commands, and compensation commands\n- Orchestrator or choreography implementation for your chosen pattern\n- Compensation logic for each participant service (idempotent, always-succeeds)\n- Step timeout configuration with per-step deadlines\n- Monitoring setup: state machine metrics, stuck saga detection, DLQ recovery\n\n---\n\n## When to Use This Skill\n\n- Coordinating multi-service transactions without distributed locks\n- Implementing compensating transactions for partial failures\n- Managing long-running business workflows (minutes to hours)\n- Handling failures in distributed systems where atomicity is required\n- Building order fulfillment, approval, or booking processes\n- Replacing fragile two-phase commit with async compensation\n\n---\n\n## Detailed section: Core Concepts\n\nMoved to `references\u002Fdetails.md`.\n\n## Detailed section: Templates\n\nMoved to `references\u002Fdetails.md`.\n\n## Best Practices\n\n### Do's\n\n- **Make every step idempotent** — Commands may be replayed on broker reconnect\n- **Design compensations carefully** — They are the most critical code path\n- **Use correlation IDs** — The `saga_id` must flow through every event and log\n- **Implement per-step timeouts** — Never wait indefinitely for a participant reply\n- **Log state transitions** — `saga_id`, `step_name`, `old_state → new_state` on every change\n- **Test compensation paths explicitly** — Inject failures at each step index in integration tests\n\n### Don'ts\n\n- **Don't assume instant completion** — Sagas are async and may take minutes\n- **Don't skip compensation testing** — The rollback path is the hardest to get right\n- **Don't couple services directly** — Use async messaging, never synchronous calls inside a saga step\n- **Don't ignore partial failures** — A step that partially executed still needs compensation\n- **Don't use a global timeout** — Each step has different latency characteristics\n\n---\n\n## Troubleshooting\n\n### Saga stuck in COMPENSATING state\n\nA saga enters compensation but never reaches FAILED. This means a compensation handler is throwing an unhandled exception and never publishing `SagaCompensationCompleted`. Add dead-letter queue (DLQ) handling to compensation consumers and ensure every compensation action publishes a result event even when the underlying operation was already rolled back.\n\n```python\nasync def handle_release_reservation(self, command: Dict):\n    try:\n        await self.release_reservation(command[\"original_result\"][\"reservation_id\"])\n    except ReservationNotFoundError:\n        pass  # Already released — treat as success\n    # Always publish completion, regardless of outcome\n    await self.event_publisher.publish(\"SagaCompensationCompleted\", {\n        \"saga_id\": command[\"saga_id\"],\n        \"step_name\": \"reserve_inventory\"\n    })\n```\n\n### Duplicate saga executions on restart\n\nIf your orchestrator service restarts mid-saga, it may replay events and re-execute already-completed steps. Guard every step action with an idempotency key — see **Template 3** above.\n\n### Choreography saga losing events\n\nIn a choreography-based saga, a downstream service may miss an event if it was offline when published. Use a durable message broker (Kafka with replication, RabbitMQ with persistence) and store the current saga state in a dedicated `saga_log` table so you can replay from the last known good step.\n\n### Timeout firing before a slow-but-valid step completes\n\nA step like `create_shipment` might take up to 15 minutes during peak load but your global timeout is 5 minutes, causing spurious compensation. Make step timeouts configurable per step type — see `references\u002Fadvanced-patterns.md` for the `TimeoutSagaOrchestrator` implementation and the `STEP_TIMEOUTS` dict pattern.\n\n### Compensation order not matching execution order\n\nWhen two steps both complete before a failure is detected, compensation must run in strict reverse order or you leave data in an inconsistent state. Verify that `_compensate()` iterates from `current_step - 1` down to `0`, and add an integration test that deliberately fails at each step index to confirm correct rollback order.\n\n---\n\n## Advanced Patterns\n\nThe `references\u002F` directory contains production-grade implementations not needed for most sagas:\n\n- **`references\u002Fadvanced-patterns.md`** — Full `SagaOrchestrator` abstract base class, `TimeoutSagaOrchestrator` with per-step deadlines, detailed bank transfer compensating transaction chain, Prometheus instrumentation, stuck saga PromQL alerts, and DLQ recovery worker.\n\n---\n\n## Related Skills\n\n- `cqrs-implementation` — Pair sagas with CQRS for read-model updates after each step completes\n- `event-store-design` — Store saga events in an event store for full audit trail and replay capability\n- `workflow-orchestration-patterns` — Higher-level workflow engines (Temporal, Conductor) that build on saga concepts\n","# Saga Orchestration\n\nPatterns for managing distributed transactions and long-running business processes without two-phase commit.\n\n## Inputs and Outputs\n\n**What you provide:**\n- Service boundaries and ownership (which service owns which step)\n- Transaction requirements (which steps must be atomic, which can be eventual)\n- Failure modes for each step (transient vs. permanent, retry policy)\n- SLA requirements per step (informs timeout configuration)\n- Existing event\u002Fmessaging infrastructure (Kafka, RabbitMQ, SQS, etc.)\n\n**What this skill produces:**\n- Saga definition with ordered steps, action commands, and compensation commands\n- Orchestrator or choreography implementation for your chosen pattern\n- Compensation logic for each participant service (idempotent, always-succeeds)\n- Step timeout configuration with per-step deadlines\n- Monitoring setup: state machine metrics, stuck saga detection, DLQ recovery\n\n---\n\n## When to Use This Skill\n\n- Coordinating multi-service transactions without distributed locks\n- Implementing compensating transactions for partial failures\n- Managing long-running business workflows (minutes to hours)\n- Handling failures in distributed systems where atomicity is required\n- Building order fulfillment, approval, or booking processes\n- Replacing fragile two-phase commit with async compensation\n\n---\n\n## Detailed section: Core Concepts\n\nMoved to `references\u002Fdetails.md`.\n\n## Detailed section: Templates\n\nMoved to `references\u002Fdetails.md`.\n\n## Best Practices\n\n### Do's\n\n- **Make every step idempotent** — Commands may be replayed on broker reconnect\n- **Design compensations carefully** — They are the most critical code path\n- **Use correlation IDs** — The `saga_id` must flow through every event and log\n- **Implement per-step timeouts** — Never wait indefinitely for a participant reply\n- **Log state transitions** — `saga_id`, `step_name`, `old_state → new_state` on every change\n- **Test compensation paths explicitly** — Inject failures at each step index in integration tests\n\n### Don'ts\n\n- **Don't assume instant completion** — Sagas are async and may take minutes\n- **Don't skip compensation testing** — The rollback path is the hardest to get right\n- **Don't couple services directly** — Use async messaging, never synchronous calls inside a saga step\n- **Don't ignore partial failures** — A step that partially executed still needs compensation\n- **Don't use a global timeout** — Each step has different latency characteristics\n\n---\n\n## Troubleshooting\n\n### Saga stuck in COMPENSATING state\n\nA saga enters compensation but never reaches FAILED. This means a compensation handler is throwing an unhandled exception and never publishing `SagaCompensationCompleted`. Add dead-letter queue (DLQ) handling to compensation consumers and ensure every compensation action publishes a result event even when the underlying operation was already rolled back.\n\n```python\nasync def handle_release_reservation(self, command: Dict):\n    try:\n        await self.release_reservation(command[\"original_result\"][\"reservation_id\"])\n    except ReservationNotFoundError:\n        pass  # Already released — treat as success\n    # Always publish completion, regardless of outcome\n    await self.event_publisher.publish(\"SagaCompensationCompleted\", {\n        \"saga_id\": command[\"saga_id\"],\n        \"step_name\": \"reserve_inventory\"\n    })\n```\n\n### Duplicate saga executions on restart\n\nIf your orchestrator service restarts mid-saga, it may replay events and re-execute already-completed steps. Guard every step action with an idempotency key — see **Template 3** above.\n\n### Choreography saga losing events\n\nIn a choreography-based saga, a downstream service may miss an event if it was offline when published. Use a durable message broker (Kafka with replication, RabbitMQ with persistence) and store the current saga state in a dedicated `saga_log` table so you can replay from the last known good step.\n\n### Timeout firing before a slow-but-valid step completes\n\nA step like `create_shipment` might take up to 15 minutes during peak load but your global timeout is 5 minutes, causing spurious compensation. Make step timeouts configurable per step type — see `references\u002Fadvanced-patterns.md` for the `TimeoutSagaOrchestrator` implementation and the `STEP_TIMEOUTS` dict pattern.\n\n### Compensation order not matching execution order\n\nWhen two steps both complete before a failure is detected, compensation must run in strict reverse order or you leave data in an inconsistent state. Verify that `_compensate()` iterates from `current_step - 1` down to `0`, and add an integration test that deliberately fails at each step index to confirm correct rollback order.\n\n---\n\n## Advanced Patterns\n\nThe `references\u002F` directory contains production-grade implementations not needed for most sagas:\n\n- **`references\u002Fadvanced-patterns.md`** — Full `SagaOrchestrator` abstract base class, `TimeoutSagaOrchestrator` with per-step deadlines, detailed bank transfer compensating transaction chain, Prometheus instrumentation, stuck saga PromQL alerts, and DLQ recovery worker.\n\n---\n\n## Related Skills\n\n- `cqrs-implementation` — Pair sagas with CQRS for read-model updates after each step completes\n- `event-store-design` — Store saga events in an event store for full audit trail and replay capability\n- `workflow-orchestration-patterns` — Higher-level workflow engines (Temporal, Conductor) that build on saga concepts\n",{"name":5,"description":7},"main","f846d9a97082ff30d613b55a085cef425d822473","plugins\u002Fbackend-development\u002Fskills\u002Fsaga-orchestration","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle","https:\u002F\u002Fshotcowboystyle.github.io","Building smarter with AI, automation & modern tools. Exploring how far one person can go without a big team using today’s AI.","2026-11-10 04:58:27",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add shotcowboystyle\u002Fag-skills --skill saga-orchestration",{"tool":38,"command":39},"bunx","bunx skills add shotcowboystyle\u002Fag-skills --skill saga-orchestration",{"tool":41,"command":42},"pnpm","pnpm dlx skills add shotcowboystyle\u002Fag-skills --skill saga-orchestration","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fbackend-development\u002Fskills\u002Fsaga-orchestration\u002FSKILL.md",true,[46,52],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"references\u002Fadvanced-patterns.md","REFERENCE","参考文档",15201,"https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fbackend-development\u002Fskills\u002Fsaga-orchestration\u002Freferences\u002Fadvanced-patterns.md",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"references\u002Fdetails.md",10076,"https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Fbackend-development\u002Fskills\u002Fsaga-orchestration\u002Freferences\u002Fdetails.md",[57,63,70,77,84,91],{"skillNo":58,"name":59,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7F1YRY5S5QRJ1V0BJS130QX","no-description","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fno-description\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7F1Y9BV2FJNQJ3NB32JS5CM","good-skill","Fixture skill that satisfies every rule.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fgood-skill\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7F1XXBQ3NQRXZSS0KAGAR9V","broken-link","Links to a reference file that does not exist.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbroken-link\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7F1XBX4R46NR9W0HXQ7XCDX","Bad_Name","Name violates the kebab-case rule and does not match the directory.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fbad-name\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7F1WNAF8WNEQ7S5HKT5VK0D","skill-authoring","Write, review, and validate portable agent skills in SKILL.md format. Use when creating a new skill, editing an existing one, or asked whether a skill follows the Agent Skills spec.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fskills\u002Fskill-authoring\u002FSKILL.md",[],[],{"skillNo":92,"name":93,"nameZh":6,"description":94,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":95,"categories":96,"keywords":97,"publishedAt":19},"01M7F1W30TC0XFNSF7YBRGETK2","weigh-bags","Record scale readings for each bag — empty (tare), outbound, current, final — and reconcile them against the itemised inventory to find unaccounted weight. Use when the user gives a bag weight, says how heavy something is, weighs their luggage, or asks how close to the limit they are. Appends to bags.yaml and runs scripts\u002Freconcile.py.","https:\u002F\u002Fgithub.com\u002Fshotcowboystyle\u002Fag-skills\u002Fblob\u002Fmain\u002Fplugins\u002Ftravel-packing-assistant\u002Fskills\u002Fweigh-bags\u002FSKILL.md",[],[]]