# Cpp Reliability

> Analyze production C++ for ownership, lifetime, RAII, concurrency, error handling, exception safety, and material runtime costs. Use for reviews, regressions, design analysis, and reliability debugging.

- Skill: `iamhrithikraj/cpp-reliability` (Agent Skill)
- Install (CLI): `npx skillmds@latest add iamhrithikraj/cpp-reliability`
- Raw SKILL.md: https://api.skillmd.com/api/skills/iamhrithikraj/cpp-reliability/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: iamHrithikRaj (https://skillmd.com/u/iamhrithikraj)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/iamhrithikraj/cpp-reliability

---


# C++ reliability

## Ownership and lifetime

- Identify the owner of every relevant object and resource.
- Check whether references, pointers, spans, views, callbacks, and captures can
  outlive their targets.
- Treat shared ownership as a deliberate design decision, not a default.
- Verify destruction ordering and shutdown behavior.
- Check move operations for valid source and destination states.

## Resource safety

- Prefer RAII for memory, handles, locks, registrations, and transactions.
- Verify cleanup after partial initialization and every error path.
- Check exception guarantees where exceptions are enabled.
- Ensure destructors cannot unexpectedly propagate failures.

## Concurrency

- Document shared state and its synchronization.
- Check lock ordering, callback reentrancy, races, deadlocks, and cancellation.
- Verify that atomics use an ordering strong enough for the invariant.
- Examine object lifetime across asynchronous work.

## Error handling

- Preserve actionable error context.
- Avoid broad catches and success-shaped fallbacks.
- Verify that failed operations leave state valid and recoverable.
- Check retry safety, idempotency, and duplicate effects.

## Performance

- Look for avoidable allocation, copying, contention, and cache-unfriendly
  access only when they are material to the workload.
- Require measurement before recommending complexity.
- Include correctness and operational costs in every optimization tradeoff.

## Findings

Report only issues with a concrete failure scenario or evidence-backed material
risk. Include severity, location, scenario, evidence, correction, and
confidence.


