Next.js Auth View Discovery + Clean Platform Scaffold
Quick start
- Identify router type and entry points.
- Inventory routes, auth boundaries, and roles.
- Run a route naming audit (librarian pass).
- Confirm the view list and new names with the user.
- Derive the platform name and route segment from existing copy.
- Scaffold
app/<platform-segment> public/app layouts.
- Add the landing header dropdown link.
- Smoke-test public and auth routes.
Scope
Does:
- Inventory public vs authenticated routes and role gates.
- Confirm view naming and scope before scaffold.
- Create a clean App Router subtree for the new platform.
- Keep legacy routes intact and isolated.
Does not:
- Migrate every legacy screen.
- Change auth logic or delete old code.
Required inputs
Derive before scaffolding (do not ask the user):
platformName
platformRouteSegment
platformFolderName (default: platformRouteSegment)
landingDropdownLabel (default: platformName)
landingDropdownItemLabel (default: platformName)
Rule categories by priority
| Priority |
Category |
Rules |
| 1 |
Discovery & confirmation |
rules/discovery-auth-views, rules/route-naming-audit, rules/confirm-view-names, rules/platform-naming-derive |
| 2 |
Platform scaffold & boilerplate |
rules/routing-platform-scaffold, rules/boilerplate-first |
| 3 |
Coexistence & entry |
rules/coexistence-legacy, rules/landing-header-dropdown |
| 4 |
Naming & testing |
rules/naming-clean, rules/test-auth-flows |
Output: view inventory template
UserRole: <role name>
Public views (unauthenticated):
- <View Title> -> <route> (source: <file>)
Authenticated views:
- <View Title> -> <route> (source: <file>)
Role-specific views:
- <View Title> -> <route> (role gate: <where>)
Status:
- Recreate in new platform: YES / NO
- Rename required: YES / NO
- New name (if renamed): <confirmed title>
- Active in UI navigation: YES / NO
- Evidence of activity: <nav link | redirect | deep link | comment>
Rules (must follow)
- Boilerplate-first: only scaffold confirmed views.
- Confirmation-first: do not scaffold before view list + naming is confirmed.
- Clean naming: no
New*, *V2, Temp*, legacy prefixes.
- Legacy isolation: do not import legacy CSS into new platform layouts.
- Shadcn-first: use shadcn components via CLI or MCP.
- Shadcn install: use MCP to add all components upfront, then reuse.
- Shadcn blocks: prefer
sidebar-16/sidebar-01, dashboard-01, login-04, signup-02.
- Global CSS baseline: use shadcn create preset (nova/zinc/orange).
- No legacy UI kits: do not use Ant/Chakra/etc in new routes.
- Auth parity: align new auth routes with historical provider and users.
- No legacy CSS: enforce new baseline styles only.
- Keep new routes under
app/<platform-segment>.
Platform structure
app/
<platform-segment>/
layout.tsx
(public)/
layout.tsx
page.tsx
<public-views>/
(app)/
layout.tsx
<auth-views>/
Verification
- Public routes load unauthenticated.
- Authenticated routes redirect when unauthenticated.
- Role-gated routes block unauthorized roles.
- Landing dropdown navigates to
/<platform-segment>.
- No console errors on load.
Version policy
Use the latest stable versions of next, react, tailwindcss, and shadcn/ui.
Additional resources
- Scans, mapping tips, and gotchas:
reference.md
- Example inventories and scaffolds:
examples.md
- Rule index:
- Priority 1:
rules/discovery-auth-views, rules/route-naming-audit, rules/confirm-view-names, rules/platform-naming-derive
- Priority 2:
rules/routing-platform-scaffold, rules/boilerplate-first
- Priority 3:
rules/coexistence-legacy, rules/landing-header-dropdown
- Priority 4:
rules/naming-clean, rules/test-auth-flows
1---2name: copycat3description: Inventory a Next.js app's marketing and dashboard views by authenticated vs unauthenticated roles, confirm view names with the user, and plan a shadcn-based clean platform scaffold in a separate App Router folder using user-confirmed naming and route segments. Use when auditing role-based views, planning shadcn UI recreation, or splitting auth vs public routes.4---5
6# Next.js Auth View Discovery + Clean Platform Scaffold
7
8## Quick start
91) Identify router type and entry points.
102) Inventory routes, auth boundaries, and roles.
113) Run a route naming audit (librarian pass).
124) Confirm the view list and new names with the user.
135) Derive the platform name and route segment from existing copy.
146) Scaffold `app/<platform-segment>` public/app layouts.
157) Add the landing header dropdown link.
168) Smoke-test public and auth routes.
17
18## Scope
19Does:
20- Inventory public vs authenticated routes and role gates.
21- Confirm view naming and scope before scaffold.
22- Create a clean App Router subtree for the new platform.
23- Keep legacy routes intact and isolated.
24
25Does not:
26- Migrate every legacy screen.
27- Change auth logic or delete old code.
28
29## Required inputs
30Derive before scaffolding (do not ask the user):
31- `platformName`
32- `platformRouteSegment`
33- `platformFolderName` (default: `platformRouteSegment`)
34- `landingDropdownLabel` (default: `platformName`)
35- `landingDropdownItemLabel` (default: `platformName`)
36
37## Rule categories by priority
38| Priority | Category | Rules |
39| --- | --- | --- |
40| 1 | Discovery & confirmation | `rules/discovery-auth-views`, `rules/route-naming-audit`, `rules/confirm-view-names`, `rules/platform-naming-derive` |
41| 2 | Platform scaffold & boilerplate | `rules/routing-platform-scaffold`, `rules/boilerplate-first` |
42| 3 | Coexistence & entry | `rules/coexistence-legacy`, `rules/landing-header-dropdown` |
43| 4 | Naming & testing | `rules/naming-clean`, `rules/test-auth-flows` |
44
45## Output: view inventory template
46```
47UserRole: <role name>
48Public views (unauthenticated):
49- <View Title> -> <route> (source: <file>)
50
51Authenticated views:
52- <View Title> -> <route> (source: <file>)
53
54Role-specific views:
55- <View Title> -> <route> (role gate: <where>)
56
57Status:
58- Recreate in new platform: YES / NO
59- Rename required: YES / NO
60- New name (if renamed): <confirmed title>
61 - Active in UI navigation: YES / NO
62 - Evidence of activity: <nav link | redirect | deep link | comment>
63```
64
65## Rules (must follow)
66- Boilerplate-first: only scaffold confirmed views.
67- Confirmation-first: do not scaffold before view list + naming is confirmed.
68- Clean naming: no `New*`, `*V2`, `Temp*`, legacy prefixes.
69- Legacy isolation: do not import legacy CSS into new platform layouts.
70- Shadcn-first: use shadcn components via CLI or MCP.
71- Shadcn install: use MCP to add all components upfront, then reuse.
72- Shadcn blocks: prefer `sidebar-16`/`sidebar-01`, `dashboard-01`, `login-04`, `signup-02`.
73- Global CSS baseline: use shadcn create preset (nova/zinc/orange).
74- No legacy UI kits: do not use Ant/Chakra/etc in new routes.
75- Auth parity: align new auth routes with historical provider and users.
76- No legacy CSS: enforce new baseline styles only.
77- Keep new routes under `app/<platform-segment>`.
78
79## Platform structure
80```
81app/
82 <platform-segment>/
83 layout.tsx
84 (public)/
85 layout.tsx
86 page.tsx
87 <public-views>/
88 (app)/
89 layout.tsx
90 <auth-views>/
91```
92
93## Verification
94- Public routes load unauthenticated.
95- Authenticated routes redirect when unauthenticated.
96- Role-gated routes block unauthorized roles.
97- Landing dropdown navigates to `/<platform-segment>`.
98- No console errors on load.
99
100## Version policy
101Use the latest stable versions of `next`, `react`, `tailwindcss`, and `shadcn/ui`.
102
103## Additional resources
104- Scans, mapping tips, and gotchas: `reference.md`
105- Example inventories and scaffolds: `examples.md`
106- Rule index:
107 - Priority 1: `rules/discovery-auth-views`, `rules/route-naming-audit`, `rules/confirm-view-names`, `rules/platform-naming-derive`
108 - Priority 2: `rules/routing-platform-scaffold`, `rules/boilerplate-first`
109 - Priority 3: `rules/coexistence-legacy`, `rules/landing-header-dropdown`
110 - Priority 4: `rules/naming-clean`, `rules/test-auth-flows`