architecture-audit

Detect architectural violations in Swift codebases, including factory bypass and scope compliance.

2|Updated Aug 15, 2025
One-click install
npx skills add https://github.com/rfhayn/forager --skill architecture-audit-rfhayn
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture-audit
Source: https://github.com/rfhayn/forager/tree/main/.claude/skills/architecture-audit
Command: npx skills add https://github.com/rfhayn/forager --skill architecture-audit-rfhayn

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the process of identifying architectural violations in a codebase, ensuring that the code adheres to best practices and standards.

Core Features & Use Cases

  • Factory Bypass Detection: Identifies direct creation of Core Data objects without using the factory.
  • Raw Assign Detection: Checks for direct assignments to viewContext or context outside ManagedObjectFactory.swift.
  • ADR 013 Scope Compliance: Verifies that fetch requests in services and repositories include the householdKey predicate.
  • Service Layer Compliance: Ensures that context.save() is not called in production view files.
  • Use Case: Before any milestone that creates Core Data objects, during code review, and before PR creation, use this Skill to catch potential architectural issues.

Quick Start

Run the architecture-audit skill to check your codebase for architectural violations.

Frequently Asked Questions about architecture-audit

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

FAQPage Schema
How do I detect Core Data factory bypass violations in a Swift codebase?

Detect Core Data factory bypass violations in Swift by running an automated architectural audit that scans for direct object creation bypassing the designated ManagedObjectFactory, ensuring strict architectural compliance before pull request creation.

What is the best way to check for raw viewContext assignments outside the factory class?

Checking for raw viewContext assignments involves auditing the Swift codebase for direct context manipulations occurring outside ManagedObjectFactory.swift, automatically flagging these architectural violations to maintain strict data layer boundaries.

How do I verify ADR 013 scope compliance for fetch requests in Swift repositories?

Verify ADR 013 scope compliance by auditing Swift repository and service fetch requests to ensure they include the required householdKey predicate, automatically validating architectural scope adherence across the codebase.

Can I automate codebase checks for context.save() calls in production view files?

You can automate codebase checks for service layer compliance by scanning production Swift view files for context.save() calls, automatically detecting architectural violations where persistence logic bypasses the designated service layer.

When should I run an architectural compliance audit on my Swift project?

Run an architectural compliance audit before milestones creating Core Data objects, during code reviews, and before PR creation to catch potential architectural issues like factory bypass, raw assignments, and scope violations early.