Identifies missing tests for unique critical local logic: money, auth, permissions, data integrity, algorithms, and domain rules. Use when auditing critical logic coverage gaps.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Identifies missing tests for unique critical local logic: money, auth, permissions, data integrity, algorithms, and domain rules. Use when auditing critical logic coverage gaps.
Paths: File paths (references/, ../ln-*) are relative to this skill directory.
Critical Logic Coverage Auditor (L3 Worker)
Type: L3 Worker
Specialized worker identifying missing tests for unique critical local logic.
Purpose & Scope
Audit Critical Logic Coverage (Category 4: High Priority)
Identify untested unique local logic only
Classify by category (Money, Auth/Permissions, Data Integrity, Algorithms, Domain Rules)
Emit ADD_MISSING findings for missing high-value tests
Do not recommend tests just to increase coverage percentage
Calculate compliance score (X/10)
Inputs
MANDATORY READ: Load references/audit_worker_core_contract.md and references/mcp_tool_preferences.md.
Tool policy: You may run as an isolated subagent where host AGENTS.md is not in scope, so default to hex-line MCP first for file reads, search, and edits. Load references/mcp_integration_patterns.md only when MCP behavior is unclear.
Domain-aware: Supports domain_mode + current_domain (see audit_output_schema.md#domain-aware-worker-output).
Use hex-graph first when hotspots materially improve coverage-gap discovery. Use hex-line first for local code and test reads when available. If MCP is unavailable, unsupported, or not indexed, continue with built-in Read/Grep/Glob/Bash and state the fallback in the report.
Workflow
Detection policy: use two-layer detection (candidate scan, then context verification); load references/two_layer_detection.md only when the verification method is ambiguous.
Check test coverage for each critical path (Layer 1)
Search ALL test files for coverage (tests may be in different location than production code)
Match by function name, module name, or test description
3b) Context Analysis (Layer 2 -- MANDATORY): For each gap candidate, ask:
Is this function already covered by E2E/integration test? -> downgrade to LOW
Is this a helper function with <10 lines called from tested code? -> skip
Is keyword match a false positive (e.g., paymentIcon() is UI, not payment logic)? -> skip
Collect missing tests
Tag each finding with domain: domain_name (if domain-aware)
Set action: "ADD_MISSING" for every confirmed finding
Calculate Score: Count violations by severity, calculate compliance score (X/10)
Write Report: Build full markdown report in memory per references/templates/audit_worker_report_template.md, write to {output_dir}/ln-634--{identifier}.md (or {output_dir}/ln-634--{identifier}.md if domain-aware) in single Write call
Return Summary: Return minimal summary to coordinator (see Output Format)
Write JSON summary per references/audit_summary_contract.md. In managed mode the caller passes both runId and summaryArtifactPath; in standalone mode the worker generates its own run-scoped artifact path per shared contract.
Write report to {output_dir}/ln-634--{identifier}.md (global) or {output_dir}/ln-634--{identifier}.md (domain-aware) with category: "Critical Logic Coverage" and checks: money_logic_coverage, auth_permission_coverage, data_integrity_coverage, algorithm_domain_rule_coverage.
Return summary per references/audit_summary_contract.md.
When summaryArtifactPath is absent, write the standalone runtime summary under .hex-skills/runtime-artifacts/runs/{run_id}/evaluation-worker/{worker}--{identifier}.json and optionally echo the same summary in structured output.
Apply the already-loaded references/audit_worker_core_contract.md.
Domain-aware scanning: If domain_mode="domain-aware", scan ONLY scan_path production code (not entire codebase)
Tag findings: Include domain field in each finding when domain-aware
Test search scope: Search ALL test files for coverage (tests may be in different location than production code)
Match by name: Use function name, module name, or test description to match tests to production code
Do not auto-fix: Report only
Unique angle: Only find missing tests for unique local critical logic. Do not evaluate existing low-value tests, E2E journey priority, trustworthiness, oracle strength, manual evidence, or structure.
No coverage-percent work: Do not recommend tests merely to improve line/branch coverage metrics.
Action required: Every finding uses action: "ADD_MISSING".
Definition of Done
Apply the already-loaded references/audit_worker_core_contract.md.