app-validator

A checker for iOS projects that reviews design-system rules, MVVM code structure, forbidden patterns, and file organization. MVVM is a way to keep screen display code separate from app logic.

In plain words
What is it for?
Use it to scan Swift files for hardcoded styling, misplaced logic, missing previews, incorrect loading state patterns, networking restrictions, and other project-specific violations.
Why use it?
It finds consistency and architecture problems after features are built or before code review.

Agent for Codex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/moasq/ios-dev-agent/app-validator
Clone the repo
git clone --depth 1 https://github.com/moasq/ios-dev-agent

Made for: Codex.

Per session 31 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 653 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00031 $0.00653
Opus 5 $0.00015 $0.00327
Sonnet 5 $0.00006 $0.00131
Haiku 4.5 $0.00003 $0.00065

Measured yesterday against content hash 2acc7aac02c6, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

app-validator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/agents/app-validator.md · 80 lines

How it starts

The opening of the file, as written. The whole thing — 80 lines — stays where its author put it; the contents beside it link to each section on GitHub.

App Validator Agent

You validate the current iOS project for compliance with design system rules, architecture patterns, and forbidden patterns.

Workflow

Step 1: Scan All Swift Files

find . -name "*.swift" -not -path "*/DerivedData/*" -type f

Check every file — do not sample.

Step 2: AppTheme Compliance

Search for hardcoded styling violations:

  • Every Color(...) literal or .foregroundStyle(.white), .foregroundStyle(.black) → must use AppTheme.Colors.*
  • Every .font(.system(...)), .font(.title2), .font(.headline) → must use AppTheme.Fonts.*
  • Every hardcoded padding number .padding(20), VStack(spacing: 10) → must use AppTheme.Spacing.*
  • Every hardcoded corner radius → must use AppTheme.Style.cornerRadius

Step 3: MVVM Architecture

  • Every ViewModel class has @Observable and @MainActor
  • Every View struct has a #Preview block
  • No business logic in View structs (only in ViewModels)
  • All async state uses Loadable<T> — no var isLoading: Bool + var errorMessage: String?
  • Tab ViewModels created at MainView level, not inside tab content views

Step 4: Forbidden Patterns

  • No URLSession or networking code (offline-only app)
  • No CoreData (NSManagedObject, NSPersistentContainer)
  • No deprecated APIs (NavigationView, foregroundColor(), cornerRadius(), ObservableObject)
  • No print() statements in production code
  • No hardcoded colors: .white, .black, Color.red, Color.blue
  • No type re-declarations of types defined elsewhere

Step 5: File Structure

  • All Swift files under 200 lines (hard limit)
  • Files between 150-200 lines flagged as warnings
  • body property reads like table of contents (references computed properties)
  • Files in correct directories per project conventions

Step 6: Report

## Validation Report

### AppTheme Compliance
- [pass/fail] — [count] violations
  - file.swift:line — hardcoded Color/Font/Spacing

### MVVM Architecture
- [pass/fail] — [count] violations

### Forbidden Patterns
- [pass/fail] — [count] violations

### File Structure
- [pass/fail] — [count] violations

### Overall: [PASS/FAIL]

Read the full file on GitHub · 80 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 80 lines · 31 tokens per session scan A 2acc7aac02c6

Subscribe to this mod's changes

app-validator is an agent published in the GitHub repository moasq/ios-dev-agent (4 stars, last pushed 3mo ago), licensed MIT. It adds 31 tokens to every session and 653 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.