@longtq2501/next-spring-skills 1.3.0 → 1.4.0

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.
package/AGENT.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Agent Instructions
2
2
 
3
+ > [!IMPORTANT]
4
+ > **MANDATORY STARTUP STEP**: Upon starting a new session or entering this project, the AI Agent **MUST** immediately read `skills/SKILL.md` to index all available standards and architectural patterns. Do not proceed with code generation until you have understood the patterns in the `skills/` directory.
5
+
3
6
  Rules for contributing to this repository.
4
7
 
5
8
  ## Style Guidelines
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Next-Spring Skills
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@longtq2501/next-spring-skills.svg)](https://www.npmjs.com/package/@longtq2501/next-spring-skills)
4
+
3
5
  Modular best practices, code templates, and interaction protocols for full-stack projects using **Next.js** and **Spring Boot**.
4
6
 
5
7
  ## Key Directories
@@ -11,6 +13,11 @@ Modular best practices, code templates, and interaction protocols for full-stack
11
13
 
12
14
  ---
13
15
 
16
+ ## NPM Package
17
+ 📦 **Registry**: [https://www.npmjs.com/package/@longtq2501/next-spring-skills](https://www.npmjs.com/package/@longtq2501/next-spring-skills)
18
+
19
+ ---
20
+
14
21
  ## Installation
15
22
  You can instantly add these skills to any project using `npx`:
16
23
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longtq2501/next-spring-skills",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "description": "Standardized best practices and code patterns for Next.js and Spring Boot",
5
5
  "bin": {
6
6
  "next-spring-skills": "bin/cli.js"
package/skills/SKILL.md CHANGED
@@ -69,6 +69,9 @@ See [webrtc.md](./nextjs/webrtc.md) for real-time media and signaling.
69
69
  ### Quality Assurance
70
70
  See [testing.md](./nextjs/testing.md) for Vitest and React Testing Library patterns.
71
71
 
72
+ ### Architecture & Monorepo
73
+ See [monorepo.md](./nextjs/monorepo.md) for Turborepo and code-sharing strategies.
74
+
72
75
  ### Accessibility (a11y)
73
76
  See [accessibility.md](./nextjs/accessibility.md) for semantic HTML and ARIA.
74
77
 
@@ -0,0 +1,116 @@
1
+ # Skill: Monorepo Management - Turborepo (Production Blueprint)
2
+
3
+ Guidelines for building a scalable, high-performance monorepo for enterprise-level multi-platform projects.
4
+
5
+ ## TL;DR - Quick Reference
6
+
7
+ ### Critical Rules
8
+ 1. **Orchestration**: Use Turborepo for build pipeline and remote caching.
9
+ 2. **Modular Packages**: Extract logic to `packages/` to ensure 95%+ code reusability.
10
+ 3. **Internal Linking**: Use `workspace:*` for local package dependencies.
11
+ 4. **Consistency**: Share ESLint, Prettier, Tailwind, and TS configs across all apps.
12
+ 5. **Types First**: Shared DTOs in `packages/types` are the single source of truth for FE/BE sync.
13
+
14
+ ---
15
+
16
+ ## 1. Enterprise Directory Structure
17
+
18
+ ```text
19
+ /my-monorepo/
20
+ ├── apps/ # Deployable Applications
21
+ │ ├── web/ # Next.js 14 App Router
22
+ │ ├── admin/ # Admin Dashboard
23
+ │ ├── mobile/ # React Native (Expo)
24
+ │ ├── desktop/ # Electron
25
+ │ └── api/ # Spring Boot (Backend)
26
+ ├── packages/ # Shared Domain Logic
27
+ │ ├── ui/ # Core UI (Shadcn/React)
28
+ │ ├── types/ # Shared Interfaces & DTOs
29
+ │ ├── validators/ # Zod/Validation Logic
30
+ │ ├── utils/ # Shared Helpers (Date, String)
31
+ │ ├── api-client/ # Axios/Fetch Wrapper
32
+ │ └── database/ # Prisma/DB Client
33
+ ├── infra/ # Shared Configuration
34
+ │ ├── tailwind-config/
35
+ │ ├── eslint-config/
36
+ │ └── typescript-config/
37
+ ├── turbo.json # Build Pipeline Config
38
+ └── package.json # Workspace Definition
39
+ ```
40
+
41
+ ---
42
+
43
+ ## 2. Core Configurations
44
+
45
+ ### turbo.json (The Brain)
46
+ Defines task dependencies and caching outputs.
47
+
48
+ ```json
49
+ {
50
+ "$schema": "https://turbo.build/schema.json",
51
+ "pipeline": {
52
+ "build": {
53
+ "dependsOn": ["^build"],
54
+ "outputs": [".next/**", "dist/**", "out/**"]
55
+ },
56
+ "lint": {},
57
+ "test": {
58
+ "cache": true
59
+ },
60
+ "dev": {
61
+ "cache": false,
62
+ "persistent": true
63
+ }
64
+ }
65
+ }
66
+ ```
67
+
68
+ ### package.json (The Workspace)
69
+ Must include `workspaces` (npm/yarn) or `pnpm-workspace.yaml`.
70
+
71
+ ```json
72
+ {
73
+ "private": true,
74
+ "workspaces": ["apps/*", "packages/*"],
75
+ "scripts": {
76
+ "dev": "turbo dev",
77
+ "build": "turbo build",
78
+ "test": "turbo test"
79
+ }
80
+ }
81
+ ```
82
+
83
+ ---
84
+
85
+ ## 3. Shared Packages Pattern
86
+
87
+ ### How to share a package (ex: Types)
88
+ 1. Create `packages/types/package.json` with a scoped name like `@repo/types`.
89
+ 2. Export your types/interfaces from `index.ts`.
90
+ 3. In `apps/web/package.json`, add `"@repo/types": "workspace:*"`.
91
+
92
+ // Good: Shared DTO Example
93
+ export interface OrderDTO {
94
+ id: string;
95
+ status: 'PENDING' | 'DONE';
96
+ items: string[];
97
+ }
98
+
99
+ ---
100
+
101
+ ## 4. Scaling & Efficiency
102
+
103
+ ### Remote Caching
104
+ Enable `turbo login` and `turbo link` in CI/CD to share build artifacts across the team, reducing build times from minutes to seconds.
105
+
106
+ ### Monolith to Monorepo Migration
107
+ - **Step 1**: Move your monolithic `src/` to `apps/main-app/`.
108
+ - **Step 2**: Identify shared logic (utils, constants) and move them to `packages/`.
109
+ - **Step 3**: Introduce internal packages and replace local imports with `@repo/...`.
110
+
111
+ ---
112
+
113
+ ## Related Skills
114
+ - **Frontend Testing**: `skills/nextjs/testing.md`
115
+ - **Performance**: `skills/nextjs/performance.md`
116
+ - **Agent Workflow**: `skills/agent-workflow.md`