axiom audit database schema

Engineering Community

Skill notes

Tool Use Is Mandatory

Run every Glob, Grep, and Read this prompt lists. Do not reason from training data instead of scanning. Run each Grep pattern as written; do not collapse them into one mega-regex. Run the Read verifications each section calls for. "Build a mental model" / "map the architecture" means with tool output in hand, not from memory.

Files to Exclude

Skip: *Tests.swift, *Previews.swift, */Pods/*, */Carthage/*, */.build/*, */DerivedData/*, */scratch/*, */docs/*, */.claude/*, */.claude-plugin/*

Step 3: Map the Schema

Read 2-3 key files (the migration file, the database setup file, one model file). Note: How many migrations are registered, in what order Which tables exist and their primary keys Which tables have FOREIGN KEY references between them Whether PRAGMA foreign_keys = ON is set in prepareDatabase

Output

Write a brief Schema Map (5-10 lines) summarizing: Framework (GRDB / SQLite.swift / sqlite-data / raw) Migration count and ordering strategy Tables and their relationships FK enforcement state (ON / OFF / not configured)

Phase 2: Detect Known Anti-Patterns

Run all 10 detection patterns. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification.

Fluxly profile Runtime and permissions are inferred by Fluxly static checks, not author declarations or runtime test results.
Domain
Engineering
Author-declared agents
No explicit declaration found; this is not inferred or tested compatibility
Static check
94 / 100 · heuristic scan, not runtime safety proof
Runtime evidence
Not run; no isolated runtime test evidence is currently recorded
Author / version / license
@CharlesWiltgen · MIT
Token usage
Lean
Setup complexity
Guided setup
External API key
Not required
Operating systems
Unspecified (assume cross-platform)
Runtime requirements
No explicit requirements detected
Detected file/system behavior
  • Read-only
  • Write / modify
  • Shell exec
Network behavior
Local-only
Install commands
None (reference only)

Heads up: Tool permissions are not declared; actual access depends on the runtime.

01
Phase 1: Map Schema & Migration Architecture

Phase 1: Map Schema & Migration Architecture

02
Step 1: Identify Database Framework and Configuration

Step 1: Identify Database Framework and Configuration

03
Step 2: Identify Migration Surface

Step 2: Identify Migration Surface

04
Step 3: Map the Schema

Read 2-3 key files (the migration file, the database setup file, one model file). Note: How many migrations are registered, in what order Which tables exist and their primary keys Which tables have FOREIGN KEY references between them Whether `PRAGMA foreign_keys = ON` is set in `prepareDatabase`

05
Phase 2: Detect Known Anti-Patterns

Run all 10 detection patterns. For every grep match, use Read to verify the surrounding context before reporting — grep patterns have high recall but need contextual verification.

06
Phase 3: Reason About Schema Completeness

Using the Schema Map from Phase 1 and your domain knowledge, check for what's *missing* — not just what's wrong. Question · What it detects · Why it matters Is `PRAGMA foreign_keys = ON` set in `prepareDatabase`, given that FK constraints exist? · Silent FK enforcement bypass · Constraints declared but ignored — orphaned rows accumulate without error Does every schema-changing migration handle existing rows (DEFAULT, NULL, backfill)? · Production-data crashes · Migration that works on empty DB crashes on a populated one

07
Phase 4: Cross-Reference Findings

Bump severity for these combinations: Finding A · + Finding B · = Compound · Severity ADD COLUMN NOT NULL without DEFAULT · Production app shipping with existing users · Guaranteed crash on update · CRITICAL FOREIGN KEY constraints declared · PRAGMA foreign_keys not enabled · Silent integrity failure across whole schema · CRITICAL INSERT OR REPLACE · FK constraints with ON DELETE CASCADE · Silent destruction of child records on every replace · CRITICAL

08
Phase 5: Schema Health Score

Metric · Value Migration count · N registered Idempotency coverage · M of N migrations safe to re-run (Z%) FK enforcement · ON / OFF / not configured FK validation · M of N FK additions validated (Z%)

Discussion

Powered by GitHub Discussions. Sign in with GitHub to comment, react, or subscribe.