@polymorphism-tech/morph-spec 4.8.1 → 4.8.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/README.md +2 -2
  2. package/claude-plugin.json +1 -1
  3. package/docs/CHEATSHEET.md +1 -1
  4. package/docs/QUICKSTART.md +1 -1
  5. package/framework/hooks/dev/guard-version-numbers.js +1 -1
  6. package/framework/skills/level-1-workflows/phase-clarify/SKILL.md +1 -1
  7. package/framework/skills/level-1-workflows/phase-codebase-analysis/SKILL.md +1 -1
  8. package/framework/skills/level-1-workflows/phase-design/SKILL.md +1 -1
  9. package/framework/skills/level-1-workflows/phase-implement/SKILL.md +1 -1
  10. package/framework/skills/level-1-workflows/phase-setup/SKILL.md +1 -1
  11. package/framework/skills/level-1-workflows/phase-tasks/SKILL.md +1 -1
  12. package/framework/skills/level-1-workflows/phase-uiux/SKILL.md +1 -1
  13. package/package.json +4 -4
  14. package/src/scripts/global-install.js +15 -3
  15. package/.morph/analytics/threads-log.jsonl +0 -54
  16. package/.morph/state.json +0 -198
  17. package/docs/ARCHITECTURE.md +0 -328
  18. package/docs/COMMAND-FLOWS.md +0 -398
  19. package/docs/plans/2026-02-22-claude-docs-morph-alignment-analysis.md +0 -514
  20. package/docs/plans/2026-02-22-claude-settings.md +0 -517
  21. package/docs/plans/2026-02-22-morph-cc-alignment-impl.md +0 -730
  22. package/docs/plans/2026-02-22-morph-spec-next.md +0 -480
  23. package/docs/plans/2026-02-22-native-alignment-design.md +0 -201
  24. package/docs/plans/2026-02-22-native-alignment-impl.md +0 -927
  25. package/docs/plans/2026-02-22-native-enrichment-design.md +0 -246
  26. package/docs/plans/2026-02-22-native-enrichment.md +0 -737
  27. package/docs/plans/2026-02-23-ddd-architecture-refactor.md +0 -1155
  28. package/docs/plans/2026-02-23-ddd-nextsteps.md +0 -684
  29. package/docs/plans/2026-02-23-infra-architect-refactor.md +0 -439
  30. package/docs/plans/2026-02-23-nextjs-code-review-design.md +0 -157
  31. package/docs/plans/2026-02-23-nextjs-code-review-impl.md +0 -1256
  32. package/docs/plans/2026-02-23-nextjs-standards-design.md +0 -150
  33. package/docs/plans/2026-02-23-nextjs-standards-impl.md +0 -1848
  34. package/docs/plans/2026-02-24-cli-radical-simplification.md +0 -592
  35. package/docs/plans/2026-02-24-framework-failure-points.md +0 -125
  36. package/docs/plans/2026-02-24-morph-init-design.md +0 -337
  37. package/docs/plans/2026-02-24-morph-init-impl.md +0 -1269
  38. package/docs/plans/2026-02-24-tutorial-command-design.md +0 -71
  39. package/docs/plans/2026-02-24-tutorial-command.md +0 -298
  40. package/scripts/bump-version.js +0 -248
  41. package/scripts/generate-refs.js +0 -336
  42. package/scripts/generate-standards-registry.js +0 -44
  43. package/scripts/install-dev-hooks.js +0 -138
  44. package/scripts/scan-nextjs.mjs +0 -169
  45. package/scripts/validate-real.mjs +0 -255
@@ -1,150 +0,0 @@
1
- # Next.js Standards Package — Design Document
2
-
3
- **Status:** COMPLETE (see implementation plan)
4
-
5
- **Date:** 2026-02-23
6
-
7
- ---
8
-
9
- ## Goal
10
-
11
- Add a comprehensive Next.js standards package to morph-spec-framework, bringing Next.js coverage from ~15% to parity with .NET for the primary use case: **Next.js frontend + .NET API backend**, deployed on EasyPanel (VPS/Docker).
12
-
13
- ## Stack (Locked)
14
-
15
- | Layer | Technology |
16
- |-------|-----------|
17
- | Framework | Next.js App Router |
18
- | UI Components | shadcn/ui |
19
- | Styling | Tailwind CSS |
20
- | Server state | TanStack Query (client) + Server Components (initial fetch) |
21
- | Forms | react-hook-form + Zod |
22
- | Deployment | Docker multi-stage build → EasyPanel (VPS) |
23
- | Language | TypeScript (strict mode) |
24
-
25
- ---
26
-
27
- ## Project Structure Convention
28
-
29
- Feature-based with shared core:
30
-
31
- ```
32
- src/
33
- ├── app/ # Next.js App Router — routes only
34
- ├── features/
35
- │ ├── {feature}/
36
- │ │ ├── components/ # feature-specific components
37
- │ │ ├── hooks/ # TanStack Query hooks for this feature
38
- │ │ ├── types/
39
- │ │ │ ├── {feature}.types.ts
40
- │ │ │ └── {feature}.schemas.ts # Zod schemas → z.infer<> types
41
- │ │ └── index.ts # public API of the feature
42
- ├── components/
43
- │ ├── ui/ # shadcn/ui primitives — never edit directly
44
- │ └── {shared-component}.tsx # composed shared components (no business logic)
45
- ├── hooks/ # shared utility hooks only (no API calls)
46
- ├── lib/
47
- │ ├── api-client.ts # typed fetch wrapper for .NET API
48
- │ └── query-client.ts # TanStack Query client config
49
- ├── types/
50
- │ ├── api.ts # shared API shapes: PaginatedResponse<T>, ApiError
51
- │ └── env.d.ts
52
- └── env.mjs # Zod-validated env vars
53
- ```
54
-
55
- ---
56
-
57
- ## Naming Conventions (Locked)
58
-
59
- | Artifact | Convention | Example |
60
- |----------|-----------|---------|
61
- | Component files | kebab-case | `user-card.tsx` |
62
- | Component exports | PascalCase | `export function UserCard()` |
63
- | Hook files | kebab-case with `use-` prefix | `use-create-user.ts` |
64
- | Hook exports | camelCase with `use` prefix | `export function useCreateUser()` |
65
- | Type files | kebab-case with `.types.ts` | `user.types.ts` |
66
- | Schema files | kebab-case with `.schemas.ts` | `user.schemas.ts` |
67
- | Feature folders | kebab-case | `features/user-management/` |
68
- | Page files | Next.js conventions | `page.tsx`, `layout.tsx`, `loading.tsx` |
69
-
70
- ---
71
-
72
- ## Component Hierarchy Rules
73
-
74
- 1. **`components/ui/`** — shadcn/ui CLI output. Never edit. Customize by wrapping.
75
- 2. **`components/`** — Composed shared components. No API calls, no feature imports, no business logic.
76
- 3. **`features/*/components/`** — Feature-scoped. May use `components/` but never import from another feature's `components/`.
77
-
78
- ---
79
-
80
- ## Deliverables (~20 artifacts)
81
-
82
- ### 1. Standards Files (8) — `framework/standards/frontend/nextjs/`
83
-
84
- | File | Scope |
85
- |------|-------|
86
- | `app-router.md` | Folder structure, file conventions, Server vs Client component decision |
87
- | `components.md` | Three-tier hierarchy, naming rules, reuse rules |
88
- | `data-fetching.md` | Server Components for initial fetch, TanStack Query patterns, query key conventions |
89
- | `forms.md` | react-hook-form + Zod patterns, schema co-location, shadcn Form wiring |
90
- | `state-management.md` | Server Components vs TanStack Query vs Context — escalation rules |
91
- | `naming-conventions.md` | Complete naming reference for files, exports, hooks, schemas, folders |
92
- | `project-structure.md` | Full canonical folder tree with examples |
93
- | `testing.md` | Jest + Testing Library, MSW for API mocking, co-location conventions |
94
-
95
- ### 2. Rule File (1) — `framework/rules/nextjs-standards.md`
96
-
97
- Path-scoped to `**/*.tsx`, `**/*.ts` (excluding `**/*.cs`). References the 8 standards above. Installed to `.claude/rules/` during `morph-spec init`/`update`.
98
-
99
- ### 3. Validator (1) — `src/lib/validators/nextjs/next-component-validator.js`
100
-
101
- Checks:
102
- - `'use client'` used without actual interactivity (useState, useEffect, event handlers)
103
- - `useState`/`useEffect` present without `'use client'` directive
104
- - Component file names are kebab-case
105
- - No `fetch('/api/...')` in Server Components (should call .NET API base URL)
106
-
107
- ### 4. Templates (6) — `framework/templates/frontend/nextjs/`
108
-
109
- | File | Generates |
110
- |------|-----------|
111
- | `page.tsx.hbs` | App Router page with Server Component data fetch |
112
- | `client-component.tsx.hbs` | Client Component with TanStack Query + shadcn/ui |
113
- | `feature-form.tsx.hbs` | react-hook-form + Zod + shadcn Form |
114
- | `env.mjs.hbs` | Zod-validated environment variables |
115
- | `tsconfig.json.hbs` | Strict TypeScript config with path aliases |
116
- | `Dockerfile.nextjs.hbs` | Multi-stage production build for EasyPanel |
117
-
118
- ### 5. Enhanced nextjs-expert Agent (1) — `framework/agents/frontend/nextjs-expert.md`
119
-
120
- Update to include:
121
- - Three-tier component hierarchy awareness
122
- - TanStack Query + react-hook-form/Zod as mandated patterns
123
- - kebab-case naming enforcement
124
- - EasyPanel/Docker deployment knowledge
125
- - Feature-based project structure guidance
126
-
127
- ---
128
-
129
- ## Standards Registry
130
-
131
- After adding 8 new standards files, regenerate `framework/standards/STANDARDS.json`:
132
- ```bash
133
- node scripts/generate-standards-registry.js
134
- ```
135
-
136
- ---
137
-
138
- ## Rules Installer
139
-
140
- The new `nextjs-standards.md` rule must be added to `src/commands/project/init.js`'s rules copy step (already copies `framework/rules/` → `.claude/rules/`). No code change needed — just adding the file is sufficient.
141
-
142
- ---
143
-
144
- ## Out of Scope
145
-
146
- - Next.js Route Handlers as backend (project uses .NET API)
147
- - SWR (TanStack Query is the standard)
148
- - Zustand/Redux (Server Components + TanStack Query covers state needs)
149
- - Vercel deployment (EasyPanel is the target)
150
- - React Native