Eng cleanup failure paths

From compozy/compozy · View interactive version

Eng cleanup failure paths is an AI agent skill from the GitHub repository compozy/compozy. Partial-failure cleanup audit for Compozy Go functions. Use when a changed function acquires, registers, starts, claims, leases, or opens more than one fallible resource before returning. Do not use for pure transformations, read-only helpers, or test-only code.

How to use this skill

Skill file

Cleanup Failure Paths

Prove ownership across the affected function's acquisitions and exits. Account for the whole lifetime when a local edit changes cleanup; a matrix in working notes is useful for complex ownership, not a required report.

Before changing coverage, name the invariant, owning layer, and existing suite. Use eng-consolidate-test-suites only if placement is unclear and eng-test-conventions for Go test shape. references/test-failure-paths.md supplies patterns for the distinct failure class being changed. Reuse coverage that already proves the invariant; multiple syntactic returns do not imply multiple tests.

Inject failures through an interface or real I/O boundary and assert actual release, reuse, closure, or termination. A mock-call count alone does not prove cleanup. Complete when affected ownership paths are sound and their owning checks pass; the enclosing workstream owns delivery gates.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.