modrexio/modrex / .agents/skills/danger-audit
danger-audit
VerifiedAudit a diff for the five dangerous AI patterns
danger-audit
Use this skill before finishing any non-trivial AI-assisted code change.
These patterns can hide bugs or break Modrex-specific behavior. They are stricter than a general style review.
Target
Default to git diff HEAD.
If the user provides a path, branch, or file, audit that target.
The five blockers
A change is not ready if it introduces one of these without a strong project-specific reason:
- Silent catch / silent fallback
- Generic helpers replacing game-specific logic
- Defensive checks that hide broken invariants
- Deep
if/elsenesting - Fake abstractions / speculative future-proofing
Read .agents/rules/ai-danger-patterns.md for full examples.
1. Silent catch / silent fallback
Block:
catch { return }
catch { return [] }
return data ?? [] // when this hides a failed load, parse, or install
Ask:
- Is the fallback a correct domain result?
- Would this make the UI lie?
- Would this hide a filesystem, IPC, archive, or network failure?
- Can the caller show a useful error instead?
Accept only when the fallback is genuinely optional (missing thumbnail, cache miss).
2. Generic helpers replacing game-specific logic
Block helpers that collapse game-specific behavior into generic behavior.
Danger signs:
- function names like
getModsPath,getGamePath,processGame,handleLoader - helpers that assume all games use the same
Modsconvention - removal of explicit
payday2,payday3,pdth, orcrimebossbranching - "cleanup" that makes code shorter by deleting domain cases
Ask:
- Which game-specific invariants existed before?
- Are all loaders still handled?
- Are Steam, Epic, Xbox, and legacy layouts still handled where relevant?
3. Defensive checks hiding broken invariants
Block defensive checks inside trusted code paths.
Danger signs:
- changing
InstalledModtoInstalledMod | null | undefined - returning
nullinstead of fixing the caller if (!value) returndeep inside business logic- optional chaining added everywhere
?? "",?? [],?? falseused to silence type errors
Ask:
- Is this value allowed to be missing by design?
- Should this be validated at a boundary instead?
- Is the type wrong?
4. Deep if/else nesting
Block new nested pyramids.
Danger signs:
- more than two levels of
if elseafterreturn,throw,continue, orbreak- happy path indented inside validation branches
- side effects hidden inside nested branches
Fix with: guard clauses, early returns, named booleans, smaller functions, switch for exclusive domain cases.
5. Fake abstractions / speculative future-proofing
Block abstractions that are not needed now.
Danger signs:
Manager,Service,Factory,Adapter,Strategy,Handleradded for one use- options like
dryRun,force,silent,experimental,mode - new layers around existing direct code
- broad interfaces with one implementation
Ask:
- Does this remove real duplication?
- Does this name a real domain concept?
- Would inline code be clearer?
Output format
## Danger audit
### Blockers
- ...
### Cleanups
- ...
### Accepted
- ...
### Recommended next step
...
If clean:
## Danger audit
No blocker-level AI danger patterns found.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 466k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 466k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 466k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 192k | Updated | Claude CodeCodex | Verified | Install |