architecture-guard

Enforce feature-driven folder structure and routing separation in Next.js monorepos.

Updated May 7, 2026
One-click install
npx skills add https://github.com/johinsDev/loyalty-app --skill architecture-guard-johinsdev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: architecture-guard
Source: https://github.com/johinsDev/loyalty-app/tree/main/.claude/skills/architecture-guard
Command: npx skills add https://github.com/johinsDev/loyalty-app --skill architecture-guard-johinsdev

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you avoid architectural drift in a multi-app Next.js monorepo by keeping routing, domain logic, and data access in the right places.

Core Features & Use Cases

  • Feature-driven layout enforcement: Keeps app/ for routing only while placing business logic, UI, state, and helpers in src/features/<feature>/ and src/lib/.
  • Consistent tRPC layering: Ensures Next route handlers and domain code follow the repository → service → router pattern, so Drizzle calls stay centralized.
  • Channel and API conventions: Guides how to add new outbound channels (e.g., WhatsApp/SMS/push) with matching package, DB schema, API feature folder, and dev/admin views.
  • Review and onboarding guardrails: Provides a checklist for PR reviews to ensure performance, i18n, loading/error handling, and test expectations are met.

Quick Start

When you add or modify a page in apps/web or apps/admin, ask the AI to review your proposed file placement and data-fetching approach against the architecture guard rules in this Skill.

Frequently Asked Questions about architecture-guard

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

FAQPage Schema
How do I enforce a feature-driven folder structure in a Next.js monorepo?

Enforce a feature-driven folder structure by keeping the Next.js app directory for routing only, while moving business logic, UI, and state into src/features/ and src/lib/.

How do I structure tRPC layering in a Next.js app to prevent architectural drift?

Structure tRPC layering by following the repository, service, and router pattern to keep Drizzle calls centralized and maintain a consistent request flow.

What should a PR review checklist include for a Next.js monorepo?

A PR review checklist should verify feature-driven file placement, tRPC layering, i18n, loading and error handling, and test expectations across web, admin, and API packages.

Does this architecture guard work with Next.js App Router and multi-app setups?

Yes, it applies to Next.js App Router and multi-app setups by enforcing consistent conventions across apps/web, apps/admin, and packages/api for routing and domain logic.

Where should Drizzle ORM calls go in a feature-driven Next.js architecture?

Drizzle calls must remain strictly inside repositories to centralize data access and prevent domain logic from leaking into tRPC routers or Next.js route handlers.