/loxihart-engineering:auditing-logicfrom loxihart-engineering
Audits code for logical errors before they become bugs — control flow gaps, data contract violations, schema/type drift, business logic inconsistencies, and silent failure paths. Produces a severity-rated issue list with a one-line diagnosis and one-line fix per finding. Use this skill whenever code is pasted with a review request, or when the user says "audit this", "check the logic", "does this make sense", "any issues with this", "logic audit", "what's wrong here", "review this function", "is this correct", or hands you any code file and wants a critical eye. Even if the user does not say "logic" — if code is present and they want feedback, use this skill. Also triggers on: "find the bug", "something feels off", "is this right", "sanity check this", "does this hold", "validate my logic", "code review", "PR review", "review this PR".
Ships in loxihart-engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Audits code for five classes of logical defect. Does NOT review style, naming, formatting, or architecture. Stays focused on: does this do what the developer thinks it does?
Before running passes, assess scope:
| Scope | Guidance |
|---|---|
| ≤ 3 files / ≤ 300 LOC | Full five-pass audit on all code |
| 4–10 files / 300–1000 LOC | Full audit; group findings by file; emit cross-file section last |
| > 10 files / > 1000 LOC | Ask: "This is a large surface — which file or subsystem is highest priority?" Audit that first, then ask whether to continue. |
If scope is ambiguous (no file count given), proceed and note at the top:
Auditing provided excerpt only — findings may not reflect full codebase state.
Every audit response must contain these sections in this order.
FINDINGS One bullet per finding:
[CRITICAL|HIGH|MEDIUM|LOW] file:line — one-line diagnosis. Fix: one-line action (imperative verb first).Never group findings. Every finding gets an individual severity label.
SUMMARY
SELF-REVIEW State what the self-review pass caught, or: "Self-review: no additional findings." Do not skip this section.
Run all five passes on every audit. Skip a pass only if it provably does not apply. State skipped passes once.
else/default in exhaustive-looking conditionalsundefined/None when they expect a value?.) or None-safe access masking a null that should be an erroras X / cast()) papering over a narrowing gapLiteral type exhaustiveness — is every variant handled?Apply the relevant sub-pass for the language in scope. Skip and state why if none apply.
TypeScript / Zod:
.strict() schemas paired with types that allow extra keys (or vice versa).default() values that conflict with the interface defaultz.infer<> used downstream as authoritative when the schema is narrower than the typePython / Pydantic:
Optional field accessed without a guard)model_validate() called on data that hasn't been sanitized to match field constraintsField(default=...) values that conflict with caller assumptionsmodel_config settings (e.g., extra='ignore') silently dropping fields callers expect to survive@validator / @field_validator that passes but downstream code assumes stricter invariantsOther languages / no schema library:
Skip and emit: Pass 3 skipped — no runtime schema/validation library detected.
catch {} / bare except: / except Exception: pass)When a finding depends on behavior you cannot see:
Requires visibility into [X] to confirm.I need to see [X] to determine if this is HIGH or CRITICAL — can you paste it?Ask once per audit, max. If multiple findings need external context, batch:
To fully assess N findings, I need: [list].
Emit a severity-rated issue list. Never pad with "this looks good" between findings. If a pass is clean, state it once and move on.
Pass N — Label: No findings.
| Level | Meaning |
|---|---|
| CRITICAL | Will produce wrong behavior at runtime; data loss or incorrect state likely |
| HIGH | Logic gap that surfaces under realistic inputs |
| MEDIUM | Inconsistency that becomes a bug as the codebase grows |
| LOW | Latent fragility — won't bite now but creates risk |
[SEVERITY] Pass N — Label
Location: file.ts → functionName() (line N if available)
Diagnosis: One sentence — what is wrong and why.
Fix: One sentence or minimal code snippet showing the correction.
When the same root cause produces findings in multiple files, log once at the root location. Do not duplicate per-file:
[SEVERITY] Pass N — Label ⬡ ROOT CAUSE
Root: file-a.ts → sourceOfTruth()
Surfaces in:
- file-b.ts → consumerA() — one-line description of how it manifests here
- file-c.ts → consumerB() — one-line description of how it manifests here
Diagnosis: One sentence describing the shared underlying defect.
Fix: One sentence fixing the root. Surface findings resolve automatically.
Use this pattern when:
Do NOT use when:
AUDIT SUMMARY
─────────────
Critical: N High: N Medium: N Low: N
Total: N issues across N passes
Root cause clusters: N (N surface findings consolidated) ← omit if none
Passes skipped: [list] — [reason] ← omit if none
AUDIT SUMMARY
─────────────
No logical defects found across all applicable passes.
Passes run: 1, 2, 3 (variant), 4, 5
Passes skipped: [list] — [reason]
[Note any caveats — e.g., "External function behavior assumed correct where
implementation was not provided."]
Before emitting the summary, ask yourself:
Single-file finding:
[HIGH] Pass 2 — Unused parameter silently degrades contract
Location: raci-chart.ts → validatePhaseTransition()
Diagnosis: _targetPhase is accepted but never used — the function validates
current-phase deliverables regardless of destination, so Build→Discovery
passes if Build deliverables are complete.
Fix: Derive required deliverables from targetPhase entry criteria, or remove
the parameter and document that only source-phase completion is checked.
Cross-file root cause:
[HIGH] Pass 4 — allowedPhases manually curated; drifts from RACI chart ⬡ ROOT CAUSE
Root: role-matrix.ts → ROLE_CONSTRAINTS
Surfaces in:
- role-tools.ts → ff_invoke_persona() — phase gate passes but RACI returns null
- raci-tools.ts → ff_get_raci_position() — position lookup disagrees with gate result
Diagnosis: allowedPhases is hardcoded independently of RACI_CHART — the two
sources can contradict each other silently as roles are modified.
Fix: Derive allowedPhases at startup from RACI_CHART so any phase where the
role appears in R/A/C/I is automatically allowed.
Clean audit:
AUDIT SUMMARY
─────────────
No logical defects found across all applicable passes.
Passes run: 1, 2, 4, 5
Passes skipped: 3 — no runtime schema/validation library detected in provided code.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub krosebrook/loxihart-skills --plugin loxihart-engineering22 skills in this plugin
/administering-supabaseManages Supabase database operations for FlashFusion's production stack — schema design, Row Level Security policies, migrations, Edge Functions, and debugging. Active project: flashnframe-app (etctmappdhpjuwptdbeb). Use when the user mentions: Supabase, RLS, row level security, migration, schema, database, table, Edge Function, auth, policies, Postgres, supabase query, database admin, add a column, create a table, why is my query blocked, or any task involving the Supabase project or database structure.
/code-auditorPerforms comprehensive codebase analysis covering architecture, code quality, security, performance, testing, and maintainability. Use when user wants to audit code quality, identify technical debt, find security issues, assess test coverage, or get a codebase health check./code-transferTransfer code between files with line-based precision. Use when users request copying code from one location to another, moving functions or classes between files, extracting code blocks, or inserting code at specific line numbers./debug-like-expertDeep analysis debugging mode for complex issues. Activates methodical investigation protocol with evidence gathering, hypothesis testing, and rigorous verification. Use when standard troubleshooting fails or when issues require systematic root cause analysis. Triggers on: debug this, root cause analysis, systematic debugging, why is this failing, trace this bug, diagnose this issue, investigation protocol, hypothesis testing./engineering-patternsProduction engineering pattern library spanning 11 phases — Foundation, Resilience, Performance, Data Integrity, Observability, Deployment, Scalability, Edge Cases, Security Deep, Compliance/DR/FinOps, and AI/HITL. Use when auditing code for production readiness, applying hardening patterns, reviewing system design, pattern audit, apply phase, harden this, production-ready, resilience patterns, observability gaps, security review, DR plan, FinOps, or AI guardrails. Use alongside engineering-staff-workflows for execution. Not for writing the implementation itself — that is engineering-staff-workflows.
/engineering-staff-workflowsOperates as a security-first, scope-gated Staff Engineer workflow for production system builds across a 50–200 engineer organization. Routes every task through mandatory SCOPE_MODE gating, applies WSJF backlog prioritization, enforces AppSec-grade threat modeling, and covers the full stack from frontend to edge to AI pipeline to agent orchestration. Use when the user mentions: multi-file builds, agent or MCP systems, infrastructure work, security audits, full-stack features, or any architecture requiring agentic-aware design with observability-first patterns. Also triggers on: help me architect this, build this properly, review my system design, multi-file build, how should I structure this, is this production ready, or any request involving 3 or more files or system-level thinking.