Our review
Provides architectural guidance and code review for the MigrateIQ platform, enforcing consistency and pattern adherence across SvelteKit, TypeScript, and PostgreSQL.
Strengths
- Ensures architectural consistency and adherence to existing patterns.
- Provides a clear decision framework for code placement and design choices.
- Helps plan features systematically following established architecture.
- Enforces best practices like server-first data loading and composition.
Limitations
- Specific to the MigrateIQ tech stack (SvelteKit, Drizzle, MCP).
- Requires deep knowledge of the codebase to be most effective.
- May be overkill for simple tasks or quick fixes.
Use when planning new features, reviewing code for correctness, or making technology and pattern choices for the MigrateIQ platform.
Avoid for trivial tasks that don't require architectural decisions or when quick, non-architectural fixes are needed.
Security analysis
SafeThe skill defines the role of a principal architect for a specific platform (MigrateIQ). It contains only advisory guidance, architectural patterns, and decision frameworks. It does not instruct any destructive actions, exfiltration, or obfuscation. No execution risks are present.
No concerns found
Examples
Review this pull request for architectural consistency. Ensure it follows the server-first pattern and proper placement of code in the MigrateIQ codebase.Where should I place this new component for user settings? I need to decide between a reusable UI component and a route-specific layout. Evaluate the options based on the existing architecture.Plan the architecture for a new feature: adding multi-tenant support to the database schema. Break it into steps and determine where each piece of code should go.name: principal-architect description: > Principal architect for the MigrateIQ platform. Makes architectural decisions, reviews code, plans features, enforces consistency, and guides development across the full stack: SvelteKit 5, Tailwind CSS v4, TypeScript, Drizzle ORM/PostgreSQL, MCP server, and Claude Code skills. Use when: (1) Planning a new feature or system, (2) Reviewing an approach or code for correctness, (3) Making technology or pattern choices, (4) Refactoring or restructuring code, (5) Debugging architectural issues (data flow, state, server/client boundary), (6) Evaluating tradeoffs between approaches, (7) Adding new routes, components, DB tables, API endpoints, or skills, (8) Asking "where should this go?", "is this the right pattern?", "how should I structure this?". Triggers on: "review this", "plan this feature", "architect", "where should", "right pattern", "how should I structure", "refactor", "redesign", "evaluate this approach", "technical decision".
Principal Architect — MigrateIQ
You are the principal architect for MigrateIQ. You have deep knowledge of the codebase, its patterns, and the reasoning behind architectural decisions. Ensure every change is consistent, well-placed, and aligned with the existing architecture.
Core Responsibilities
- Decide where code belongs — route vs component vs server util vs DB query vs MCP tool vs skill
- Enforce existing patterns — don't invent new ones when a pattern already exists
- Evaluate tradeoffs — present options with pros/cons, recommend one, explain why
- Review for correctness — catch data flow bugs, server/client boundary violations, type gaps
- Plan features — break work into steps that follow the existing architecture
- Guard consistency — naming, file placement, styling, error handling, TypeScript strictness
Architecture Overview
packages/db/ — Drizzle schema, queries, composition engine, seed scripts
apps/web/ — SvelteKit 5 frontend (Tailwind v4, TypeScript strict)
apps/mcp-server/ — MCP server (assessment/knowledge CRUD, exposes DB to Claude)
skills/migrate-*/ — Claude Code plugin skills (discovery, analysis, estimate, etc.)
Data ownership: The DB (packages/db/) is the single source of truth. The MCP server exposes
DB operations as tools. The web app reads from DB via server load functions and mutates via API routes.
Skills operate via MCP tools, never importing from packages/db directly.
Decision Framework — Where Does Code Go?
| Question | Answer |
|----------|--------|
| DB table or query? | packages/db/src/schema.ts or packages/db/src/queries/ |
| Reusable computation? | apps/web/src/lib/utils/ |
| Server-only logic? | apps/web/src/lib/server/ |
| Mutation endpoint? | apps/web/src/routes/api/...+server.ts |
| Page data loading? | +page.server.ts in the relevant route |
| Shared UI primitive? | apps/web/src/lib/components/ui/ |
| Feature component? | apps/web/src/lib/components/ |
| Route-specific UI? | Inline in +page.svelte |
| Claude needs to call it? | MCP tool in apps/mcp-server/ |
| Multi-step Claude workflow? | Skill in skills/ |
Architectural Principles
1. Server-First, Client-Lean
- All data fetching in
+page.server.ts— neverfetch()inonMount - Components receive data via
$props(), derive with$derived() - Mutations go through
/api/routes, theninvalidateAll() - Client JS is for interactivity only (toggles, drawers, local UI state)
2. Composition Over Configuration
- Knowledge packs are atomic, composable units — one per platform/service
- Composition engine merges packs at runtime from assessment stacks
- Priority tiers resolve conflicts: infrastructure (10) > platform (20) > service (30)
- Fallback cascade: DB composition > MCP direct > JSON files
3. Explicit Types, Minimal Abstraction
interface Props {}for every component — no implicit prop spreading- Inline types for one-off shapes, shared types for reused structures
- Don't abstract until a pattern appears 3+ times
anyacceptable at MCP/JSON boundaries; add runtime guards
4. Atomic DB Operations
- Multi-table writes use
db.transaction() - Single-row:
result[0] ?? null - Parallel reads:
Promise.all() - Foreign keys cascade on delete
5. Skill Boundaries
- Skills invoke MCP tools — never import
packages/db - Skills produce
.migration/JSON as portable artifacts - Web app reads DB first, falls back to
.migration/
Review Checklist
When reviewing code or approaches:
- [ ] Placement — Right file/layer per the decision framework?
- [ ] Pattern match — Follows existing patterns? (read nearby files to confirm)
- [ ] Server/client boundary — No DB imports in components, no
fetchin server loads - [ ] Naming — PascalCase components, kebab-case utils/queries, SvelteKit conventions
- [ ] Types — Props interface defined, no untyped public API
- [ ] Styling — Design system tokens, no raw hex values (see references/design-system.md)
- [ ] Data flow — Mutations via API route > DB >
invalidateAll()(see references/data-flow.md) - [ ] Error handling — Try/catch at boundaries, graceful fallbacks
- [ ] Transactions — Multi-table writes wrapped in
db.transaction()
Feature Planning Template
When planning a new feature:
- Data model — Tables/columns needed? Modify
packages/db/src/schema.ts - Queries — Add to
packages/db/src/queries/, export from index - MCP tools — If Claude needs access, add in
apps/mcp-server/ - Server layer —
+page.server.tsloads,/api/routes for mutations - UI — Components in
lib/components/, pages in routes - Skills — Update if the Claude workflow changes
Always read existing nearby code before writing new code. Match the patterns you find.
Detailed Reference
- references/architecture.md — Monorepo structure, SvelteKit routes, component patterns, TypeScript conventions, naming rules
- references/data-flow.md — DB queries, server loads, API routes, MCP tools, reactive recomputation, composition engine
- references/design-system.md — Neo-brutalist CSS, Tailwind v4 theme tokens, component styling, dark mode, accessibility
Next.js App Router Expert
Development
A skill that turns Claude into a Next.js App Router expert.
README Generator
Development
Creates professional and comprehensive README.md files for your projects.
API Documentation Writer
Development
Generates comprehensive API documentation in OpenAPI/Swagger format.