design-compensation-strategy
Installation
SKILL.md
Design Compensation Strategy (design_compensation_strategy)
Use this skill when a Blueprint or JSON architecture contains mutating steps and you need to add robust, LIFO-ordered compensation logic and corresponding test cases.
When to Use
- Adding addCompensation blocks to a BaseBlueprint or architecture
- Identifying non-reversible actions and defining HITL or manual remediation
- Matching "Undo" capabilities from the MCP Registry for Connectors/Commanders
- Writing or extending blueprint tests for failure-and-rollback scenarios
Instructions
- Mutation analysis: Scan for this.execute() calls that are not read-only (Connectors, Commanders). Categorize as CREATE, UPDATE, DELETE, PROVISION.
- Semantic matching: Query MCP Registry for Undo capabilities (e.g., create_issue → delete_issue). If no match, ask the user (HITL) for compensation tool ID or strategy.
- Non-reversible guardrails: For "point of no return" actions (e.g., payments, physical world), require a manual gate or compensation log step for human remediation. Do not ignore.
- Code injection: Insert addCompensation immediately after the successful step; capture IDs from step output for the compensation call. Ensure compensations are idempotent and use the same runAs context.
- Tests: Add negative scenarios: force step failure, exhaust retries, assert all prior compensations were called (test-driven-development).
- Output: Provide Saga design summary, updated Blueprint code with compensations, and updated blueprint.test.ts with rollback assertions.