vibes-plug 1.0.0 → 2.11.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 (183) hide show
  1. package/.claude/rules/vibes-plug-core.md +32 -0
  2. package/.cursor/rules/vibes-plug-core.mdc +51 -0
  3. package/.cursorrules +42 -0
  4. package/AGENTS.md +96 -0
  5. package/BLUEPRINT.md +309 -125
  6. package/CHANGELOG.md +183 -1
  7. package/CLAUDE.md +70 -0
  8. package/LICENSE +1 -1
  9. package/README.md +641 -263
  10. package/index.js +19 -0
  11. package/package.json +61 -25
  12. package/plugin.json +24 -7
  13. package/scripts/generate_swarm_gif.py +295 -0
  14. package/scripts/install.js +201 -0
  15. package/skills/accessibility-testing-expert/SKILL.md +116 -0
  16. package/skills/ai-cost-token-optimizer/SKILL.md +82 -0
  17. package/skills/ai-evals-benchmark-expert/SKILL.md +188 -0
  18. package/skills/ai-llm-integration-expert/SKILL.md +147 -122
  19. package/skills/ai-media-generation-expert/SKILL.md +172 -0
  20. package/skills/ai-prompt-engineering-expert/SKILL.md +84 -0
  21. package/skills/angular-expert/SKILL.md +148 -0
  22. package/skills/api-design-expert/SKILL.md +316 -309
  23. package/skills/api-gateway-proxy-expert/SKILL.md +81 -0
  24. package/skills/app-analyzer-optimizer/SKILL.md +195 -188
  25. package/skills/apple-ecosystem-expert/SKILL.md +145 -0
  26. package/skills/{asisten_ramah → asisten-ramah}/SKILL.md +7 -1
  27. package/skills/astro-framework-expert/SKILL.md +200 -0
  28. package/skills/async-queue-temporal-expert/SKILL.md +240 -0
  29. package/skills/authentication-identity-expert/SKILL.md +279 -45
  30. package/skills/auto-doc-updater/SKILL.md +219 -203
  31. package/skills/autonomous-chaos-monkey/SKILL.md +63 -0
  32. package/skills/autonomous-red-teamer/SKILL.md +203 -0
  33. package/skills/autonomous-tdd-debugger/SKILL.md +71 -0
  34. package/skills/background-jobs-queue-expert/SKILL.md +235 -0
  35. package/skills/biome-linter-formatter-expert/SKILL.md +89 -0
  36. package/skills/blockchain-web3-expert/SKILL.md +115 -0
  37. package/skills/bootstrap-to-modern/SKILL.md +93 -86
  38. package/skills/brainstorming/SKILL.md +381 -353
  39. package/skills/browser-automation-expert/SKILL.md +222 -0
  40. package/skills/bun-runtime-expert/SKILL.md +7 -1
  41. package/skills/chatbot-messaging-expert/SKILL.md +114 -0
  42. package/skills/ci-cd-devops-architect/SKILL.md +81 -45
  43. package/skills/cloud-hosting-expert/SKILL.md +249 -243
  44. package/skills/coderabbit/SKILL.md +197 -191
  45. package/skills/compliance-gdpr-privacy-expert/SKILL.md +85 -0
  46. package/skills/cron-scheduler-expert/SKILL.md +304 -0
  47. package/skills/data-pipeline-etl-expert/SKILL.md +84 -0
  48. package/skills/data-telemetry-expert/SKILL.md +218 -212
  49. package/skills/data-visualization-expert/SKILL.md +154 -0
  50. package/skills/database-migration-versioning-expert/SKILL.md +90 -0
  51. package/skills/database-orm-expert/SKILL.md +303 -293
  52. package/skills/dependency-upgrade-migrator/SKILL.md +301 -0
  53. package/skills/design-system-architect/SKILL.md +278 -242
  54. package/skills/desktop-electron-expert/SKILL.md +128 -0
  55. package/skills/documentation-site-expert/SKILL.md +59 -0
  56. package/skills/doku-mcp-server/SKILL.md +257 -0
  57. package/skills/doku-payment-gateway/SKILL.md +233 -0
  58. package/skills/domain-driven-design-expert/SKILL.md +82 -0
  59. package/skills/e2e-testing-expert/SKILL.md +320 -314
  60. package/skills/ecommerce-expert/SKILL.md +87 -0
  61. package/skills/edge-serverless-db-expert/SKILL.md +99 -0
  62. package/skills/email-notification-expert/SKILL.md +368 -0
  63. package/skills/error-resilience-expert/SKILL.md +486 -0
  64. package/skills/event-driven-architect/SKILL.md +86 -80
  65. package/skills/feature-flag-analytics-expert/SKILL.md +66 -0
  66. package/skills/file-upload-media-expert/SKILL.md +437 -0
  67. package/skills/firebase-security-expert/SKILL.md +7 -1
  68. package/skills/form-validation-expert/SKILL.md +407 -0
  69. package/skills/fullstack-expert/SKILL.md +260 -201
  70. package/skills/fullstack-expert/references/api_design_guide.md +466 -466
  71. package/skills/fullstack-expert/references/multi_language_backend.md +528 -528
  72. package/skills/fullstack-expert/scripts/api_contract_validator.py +253 -253
  73. package/skills/fullstack-expert/scripts/architecture_analyzer.py +326 -326
  74. package/skills/gemini-agent-booster/SKILL.md +142 -104
  75. package/skills/geospatial-maps-expert/SKILL.md +80 -0
  76. package/skills/global-a11y-i18n-expert/SKILL.md +86 -80
  77. package/skills/glsl-shader-expert/SKILL.md +107 -0
  78. package/skills/go-programming-expert/SKILL.md +300 -294
  79. package/skills/graph-rag-knowledge-expert/SKILL.md +159 -0
  80. package/skills/graphql-apollo-expert/SKILL.md +114 -0
  81. package/skills/headless-cms-expert/SKILL.md +181 -0
  82. package/skills/hig/SKILL.md +193 -187
  83. package/skills/js-backend-expert/SKILL.md +218 -191
  84. package/skills/legacy-code-translator/SKILL.md +71 -0
  85. package/skills/local-slm-edge-ai-expert/SKILL.md +167 -0
  86. package/skills/logging-error-tracking-expert/SKILL.md +344 -0
  87. package/skills/mcp-client-orchestrator/SKILL.md +76 -0
  88. package/skills/mcp-server-architect/SKILL.md +226 -126
  89. package/skills/micro-frontend-architect/SKILL.md +112 -0
  90. package/skills/mobile-expo-expert/SKILL.md +191 -185
  91. package/skills/mobile-push-notification-expert/SKILL.md +71 -0
  92. package/skills/modern-css-native-expert/SKILL.md +189 -0
  93. package/skills/monday-design-aesthetic/SKILL.md +72 -66
  94. package/skills/monorepo-architect/SKILL.md +232 -226
  95. package/skills/mpa-orchestrator/SKILL.md +120 -101
  96. package/skills/multi-agent-orchestration/SKILL.md +173 -153
  97. package/skills/multiple-entry-points/SKILL.md +91 -55
  98. package/skills/mvc-expert/SKILL.md +237 -231
  99. package/skills/n8n-automation-expert/SKILL.md +89 -0
  100. package/skills/nextjs-app-router-expert/SKILL.md +148 -0
  101. package/skills/openapi-swagger-codegen-expert/SKILL.md +67 -0
  102. package/skills/payment-gateway-expert/SKILL.md +129 -45
  103. package/skills/pdf-document-generation-expert/SKILL.md +91 -0
  104. package/skills/performance-web-vitals/SKILL.md +337 -331
  105. package/skills/post-quantum-crypto-migrator/SKILL.md +57 -0
  106. package/skills/prd-architect/SKILL.md +206 -190
  107. package/skills/proactive-background-watcher/SKILL.md +68 -0
  108. package/skills/production-ready-hardener/PRODUCTION_READINESS_REPORT.md +67 -0
  109. package/skills/production-ready-hardener/SKILL.md +461 -468
  110. package/skills/production-ready-hardener/references/production_checklist.md +161 -161
  111. package/skills/production-ready-hardener/scripts/production_readiness_scanner.py +881 -875
  112. package/skills/project-context-mapper/SKILL.md +85 -0
  113. package/skills/pwa-offline-first-expert/SKILL.md +185 -0
  114. package/skills/python-programming-expert/SKILL.md +407 -270
  115. package/skills/rate-limit-abuse-prevention/SKILL.md +377 -0
  116. package/skills/realtime-collaboration-expert/SKILL.md +99 -45
  117. package/skills/rich-text-editor-expert/SKILL.md +177 -0
  118. package/skills/rust-programming-expert/SKILL.md +240 -234
  119. package/skills/saas-billing/SKILL.md +382 -376
  120. package/skills/saas-multi-tenant/SKILL.md +256 -236
  121. package/skills/saas-mvp-launcher/SKILL.md +30 -1
  122. package/skills/saas-transformer/SKILL.md +499 -445
  123. package/skills/saas-transformer/references/billing_integration_guide.md +401 -401
  124. package/skills/saas-transformer/references/feature_gating_patterns.md +137 -137
  125. package/skills/saas-transformer/references/saas_transformation_checklist.md +121 -121
  126. package/skills/saas-transformer/scripts/saas_transformation_scanner.py +39 -29
  127. package/skills/scalability-clean-code/SKILL.md +234 -228
  128. package/skills/search-engine-expert/SKILL.md +89 -0
  129. package/skills/secure-fuzz-testing/SKILL.md +7 -1
  130. package/skills/self-evolving-memory-graph/SKILL.md +91 -0
  131. package/skills/self-healing-cloud-orchestrator/SKILL.md +57 -0
  132. package/skills/senior-frontend/SKILL.md +85 -105
  133. package/skills/seo/SKILL.md +258 -224
  134. package/skills/session-context-loader/SKILL.md +83 -0
  135. package/skills/session-handoff-resume/SKILL.md +163 -157
  136. package/skills/{skill_baru → skill-baru}/SKILL.md +177 -146
  137. package/skills/solidjs-expert/SKILL.md +80 -0
  138. package/skills/spa-orchestrator/SKILL.md +306 -287
  139. package/skills/sse-websocket-streaming-expert/SKILL.md +93 -0
  140. package/skills/state-management-expert/SKILL.md +277 -271
  141. package/skills/supabase-migration/SKILL.md +47 -1
  142. package/skills/supabase-security-expert/SKILL.md +248 -242
  143. package/skills/svelte-sveltekit-expert/SKILL.md +91 -0
  144. package/skills/svg-animation-motion-expert/SKILL.md +115 -0
  145. package/skills/tailwind-expert/SKILL.md +139 -187
  146. package/skills/tanstack-query-expert/SKILL.md +204 -198
  147. package/skills/tauri-expert/SKILL.md +7 -1
  148. package/skills/token-saver/SKILL.md +118 -110
  149. package/skills/typescript-expert/SKILL.md +329 -278
  150. package/skills/ui-components-expert/SKILL.md +166 -63
  151. package/skills/ui-ux-pro-max/SKILL.md +221 -200
  152. package/skills/vector-db-rag-expert/SKILL.md +208 -0
  153. package/skills/vibe-code-gardener/SKILL.md +180 -172
  154. package/skills/visual-qa-vision-agent/SKILL.md +71 -0
  155. package/skills/voice-ai-realtime-agent/SKILL.md +202 -0
  156. package/skills/vue-frontend-expert/SKILL.md +132 -0
  157. package/skills/wasm-edge-computing-expert/SKILL.md +97 -0
  158. package/skills/web-3d-graphics-expert/SKILL.md +137 -0
  159. package/skills/web-game-engine-expert/SKILL.md +102 -0
  160. package/skills/web-scraper/SKILL.md +98 -146
  161. package/skills/website-design-cloner/SKILL.md +180 -0
  162. package/skills/webxr-ar-vr-expert/SKILL.md +123 -0
  163. package/skills/wordpress-headless-expert/SKILL.md +144 -0
  164. package/skills/zero-to-prod-orchestrator/SKILL.md +231 -180
  165. package/skills/zero-trust-secret-vault/SKILL.md +88 -0
  166. package/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  167. package/CONTRIBUTING.md +0 -199
  168. package/SECURITY.md +0 -21
  169. package/banner.png +0 -0
  170. package/skills/senior-fullstack/SKILL.md +0 -167
  171. package/skills/senior-fullstack/references/architecture_patterns.md +0 -160
  172. package/skills/senior-fullstack/references/development_workflows.md +0 -222
  173. package/skills/senior-fullstack/references/tech_stack_guide.md +0 -190
  174. package/skills/senior-fullstack/scripts/code_quality_analyzer.py +0 -114
  175. package/skills/senior-fullstack/scripts/fullstack_scaffolder.py +0 -114
  176. package/skills/senior-fullstack/scripts/project_scaffolder.py +0 -114
  177. package/skills/seo-aeo-landing-page-writer/SKILL.md +0 -97
  178. package/skills/seo-geo/SKILL.md +0 -188
  179. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-310.pyc +0 -0
  180. package/skills/ui-ux-pro-max/scripts/__pycache__/core.cpython-312.pyc +0 -0
  181. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-310.pyc +0 -0
  182. package/skills/ui-ux-pro-max/scripts/__pycache__/design_system.cpython-312.pyc +0 -0
  183. package/skills/ui_ux_expert/SKILL.md +0 -114
@@ -1,222 +0,0 @@
1
- # Development Workflows
2
-
3
- ## Overview
4
- This reference guide details production-grade development workflows, automated testing matrices, and CI/CD pipelines for senior fullstack applications.
5
-
6
- ---
7
-
8
- ## Production Workflows & Pipelines
9
-
10
- ### 1. High-Fidelity Test Matrix (Vitest & Playwright)
11
-
12
- Senior fullstack projects must enforce a multi-tiered test strategy:
13
- 1. **Unit Testing**: Instant feedback cycles using Vitest or Jest for pure logic and schema validations.
14
- 2. **End-to-End (E2E) Testing**: High-fidelity customer flow validations using Playwright.
15
-
16
- #### Pattern: Vitest Schema Validator Unit Test (`__tests__/signup.test.ts`)
17
-
18
- ```typescript
19
- import { describe, it, expect } from 'vitest';
20
- import { SignupSchema } from '../lib/validators/auth';
21
-
22
- describe('Signup Schema Validation', () => {
23
- it('should pass on complete, valid payload', () => {
24
- const payload = {
25
- email: 'test@example.com',
26
- password: 'password123',
27
- name: 'Jane Doe',
28
- };
29
- const result = SignupSchema.safeParse(payload);
30
- expect(result.success).toBe(true);
31
- });
32
-
33
- it('should reject passwords shorter than 8 characters', () => {
34
- const payload = {
35
- email: 'test@example.com',
36
- password: 'short',
37
- };
38
- const result = SignupSchema.safeParse(payload);
39
- expect(result.success).toBe(false);
40
- });
41
- });
42
- ```
43
-
44
- #### Pattern: Playwright Multi-Role Customer E2E Flow (`e2e/onboarding.spec.ts`)
45
-
46
- ```typescript
47
- import { test, expect } from '@playwright/test';
48
-
49
- test.describe('Customer Workspace Onboarding', () => {
50
- test('should allow authenticated customer to create a workspace and view dashboard', async ({ page }) => {
51
- // 1. Visit landing page
52
- await page.goto('/sign-in');
53
-
54
- // 2. Perform mock login or enter user credentials
55
- await page.fill('input[type="email"]', 'jane@company.com');
56
- await page.fill('input[type="password"]', 'janePassword123');
57
- await page.click('button[type="submit"]');
58
-
59
- // 3. Confirm redirected to dashboard onboarding step
60
- await expect(page).toHaveURL(/.*dashboard/);
61
- await expect(page.locator('h1')).toContainText('Create Your Workspace');
62
-
63
- // 4. Submit form
64
- await page.fill('input[name="name"]', 'Jane Ventures');
65
- await page.fill('input[name="slug"]', 'jane-ventures');
66
- await page.click('button[type="submit"]');
67
-
68
- // 5. Verify success state and layout rendering
69
- await expect(page.locator('main')).toContainText('Jane Ventures');
70
- });
71
- });
72
- ```
73
-
74
- ---
75
-
76
- ### 2. Automated CI/CD Pipelines (GitHub Actions)
77
-
78
- Establish automated quality gates on every Pull Request to verify build integrity, linter standards, and security vulnerability profiles.
79
-
80
- #### Pattern: GitHub Actions Workflow (`.github/workflows/ci.yml`)
81
-
82
- ```yaml
83
- name: Continuous Integration
84
-
85
- on:
86
- push:
87
- branches: [ main ]
88
- pull_request:
89
- branches: [ main ]
90
-
91
- jobs:
92
- validate:
93
- runs-on: ubuntu-latest
94
-
95
- services:
96
- postgres:
97
- image: postgres:15
98
- env:
99
- POSTGRES_USER: test_user
100
- POSTGRES_PASSWORD: test_password
101
- POSTGRES_DB: test_db
102
- ports:
103
- - 5432:5432
104
- options: >-
105
- --health-cmd pg_isready
106
- --health-interval 10s
107
- --health-timeout 5s
108
- --health-retries 5
109
-
110
- steps:
111
- - name: Checkout Source Code
112
- uses: actions/checkout@v4
113
-
114
- - name: Setup Node.js Environment
115
- uses: actions/setup-node@v4
116
- with:
117
- node-version: 20
118
- cache: 'npm'
119
-
120
- - name: Install Dependencies
121
- run: npm ci
122
-
123
- - name: Verify Linter & Formatters
124
- run: |
125
- npm run lint
126
- npm run format:check
127
-
128
- - name: Run Database Migrations
129
- env:
130
- DATABASE_URL: postgresql://test_user:test_password@localhost:5432/test_db
131
- run: npx prisma migrate deploy # or npx drizzle-kit migrate
132
-
133
- - name: Execute Vitest Unit Suite
134
- env:
135
- DATABASE_URL: postgresql://test_user:test_password@localhost:5432/test_db
136
- run: npm run test:unit
137
-
138
- - name: Install Playwright Browsers
139
- run: npx playwright install --with-deps
140
-
141
- - name: Execute E2E Integration Suite
142
- env:
143
- DATABASE_URL: postgresql://test_user:test_password@localhost:5432/test_db
144
- run: npm run test:e2e
145
-
146
- - name: Validate Production Build
147
- run: npm run build
148
- ```
149
-
150
- ---
151
-
152
- ### 3. Containerized Local Environments (Docker & Compose)
153
-
154
- To guarantee absolute environment consistency between developer workstations and staging/production clouds, define lightweight multi-container environments.
155
-
156
- #### Pattern: Production-Grade Multi-Stage Dockerfile (`Dockerfile`)
157
-
158
- ```dockerfile
159
- # --- Stage 1: Build Workspace ---
160
- FROM node:20-alpine AS builder
161
- WORKDIR /app
162
- COPY package*.json ./
163
- RUN npm ci
164
- COPY . .
165
- RUN npm run build
166
-
167
- # --- Stage 2: Minimalist Production Runner ---
168
- FROM node:20-alpine AS runner
169
- WORKDIR /app
170
- ENV NODE_ENV=production
171
- COPY --from=builder /app/package*.json ./
172
- COPY --from=builder /app/node_modules ./node_modules
173
- COPY --from=builder /app/.next ./.next
174
- COPY --from=builder /app/public ./public
175
-
176
- EXPOSE 3000
177
- CMD ["npm", "run", "start"]
178
- ```
179
-
180
- #### Pattern: Docker Compose Stack (`docker-compose.yml`)
181
-
182
- ```yaml
183
- version: '3.8'
184
-
185
- services:
186
- web:
187
- build:
188
- context: .
189
- dockerfile: Dockerfile
190
- ports:
191
- - "3000:3000"
192
- environment:
193
- - DATABASE_URL=postgresql://app_user:app_password@db:5432/app_db
194
- - REDIS_URL=redis://redis:6379
195
- depends_on:
196
- - db
197
- - redis
198
-
199
- db:
200
- image: postgres:15
201
- environment:
202
- POSTGRES_USER: app_user
203
- POSTGRES_PASSWORD: app_password
204
- POSTGRES_DB: app_db
205
- ports:
206
- - "5432:5432"
207
- volumes:
208
- - pgdata:/var/lib/postgresql/data
209
-
210
- redis:
211
- image: redis:7-alpine
212
- ports:
213
- - "6379:6379"
214
-
215
- volumes:
216
- pgdata:
217
- ```
218
-
219
- ---
220
-
221
- ## Conclusion
222
- Setting up rigorous CI/CD gates, high-fidelity testing metrics, and matching container local stacks completely eliminates "works on my machine" failures and keeps server releases highly stable.
@@ -1,190 +0,0 @@
1
- # Tech Stack Guide
2
-
3
- ## Overview
4
- This reference guide details production-grade tech stack patterns, concrete typescript implementations, and scaling strategies for React 19, Next.js 15, PostgreSQL, and connection pooling.
5
-
6
- ---
7
-
8
- ## Production Patterns & Practices
9
-
10
- ### 1. Server-First Next.js 15 Architecture
11
-
12
- Next.js 15 standardizes on React Server Components (RSC) by default. Data fetching is co-located with rendering, preventing waterfalls and saving significant client bandwidth.
13
-
14
- #### Pattern: Modular Layout & Data Fetching
15
-
16
- ```tsx
17
- // app/dashboard/layout.tsx
18
- import { ReactNode } from 'react';
19
- import { Sidebar } from '@/components/dashboard/sidebar';
20
- import { Header } from '@/components/dashboard/header';
21
-
22
- export default async function DashboardLayout({ children }: { children: ReactNode }) {
23
- return (
24
- <div className="flex h-screen overflow-hidden bg-slate-50">
25
- <Sidebar />
26
- <div className="flex flex-1 flex-col overflow-y-auto">
27
- <Header />
28
- <main className="p-6">{children}</main>
29
- </div>
30
- </div>
31
- );
32
- }
33
- ```
34
-
35
- ```tsx
36
- // app/dashboard/page.tsx
37
- import { Suspense } from 'react';
38
- import { db } from '@/lib/db';
39
- import { workspaces } from '@/lib/db/schema';
40
- import { auth } from '@clerk/nextjs/server';
41
- import { eq } from 'drizzle-orm';
42
- import { Skeleton } from '@/components/ui/skeleton';
43
- import { WorkspaceCard } from '@/components/dashboard/workspace-card';
44
-
45
- // Server-side dynamic fetching component
46
- async function WorkspaceList() {
47
- const { userId } = await auth();
48
- if (!userId) throw new Error('Unauthorized');
49
-
50
- const userWorkspaces = await db
51
- .select()
52
- .from(workspaces)
53
- .where(eq(workspaces.ownerId, userId));
54
-
55
- return (
56
- <div className="grid gap-4 md:grid-cols-3">
57
- {userWorkspaces.map((ws) => (
58
- <WorkspaceCard key={ws.id} workspace={ws} />
59
- ))}
60
- </div>
61
- );
62
- }
63
-
64
- export default function DashboardPage() {
65
- return (
66
- <div className="space-y-6">
67
- <h1 className="text-3xl font-bold">Your Workspaces</h1>
68
- <Suspense fallback={<div className="grid gap-4 md:grid-cols-3"><Skeleton className="h-32 w-full" /></div>}>
69
- <WorkspaceList />
70
- </Suspense>
71
- </div>
72
- );
73
- }
74
- ```
75
-
76
- ---
77
-
78
- ### 2. High-Performance PostgreSQL & Connection Pooling
79
-
80
- In a serverless runtime (e.g., Vercel / Netlify Functions), direct database connections spike exponentially during peak request loads. Employ transaction connection pooling (via Supabase Supavisor, PgBouncer, or Neon Serverless Driver) to recycle handles.
81
-
82
- #### Pattern: Multi-Client Connection Configuration (`lib/db/index.ts`)
83
-
84
- ```typescript
85
- import { drizzle } from 'drizzle-orm/postgres-js';
86
- import postgres from 'postgres';
87
- import * as schema from './schema';
88
-
89
- // Enforce single database client in development to prevent hot-reload socket exhaustion
90
- const globalForDb = globalThis as unknown as {
91
- conn: postgres.Sql | undefined;
92
- };
93
-
94
- // Use transaction pooling for high concurrent workloads
95
- const connectionString = process.env.DATABASE_URL!;
96
-
97
- const client = globalForDb.conn ?? postgres(connectionString, {
98
- max: process.env.DB_MAX_CONNECTIONS ? parseInt(process.env.DB_MAX_CONNECTIONS) : 10,
99
- prepare: false, // Set to false when utilizing Transaction poolers like pgBouncer/Supavisor
100
- idle_timeout: 20,
101
- connect_timeout: 10,
102
- });
103
-
104
- if (process.env.NODE_ENV !== 'production') {
105
- globalForDb.conn = client;
106
- }
107
-
108
- export const db = drizzle(client, { schema });
109
- ```
110
-
111
- ---
112
-
113
- ## Technical Guidelines & Guidelines
114
-
115
- ### Type-Safe REST Contracts
116
-
117
- Utilize Zod structures on both the client form schemas and the server-side Next.js route handlers to achieve full type safety across HTTP borders.
118
-
119
- ```typescript
120
- // lib/validators/auth.ts
121
- import { z } from 'zod';
122
-
123
- export const SignupSchema = z.object({
124
- email: z.string().email('Please supply a valid email address'),
125
- password: z.string().min(8, 'Password must contain at least 8 characters'),
126
- name: z.string().min(2, 'Name must contain at least 2 characters').optional(),
127
- });
128
-
129
- export type SignupInput = z.infer<typeof SignupSchema>;
130
- ```
131
-
132
- ```typescript
133
- // app/api/auth/signup/route.ts
134
- import { NextResponse } from 'next/server';
135
- import { SignupSchema } from '@/lib/validators/auth';
136
- import { db } from '@/lib/db';
137
- import { users } from '@/lib/db/schema';
138
- import { hash } from 'bcrypt';
139
-
140
- export async function POST(req: Request) {
141
- try {
142
- const body = await req.json();
143
- const result = SignupSchema.safeParse(body);
144
-
145
- if (!result.success) {
146
- return NextResponse.json({ error: result.error.format() }, { status: 400 });
147
- }
148
-
149
- const { email, password, name } = result.data;
150
-
151
- // Check if user already exists
152
- const existing = await db.query.users.findFirst({
153
- where: (u, { eq }) => eq(u.email, email),
154
- });
155
-
156
- if (existing) {
157
- return NextResponse.json({ error: 'User already exists' }, { status: 409 });
158
- }
159
-
160
- const hashedPassword = await hash(password, 12);
161
-
162
- const [newUser] = await db.insert(users).values({
163
- email,
164
- name,
165
- password: hashedPassword,
166
- }).returning();
167
-
168
- return NextResponse.json({ id: newUser.id, email: newUser.email, name: newUser.name }, { status: 201 });
169
- } catch (err) {
170
- return NextResponse.json({ error: 'Internal Server Error' }, { status: 500 });
171
- }
172
- }
173
- ```
174
-
175
- ---
176
-
177
- ## Anti-Patterns to Avoid
178
-
179
- ### 🚫 Client-Side Waterfall Loading
180
- *Do not* chain individual API requests inside standard client-side `useEffect` declarations (e.g. Fetch user -> then fetch workspaces -> then fetch analytics).
181
- *Instead:* Prefetch parallel states via Next.js server components or leverage dynamic `Promise.all` scopes before returning client modules.
182
-
183
- ### 🚫 Global Database Client Hot Exhaustion
184
- *Do not* initialize fresh database connections inline inside database-consuming server functions.
185
- *Instead:* Maintain a shared, global db handle scoped correctly to check development hot-reloads.
186
-
187
- ---
188
-
189
- ## Conclusion
190
- Adhering to server-first Next.js models paired with secure pooled database connections will guarantee your fullstack applications execute fast, scale securely, and retain complete end-to-end type safety.
@@ -1,114 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Code Quality Analyzer
4
- Automated tool for senior fullstack tasks
5
- """
6
-
7
- import os
8
- import sys
9
- import json
10
- import argparse
11
- from pathlib import Path
12
- from typing import Dict, List, Optional
13
-
14
- class CodeQualityAnalyzer:
15
- """Main class for code quality analyzer functionality"""
16
-
17
- def __init__(self, target_path: str, verbose: bool = False):
18
- self.target_path = Path(target_path)
19
- self.verbose = verbose
20
- self.results = {}
21
-
22
- def run(self) -> Dict:
23
- """Execute the main functionality"""
24
- print(f"🚀 Running {self.__class__.__name__}...")
25
- print(f"📁 Target: {self.target_path}")
26
-
27
- try:
28
- self.validate_target()
29
- self.analyze()
30
- self.generate_report()
31
-
32
- print("✅ Completed successfully!")
33
- return self.results
34
-
35
- except Exception as e:
36
- print(f"❌ Error: {e}")
37
- sys.exit(1)
38
-
39
- def validate_target(self):
40
- """Validate the target path exists and is accessible"""
41
- if not self.target_path.exists():
42
- raise ValueError(f"Target path does not exist: {self.target_path}")
43
-
44
- if self.verbose:
45
- print(f"✓ Target validated: {self.target_path}")
46
-
47
- def analyze(self):
48
- """Perform the main analysis or operation"""
49
- if self.verbose:
50
- print("📊 Analyzing...")
51
-
52
- # Main logic here
53
- self.results['status'] = 'success'
54
- self.results['target'] = str(self.target_path)
55
- self.results['findings'] = []
56
-
57
- # Add analysis results
58
- if self.verbose:
59
- print(f"✓ Analysis complete: {len(self.results.get('findings', []))} findings")
60
-
61
- def generate_report(self):
62
- """Generate and display the report"""
63
- print("\n" + "="*50)
64
- print("REPORT")
65
- print("="*50)
66
- print(f"Target: {self.results.get('target')}")
67
- print(f"Status: {self.results.get('status')}")
68
- print(f"Findings: {len(self.results.get('findings', []))}")
69
- print("="*50 + "\n")
70
-
71
- def main():
72
- """Main entry point"""
73
- parser = argparse.ArgumentParser(
74
- description="Code Quality Analyzer"
75
- )
76
- parser.add_argument(
77
- 'target',
78
- help='Target path to analyze or process'
79
- )
80
- parser.add_argument(
81
- '--verbose', '-v',
82
- action='store_true',
83
- help='Enable verbose output'
84
- )
85
- parser.add_argument(
86
- '--json',
87
- action='store_true',
88
- help='Output results as JSON'
89
- )
90
- parser.add_argument(
91
- '--output', '-o',
92
- help='Output file path'
93
- )
94
-
95
- args = parser.parse_args()
96
-
97
- tool = CodeQualityAnalyzer(
98
- args.target,
99
- verbose=args.verbose
100
- )
101
-
102
- results = tool.run()
103
-
104
- if args.json:
105
- output = json.dumps(results, indent=2)
106
- if args.output:
107
- with open(args.output, 'w') as f:
108
- f.write(output)
109
- print(f"Results written to {args.output}")
110
- else:
111
- print(output)
112
-
113
- if __name__ == '__main__':
114
- main()
@@ -1,114 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- Fullstack Scaffolder
4
- Automated tool for senior fullstack tasks
5
- """
6
-
7
- import os
8
- import sys
9
- import json
10
- import argparse
11
- from pathlib import Path
12
- from typing import Dict, List, Optional
13
-
14
- class FullstackScaffolder:
15
- """Main class for fullstack scaffolder functionality"""
16
-
17
- def __init__(self, target_path: str, verbose: bool = False):
18
- self.target_path = Path(target_path)
19
- self.verbose = verbose
20
- self.results = {}
21
-
22
- def run(self) -> Dict:
23
- """Execute the main functionality"""
24
- print(f"🚀 Running {self.__class__.__name__}...")
25
- print(f"📁 Target: {self.target_path}")
26
-
27
- try:
28
- self.validate_target()
29
- self.analyze()
30
- self.generate_report()
31
-
32
- print("✅ Completed successfully!")
33
- return self.results
34
-
35
- except Exception as e:
36
- print(f"❌ Error: {e}")
37
- sys.exit(1)
38
-
39
- def validate_target(self):
40
- """Validate the target path exists and is accessible"""
41
- if not self.target_path.exists():
42
- raise ValueError(f"Target path does not exist: {self.target_path}")
43
-
44
- if self.verbose:
45
- print(f"✓ Target validated: {self.target_path}")
46
-
47
- def analyze(self):
48
- """Perform the main analysis or operation"""
49
- if self.verbose:
50
- print("📊 Analyzing...")
51
-
52
- # Main logic here
53
- self.results['status'] = 'success'
54
- self.results['target'] = str(self.target_path)
55
- self.results['findings'] = []
56
-
57
- # Add analysis results
58
- if self.verbose:
59
- print(f"✓ Analysis complete: {len(self.results.get('findings', []))} findings")
60
-
61
- def generate_report(self):
62
- """Generate and display the report"""
63
- print("\n" + "="*50)
64
- print("REPORT")
65
- print("="*50)
66
- print(f"Target: {self.results.get('target')}")
67
- print(f"Status: {self.results.get('status')}")
68
- print(f"Findings: {len(self.results.get('findings', []))}")
69
- print("="*50 + "\n")
70
-
71
- def main():
72
- """Main entry point"""
73
- parser = argparse.ArgumentParser(
74
- description="Fullstack Scaffolder"
75
- )
76
- parser.add_argument(
77
- 'target',
78
- help='Target path to analyze or process'
79
- )
80
- parser.add_argument(
81
- '--verbose', '-v',
82
- action='store_true',
83
- help='Enable verbose output'
84
- )
85
- parser.add_argument(
86
- '--json',
87
- action='store_true',
88
- help='Output results as JSON'
89
- )
90
- parser.add_argument(
91
- '--output', '-o',
92
- help='Output file path'
93
- )
94
-
95
- args = parser.parse_args()
96
-
97
- tool = FullstackScaffolder(
98
- args.target,
99
- verbose=args.verbose
100
- )
101
-
102
- results = tool.run()
103
-
104
- if args.json:
105
- output = json.dumps(results, indent=2)
106
- if args.output:
107
- with open(args.output, 'w') as f:
108
- f.write(output)
109
- print(f"Results written to {args.output}")
110
- else:
111
- print(output)
112
-
113
- if __name__ == '__main__':
114
- main()