Skip to content

ai-unified-process/aiup-nextjs

v3.1.1

AI Unified Process UI layer - Next.js App Router pages on an API layer, and their component tests

nextjs-ui

Implements the UI layer of a use case (UC-XXX) as a Next.js App Router client: the route under src/app, client components with an explicit 'use client' boundary, contract types that match the API layer's DTOs field by field, and calls to relative /api paths through the project's fetch client, with the rewrite in next.config reaching the API. Consumes the Handover of the API layer, NestJS or any other backend, and checks the JSON contract against it. Use when the user asks to "build the Next.js page", "implement the UI of UC-001", "create the React page", "wire the frontend to the REST API", or mentions Next.js, the App Router, page.tsx, or a Next.js frontend calling a backend in a project that combines layer plugins. Normally run by /use-case-implement as the UI layer of a project whose docs/architecture/stack.md names Next.js; it can also be run directly. Does not write tests: that is /nextjs-ui-test.

nextjs-ui-test

Writes the UI-layer tests of a use case (UC-XXX) for a Next.js App Router client with Vitest and React Testing Library in jsdom: renders the client component that holds the markup, drives it with user-event, mocks the project's API client module, and asserts the rendered content, the messages, and the requests sent to the API, in colocated <Component>.test.tsx files with a describe('UC-XXX: …') block. Reports a Server Component as unreachable and leaves it to the E2E layer. Use when the user asks to "write frontend tests", "write Vitest tests for the page", "write React unit tests", "test the component", "test the UI of UC-001", or mentions React Testing Library, jsdom, or component testing for a Next.js project that combines layer plugins. Normally run by /use-case-test as the UI test layer of a project whose docs/architecture/stack.md names Next.js; it can also be run directly. Browser tests against the running application are /playwright-e2e-test.