From Bug Handler
Use when reviewing code in an app that depends on bug_handler - PR review, "check our error handling", pre-release audits, or "are we using bug_handler correctly". Finds violations of the guard contract: string errors in state, unreported catches, raw exceptions crossing repository boundaries, missing source labels, misused isReportable.
How this skill is triggered — by the user, by Claude, or both
Slash command
/bug-handler:audit-error-handlingThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Review-mode counterpart to the `guard-workflow` skill: systematically find
Review-mode counterpart to the guard-workflow skill: systematically find
violations, rank them, and report with file:line evidence. Do not rewrite code
unless asked - the deliverable is findings.
Determine the audit surface (a PR diff, a feature directory, or lib/). For a diff, audit changed files plus the repositories/state they touch. Record the app's wrapper conventions (guard mixins, base cubits/notifiers, app exception bases) so findings respect local idiom instead of demanding raw package calls.
catch must rethrow a BaseException subclass.
Find: grep -n "catch (" <repo files> then inspect each: throws of
Exception(, StateError(, app-local implements Exception types, or bare
rethrow of foreign errors are findings. Severity: high (events lose
severity/user-vs-dev split and bypass reporting).String? errorMessage/
String error set from e.userMessage/e.toString().
Find: grep -rn -E "String\??\s+(errorMessage|error\b)" <state files> plus
freezed factories .error(String. Severity: high for new code, medium for
pre-existing shared containers (report, do not churn).AsyncValue.guard(, hand-rolled _guarded helpers, or
Future.catchError where bug_handler reporting was intended.
Find: grep -rn "AsyncValue.guard(\|catchError(" lib/. Severity: medium-high.source: labels. guard/guardSync calls without source:,
or labels that are not stable dotted ClassName.method strings.
Find: grep -rn -A2 "guard(\|guardSync(" lib/ | grep -v "source:" (inspect
matches; multiline calls need manual read). Severity: medium (breaks
grouping/dedupe quality).isReportable misuse. Code that sets isReportable: false expecting
suppression, or reporters that never check it. The pipeline does NOT enforce
the flag (../../references/policy-and-delivery.md). Severity: medium;
pair each finding with where enforcement should live (reporter skip or
severity).userMessage (e.g. userMessage: 'somethingWentWrong'
camelCase key shapes) that render raw if unmapped. Find: constructor calls
whose userMessage has no spaces and matches [a-z]+[A-Z]. Severity: medium.parser. fromJson/fromMap invocations inside repositories
done bare where the app convention uses parser(() => ..., data: raw).
Severity: low-medium (errors arrive as FormatException/TypeError instead of
typed ParsingException with payload).runAppWithReporting AND manual
FlutterError/PlatformDispatcher/zone handlers -> double reporting.
Find: grep -rn "runAppWithReporting\|FlutterError.onError\|PlatformDispatcher" lib/.
Severity: high if both present.event.context
instead of event.toMap() (sanitizer bypass - privacy issue, high),
returning false for intentional skips (outbox growth, medium), throwing
(low - swallowed but loses outbox semantics).Group by severity (high/medium/low). Each finding: file:line, one-sentence
violation, one-sentence consequence, the concrete fix direction (respecting app
idiom). End with: counts per category, the top 3 fixes by impact, and explicitly
list categories that came back CLEAN so coverage is visible. If the surface was
a diff, do not report pre-existing issues outside it except as a short
"pre-existing, out of scope" note.
migrate-legacy-api skill and stop auditing files that are pre-migration."Review this PR adding checkout error handling" -> scope = diff files + their
repositories; findings: checkout_repository.dart:84 catches DioException and
throws app-local CheckoutException implements Exception (high, breaks
contract - suggest extending ApiException); checkout_cubit.dart:41 stores
e.userMessage string (high - store the exception, render userMessage in UI);
guard call missing source at checkout_cubit.dart:39 (medium). Categories 6-12
clean. Top fix: make CheckoutException extend ApiException.
npx claudepluginhub omar-hanafy/bug_handler --plugin bug-handlerGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Dispatches multiple subagents concurrently for independent tasks without shared state. Use when facing 2+ unrelated failures or subsystems that can be investigated in parallel.