vibes-plug 2.11.0 → 2.14.1

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 (69) hide show
  1. package/.cursor/rules/vibes-plug-core.mdc +3 -3
  2. package/.cursorrules +3 -3
  3. package/AGENTS.md +4 -4
  4. package/BLUEPRINT.md +16 -6
  5. package/CHANGELOG.md +37 -0
  6. package/CLAUDE.md +8 -8
  7. package/README.md +85 -115
  8. package/index.js +1 -1
  9. package/package.json +2 -2
  10. package/plugin.json +2 -2
  11. package/scripts/check-anti-slop.js +53 -0
  12. package/scripts/generate_swarm_gif.py +2 -2
  13. package/skills/ai-llm-integration-expert/SKILL.md +22 -15
  14. package/skills/ai-prompt-engineering-expert/SKILL.md +133 -83
  15. package/skills/anti-slop/SKILL.md +133 -0
  16. package/skills/async-queue-temporal-expert/SKILL.md +135 -158
  17. package/skills/authentication-identity-expert/SKILL.md +172 -278
  18. package/skills/brainstorming/SKILL.md +26 -26
  19. package/skills/database-orm-expert/SKILL.md +164 -303
  20. package/skills/deep-research-analyst/SKILL.md +136 -0
  21. package/skills/design-system-architect/SKILL.md +31 -1
  22. package/skills/email-notification-expert/SKILL.md +31 -4
  23. package/skills/error-resilience-expert/SKILL.md +21 -0
  24. package/skills/fullstack-expert/SKILL.md +183 -260
  25. package/skills/glsl-shader-expert/SKILL.md +190 -107
  26. package/skills/graph-rag-knowledge-expert/SKILL.md +42 -1
  27. package/skills/mcp-server-architect/SKILL.md +15 -1
  28. package/skills/prd-architect/SKILL.md +181 -206
  29. package/skills/production-ready-hardener/SKILL.md +16 -19
  30. package/skills/pwa-offline-first-expert/SKILL.md +42 -1
  31. package/skills/pydantic-ai-expert/SKILL.md +161 -0
  32. package/skills/saas-architect/SKILL.md +154 -0
  33. package/skills/senior-frontend/SKILL.md +9 -11
  34. package/skills/senior-frontend/scripts/frontend_scaffolder.py +1 -1
  35. package/skills/session-memory-manager/SKILL.md +128 -0
  36. package/skills/synthetic-data-finetuning-expert/SKILL.md +155 -0
  37. package/skills/ui-ux-pro-max/SKILL.md +4 -2
  38. package/skills/vercel-ai-sdk-expert/SKILL.md +181 -0
  39. package/skills/voice-ai-realtime-agent/SKILL.md +41 -1
  40. package/skills/web-3d-graphics-expert/SKILL.md +313 -137
  41. package/skills/web-game-engine-expert/SKILL.md +329 -102
  42. package/skills/webxr-ar-vr-expert/SKILL.md +162 -123
  43. package/skills/zero-to-prod-orchestrator/SKILL.md +26 -24
  44. package/skills/ai-cost-token-optimizer/SKILL.md +0 -82
  45. package/skills/ai-evals-benchmark-expert/SKILL.md +0 -188
  46. package/skills/asisten-ramah/SKILL.md +0 -47
  47. package/skills/auto-doc-updater/SKILL.md +0 -220
  48. package/skills/autonomous-chaos-monkey/SKILL.md +0 -63
  49. package/skills/background-jobs-queue-expert/SKILL.md +0 -235
  50. package/skills/database-migration-versioning-expert/SKILL.md +0 -90
  51. package/skills/edge-serverless-db-expert/SKILL.md +0 -99
  52. package/skills/mcp-client-orchestrator/SKILL.md +0 -76
  53. package/skills/mobile-push-notification-expert/SKILL.md +0 -71
  54. package/skills/monday-design-aesthetic/SKILL.md +0 -73
  55. package/skills/project-context-mapper/SKILL.md +0 -85
  56. package/skills/saas-mvp-launcher/SKILL.md +0 -260
  57. package/skills/saas-transformer/SKILL.md +0 -500
  58. package/skills/saas-transformer/references/billing_integration_guide.md +0 -401
  59. package/skills/self-evolving-memory-graph/SKILL.md +0 -91
  60. package/skills/session-context-loader/SKILL.md +0 -83
  61. package/skills/session-handoff-resume/SKILL.md +0 -164
  62. package/skills/skill-baru/SKILL.md +0 -178
  63. package/skills/supabase-migration/SKILL.md +0 -91
  64. package/skills/token-saver/SKILL.md +0 -119
  65. package/skills/ui-components-expert/SKILL.md +0 -166
  66. package/skills/vibe-code-gardener/SKILL.md +0 -181
  67. /package/skills/{saas-transformer → saas-architect}/references/feature_gating_patterns.md +0 -0
  68. /package/skills/{saas-transformer → saas-architect}/references/saas_transformation_checklist.md +0 -0
  69. /package/skills/{saas-transformer → saas-architect}/scripts/saas_transformation_scanner.py +0 -0
@@ -1,304 +1,165 @@
1
- ---
2
- name: database-orm-expert
3
- description: "Expert guide for database schema design, ORM tools (Prisma 6, Drizzle ORM, TypeORM), migrations, query optimization, and type-safe SQL patterns in TypeScript / Panduan ahli untuk desain skema database, ORM tools (Prisma 6, Drizzle ORM, TypeORM), migrasi, optimasi query, dan pola SQL type-safe di TypeScript."
1
+ ---
2
+ name: database-orm-expert
3
+ description: "Updated to be the unified database skill covering ORM, migrations, edge DBs, and Supabase CLI / Keahlian database terpadu untuk ORM, migrasi, edge DB, dan Supabase CLI."
4
4
  author: "Roedy Rustam"
5
- ---
6
-
7
- # Database ORM Expert (Prisma 6 + Drizzle ORM Edition)
8
-
9
- [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
10
-
11
- ---
12
-
13
- <a name="english"></a>
14
- ## English
15
-
16
- ### Description
17
- Design schemas, select ORMs, execute migrations, optimize queries, and implement type-safe SQL patterns. Prioritize **Prisma 6** and **Drizzle ORM**. Implement connection pooling for production workloads.
18
-
19
- ### Trigger Conditions
20
- - Designing or migrating a database schema.
21
- - Choosing between Prisma, Drizzle ORM, or TypeORM.
22
- - Writing complex queries with joins, aggregations, or pagination.
23
- - Optimizing slow queries or N+1 problems.
24
- - Setting up database migrations in CI/CD pipelines.
25
- - Implementing Row Level Security (RLS) patterns.
26
- - Working with PostgreSQL, MySQL, SQLite, or PlanetScale.
27
-
28
- ## Orchestration & Integration
29
- - `js-backend-expert`: For Node/Bun/Deno backend implementations integrating these ORMs.
30
- - `edge-serverless-db-expert`: For edge/serverless connections (e.g., Supabase, Neon, Turso).
31
- - `database-migration-versioning-expert`: For advanced migration strategies and CI/CD pipelines.
32
-
33
- ---
34
-
35
- ### ORM Selection Guide
36
-
37
- | Criteria | Prisma 6 | Drizzle ORM | TypeORM |
38
- |---|---|---|---|
39
- | **Type Safety** | Schema-generated types | SQL-like, inferred types | Decorator-based |
40
- | **Bundle Size** | Heavy (binary client) | Lightweight (<35KB) | Medium |
41
- | **Query Style** | Fluent ORM API | SQL-first, composable | ActiveRecord / QueryBuilder |
42
- | **Edge Runtime** | Prisma Accelerate needed | Native edge support | No |
43
- | **Migrations** | `prisma migrate dev` | `drizzle-kit push/migrate` | `synchronize` (dev only) |
44
- | **Best For** | Rapid prototyping, teams | Production edge, monorepos | Legacy NestJS projects |
45
-
46
- **Recommendation**: Use **Drizzle ORM** for edge-compatible apps and performance-critical systems. Use **Prisma 6** for teams that prefer a schema-first DX and rich Studio tooling.
47
-
48
- ---
49
-
50
- ### Prisma 6 — Best Practices
51
-
52
- #### Schema Design
53
- ```prisma
54
- // schema.prisma
55
- generator client {
56
- provider = "prisma-client-js"
57
- previewFeatures = ["relationJoins", "nativeDistinct"]
58
- }
59
-
60
- datasource db {
61
- provider = "postgresql"
62
- url = env("DATABASE_URL")
63
- directUrl = env("DIRECT_URL") // for Supabase Pooler
64
- }
65
-
66
- model User {
67
- id String @id @default(cuid())
68
- email String @unique
69
- name String?
70
- role Role @default(USER)
71
- posts Post[]
72
- createdAt DateTime @default(now())
73
- updatedAt DateTime @updatedAt
74
-
75
- @@index([email])
76
- @@map("users")
77
- }
78
-
79
- model Post {
80
- id String @id @default(cuid())
81
- title String
82
- content String?
83
- published Boolean @default(false)
84
- authorId String
85
- author User @relation(fields: [authorId], references: [id], onDelete: Cascade)
86
- publishedAt DateTime?
87
-
88
- @@index([authorId, published])
89
- @@map("posts")
90
- }
91
-
92
- enum Role {
93
- USER
94
- ADMIN
95
- SUPER_ADMIN
96
- }
97
- ```
98
-
99
- #### Avoiding N+1 with `include` vs `select`
100
- ```typescript
101
- // BAD: triggers N+1 queries
102
- const users = await prisma.user.findMany();
103
- for (const user of users) {
104
- const posts = await prisma.post.findMany({ where: { authorId: user.id } });
105
- }
106
-
107
- // GOOD: single query with JOIN (Prisma 5.7+ relationJoins preview)
108
- const users = await prisma.user.findMany({
109
- select: {
110
- id: true,
111
- name: true,
112
- email: true,
113
- _count: { select: { posts: true } },
114
- posts: {
115
- where: { published: true },
116
- select: { id: true, title: true },
117
- take: 5,
118
- orderBy: { publishedAt: 'desc' },
119
- },
120
- },
121
- });
122
- ```
123
-
124
- #### Optimistic Transactions
125
- ```typescript
126
- // Use $transaction for atomic operations
127
- const [updatedUser, newPost] = await prisma.$transaction([
128
- prisma.user.update({ where: { id }, data: { name } }),
129
- prisma.post.create({ data: { title, authorId: id } }),
130
- ]);
131
-
132
- // Interactive transaction for complex logic
133
- const result = await prisma.$transaction(async (tx) => {
134
- const user = await tx.user.findUniqueOrThrow({ where: { id } });
135
- if (user.role !== 'ADMIN') throw new Error('Unauthorized');
136
- return tx.post.updateMany({ where: { authorId: id }, data: { published: true } });
137
- });
138
- ```
139
-
140
- ---
141
-
142
- ### Drizzle ORM — Best Practices
143
-
144
- #### Schema Definition (PostgreSQL)
145
- ```typescript
146
- // src/db/schema.ts
147
- import { pgTable, text, boolean, timestamp, pgEnum, index } from 'drizzle-orm/pg-core';
148
- import { createId } from '@paralleldrive/cuid2';
149
- import { relations } from 'drizzle-orm';
150
-
151
- export const roleEnum = pgEnum('role', ['USER', 'ADMIN', 'SUPER_ADMIN']);
152
-
153
- export const users = pgTable('users', {
154
- id: text('id').primaryKey().$defaultFn(() => createId()),
155
- email: text('email').notNull().unique(),
156
- name: text('name'),
157
- role: roleEnum('role').default('USER').notNull(),
158
- createdAt: timestamp('created_at', { withTimezone: true }).defaultNow().notNull(),
159
- updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow().notNull().$onUpdateFn(() => new Date()),
160
- }, (t) => [
161
- index('users_email_idx').on(t.email),
162
- ]);
163
-
164
- export const posts = pgTable('posts', {
165
- id: text('id').primaryKey().$defaultFn(() => createId()),
166
- title: text('title').notNull(),
167
- content: text('content'),
168
- published: boolean('published').default(false).notNull(),
169
- authorId: text('author_id').notNull().references(() => users.id, { onDelete: 'cascade' }),
170
- publishedAt: timestamp('published_at', { withTimezone: true }),
171
- }, (t) => [
172
- index('posts_author_published_idx').on(t.authorId, t.published),
173
- ]);
174
-
175
- export const usersRelations = relations(users, ({ many }) => ({
176
- posts: many(posts),
177
- }));
178
-
179
- export const postsRelations = relations(posts, ({ one }) => ({
180
- author: one(users, { fields: [posts.authorId], references: [users.id] }),
181
- }));
182
- ```
183
-
184
- #### Type-safe Queries with Drizzle
185
- ```typescript
186
- // src/db/index.ts
187
- import { drizzle } from 'drizzle-orm/postgres-js';
188
- import postgres from 'postgres';
189
- import * as schema from './schema';
190
-
191
- const client = postgres(process.env.DATABASE_URL!);
192
- export const db = drizzle(client, { schema });
193
-
194
- // Type-safe query with joins
195
- import { eq, and, desc, count } from 'drizzle-orm';
196
-
197
- const usersWithPosts = await db.query.users.findMany({
198
- with: {
199
- posts: {
200
- where: eq(posts.published, true),
201
- orderBy: desc(posts.publishedAt),
202
- limit: 5,
203
- },
204
- },
205
- extras: {
206
- postCount: db.$count(posts, eq(posts.authorId, users.id)).as('post_count'),
207
- },
208
- });
209
-
210
- // Paginated query
211
- async function getPaginatedPosts(page: number, pageSize = 20) {
212
- const offset = (page - 1) * pageSize;
213
- const [items, [{ total }]] = await Promise.all([
214
- db.select().from(posts).where(eq(posts.published, true))
215
- .orderBy(desc(posts.publishedAt))
216
- .limit(pageSize)
217
- .offset(offset),
218
- db.select({ total: count() }).from(posts).where(eq(posts.published, true)),
219
- ]);
220
- return { items, total, pages: Math.ceil(total / pageSize) };
221
- }
222
- ```
223
-
224
- #### Drizzle Migration Workflow
225
- ```bash
226
- # drizzle.config.ts defines connection + schema path
227
- npx drizzle-kit generate # generate migration SQL files
228
- npx drizzle-kit migrate # apply migrations to database
229
- npx drizzle-kit push # push schema directly (dev only)
230
- npx drizzle-kit studio # open Drizzle Studio GUI
231
- ```
232
-
233
- ---
234
-
235
- ### Query Optimization Principles
236
-
237
- 1. **Always index foreign keys** and columns used in `WHERE`, `ORDER BY`, and `JOIN`.
238
- 2. **Use `EXPLAIN ANALYZE`** to detect sequential scans and missing indexes.
239
- 3. **Cursor-based pagination** over offset for large datasets:
240
- ```typescript
241
- // Cursor pagination with Drizzle
242
- const items = await db.select().from(posts)
243
- .where(cursor ? lt(posts.createdAt, cursor) : undefined)
244
- .orderBy(desc(posts.createdAt))
245
- .limit(pageSize);
246
- ```
247
- 4. **Connection pooling**: Use PgBouncer or Supabase's built-in pooler. Set `DIRECT_URL` for migrations and `DATABASE_URL` for pooled reads/writes.
248
- 5. **Avoid `SELECT *`**: Always select only the columns you need.
249
- 6. **Batch inserts**: Use `db.insert(table).values([...items])` instead of looping.
250
-
251
- ---
252
-
253
- ### Migration Best Practices
254
-
255
- - **Never use `synchronize: true`** in production (TypeORM).
256
- - **Never run `prisma db push`** in production — always use `prisma migrate deploy`.
257
- - Store migration files in version control.
258
- - Run migrations as a separate step before deploying new app versions.
259
- - Use **advisory locks** or migration tools to prevent concurrent migration runs.
260
-
261
- ---
262
-
263
- <a name="bahasa-indonesia"></a>
264
- ## Bahasa Indonesia
265
-
266
- ### Deskripsi
267
- Rancang skema, pilih ORM, eksekusi migrasi, optimalkan query, dan implementasikan pola SQL type-safe. Prioritaskan **Prisma 6** dan **Drizzle ORM**. Implementasikan connection pooling untuk beban kerja produksi.
268
-
269
- ### Kondisi Pemicu
270
- - Merancang atau memigrasikan skema database.
271
- - Memilih antara Prisma, Drizzle ORM, atau TypeORM.
272
- - Menulis query kompleks dengan join, agregasi, atau paginasi.
273
- - Mengoptimalkan query lambat atau masalah N+1.
274
- - Menyiapkan migrasi database dalam pipeline CI/CD.
275
- - Mengimplementasikan pola Row Level Security (RLS).
276
- - Bekerja dengan PostgreSQL, MySQL, SQLite, atau PlanetScale.
277
-
278
- ## Integrasi Orkestrasi
279
- - `js-backend-expert`: Untuk implementasi backend Node/Bun/Deno yang menggunakan ORM ini.
280
- - `edge-serverless-db-expert`: Untuk koneksi edge/serverless (mis. Supabase, Neon, Turso).
281
- - `database-migration-versioning-expert`: Untuk strategi migrasi lanjutan dan pipeline CI/CD.
282
-
283
- ### Panduan Pemilihan ORM
284
-
285
- Gunakan tabel di atas (lihat bagian English) sebagai referensi pemilihan ORM. Rekomendasi singkat:
286
- - **Drizzle ORM**: Untuk aplikasi edge-compatible dan sistem kritis performa.
287
- - **Prisma 6**: Untuk tim yang lebih menyukai DX schema-first dan tooling Studio yang kaya.
288
- - **TypeORM**: Hanya untuk proyek lama (legacy) berbasis NestJS.
289
-
290
- ### Prinsip Utama
291
-
292
- 1. **Selalu index foreign key** dan kolom yang digunakan di `WHERE`, `ORDER BY`, dan `JOIN`.
293
- 2. **Gunakan `EXPLAIN ANALYZE`** untuk mendeteksi sequential scan dan index yang hilang.
294
- 3. **Cursor-based pagination** lebih baik dari offset untuk dataset besar.
295
- 4. **Connection pooling**: Gunakan PgBouncer atau Supabase pooler bawaan.
296
- 5. **Hindari `SELECT *`**: Selalu pilih hanya kolom yang dibutuhkan.
297
- 6. **Batch insert**: Gunakan insert massal, bukan looping satu per satu.
298
-
299
- ### Prinsip Migrasi
300
-
301
- - Jangan gunakan `synchronize: true` di produksi (TypeORM).
302
- - Jangan jalankan `prisma db push` di produksi — selalu gunakan `prisma migrate deploy`.
303
- - Simpan file migrasi di version control.
304
- - Jalankan migrasi sebagai langkah terpisah sebelum deploy versi aplikasi baru.
5
+ ---
6
+
7
+ # Unified Database & ORM Expert
8
+
9
+ [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
10
+
11
+ ---
12
+
13
+ <a name="english"></a>
14
+ ## English
15
+
16
+ ### Description
17
+ Design schemas, select ORMs, execute zero-downtime migrations, optimize queries, and implement edge serverless databases. Covers Prisma 6, Drizzle ORM, TypeORM, Supabase CLI workflows, and Edge DBs (Neon, Cloudflare D1, Turso, Upstash).
18
+
19
+ ### Trigger Conditions
20
+ - Designing or migrating a production schema (blue-green, canary).
21
+ - Choosing between Prisma, Drizzle ORM, or TypeORM.
22
+ - Writing complex queries with joins, aggregations, or pagination.
23
+ - Optimizing slow queries or N+1 problems.
24
+ - Building edge-compatible serverless database connections.
25
+ - Executing Supabase migrations and RLS patterns.
26
+ - Managing backward-compatible massive data backfills.
27
+
28
+ ## Orchestration & Integration
29
+ - `js-backend-expert`: For Node/Bun/Deno backend implementations integrating these ORMs.
30
+ - `ci-cd-devops-architect`: For automated migration deployment steps.
31
+ - `supabase-security-expert`: For Supabase RLS and security.
32
+ - `cloud-hosting-expert`: For infrastructure integration.
33
+
34
+ ---
35
+
36
+ ### Core ORM & Query Strategies
37
+
38
+ #### ORM Selection Guide
39
+ | Criteria | Prisma 6 | Drizzle ORM | TypeORM |
40
+ |---|---|---|---|
41
+ | **Type Safety** | Schema-generated types | SQL-like, inferred types | Decorator-based |
42
+ | **Bundle Size** | Heavy (binary client) | Lightweight (<35KB) | Medium |
43
+ | **Query Style** | Fluent ORM API | SQL-first, composable | ActiveRecord / QueryBuilder |
44
+ | **Edge Runtime** | Prisma Accelerate needed | Native edge support | No |
45
+ | **Migrations** | `prisma migrate dev` | `drizzle-kit push/migrate` | `synchronize` (dev only) |
46
+
47
+ **Recommendation**: Use **Drizzle ORM** for edge-compatible apps and performance-critical systems. Use **Prisma 6** for teams preferring a schema-first DX.
48
+
49
+ #### Prisma 6 Best Practices
50
+ - Use `$transaction` for atomic operations.
51
+ - Avoid N+1 queries by using `select` and `include` (with Prisma 5.7+ relationJoins preview) rather than looping over `findMany`.
52
+
53
+ #### Drizzle ORM Best Practices
54
+ - Use `drizzle-kit generate` for generating SQL and `drizzle-kit migrate` for deployment.
55
+ - Utilize native edge support and type-safe query builders with `drizzle-orm`.
56
+
57
+ #### Query Optimization Principles
58
+ 1. **Always index foreign keys** and columns used in `WHERE`, `ORDER BY`, and `JOIN`.
59
+ 2. **Use `EXPLAIN ANALYZE`** to detect sequential scans.
60
+ 3. **Cursor-based pagination** over offset for large datasets.
61
+ 4. **Avoid `SELECT *`**. Batch inserts where possible.
62
+ 5. **Connection Pooling**: Use PgBouncer, Supabase's built-in pooler, or Prisma Accelerate for standard TCP to avoid exhausting connection limits. Alternatively, use HTTP/WebSocket drivers for edge queries.
63
+
64
+ ---
65
+
66
+ ### Zero-Downtime Migrations & Versioning
67
+
68
+ #### 1. Zero-Downtime Migration Pattern (Expand and Contract)
69
+ Never make breaking changes in a single deployment.
70
+ - **Phase 1 (Expand)**: Add the new schema element (column, table) without removing the old one.
71
+ - **Phase 2 (Migrate)**: Update app to write to *both* and read from the new element (with fallback).
72
+ - **Phase 3 (Backfill)**: Run background script to backfill data to new element.
73
+ - **Phase 4 (Contract)**: Remove old application code.
74
+ - **Phase 5 (Cleanup)**: Drop old schema element in next deployment.
75
+
76
+ #### 2. Backward Compatibility Rules
77
+ - **Never `DROP` or `RENAME`** a column/table in active use.
78
+ - **Add `DEFAULT` values** to new `NOT NULL` columns.
79
+
80
+ #### 3. Migration Mechanics & Safe Data Backfilling
81
+ - **Never run `prisma db push` or `synchronize: true`** in production. Always use immutable version-controlled scripts (e.g., `20260814_add_user_status.sql`).
82
+ - Write idempotent scripts (`CREATE TABLE IF NOT EXISTS`).
83
+ - **Chunking**: For large tables, perform updates in batches (using `LIMIT` and sleep intervals) to prevent table locking. Use background jobs (BullMQ/Inngest).
84
+
85
+ ---
86
+
87
+ ### Edge & Serverless Drivers
88
+
89
+ Exploit serverless DBs for ultra-low latency:
90
+ - **Neon & Cloudflare D1**: Serverless autoscaling Postgres with instant branching; Distributed edge SQLite.
91
+ - **Embedded Replicas**: Sync edge SQLite read-replicas with central cloud DBs.
92
+ - **HTTP/WebSocket Proxy Pooling**: Use `neon-http` or similar when querying databases from Edge Workers/Functions.
93
+ - **Upstash Redis Edge Caching**:
94
+ ```typescript
95
+ import { Redis } from '@upstash/redis';
96
+ const redis = new Redis({ url: process.env.UPSTASH_REDIS_REST_URL!, token: process.env.UPSTASH_REDIS_REST_TOKEN! });
97
+ export async function getCachedData(key: string) {
98
+ let data = await redis.get(key);
99
+ if (!data) {
100
+ data = await fetchFromDB();
101
+ await redis.set(key, data, { ex: 3600 });
102
+ }
103
+ return data;
104
+ }
105
+ ```
106
+
107
+ ---
108
+
109
+ ### Supabase CLI & MCP Workflow
110
+
111
+ 1. **Check Environment**: Ensure `supabase/migrations` directory exists.
112
+ 2. **Review Available MCP Commands**:
113
+ - List existing migrations: `mcp_supabase-mcp-server_list_migrations` with `project_id`.
114
+ - Confirm SQL before executing via server directly.
115
+ 3. **Execute Command**:
116
+ - Write SQL script locally: `npx supabase migration new [name]` -> writes to `supabase/migrations/<timestamp>_[name].sql`.
117
+ - Test locally: `npx supabase migration up` or `npx supabase db reset`.
118
+ - Apply remote: `npx supabase db push` (or use remote MCP `apply_migration`).
119
+ 4. **Final Step**: If using RLS, explicitly add policies to new tables. Confirm completion with user.
120
+
121
+ ---
122
+
123
+ <a name="bahasa-indonesia"></a>
124
+ ## Bahasa Indonesia
125
+
126
+ ### Deskripsi
127
+ Rancang skema, pilih ORM, eksekusi migrasi tanpa downtime, optimalkan query, dan implementasikan edge serverless DB. Mencakup Prisma 6, Drizzle, TypeORM, Supabase CLI, dan Edge DBs (Neon, Cloudflare D1, Turso, Upstash).
128
+
129
+ ### Kondisi Pemicu
130
+ - Merancang atau memigrasikan skema produksi (blue-green, canary).
131
+ - Memilih antara Prisma, Drizzle, atau TypeORM.
132
+ - Mengoptimalkan query lambat atau masalah N+1.
133
+ - Membuat koneksi serverless kompatibel dengan edge.
134
+ - Mengeksekusi migrasi Supabase dan pola RLS.
135
+ - Mengelola backfill data besar secara backward-compatible.
136
+
137
+ ## Integrasi Orkestrasi
138
+ - `js-backend-expert`: Untuk implementasi Node/Bun/Deno.
139
+ - `ci-cd-devops-architect`: Untuk otomatisasi langkah deployment migrasi.
140
+ - `supabase-security-expert`: Untuk RLS dan keamanan Supabase.
141
+ - `cloud-hosting-expert`: Untuk integrasi infrastruktur.
142
+
143
+ ### Strategi Inti ORM & Query
144
+ - **Drizzle ORM** direkomendasikan untuk aplikasi edge, **Prisma 6** untuk DX schema-first.
145
+ - Gunakan `$transaction` dan batasi `SELECT *`.
146
+ - Selalu indeks foreign key dan gunakan pagination berbasis cursor (Cursor-based pagination).
147
+ - **Connection Pooling**: Gunakan pooler bawaan Supabase, PgBouncer, Prisma Accelerate, atau driver HTTP (seperti `neon-http`) untuk request edge.
148
+
149
+ ### Migrasi Tanpa Downtime & Versioning
150
+ - **Pola Expand and Contract**: Jangan pernah melakukan breaking change dalam satu rilis. Tambah kolom baru, update kode untuk memakai keduanya, backfill data, hapus kode lama, lalu drop kolom lama.
151
+ - Jangan gunakan `DROP` atau `RENAME` pada kolom aktif. Kolom `NOT NULL` baru harus memiliki nilai `DEFAULT`.
152
+ - **Jangan jalankan `prisma db push` atau `synchronize: true`** di produksi. Gunakan skrip migrasi bertahap (idempoten).
153
+ - **Backfill Aman**: Gunakan pemrosesan batch/chunking dengan background job untuk tabel raksasa agar tidak menyebabkan table lock.
154
+
155
+ ### Driver Edge & Serverless
156
+ - Manfaatkan Neon Serverless Postgres, Cloudflare D1, Turso, atau Upstash Redis (caching).
157
+ - Gunakan driver berbasis HTTP/WebSocket di lingkungan Edge Workers untuk mencegah habisnya batas koneksi TCP.
158
+
159
+ ### Alur Kerja Supabase CLI & MCP
160
+ 1. Pastikan folder `supabase/migrations` ada.
161
+ 2. Periksa migrasi dengan `mcp_supabase-mcp-server_list_migrations`.
162
+ 3. Buat file migrasi lokal dengan `npx supabase migration new [nama]`.
163
+ 4. Uji lokal dengan `npx supabase migration up`.
164
+ 5. Deploy remote dengan `npx supabase db push` atau melalui MCP.
165
+ 6. Tambahkan kebijakan RLS jika diperlukan. Konfirmasikan sukses ke pengguna.
@@ -0,0 +1,136 @@
1
+ ---
2
+ name: deep-research-analyst
3
+ description: "Expert guide for autonomous deep research, iterative web search, citation verification, evidence graph synthesis, and hallucination mitigation / Panduan ahli riset mendalam otonom, pencarian web iteratif, verifikasi sitasi, dan mitigasi halusinasi."
4
+ author: vibes-plug-swarm
5
+ ---
6
+
7
+ # Deep Research Analyst (2026 Autonomous Research Edition)
8
+
9
+ [English](#english) | [Bahasa Indonesia](#bahasa-indonesia)
10
+
11
+ ---
12
+
13
+ <a name="english"></a>
14
+ ## English
15
+
16
+ ### Orchestration & Integration
17
+ Connects and orchestrates with relevant domain skills like `brainstorming`, `prd-architect`, `web-scraper`, `browser-automation-expert`, `project-context-mapper`, and `multi-agent-orchestration` to form an evidence-backed intelligence swarm.
18
+
19
+ ### Description
20
+ Production guide for architecting and executing autonomous **Deep Research** pipelines. Unlike simple one-shot retrieval (RAG), Deep Research operates as a goal-directed autonomous loop: decomposing queries into multi-perspective sub-questions, crawling and scraping academic/technical sources, scoring source credibility, cross-verifying facts across multiple independent citations, constructing an evidence graph, and synthesizing comprehensive, citation-grounded intelligence briefs.
21
+
22
+ **Swarm Synergy:** Within the **Fan-Out / Fan-In Research Swarm**, this skill acts as the Lead Intelligence Subagent. It is deployed in Phase 1 (Discovery & PRD) to gather ground truth, audit competitor architectures, and resolve high-risk technical unknowns before code is written.
23
+
24
+ ### Trigger Conditions
25
+ - Requiring deep, multi-source investigation before architectural decision-making.
26
+ - Benchmarking libraries, database engines, or cloud architectures with empirical data.
27
+ - Building autonomous research agents, competitive intelligence scrapers, or literature synthesis tools.
28
+ - Eliminating LLM hallucinations in high-stakes technical or business documentation.
29
+ - Synthesizing complex multi-page web information into structured, cited intelligence reports.
30
+
31
+ ### Deep Research Operational Workflow
32
+
33
+ ```
34
+ 1. QUERY DECOMPOSITION & HYPOTHESIS FORMULATION
35
+ [User Objective] ──► [Query Expander] ──┬──► Sub-query A (Technical Specs)
36
+ ├──► Sub-query B (Benchmarks & Limitations)
37
+ └──► Sub-query C (Community Issues & Regressions)
38
+
39
+ 2. RECURSIVE SOURCE DISCOVERY & CRAWLING
40
+ [Sub-queries] ──► [Crawl4AI / Firecrawl / SerpAPI] ──► Raw Markdown / HTML Sources
41
+
42
+ 3. SOURCE CREDIBILITY & FACT TRIANGULATION
43
+ Raw Documents ──► [Evidence Evaluator] ──► Triangulate Facts (>= 2 Independent Sources)
44
+ ──► Discard Low-Trust / SEO-Spam Content
45
+
46
+ 4. EVIDENCE GRAPH SYNTHESIS & REPORTING
47
+ Verified Facts ──► [Synthesizer Node] ──► Structured Report with Clickable Markdown Citations
48
+ ```
49
+
50
+ ### Core Implementation Guidelines
51
+
52
+ #### 1. Recursive Query Decomposer (Python / TypeScript)
53
+ Break high-level user requests into diverse search vectors targeting technical documentation, GitHub issues, and benchmarks:
54
+ ```typescript
55
+ import { generateObject } from 'ai';
56
+ import { z } from 'zod';
57
+
58
+ interface ResearchPlan {
59
+ coreObjective: string;
60
+ subQueries: Array<{
61
+ query: string;
62
+ focus: 'architecture' | 'benchmarks' | 'security' | 'pitfalls';
63
+ expectedSourceType: 'docs' | 'github_repo' | 'benchmark_paper';
64
+ }>;
65
+ }
66
+
67
+ export async function decomposeResearchQuery(userPrompt: string): Promise<ResearchPlan> {
68
+ const { object } = await generateObject({
69
+ model: customModel('gemini-3.8-flash'),
70
+ schema: z.object({
71
+ coreObjective: z.string(),
72
+ subQueries: z.array(z.object({
73
+ query: z.string().describe('Precise keyword search query with technical operators'),
74
+ focus: z.enum(['architecture', 'benchmarks', 'security', 'pitfalls']),
75
+ expectedSourceType: z.enum(['docs', 'github_repo', 'benchmark_paper']),
76
+ })).min(3).max(6),
77
+ }),
78
+ prompt: `Analyze the following research objective and decompose it into 4-6 targeted, non-overlapping search vectors: "${userPrompt}"`,
79
+ });
80
+
81
+ return object;
82
+ }
83
+ ```
84
+
85
+ #### 2. Source Credibility & Fact Triangulation Protocol
86
+ Never accept a claim from a single unverified blog post. Require citation triangulation:
87
+ - **Tier 1 (Highest Confidence):** Official documentation, source code repositories, peer-reviewed benchmarks, RFCs.
88
+ - **Tier 2 (Medium Confidence):** Production engineering blogs (Uber, Netflix, Cloudflare), maintainer posts.
89
+ - **Tier 3 (Verify Required):** Forum discussions, social threads, unverified community tutorials.
90
+ - **Rule of Triangulation:** Any non-trivial technical claim must be confirmed by at least two independent sources or verified against raw benchmark code.
91
+
92
+ #### 3. Structured Evidence Graph Output
93
+ Every research brief produced by this skill must adhere to the following markdown template:
94
+ ```markdown
95
+ # [Topic] — Deep Research & Evidence Dossier
96
+
97
+ ## Executive Summary
98
+ - Concise 3-5 bullet takeaway synthesis.
99
+
100
+ ## Evidence Matrix
101
+ | Technical Claim | Verified Status | Confidence (0-100%) | Primary Source | Corroborating Source |
102
+ |---|---|---|---|---|
103
+ | Claim Description | Confirmed / Disputed | 95% | [Source A](url) | [Source B](url) |
104
+
105
+ ## Trade-off Analysis & Key Risks
106
+ - Concrete architectural trade-offs, cold-start latencies, memory footprint, or pricing cliff.
107
+
108
+ ## Recommended Architectural Decision
109
+ - Prescriptive guidance for implementation swarms with justification.
110
+ ```
111
+
112
+ ---
113
+
114
+ <a name="bahasa-indonesia"></a>
115
+ ## Bahasa Indonesia
116
+
117
+ ### Integrasi Orkestrasi
118
+ Terhubung dan mengorkestrasi skill domain yang relevan seperti `brainstorming`, `prd-architect`, `web-scraper`, `browser-automation-expert`, `project-context-mapper`, dan `multi-agent-orchestration` untuk membentuk swarm intelijen berbasis bukti empiris.
119
+
120
+ ### Deskripsi
121
+ Panduan produksi untuk merancang dan mengeksekusi pipeline **Riset Mendalam Otonom (Deep Research)**. Berbeda dari retrieval sederhana (RAG satu langkah), Deep Research beroperasi sebagai siklus otonom terarah: memecah pertanyaan menjadi sub-vektor dari berbagai sudut pandang, merayapi dan mengekstrak sumber teknis/akademis, menilai kredibilitas sumber, memvalidasi silang fakta (*fact triangulation*) di minimal 2 sumber independen, membangun graf bukti, dan menyusun laporan intelijen komprehensif berlandaskan sitasi yang valid.
122
+
123
+ **Sinergi Swarm:** Dalam topologi **Fan-Out / Fan-In Research Swarm**, skill ini berperan sebagai Sub-agen Analis Utama. Diterapkan pada Fase 1 (Discovery & PRD) untuk mengumpulkan fakta objektif, mengaudit arsitektur kompetitor, dan mengeliminasi ketidakpastian teknis berisiko tinggi sebelum penulisan kode dimulai.
124
+
125
+ ### Kondisi Pemicu
126
+ - Membutuhkan penyelidikan multi-sumber yang mendalam sebelum membuat keputusan arsitektur.
127
+ - Melakukan benchmark komparatif library, database engine, atau infrastruktur cloud berbasis data empiris.
128
+ - Membangun agen riset otonom, alat pemantau kompetitor, atau sintesis literatur otomatis.
129
+ - Mengeliminasi halusinasi LLM pada dokumen teknis atau strategi bisnis berisiko tinggi.
130
+ - Merangkum informasi web yang rumit dan tersebar menjadi dokumen ringkasan terstruktur dengan sitasi klik langsung.
131
+
132
+ ### Protokol Triangulasi Fakta & Skor Keyakinan
133
+ 1. **Tier 1 (Otoritatif):** Dokumentasi resmi, repositori kode sumber terbuka, RFC/spesifikasi teknis, laporan audit resmi.
134
+ 2. **Tier 2 (Dapat Diandalkan):** Blog teknik produksi resmi (Netflix, Cloudflare, Uber), analisis tim pengembang inti.
135
+ 3. **Tier 3 (Perlu Verifikasi Lanjutan):** Thread diskusi komunitas, tutorial umum.
136
+ 4. **Aturan Triangulasi:** Setiap klaim teknis penting wajib diverifikasi silang oleh sekurang-kurangnya 2 sumber independen sebelum dimasukkan ke dalam blueprint arsitektur.