audit-domain

Audit TypeScript domain files for anti-patterns against ADR references.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/jluckyiv/rivcomocktrial --skill audit-domain-jluckyiv
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: audit-domain
Source: https://github.com/jluckyiv/rivcomocktrial/tree/main/.claude/skills/audit-domain
Command: npx skills add https://github.com/jluckyiv/rivcomocktrial --skill audit-domain-jluckyiv

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Domain code often drifts from codified patterns, leading to leaky routes and scattered validation. This skill provides an automated audit of the domain layer (web/src/lib/domain and web/src/routes) to detect anti-patterns and enforce ADR-009 and ADR-012.

Core Features & Use Cases

  • Scan domain models for boolean state flags and ensure explicit discriminated unions or as const enums.
  • Flag non-exhaustive switches and boundary-parse enforcement to keep domain logic out of routes.
  • Surface opportunities to move domain logic from routes into lib/domain, with reference baselines from standings.ts and registration.ts.

Quick Start

Run the domain audit against your codebase to surface violations and retrieve a guided report.

Frequently Asked Questions about audit-domain

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect domain logic leaking into my TypeScript route files?

To detect domain logic leaking into routes, an automated audit scans TypeScript files in routes and lib/domain directories to surface boundary validation issues, non-exhaustive switches, and misplaced business logic using ripgrep and Bash scripts.

Why should I replace boolean flags with discriminated unions in my domain models?

Boolean flags threaten correct domain modeling by creating ambiguous state representations. An audit surfaces these anti-patterns and recommends explicit discriminated unions or as const enums to enforce strict functional programming discipline and prevent invalid state combinations.

How do I enforce ADR compliance for domain layer patterns in a TypeScript codebase?

Enforcing ADR compliance involves scanning domain and route TypeScript files against codified ADR-009 and ADR-012 references to detect anti-patterns, generating a guided report that highlights violations and opportunities to move logic into lib/domain.

Can I audit boundary-parse enforcement without installing additional dependencies?

Auditing boundary-parse enforcement requires a local ripgrep tool (rg) and a Bash helper script included under the skill, meaning no external package dependencies are needed beyond having ripgrep installed in your local environment.

What is the best way to surface non-exhaustive switches in TypeScript domain code?

The best way to surface non-exhaustive switches is running an automated domain audit that checks web/src/lib/domain TypeScript files, comparing patterns against baseline references like standings.ts and registration.ts to flag incomplete type handling.

How do I keep domain logic out of routes when working with functional programming patterns?

Keeping domain logic out of routes requires scanning for boundary validation issues and logic leakage, then migrating identified business logic into lib/domain modules while ensuring explicit discriminated unions replace boolean flags for proper FP discipline.