End to End Feature Architect

    1

    Ensures full-stack type-safety by synchronizing Database, API, Types, and Frontend layers in order.

    $5

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned

    Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+22 more

    End to End Feature Architect

    Example session with this skill installed

    Architect a new 'Project' feature where users can create projects with a title, description, and status. Use Prisma and Next.js.

    • Read your context and instructions
    • Compiled the end to end

    I will now architect the Project feature across all four layers.

    Feature Blueprint

    DB Schema: Add Project model to schema.prisma with id, title, description, status (enum), and createdAt.

    • API Route: POST /api/projects using Next.js Route Handlers with Zod validation.
    • Shared Types: Export Project and CreateProjectInput types derived from Prisma and Zod.
    • Frontend Hook: useCreateProject mutation hook using TanStack Query.

    Layer 1: Database Schema (Prisma)

    enum ProjectStatus {
      PLANNING
      ACTIVE
      COMPLETED
    }
    
    model Project {
      id          String        @id @default(cuid())
      title       String
      description String?
      status      ProjectStatus @default(PLANNING)
      createdAt   DateTime      @default(now())
      updatedAt   DateTime      @updatedAt
    }
    

    Layer 2: Backend API & Validation (Zod)

    import { z } from 'zod';
    import { NextResponse } from 'next/server';
    import { prisma } from '@/lib/prisma';
    
    const ProjectSchema = z.object({
      title: z.string().min(1).max(255),
      description: z.string().optional(),
      status: z.enum(['PLANNING', 'ACTIVE', 'COMPLETED']).optional(),
    });
    
    export async function POST(req: Request) {
      try {
        const json = await req.json();
        const body = ProjectSchema.parse(json);
        const project = await prisma.project.create({ data: body });
        return NextResponse.json({ success: true, data: project });
      } catch (error) {
        return NextResponse.json({ success: false, error: 'Invalid input' }, { status: 400 });
      }
    }
    

    Layer 3: Shared Types

    import { Project as PrismaProject } from '@prisma/client';
    
    export type Project = PrismaProject;
    export type CreateProjectInput = z.infer<typeof ProjectSchema>;
    

    Layer 4: Frontend Hook (TanStack Query)

    import { useMutation, useQueryClient } from '@tanstack/react-query';
    import { CreateProjectInput, Project } from '@/types';
    
    export function useCreateProject() {
      const queryClient = useQueryClient();
      return useMutation({
        mutationFn: async (newProject: CreateProjectInput) => {
          const res = await fetch('/api/projects', {
            method: 'POST',
            body: JSON.stringify(newProject),
          });
          if (!res.ok) throw new Error('Failed to create project');
          return res.json();
        },
        onSuccess: () => {
          queryClient.invalidateQueries({ queryKey: ['projects'] });
        },
      });
    }
    

    Next steps

    1. Run npx prisma migrate dev --name add_project_model to update your database.
    2. Ensure the prisma client is exported from @/lib/prisma.
    3. Import useCreateProject into your form component to start creating projects.

    Connects securely to your tools. The creator never sees your data.

    About this skill

    The problem

    Developers often build full-stack features in silos, causing runtime errors when the frontend sends data the backend doesn't expect. Manual updates to types, schemas, and API routes lead to type drift and unvalidated inputs.

    What it does

    • Enforces a strict 4-layer synchronization process: Database, API, Shared Types, and Frontend UI.
    • Generates database schema updates using Prisma, Drizzle, or SQL as the single source of truth.
    • Implements Zod validation in API routes to ensure backend inputs match the database constraints.
    • Produces shared TypeScript interfaces derived directly from the schema to prevent manual typing errors.
    • Builds type-safe data-fetching hooks for the frontend using TanStack Query or custom fetch wrappers.

    Frameworks & tools

    TypeScript, Prisma, Drizzle, Zod, Next.js, TanStack Query, Express.

    Why this beats prompting it yourself

    Standard prompts often skip validation layers or fail to update the database schema, leaving you to manually bridge the gap. This skill forces a senior-level, contract-first workflow where every layer is derived from the database schema, ensuring the entire feature is type-safe before you even run it.

    Use cases

    • Adding a new user-generated content module to a SaaS platform.
    • Refactoring existing loosely-typed API endpoints to use strict Zod validation.
    • Building complex multi-step forms that require identical validation on client and server.
    • Scaffolding a new CRUD resource from the database up to the React hook.

    Known limitations

    Requires an existing TypeScript project structure. You must confirm the blueprint before code generation begins.

    How to use

    Skills on Agensi run inside your AI agent. Copy the prompt, paste it into your agent, and it connects to Agensi and installs this skill for you. If a payment is needed, your agent shows it to you first.

    Reviews

    No reviews yet

    Be one of the first to try it. Every listed skill passes our trust checks below.

    Security scanned

    Passed our 8-point scan before listing

    Fresh listing

    Recently published to Agensi

    Money-back guarantee

    Doesn't do what its page promises? You get your money back.

    Trust & safety

    Security scanned

    Verified clean 1 month ago

    • Passed all security checks, Safe to install

    Requires

    prisma
    Node.js

    Listed1 month ago

    What's inside

    Frequently Asked Questions