create-win-project 1.3.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.
Files changed (198) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +187 -0
  3. package/ci/expo.yml +28 -0
  4. package/ci/laravel.yml +49 -0
  5. package/ci/nextjs.yml +29 -0
  6. package/ci/springboot.yml +33 -0
  7. package/ci/vite.yml +36 -0
  8. package/compatibility/profiles.json +237 -0
  9. package/docs/ARCHITECTURE.md +118 -0
  10. package/docs/CONTENT_MODEL.md +36 -0
  11. package/docs/DEPENDENCY_MAINTENANCE.md +31 -0
  12. package/index.js +431 -0
  13. package/lib/application-shapes.js +95 -0
  14. package/lib/banner.js +45 -0
  15. package/lib/catalog.js +343 -0
  16. package/lib/compatibility.js +116 -0
  17. package/lib/constants.js +3 -0
  18. package/lib/doctor.js +45 -0
  19. package/lib/files.js +158 -0
  20. package/lib/generator.js +366 -0
  21. package/lib/interview.js +77 -0
  22. package/lib/laravel-scaffold.js +3 -0
  23. package/lib/playbooks.js +172 -0
  24. package/lib/project-location.js +18 -0
  25. package/lib/scaffold.js +467 -0
  26. package/lib/stacks/context.js +27 -0
  27. package/lib/stacks/contract.js +142 -0
  28. package/lib/stacks/index.js +8 -0
  29. package/lib/stacks/laravel/architecture.js +27 -0
  30. package/lib/stacks/laravel/auth/oidc.js +13 -0
  31. package/lib/stacks/laravel/auth/public.js +28 -0
  32. package/lib/stacks/laravel/auth/sanctum.js +14 -0
  33. package/lib/stacks/laravel/auth/session.js +17 -0
  34. package/lib/stacks/laravel/composer.js +50 -0
  35. package/lib/stacks/laravel/generate.js +362 -0
  36. package/lib/stacks/laravel/index.js +18 -0
  37. package/lib/stacks/laravel/ui/blade.js +15 -0
  38. package/lib/stacks/laravel/ui/index.js +29 -0
  39. package/lib/stacks/laravel/ui/inertia-react.js +35 -0
  40. package/lib/stacks/laravel/ui/livewire.js +39 -0
  41. package/lib/stacks/laravel/ui/shared.js +14 -0
  42. package/lib/stacks/registry.js +42 -0
  43. package/lib/stacks/shared/contributions.js +25 -0
  44. package/lib/template.js +62 -0
  45. package/package.json +49 -0
  46. package/playbooks/INDEX.md +58 -0
  47. package/playbooks/capabilities/auth/oidc-resource-server.md +15 -0
  48. package/playbooks/capabilities/auth/spring-session.md +15 -0
  49. package/playbooks/capabilities/ci/github-actions.manifest.json +10 -0
  50. package/playbooks/capabilities/ci/github-actions.md +61 -0
  51. package/playbooks/capabilities/docker/docker.manifest.json +11 -0
  52. package/playbooks/capabilities/docker/overview.md +55 -0
  53. package/playbooks/capabilities/flyway/environments.md +5 -0
  54. package/playbooks/capabilities/flyway/flyway.manifest.json +12 -0
  55. package/playbooks/capabilities/flyway/migrations.md +7 -0
  56. package/playbooks/capabilities/flyway/testing.md +5 -0
  57. package/playbooks/capabilities/laravel/database.md +8 -0
  58. package/playbooks/capabilities/laravel/migrations.md +15 -0
  59. package/playbooks/capabilities/laravel/observability.md +8 -0
  60. package/playbooks/capabilities/laravel/oidc-resource-server.md +10 -0
  61. package/playbooks/capabilities/laravel/queues.md +8 -0
  62. package/playbooks/capabilities/laravel/sanctum-spa.md +8 -0
  63. package/playbooks/capabilities/laravel/scheduler.md +7 -0
  64. package/playbooks/capabilities/laravel/session-auth.md +8 -0
  65. package/playbooks/capabilities/laravel/storage-uploads.md +7 -0
  66. package/playbooks/capabilities/postgresql/architecture.md +5 -0
  67. package/playbooks/capabilities/postgresql/migrations.md +5 -0
  68. package/playbooks/capabilities/postgresql/postgresql.manifest.json +15 -0
  69. package/playbooks/capabilities/postgresql/schema-design.md +7 -0
  70. package/playbooks/capabilities/postgresql/security.md +5 -0
  71. package/playbooks/capabilities/postgresql/testing.md +5 -0
  72. package/playbooks/capabilities/prisma/architecture.md +5 -0
  73. package/playbooks/capabilities/prisma/migrations.md +11 -0
  74. package/playbooks/capabilities/prisma/prisma.manifest.json +14 -0
  75. package/playbooks/capabilities/prisma/runtime.md +5 -0
  76. package/playbooks/capabilities/prisma/schema.md +5 -0
  77. package/playbooks/capabilities/prisma/testing.md +5 -0
  78. package/playbooks/capabilities/supabase/architecture.md +5 -0
  79. package/playbooks/capabilities/supabase/authentication.md +5 -0
  80. package/playbooks/capabilities/supabase/expo.md +16 -0
  81. package/playbooks/capabilities/supabase/migrations.md +7 -0
  82. package/playbooks/capabilities/supabase/nextjs.md +24 -0
  83. package/playbooks/capabilities/supabase/rls.md +7 -0
  84. package/playbooks/capabilities/supabase/supabase.manifest.json +32 -0
  85. package/playbooks/capabilities/supabase/testing.md +5 -0
  86. package/playbooks/capabilities/supabase/vite.md +14 -0
  87. package/playbooks/concerns/axios.md +123 -0
  88. package/playbooks/concerns/next-safe-action.md +66 -0
  89. package/playbooks/concerns/next-themes.md +87 -0
  90. package/playbooks/concerns/nuqs.md +59 -0
  91. package/playbooks/concerns/t3-env.md +48 -0
  92. package/playbooks/concerns/tanstack-query.md +145 -0
  93. package/playbooks/concerns/zod.md +174 -0
  94. package/playbooks/concerns/zustand.md +93 -0
  95. package/playbooks/devops/makefile.manifest.json +10 -0
  96. package/playbooks/devops/makefile.md +556 -0
  97. package/playbooks/devops/pr-template.manifest.json +10 -0
  98. package/playbooks/devops/pr-template.md +106 -0
  99. package/playbooks/platform/laravel-ui/blade/architecture.md +5 -0
  100. package/playbooks/platform/laravel-ui/blade/runtime.md +5 -0
  101. package/playbooks/platform/laravel-ui/blade/security.md +5 -0
  102. package/playbooks/platform/laravel-ui/blade/structure.md +5 -0
  103. package/playbooks/platform/laravel-ui/blade/testing.md +5 -0
  104. package/playbooks/platform/laravel-ui/inertia-react/architecture.md +5 -0
  105. package/playbooks/platform/laravel-ui/inertia-react/runtime.md +5 -0
  106. package/playbooks/platform/laravel-ui/inertia-react/security.md +5 -0
  107. package/playbooks/platform/laravel-ui/inertia-react/structure.md +5 -0
  108. package/playbooks/platform/laravel-ui/inertia-react/testing.md +5 -0
  109. package/playbooks/platform/laravel-ui/livewire/architecture.md +5 -0
  110. package/playbooks/platform/laravel-ui/livewire/runtime.md +5 -0
  111. package/playbooks/platform/laravel-ui/livewire/security.md +5 -0
  112. package/playbooks/platform/laravel-ui/livewire/structure.md +5 -0
  113. package/playbooks/platform/laravel-ui/livewire/testing.md +5 -0
  114. package/playbooks/platform/mobile.manifest.json +17 -0
  115. package/playbooks/platform/mobile.md +15 -0
  116. package/playbooks/platform/web.manifest.json +17 -0
  117. package/playbooks/platform/web.md +17 -0
  118. package/playbooks/stack/expo/architecture.md +27 -0
  119. package/playbooks/stack/expo/runtime.md +14 -0
  120. package/playbooks/stack/expo/security.md +18 -0
  121. package/playbooks/stack/expo/structure.md +26 -0
  122. package/playbooks/stack/expo/testing.md +13 -0
  123. package/playbooks/stack/laravel/architecture.md +34 -0
  124. package/playbooks/stack/laravel/runtime.md +27 -0
  125. package/playbooks/stack/laravel/security.md +23 -0
  126. package/playbooks/stack/laravel/structure.md +29 -0
  127. package/playbooks/stack/laravel/testing.md +22 -0
  128. package/playbooks/stack/laravel-ui.manifest.json +42 -0
  129. package/playbooks/stack/laravel.manifest.json +35 -0
  130. package/playbooks/stack/nextjs/architecture.md +62 -0
  131. package/playbooks/stack/nextjs/runtime.md +31 -0
  132. package/playbooks/stack/nextjs/security.md +32 -0
  133. package/playbooks/stack/nextjs/structure.md +50 -0
  134. package/playbooks/stack/nextjs/testing.md +20 -0
  135. package/playbooks/stack/nextjs.manifest.json +49 -0
  136. package/playbooks/stack/no-frontend.manifest.json +25 -0
  137. package/playbooks/stack/none.manifest.json +21 -0
  138. package/playbooks/stack/react-native.manifest.json +49 -0
  139. package/playbooks/stack/react-vite/architecture.md +33 -0
  140. package/playbooks/stack/react-vite/runtime.md +13 -0
  141. package/playbooks/stack/react-vite/security.md +16 -0
  142. package/playbooks/stack/react-vite/structure.md +23 -0
  143. package/playbooks/stack/react-vite/testing.md +12 -0
  144. package/playbooks/stack/react-vite.manifest.json +46 -0
  145. package/playbooks/stack/springboot/architecture.md +40 -0
  146. package/playbooks/stack/springboot/runtime.md +28 -0
  147. package/playbooks/stack/springboot/security.md +28 -0
  148. package/playbooks/stack/springboot/structure.md +30 -0
  149. package/playbooks/stack/springboot/testing.md +22 -0
  150. package/playbooks/stack/springboot.manifest.json +38 -0
  151. package/playbooks/styling/css-modules-extensions.md +267 -0
  152. package/playbooks/styling/css-modules.manifest.json +11 -0
  153. package/playbooks/styling/native-styles.manifest.json +9 -0
  154. package/playbooks/styling/native-styles.md +29 -0
  155. package/playbooks/styling/tailwind-extensions.md +182 -0
  156. package/playbooks/styling/tailwind.manifest.json +11 -0
  157. package/playbooks/universal/accessibility.manifest.json +11 -0
  158. package/playbooks/universal/accessibility.md +45 -0
  159. package/playbooks/universal/coding-rules.manifest.json +12 -0
  160. package/playbooks/universal/coding-rules.md +281 -0
  161. package/playbooks/universal/error-handling.manifest.json +10 -0
  162. package/playbooks/universal/error-handling.md +21 -0
  163. package/playbooks/universal/git-conventions.manifest.json +10 -0
  164. package/playbooks/universal/git-conventions.md +186 -0
  165. package/playbooks/universal/observability.manifest.json +10 -0
  166. package/playbooks/universal/observability.md +29 -0
  167. package/playbooks/universal/security.manifest.json +11 -0
  168. package/playbooks/universal/security.md +30 -0
  169. package/playbooks/universal/typescript.manifest.json +11 -0
  170. package/playbooks/universal/typescript.md +272 -0
  171. package/scripts/compatibility-matrix.mjs +48 -0
  172. package/scripts/validate-content.mjs +76 -0
  173. package/scripts/verify-generated.mjs +153 -0
  174. package/templates/agents/nextjs.md +47 -0
  175. package/templates/agents/react-native.md +48 -0
  176. package/templates/agents/react-vite.md +48 -0
  177. package/templates/docker/compose/postgres.yml +29 -0
  178. package/templates/docker/compose/springboot.yml +69 -0
  179. package/templates/docker/compose/supabase.yml +18 -0
  180. package/templates/docker/compose-prod/springboot.yml +64 -0
  181. package/templates/docker/dockerfile/laravel-inertia.dev.dockerfile +21 -0
  182. package/templates/docker/dockerfile/laravel.dev.dockerfile +12 -0
  183. package/templates/docker/dockerfile/laravel.prod.dockerfile +13 -0
  184. package/templates/docker/dockerfile/nextjs.dev.dockerfile +6 -0
  185. package/templates/docker/dockerfile/nextjs.prod.dockerfile +18 -0
  186. package/templates/docker/dockerfile/springboot.dev.dockerfile +5 -0
  187. package/templates/docker/dockerfile/springboot.prod.dockerfile +10 -0
  188. package/templates/docker/dockerfile/vite.dev.dockerfile +6 -0
  189. package/templates/docker/dockerfile/vite.prod.dockerfile +12 -0
  190. package/templates/gitignore/base.gitignore +32 -0
  191. package/templates/gitignore/nextjs.gitignore +40 -0
  192. package/templates/gitignore/react-native.gitignore +43 -0
  193. package/templates/gitignore/react-vite.gitignore +39 -0
  194. package/templates/makefile/frontend.mk +31 -0
  195. package/templates/makefile/laravel.mk +47 -0
  196. package/templates/makefile/postgres.mk +40 -0
  197. package/templates/makefile/springboot.mk +125 -0
  198. package/templates/makefile/supabase.mk +42 -0
@@ -0,0 +1,556 @@
1
+ # DevOps: Makefile
2
+
3
+ ---
4
+
5
+ ## Core Rules
6
+ - All targets declared in `.PHONY` — no exceptions
7
+ - Always include a `help` target as default
8
+ - Variables declared at top of file
9
+ - One logical action per target
10
+ - Targets that chain: call other make targets, not duplicated raw commands
11
+ - Use variables for repeated tools/commands (`$(COMPOSE)`, `$(SUPABASE)`, `$(NPM)`, etc.)
12
+ - Local development commands must stay local regardless of Git branch
13
+ - Never infer production behavior from `git branch --show-current`
14
+ - Destructive database commands must explicitly target the intended environment
15
+ - `db-reset` means local development reset unless a project manifest explicitly defines otherwise
16
+ - Never create a normal Make target that resets the production database
17
+ - Production deployment/database mutation should be handled by explicit release/CI workflows where possible
18
+ - Help text must clearly label destructive commands and environment scope
19
+
20
+ ---
21
+
22
+ ## Environment Rule
23
+
24
+ Git workflow and runtime environment are separate concerns.
25
+
26
+ ```text
27
+ Git flow:
28
+ feature/* / fix/*
29
+
30
+ dev
31
+
32
+ main
33
+
34
+ release tag
35
+ ```
36
+
37
+ Local commands must behave the same on every branch:
38
+
39
+ ```text
40
+ feature/* + make dev → LOCAL environment
41
+ dev + make dev → LOCAL environment
42
+ main + make dev → LOCAL environment
43
+ ```
44
+
45
+ Do NOT implement logic like:
46
+
47
+ ```makefile
48
+ # BAD — branch silently changes environment
49
+ ifeq ($(shell git branch --show-current),main)
50
+ ENV := production
51
+ endif
52
+ ```
53
+
54
+ Production credentials and production deployment belong to the deployment/release environment, not to branch-sensitive local Make commands.
55
+
56
+ ---
57
+
58
+ ## Full Makefile Template (React + Spring Boot)
59
+
60
+ ```makefile
61
+ # =============================================================================
62
+ # Makefile — {{PROJECT_NAME}}
63
+ # =============================================================================
64
+
65
+ # Variables
66
+ COMPOSE := docker compose
67
+ COMPOSE_PROD := docker compose -f docker-compose.prod.yml
68
+ FRONTEND := $(COMPOSE) exec frontend
69
+ BACKEND := $(COMPOSE) exec backend
70
+ DB := $(COMPOSE) exec db
71
+
72
+ # =============================================================================
73
+ # Default
74
+ # =============================================================================
75
+
76
+ .DEFAULT_GOAL := help
77
+
78
+ .PHONY: help
79
+ help: ## Show all available commands
80
+ @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
81
+ | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}'
82
+
83
+ # =============================================================================
84
+ # Project Lifecycle — LOCAL
85
+ # =============================================================================
86
+
87
+ .PHONY: dev up down restart logs logs-front logs-back clean
88
+
89
+ dev: ## LOCAL: Start all containers and follow logs
90
+ $(COMPOSE) up --build
91
+
92
+ up: ## LOCAL: Start all containers in background
93
+ $(COMPOSE) up -d --build
94
+
95
+ down: ## LOCAL: Stop and remove local containers
96
+ $(COMPOSE) down
97
+
98
+ restart: down up ## LOCAL: Stop then start all containers
99
+
100
+ logs: ## LOCAL: Follow logs from all containers
101
+ $(COMPOSE) logs -f
102
+
103
+ logs-front: ## LOCAL: Follow frontend logs only
104
+ $(COMPOSE) logs -f frontend
105
+
106
+ logs-back: ## LOCAL: Follow backend logs only
107
+ $(COMPOSE) logs -f backend
108
+
109
+ clean: ## LOCAL DESTRUCTIVE: Remove containers, volumes, and orphans
110
+ $(COMPOSE) down -v --remove-orphans
111
+
112
+ # =============================================================================
113
+ # Individual Services — LOCAL
114
+ # =============================================================================
115
+
116
+ .PHONY: dev-front dev-back
117
+
118
+ dev-front: ## LOCAL: Start frontend container only
119
+ $(COMPOSE) up frontend --build
120
+
121
+ dev-back: ## LOCAL: Start backend + DB containers only
122
+ $(COMPOSE) up backend db --build
123
+
124
+ # =============================================================================
125
+ # Database — LOCAL
126
+ # =============================================================================
127
+
128
+ .PHONY: migrate seed db-reset db-shell
129
+
130
+ migrate: ## LOCAL: Run pending Flyway migrations
131
+ $(BACKEND) ./mvnw flyway:migrate
132
+
133
+ seed: ## LOCAL: Seed database with development data
134
+ $(DB) psql -U $${POSTGRES_USER} -d $${POSTGRES_DB} -f /docker-entrypoint-initdb.d/seed.sql
135
+
136
+ db-reset: ## LOCAL DESTRUCTIVE: Drop + migrate + seed local DB
137
+ $(BACKEND) ./mvnw flyway:clean flyway:migrate
138
+ $(MAKE) seed
139
+
140
+ db-shell: ## LOCAL: Open psql shell inside local DB container
141
+ $(DB) psql -U $${POSTGRES_USER} -d $${POSTGRES_DB}
142
+
143
+ # =============================================================================
144
+ # Shells — LOCAL
145
+ # =============================================================================
146
+
147
+ .PHONY: shell-front shell-back
148
+
149
+ shell-front: ## LOCAL: Open shell inside frontend container
150
+ $(FRONTEND) sh
151
+
152
+ shell-back: ## LOCAL: Open shell inside backend container
153
+ $(BACKEND) sh
154
+
155
+ # =============================================================================
156
+ # Quality
157
+ # =============================================================================
158
+
159
+ .PHONY: lint test test-front test-back
160
+
161
+ lint: ## Run ESLint on frontend
162
+ $(FRONTEND) npm run lint
163
+
164
+ test: test-front test-back ## Run all tests
165
+
166
+ test-front: ## Run Vitest frontend tests
167
+ $(FRONTEND) npm run test
168
+
169
+ test-back: ## Run JUnit backend tests
170
+ $(BACKEND) ./mvnw test
171
+
172
+ # =============================================================================
173
+ # Production Runtime
174
+ # =============================================================================
175
+
176
+ .PHONY: build prod-up prod-down
177
+
178
+ build: ## Build production Docker images
179
+ $(COMPOSE_PROD) build
180
+
181
+ prod-up: ## PRODUCTION: Start production containers
182
+ $(COMPOSE_PROD) up -d
183
+
184
+ prod-down: ## PRODUCTION: Stop production containers
185
+ $(COMPOSE_PROD) down
186
+
187
+ # NOTE:
188
+ # Do not add prod-db-reset / db-reset-prod targets.
189
+ # Production database schema changes should use the project's migration/release flow.
190
+
191
+ # =============================================================================
192
+ # Scaffolding
193
+ # =============================================================================
194
+
195
+ .PHONY: init
196
+
197
+ init: ## Scaffold project folder structure (run once after cloning)
198
+ @echo "Scaffolding project structure..."
199
+ @mkdir -p frontend/src/{app,pages,components/{ui,shared,layout,forms},features,stores,lib,hooks,types,constants}
200
+ @mkdir -p frontend/e2e
201
+ @mkdir -p frontend/public
202
+ @mkdir -p backend/src/main/java/com/app/{auth/{dto,entity},config,common/{exception,response,jwt,audit}}
203
+ @mkdir -p backend/src/main/resources/db/{migration,dev}
204
+ @mkdir -p backend/src/test/java/com/app
205
+ @mkdir -p docs
206
+ @echo "Done. Run: make dev"
207
+ ```
208
+
209
+ ---
210
+
211
+ ## Simplified Makefile (Next.js + Supabase — Local + Production, No Staging)
212
+
213
+ This template intentionally keeps normal Makefile database operations local.
214
+
215
+ Production credentials and production migration execution belong to the deployment/release workflow.
216
+
217
+ ```makefile
218
+ # =============================================================================
219
+ # Makefile — {{PROJECT_NAME}} (Next.js + Supabase)
220
+ # =============================================================================
221
+
222
+ SHELL := /bin/bash
223
+
224
+ # Variables
225
+ SUPABASE := npm exec -- supabase
226
+ NPM := npm
227
+
228
+ # =============================================================================
229
+ # Default
230
+ # =============================================================================
231
+
232
+ .DEFAULT_GOAL := help
233
+
234
+ .PHONY: help
235
+ help: ## Show all available commands
236
+ @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
237
+ | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}'
238
+
239
+ # =============================================================================
240
+ # Development — ALWAYS LOCAL
241
+ # =============================================================================
242
+
243
+ .PHONY: dev build lint test test-e2e
244
+
245
+ dev: supabase-start ## LOCAL: Start Supabase + Next.js dev server
246
+ $(NPM) run dev
247
+
248
+ build: ## Build Next.js application
249
+ $(NPM) run build
250
+
251
+ lint: ## Run ESLint
252
+ $(NPM) run lint
253
+
254
+ test: ## Run unit/integration tests
255
+ $(NPM) run test
256
+
257
+ test-e2e: ## Run Playwright E2E tests
258
+ $(NPM) run test:e2e
259
+
260
+ # =============================================================================
261
+ # Supabase Local Stack — ALWAYS LOCAL
262
+ # =============================================================================
263
+
264
+ .PHONY: supabase-start supabase-stop supabase-status
265
+
266
+ supabase-start: ## LOCAL: Start Supabase stack
267
+ $(SUPABASE) start
268
+
269
+ supabase-stop: ## LOCAL: Stop Supabase stack
270
+ $(SUPABASE) stop
271
+
272
+ supabase-status: ## LOCAL: Show local Supabase URLs and keys
273
+ $(SUPABASE) status
274
+
275
+ # =============================================================================
276
+ # Database — ALWAYS LOCAL
277
+ # =============================================================================
278
+
279
+ .PHONY: db-reset db-reset-clean db-types db-diff
280
+
281
+ db-reset: ## LOCAL DESTRUCTIVE: Reset DB, apply migrations, run seed
282
+ $(SUPABASE) db reset --local
283
+
284
+ db-reset-clean: ## LOCAL DESTRUCTIVE: Reset DB without seed data
285
+ $(SUPABASE) db reset --local --no-seed
286
+
287
+ db-types: ## LOCAL: Generate TypeScript types from local schema
288
+ $(SUPABASE) gen types --lang typescript --local > src/types/database.types.ts
289
+
290
+ db-diff: ## LOCAL: Generate migration from local diff: make db-diff name=add_vehicle_status
291
+ @if [ -z "$(name)" ]; then \
292
+ echo "Usage: make db-diff name=add_vehicle_status"; \
293
+ exit 1; \
294
+ fi
295
+ $(SUPABASE) db diff --local -f $(name)
296
+
297
+ # =============================================================================
298
+ # Migrations — FILE CREATION ONLY
299
+ # =============================================================================
300
+
301
+ .PHONY: migration
302
+
303
+ migration: ## Create migration file: make migration name=add_vehicle_status
304
+ @if [ -z "$(name)" ]; then \
305
+ echo "Usage: make migration name=add_vehicle_status"; \
306
+ exit 1; \
307
+ fi
308
+ $(SUPABASE) migration new $(name)
309
+
310
+ # =============================================================================
311
+ # Production Safety
312
+ # =============================================================================
313
+
314
+ # Intentionally NO targets for:
315
+ # db-reset-prod
316
+ # prod-db-reset
317
+ # production-reset
318
+ #
319
+ # Do not make `dev` or `db-reset` branch-dependent.
320
+ # `make dev` is LOCAL even when current Git branch is main.
321
+ # Production database migrations should run through an explicit release/CI flow.
322
+ ```
323
+
324
+ ### Supabase Command Contract
325
+
326
+ ```text
327
+ make dev → LOCAL Supabase + local Next.js
328
+ make supabase-start → LOCAL only
329
+ make supabase-stop → LOCAL only
330
+ make supabase-status → LOCAL only
331
+ make db-reset → LOCAL only, destructive
332
+ make db-reset-clean → LOCAL only, destructive
333
+ make db-types → LOCAL schema
334
+ make db-diff name=... → LOCAL schema diff
335
+ make migration name=.. → creates migration file only
336
+ ```
337
+
338
+ No Make target should silently switch these operations to the hosted production project.
339
+
340
+ ### Production Migration Flow
341
+
342
+ Production schema deployment is intentionally not a normal local Make target.
343
+
344
+ Preferred release/CI flow:
345
+
346
+ ```bash
347
+ # Preview pending migrations against the linked production project
348
+ npm exec -- supabase db push --linked --dry-run
349
+
350
+ # Apply only after review / release approval
351
+ npm exec -- supabase db push --linked
352
+ ```
353
+
354
+ Forbidden against production:
355
+
356
+ ```bash
357
+ npm exec -- supabase db reset --linked
358
+ ```
359
+
360
+ Do not add a Make target that wraps the forbidden reset command.
361
+
362
+ ---
363
+
364
+ ## Simplified Makefile (Next.js + PostgreSQL/Prisma)
365
+
366
+ ```makefile
367
+ # =============================================================================
368
+ # Makefile — {{PROJECT_NAME}} (Next.js + Prisma)
369
+ # =============================================================================
370
+
371
+ COMPOSE := docker compose
372
+ NPM := npm
373
+ PRISMA := npx prisma
374
+
375
+ .DEFAULT_GOAL := help
376
+
377
+ .PHONY: help dev build lint test db-start db-stop db-migrate db-seed db-reset db-studio init
378
+
379
+ help: ## Show all available commands
380
+ @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
381
+ | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-24s\033[0m %s\n", $$1, $$2}'
382
+
383
+ dev: db-start ## LOCAL: Start PostgreSQL + Next.js dev server
384
+ $(NPM) run dev
385
+
386
+ build: ## Build for production
387
+ $(NPM) run build
388
+
389
+ lint: ## Run ESLint
390
+ $(NPM) run lint
391
+
392
+ test: ## Run tests
393
+ $(NPM) run test
394
+
395
+ db-start: ## LOCAL: Start PostgreSQL container
396
+ $(COMPOSE) up -d db
397
+
398
+ db-stop: ## LOCAL: Stop local PostgreSQL container
399
+ $(COMPOSE) down
400
+
401
+ db-migrate: ## LOCAL: Run Prisma development migrations
402
+ $(PRISMA) migrate dev
403
+
404
+ db-seed: ## LOCAL: Seed database
405
+ $(PRISMA) db seed
406
+
407
+ db-reset: ## LOCAL DESTRUCTIVE: Reset + migrate + seed
408
+ $(PRISMA) migrate reset --force
409
+
410
+ db-studio: ## LOCAL: Open Prisma Studio
411
+ $(PRISMA) studio
412
+
413
+ ```
414
+
415
+ Production Prisma migrations should use the deployment/release workflow (for example, `prisma migrate deploy`) rather than a destructive local reset target.
416
+
417
+ ---
418
+
419
+ ## Help Target Convention
420
+
421
+ Every user-facing target must include a `##` description so `make help` remains useful.
422
+
423
+ ```makefile
424
+ .PHONY: example
425
+ example: ## LOCAL: Explain exactly what the command does
426
+ @echo "example"
427
+ ```
428
+
429
+ Recommended prefixes in descriptions:
430
+
431
+ ```text
432
+ LOCAL: non-destructive local command
433
+ LOCAL DESTRUCTIVE: destructive local command
434
+ PRODUCTION: explicit production runtime/release command
435
+ ```
436
+
437
+ Never label a command as generic if it mutates an environment-specific database.
438
+
439
+ ---
440
+
441
+ ## Database Safety Rules
442
+
443
+ ```text
444
+ Local database reset?
445
+ → Allowed
446
+ → Target must explicitly use local environment where CLI supports it
447
+
448
+ Production database reset?
449
+ → Forbidden
450
+ → Do not create the target
451
+
452
+ Production migration?
453
+ → Use reviewed migration files
454
+ → Preview first when tooling supports dry-run
455
+ → Prefer release/CI execution
456
+
457
+ Seed development data?
458
+ → Local only
459
+ → Never automatically include development seed in production
460
+ ```
461
+
462
+ For Supabase specifically:
463
+
464
+ ```makefile
465
+ db-reset:
466
+ $(SUPABASE) db reset --local
467
+ ```
468
+
469
+ Do not rely only on the CLI default when the command is intentionally safety-critical.
470
+
471
+ ---
472
+
473
+ ## Git Branch Rules
474
+
475
+ Make targets must not use branch name as an automatic environment selector.
476
+
477
+ Bad:
478
+
479
+ ```text
480
+ main branch → production DB
481
+ dev branch → local DB
482
+ ```
483
+
484
+ Good:
485
+
486
+ ```text
487
+ any branch + local command → local environment
488
+ release/deployment config → production environment
489
+ ```
490
+
491
+ A branch check may be used as an additional safety gate for an already-explicit release target, but branch detection must never silently convert a development command into a production command.
492
+
493
+ ---
494
+
495
+ ## Agent Rules
496
+
497
+ ```text
498
+ New make target?
499
+ → Add to .PHONY
500
+ → Add ## help description
501
+ → Declare environment scope in help text when relevant
502
+ → Use tool variables instead of repeated hardcoded commands
503
+ → Keep one logical action per target
504
+
505
+ Target chains another target?
506
+ → Use $(MAKE) target-name or a prerequisite
507
+ → Do not duplicate the chained target's raw commands
508
+
509
+ New Docker command?
510
+ → Use $(COMPOSE) / configured compose variable
511
+ → Do not hardcode docker compose repeatedly
512
+
513
+ Supabase local lifecycle?
514
+ → supabase-start / supabase-stop / supabase-status
515
+ → Always local
516
+
517
+ Supabase db reset?
518
+ → Must explicitly use `db reset --local`
519
+ → Help text must say LOCAL DESTRUCTIVE
520
+ → Never use `--linked`
521
+
522
+ Supabase migration creation?
523
+ → `make migration name=...`
524
+ → Validate name is present
525
+ → Creates migration file only
526
+
527
+ Supabase schema diff?
528
+ → Explicitly use local schema
529
+ → `make db-diff name=...`
530
+
531
+ Supabase type generation?
532
+ → Generate from `--local` during normal development
533
+
534
+ Production Supabase migration?
535
+ → Do not hide it behind normal local commands
536
+ → Prefer release/CI workflow
537
+ → Preview with dry-run before applying
538
+ → Never reset production
539
+
540
+ Current Git branch is main?
541
+ → `make dev` is still LOCAL
542
+ → `make db-reset` is still LOCAL
543
+ → Do not switch credentials based on branch
544
+
545
+ New service in compose?
546
+ → Add logs-[service] if useful
547
+ → Add shell-[service] if useful
548
+
549
+ Default goal?
550
+ → Always `.DEFAULT_GOAL := help`
551
+
552
+ Init target?
553
+ → Scaffold only deterministic project structure
554
+ → Do not overwrite existing files
555
+ → Do not create production secrets
556
+ ```
@@ -0,0 +1,10 @@
1
+ {
2
+ "id": "pr-template",
3
+ "kind": "devops",
4
+ "label": "PR Template",
5
+ "required": false,
6
+ "folders": [],
7
+ "concerns": [
8
+ { "id": "pr", "required": true, "sections": ["Template"] }
9
+ ]
10
+ }
@@ -0,0 +1,106 @@
1
+ # DevOps: Pull Request Template
2
+
3
+ ---
4
+
5
+ ## Template
6
+ ```markdown
7
+ ## What does this PR do?
8
+
9
+ <!-- Describe the change clearly. What problem does it solve? What was added or fixed? -->
10
+
11
+ ---
12
+
13
+ ## Type of change
14
+
15
+ - [ ] `feat` — new feature
16
+ - [ ] `fix` — bug fix
17
+ - [ ] `refactor` — restructure without behavior change
18
+ - [ ] `chore` — deps, config, tooling
19
+ - [ ] `docs` — documentation only
20
+ - [ ] `test` — adding or updating tests
21
+
22
+ ---
23
+
24
+ ## Scope
25
+
26
+ - [ ] `frontend`
27
+ - [ ] `backend`
28
+ - [ ] `docker`
29
+ - [ ] `ci`
30
+ - [ ] `docs`
31
+ - [ ] `deps`
32
+
33
+ ---
34
+
35
+ ## How to test this?
36
+
37
+ 1.
38
+ 2.
39
+ 3.
40
+
41
+ ---
42
+
43
+ ## Checklist
44
+
45
+ ### General
46
+ - [ ] Branched off `dev`, not `main`
47
+ - [ ] Branch name follows convention (`feat/`, `fix/`, `refactor/`, `chore/`)
48
+ - [ ] Commits follow `type(scope): description` convention
49
+ - [ ] No `console.log` or debug code
50
+ - [ ] No hardcoded secrets or credentials
51
+
52
+ ### Quality
53
+ - [ ] `make lint` passes
54
+ - [ ] `make test` passes
55
+ - [ ] `make build` passes
56
+
57
+ ### Backend (if applicable)
58
+ - [ ] New endpoints documented in `docs/api/endpoints.md`
59
+ - [ ] DTOs used — no raw entity exposed in responses
60
+ - [ ] New Flyway migration created if schema changed
61
+ - [ ] Migration file follows naming: `V{n}__{description}.sql`
62
+ - [ ] Unit test added for each new service method
63
+ - [ ] Integration test added for each new controller endpoint
64
+
65
+ ### Frontend (if applicable)
66
+ - [ ] New API calls live inside `features/[name]/api/`
67
+ - [ ] New hooks live inside `features/[name]/hooks/`
68
+ - [ ] No business logic inside `pages/` or page components
69
+ - [ ] Route added to router if new page
70
+
71
+ ### Docs
72
+ - [ ] `docs/api/endpoints.md` updated if endpoints changed
73
+ - [ ] `docs/api/errors.md` updated if new error codes added
74
+ - [ ] `AGENTS.md` updated if new rules or conventions added
75
+ - [ ] `README.md` updated if setup steps changed
76
+
77
+ ---
78
+
79
+ Closes #
80
+ ```
81
+
82
+ ---
83
+
84
+ ## File Location
85
+ ```
86
+ .github/PULL_REQUEST_TEMPLATE.md
87
+ ```
88
+
89
+ GitHub automatically uses this template for all new PRs in the repo.
90
+
91
+ ---
92
+
93
+ ## Agent Rules
94
+ ```
95
+ When told to open a PR?
96
+ → Fill every section of this template
97
+ → Description must explain what AND why
98
+ → How to test must have actual numbered steps
99
+ → Checklist must be fully checked before opening
100
+ → Never open PR unless explicitly asked
101
+
102
+ When reviewing a PR?
103
+ → Check AGENTS.md rules are followed
104
+ → Check RULES.md patterns are followed
105
+ → Check docs are updated if endpoints or rules changed
106
+ ```
@@ -0,0 +1,5 @@
1
+ # Blade Architecture
2
+
3
+ Blade is Laravel's server-rendered presentation adapter. Small uses Controller → Eloquent → View;
4
+ Medium moves meaningful workflows into Actions/Services; Large aligns views with modular-monolith
5
+ ownership. Templates never own queries, authorization, transactions, or business workflows.
@@ -0,0 +1,5 @@
1
+ # Blade Runtime
2
+
3
+ Use GET rendering and POST/PUT/PATCH/DELETE followed by redirect to a fresh GET. Form Requests own
4
+ server validation; Blade renders feedback. Pass intentionally shaped view data, escape untrusted
5
+ output, flash only small non-sensitive messages, and keep secrets out of rendered HTML.
@@ -0,0 +1,5 @@
1
+ # Blade Security
2
+
3
+ Use escaped output unless explicitly sanitized, framework CSRF tokens for mutations, server-side
4
+ Policies/Gates, validated relative redirects, and throttling for authentication/recovery. Hiding a
5
+ button is not authorization. Production error pages expose no stack, SQL, secret, or private data.
@@ -0,0 +1,5 @@
1
+ # Blade Structure
2
+
3
+ Put route views in `resources/views/<feature>`, reusable shells in `layouts`, domain-free primitives
4
+ in `components/ui`, and genuinely shared presentation in `components/shared`. Keep feature-specific
5
+ components close to their feature and create directories only with real files.
@@ -0,0 +1,5 @@
1
+ # Blade Testing
2
+
3
+ Feature tests prove middleware, validation, authorization, redirects, database effects, selected
4
+ views, and required accessible content. Test component output only when it is behaviorally important;
5
+ use Playwright for critical login, navigation, submission, forbidden, and recovery journeys.
@@ -0,0 +1,5 @@
1
+ # Inertia React Architecture
2
+
3
+ Laravel owns routes, authorization, data selection, and navigation responses; React owns rendering
4
+ and browser interaction. Medium uses Laravel Actions/Services and reusable React feature modules.
5
+ Large adds public feature APIs and module checks—not an internal REST API or microservices.