agh-cleanup-failure-paths
OfficialStop leaks on every partial failure.
System Documentation
What problem does it solve?
It prevents resource leaks and cleanup regressions when editing multi-step Go functions that create contexts, claims, leases, registry entries, subprocesses, and HTTP calls across multiple error returns.
Core Features & Use Cases
- Audits cleanup discipline across every error return in complex functions, ensuring each allocated resource has the correct cancel/close/release/stop behavior.
- Enforces deterministic cleanup patterns like defer-adjacent rules for context cancelation, Close/Rollback pairings, subprocess stopping, and HTTP response draining.
- Protects production HTTP hygiene by forbidding http.DefaultClient in production execution paths and requiring drained response bodies.
- Supports failure-path regression testing by guiding how to trigger specific partial-failure scenarios and assert cleanup actually occurred.
Quick Start
Activate this skill while editing an AGH function that performs multi-step setup or teardown (especially in internal/session, internal/scheduler, internal/coordinator, internal/extension, internal/automation, internal/store, internal/memory, internal/api, or subprocess/registry handlers) to systematically verify every error return cleans up contexts, claims/leases, subprocesses, and HTTP bodies.
Dependency Matrix
Required Modules
None requiredComponents
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: agh-cleanup-failure-paths Download link: https://github.com/compozy/agh/archive/main.zip#agh-cleanup-failure-paths Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.