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.
- package/.cursor/rules/vibes-plug-core.mdc +3 -3
- package/.cursorrules +3 -3
- package/AGENTS.md +4 -4
- package/BLUEPRINT.md +16 -6
- package/CHANGELOG.md +37 -0
- package/CLAUDE.md +8 -8
- package/README.md +85 -115
- package/index.js +1 -1
- package/package.json +2 -2
- package/plugin.json +2 -2
- package/scripts/check-anti-slop.js +53 -0
- package/scripts/generate_swarm_gif.py +2 -2
- package/skills/ai-llm-integration-expert/SKILL.md +22 -15
- package/skills/ai-prompt-engineering-expert/SKILL.md +133 -83
- package/skills/anti-slop/SKILL.md +133 -0
- package/skills/async-queue-temporal-expert/SKILL.md +135 -158
- package/skills/authentication-identity-expert/SKILL.md +172 -278
- package/skills/brainstorming/SKILL.md +26 -26
- package/skills/database-orm-expert/SKILL.md +164 -303
- package/skills/deep-research-analyst/SKILL.md +136 -0
- package/skills/design-system-architect/SKILL.md +31 -1
- package/skills/email-notification-expert/SKILL.md +31 -4
- package/skills/error-resilience-expert/SKILL.md +21 -0
- package/skills/fullstack-expert/SKILL.md +183 -260
- package/skills/glsl-shader-expert/SKILL.md +190 -107
- package/skills/graph-rag-knowledge-expert/SKILL.md +42 -1
- package/skills/mcp-server-architect/SKILL.md +15 -1
- package/skills/prd-architect/SKILL.md +181 -206
- package/skills/production-ready-hardener/SKILL.md +16 -19
- package/skills/pwa-offline-first-expert/SKILL.md +42 -1
- package/skills/pydantic-ai-expert/SKILL.md +161 -0
- package/skills/saas-architect/SKILL.md +154 -0
- package/skills/senior-frontend/SKILL.md +9 -11
- package/skills/senior-frontend/scripts/frontend_scaffolder.py +1 -1
- package/skills/session-memory-manager/SKILL.md +128 -0
- package/skills/synthetic-data-finetuning-expert/SKILL.md +155 -0
- package/skills/ui-ux-pro-max/SKILL.md +4 -2
- package/skills/vercel-ai-sdk-expert/SKILL.md +181 -0
- package/skills/voice-ai-realtime-agent/SKILL.md +41 -1
- package/skills/web-3d-graphics-expert/SKILL.md +313 -137
- package/skills/web-game-engine-expert/SKILL.md +329 -102
- package/skills/webxr-ar-vr-expert/SKILL.md +162 -123
- package/skills/zero-to-prod-orchestrator/SKILL.md +26 -24
- package/skills/ai-cost-token-optimizer/SKILL.md +0 -82
- package/skills/ai-evals-benchmark-expert/SKILL.md +0 -188
- package/skills/asisten-ramah/SKILL.md +0 -47
- package/skills/auto-doc-updater/SKILL.md +0 -220
- package/skills/autonomous-chaos-monkey/SKILL.md +0 -63
- package/skills/background-jobs-queue-expert/SKILL.md +0 -235
- package/skills/database-migration-versioning-expert/SKILL.md +0 -90
- package/skills/edge-serverless-db-expert/SKILL.md +0 -99
- package/skills/mcp-client-orchestrator/SKILL.md +0 -76
- package/skills/mobile-push-notification-expert/SKILL.md +0 -71
- package/skills/monday-design-aesthetic/SKILL.md +0 -73
- package/skills/project-context-mapper/SKILL.md +0 -85
- package/skills/saas-mvp-launcher/SKILL.md +0 -260
- package/skills/saas-transformer/SKILL.md +0 -500
- package/skills/saas-transformer/references/billing_integration_guide.md +0 -401
- package/skills/self-evolving-memory-graph/SKILL.md +0 -91
- package/skills/session-context-loader/SKILL.md +0 -83
- package/skills/session-handoff-resume/SKILL.md +0 -164
- package/skills/skill-baru/SKILL.md +0 -178
- package/skills/supabase-migration/SKILL.md +0 -91
- package/skills/token-saver/SKILL.md +0 -119
- package/skills/ui-components-expert/SKILL.md +0 -166
- package/skills/vibe-code-gardener/SKILL.md +0 -181
- /package/skills/{saas-transformer → saas-architect}/references/feature_gating_patterns.md +0 -0
- /package/skills/{saas-transformer → saas-architect}/references/saas_transformation_checklist.md +0 -0
- /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: "
|
|
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
|
|
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
|
|
18
|
-
|
|
19
|
-
### Trigger Conditions
|
|
20
|
-
- Designing or migrating a
|
|
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
|
-
-
|
|
25
|
-
-
|
|
26
|
-
-
|
|
27
|
-
|
|
28
|
-
## Orchestration & Integration
|
|
29
|
-
- `js-backend-expert`: For Node/Bun/Deno backend implementations integrating these ORMs.
|
|
30
|
-
- `
|
|
31
|
-
- `
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
| **
|
|
42
|
-
| **
|
|
43
|
-
| **
|
|
44
|
-
| **
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
]
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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.
|