Skip to content
Back to skills

Eng Cleanup Failure Paths

ASecurity

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.

  • 2,785 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 3, 2026
testinggo

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 20, 2026

npx -y skills add compozy/compozy --skill eng-cleanup-failure-paths --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Eng Cleanup Failure Paths?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Eng Cleanup Failure Paths
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/compozy-eng-cleanup-failure-paths/badge)](https://www.skillsdirectory.com/skills/compozy-eng-cleanup-failure-paths)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: eng-cleanup-failure-paths
description: >-
  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.
trigger: implicit
---

# 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.

- Identify acquired resources, their owners, cleanup/error policy, shutdown order, and any explicit ownership transfer. Use the matching rows of `references/cleanup-table.md`; read the complete table when the ownership chain spans its rules.
- Walk success, error, cancellation, and reachable recovery exits after each acquisition. Release or transfer every live resource. Preserve the primary error and handle secondary cleanup failures.
- Keep responses and writers request-bound. Detached execution needs a bounded lifetime and cancel/stop surface; subprocess trees retain process-group parity and cancel-then-grace shutdown.
- Repair affected exits together. Split ownership when it cannot be proved locally, not because a function crosses an arbitrary defer-count threshold. Leave unrelated cleanup debt outside the change.

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.

Files in this skill

  • SKILL.md3.7 KB
  • references/cleanup-table.md3.4 KB
  • references/test-failure-paths.md2.9 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…