vibesuite 1.3.3 → 2.0.2

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 (75) hide show
  1. package/README.md +75 -6
  2. package/assets/.agent/skills/avoid-feature-creep/SKILL.md +307 -0
  3. package/assets/.agent/skills/avoid-feature-creep/agents/openai.yaml +3 -0
  4. package/assets/.agent/skills/avoid-feature-creep/assets/large-logo.png +0 -0
  5. package/assets/.agent/skills/avoid-feature-creep/assets/small-logo.svg +17 -0
  6. package/assets/.agent/skills/convex/SKILL.md +62 -0
  7. package/assets/.agent/skills/convex/agents/openai.yaml +3 -0
  8. package/assets/.agent/skills/convex/assets/large-logo.png +0 -0
  9. package/assets/.agent/skills/convex/assets/small-logo.svg +17 -0
  10. package/assets/.agent/skills/convex-agents/SKILL.md +516 -0
  11. package/assets/.agent/skills/convex-agents/agents/openai.yaml +3 -0
  12. package/assets/.agent/skills/convex-agents/assets/large-logo.png +0 -0
  13. package/assets/.agent/skills/convex-agents/assets/small-logo.svg +17 -0
  14. package/assets/.agent/skills/convex-best-practices/SKILL.md +369 -0
  15. package/assets/.agent/skills/convex-best-practices/agents/openai.yaml +3 -0
  16. package/assets/.agent/skills/convex-best-practices/assets/large-logo.png +0 -0
  17. package/assets/.agent/skills/convex-best-practices/assets/small-logo.svg +17 -0
  18. package/assets/.agent/skills/convex-component-authoring/SKILL.md +457 -0
  19. package/assets/.agent/skills/convex-component-authoring/agents/openai.yaml +3 -0
  20. package/assets/.agent/skills/convex-component-authoring/assets/large-logo.png +0 -0
  21. package/assets/.agent/skills/convex-component-authoring/assets/small-logo.svg +17 -0
  22. package/assets/.agent/skills/convex-cron-jobs/SKILL.md +604 -0
  23. package/assets/.agent/skills/convex-cron-jobs/agents/openai.yaml +3 -0
  24. package/assets/.agent/skills/convex-cron-jobs/assets/large-logo.png +0 -0
  25. package/assets/.agent/skills/convex-cron-jobs/assets/small-logo.svg +17 -0
  26. package/assets/.agent/skills/convex-file-storage/SKILL.md +467 -0
  27. package/assets/.agent/skills/convex-file-storage/agents/openai.yaml +3 -0
  28. package/assets/.agent/skills/convex-file-storage/assets/large-logo.png +0 -0
  29. package/assets/.agent/skills/convex-file-storage/assets/small-logo.svg +17 -0
  30. package/assets/.agent/skills/convex-functions/SKILL.md +458 -0
  31. package/assets/.agent/skills/convex-functions/agents/openai.yaml +3 -0
  32. package/assets/.agent/skills/convex-functions/assets/large-logo.png +0 -0
  33. package/assets/.agent/skills/convex-functions/assets/small-logo.svg +17 -0
  34. package/assets/.agent/skills/convex-http-actions/SKILL.md +733 -0
  35. package/assets/.agent/skills/convex-http-actions/agents/openai.yaml +3 -0
  36. package/assets/.agent/skills/convex-http-actions/assets/large-logo.png +0 -0
  37. package/assets/.agent/skills/convex-http-actions/assets/small-logo.svg +17 -0
  38. package/assets/.agent/skills/convex-migrations/SKILL.md +712 -0
  39. package/assets/.agent/skills/convex-migrations/agents/openai.yaml +3 -0
  40. package/assets/.agent/skills/convex-migrations/assets/large-logo.png +0 -0
  41. package/assets/.agent/skills/convex-migrations/assets/small-logo.svg +17 -0
  42. package/assets/.agent/skills/convex-realtime/SKILL.md +443 -0
  43. package/assets/.agent/skills/convex-realtime/agents/openai.yaml +3 -0
  44. package/assets/.agent/skills/convex-realtime/assets/large-logo.png +0 -0
  45. package/assets/.agent/skills/convex-realtime/assets/small-logo.svg +17 -0
  46. package/assets/.agent/skills/convex-schema-validator/SKILL.md +400 -0
  47. package/assets/.agent/skills/convex-schema-validator/agents/openai.yaml +3 -0
  48. package/assets/.agent/skills/convex-schema-validator/assets/large-logo.png +0 -0
  49. package/assets/.agent/skills/convex-schema-validator/assets/small-logo.svg +17 -0
  50. package/assets/.agent/skills/convex-security-audit/SKILL.md +539 -0
  51. package/assets/.agent/skills/convex-security-audit/agents/openai.yaml +3 -0
  52. package/assets/.agent/skills/convex-security-audit/assets/large-logo.png +0 -0
  53. package/assets/.agent/skills/convex-security-audit/assets/small-logo.svg +17 -0
  54. package/assets/.agent/skills/convex-security-check/SKILL.md +378 -0
  55. package/assets/.agent/skills/convex-security-check/agents/openai.yaml +3 -0
  56. package/assets/.agent/skills/convex-security-check/assets/large-logo.png +0 -0
  57. package/assets/.agent/skills/convex-security-check/assets/small-logo.svg +17 -0
  58. package/assets/.agent/skills/github-ops/SKILL.md +4 -4
  59. package/assets/.agent/skills/google-trends/SKILL.md +7 -7
  60. package/assets/.agent/skills/optimize-agent-context/SKILL.md +97 -0
  61. package/assets/.agent/skills/youtube-pipeline/SKILL.md +10 -10
  62. package/assets/.agent/workflows/LEGACY/init_smart_ops.md +2 -2
  63. package/assets/.agent/workflows/agent_reset.md +4 -6
  64. package/assets/.agent/workflows/mode-orchestrator.md +17 -22
  65. package/assets/.agent/workflows/mode-visionary.md +3 -10
  66. package/assets/.agent/workflows/optimize-agent-context.md +54 -0
  67. package/assets/.agent/workflows/remotion-build.md +17 -17
  68. package/assets/.agent/workflows/stitch.md +4 -4
  69. package/assets/VibeCode-Agents/vibe-orchestrator.yaml +14 -33
  70. package/assets/VibeCode-Agents/vibe-visionary.yaml +3 -13
  71. package/package.json +1 -1
  72. package/src/cli.js +416 -20
  73. package/src/harness.js +281 -0
  74. package/src/store.js +239 -0
  75. package/assets/VibeCode-Agents/custom_modes.yaml +0 -979
@@ -0,0 +1,369 @@
1
+ ---
2
+ name: convex-best-practices
3
+ description: Guidelines for building production-ready Convex apps covering function organization, query patterns, validation, TypeScript usage, error handling, and the Zen of Convex design philosophy
4
+ ---
5
+
6
+ # Convex Best Practices
7
+
8
+ Build production-ready Convex applications by following established patterns for function organization, query optimization, validation, TypeScript usage, and error handling.
9
+
10
+ ## Code Quality
11
+
12
+ All patterns in this skill comply with `@convex-dev/eslint-plugin`. Install it for build-time validation:
13
+
14
+ ```bash
15
+ npm i @convex-dev/eslint-plugin --save-dev
16
+ ```
17
+
18
+ ```js
19
+ // eslint.config.js
20
+ import { defineConfig } from "eslint/config";
21
+ import convexPlugin from "@convex-dev/eslint-plugin";
22
+
23
+ export default defineConfig([
24
+ ...convexPlugin.configs.recommended,
25
+ ]);
26
+ ```
27
+
28
+ The plugin enforces four rules:
29
+
30
+ | Rule | What it enforces |
31
+ | ----------------------------------- | --------------------------------- |
32
+ | `no-old-registered-function-syntax` | Object syntax with `handler` |
33
+ | `require-argument-validators` | `args: {}` on all functions |
34
+ | `explicit-table-ids` | Table name in db operations |
35
+ | `import-wrong-runtime` | No Node imports in Convex runtime |
36
+
37
+ Docs: https://docs.convex.dev/eslint
38
+
39
+ ## Documentation Sources
40
+
41
+ Before implementing, do not assume; fetch the latest documentation:
42
+
43
+ - Primary: https://docs.convex.dev/understanding/best-practices/
44
+ - Error Handling: https://docs.convex.dev/functions/error-handling
45
+ - Write Conflicts: https://docs.convex.dev/error#1
46
+ - For broader context: https://docs.convex.dev/llms.txt
47
+
48
+ ## Instructions
49
+
50
+ ### The Zen of Convex
51
+
52
+ 1. **Convex manages the hard parts** - Let Convex handle caching, real-time sync, and consistency
53
+ 2. **Functions are the API** - Design your functions as your application's interface
54
+ 3. **Schema is truth** - Define your data model explicitly in schema.ts
55
+ 4. **TypeScript everywhere** - Leverage end-to-end type safety
56
+ 5. **Queries are reactive** - Think in terms of subscriptions, not requests
57
+
58
+ ### Function Organization
59
+
60
+ Organize your Convex functions by domain:
61
+
62
+ ```typescript
63
+ // convex/users.ts - User-related functions
64
+ import { query, mutation } from "./_generated/server";
65
+ import { v } from "convex/values";
66
+
67
+ export const get = query({
68
+ args: { userId: v.id("users") },
69
+ returns: v.union(
70
+ v.object({
71
+ _id: v.id("users"),
72
+ _creationTime: v.number(),
73
+ name: v.string(),
74
+ email: v.string(),
75
+ }),
76
+ v.null(),
77
+ ),
78
+ handler: async (ctx, args) => {
79
+ return await ctx.db.get("users", args.userId);
80
+ },
81
+ });
82
+ ```
83
+
84
+ ### Argument and Return Validation
85
+
86
+ Always define validators for arguments AND return types:
87
+
88
+ ```typescript
89
+ export const createTask = mutation({
90
+ args: {
91
+ title: v.string(),
92
+ description: v.optional(v.string()),
93
+ priority: v.union(v.literal("low"), v.literal("medium"), v.literal("high")),
94
+ },
95
+ returns: v.id("tasks"),
96
+ handler: async (ctx, args) => {
97
+ return await ctx.db.insert("tasks", {
98
+ title: args.title,
99
+ description: args.description,
100
+ priority: args.priority,
101
+ completed: false,
102
+ createdAt: Date.now(),
103
+ });
104
+ },
105
+ });
106
+ ```
107
+
108
+ ### Query Patterns
109
+
110
+ Use indexes instead of filters for efficient queries:
111
+
112
+ ```typescript
113
+ // Schema with index
114
+ export default defineSchema({
115
+ tasks: defineTable({
116
+ userId: v.id("users"),
117
+ status: v.string(),
118
+ createdAt: v.number(),
119
+ })
120
+ .index("by_user", ["userId"])
121
+ .index("by_user_and_status", ["userId", "status"]),
122
+ });
123
+
124
+ // Query using index
125
+ export const getTasksByUser = query({
126
+ args: { userId: v.id("users") },
127
+ returns: v.array(
128
+ v.object({
129
+ _id: v.id("tasks"),
130
+ _creationTime: v.number(),
131
+ userId: v.id("users"),
132
+ status: v.string(),
133
+ createdAt: v.number(),
134
+ }),
135
+ ),
136
+ handler: async (ctx, args) => {
137
+ return await ctx.db
138
+ .query("tasks")
139
+ .withIndex("by_user", (q) => q.eq("userId", args.userId))
140
+ .order("desc")
141
+ .collect();
142
+ },
143
+ });
144
+ ```
145
+
146
+ ### Error Handling
147
+
148
+ Use ConvexError for user-facing errors:
149
+
150
+ ```typescript
151
+ import { ConvexError } from "convex/values";
152
+
153
+ export const updateTask = mutation({
154
+ args: {
155
+ taskId: v.id("tasks"),
156
+ title: v.string(),
157
+ },
158
+ returns: v.null(),
159
+ handler: async (ctx, args) => {
160
+ const task = await ctx.db.get("tasks", args.taskId);
161
+
162
+ if (!task) {
163
+ throw new ConvexError({
164
+ code: "NOT_FOUND",
165
+ message: "Task not found",
166
+ });
167
+ }
168
+
169
+ await ctx.db.patch("tasks", args.taskId, { title: args.title });
170
+ return null;
171
+ },
172
+ });
173
+ ```
174
+
175
+ ### Avoiding Write Conflicts (Optimistic Concurrency Control)
176
+
177
+ Convex uses OCC. Follow these patterns to minimize conflicts:
178
+
179
+ ```typescript
180
+ // GOOD: Make mutations idempotent
181
+ export const completeTask = mutation({
182
+ args: { taskId: v.id("tasks") },
183
+ returns: v.null(),
184
+ handler: async (ctx, args) => {
185
+ const task = await ctx.db.get("tasks", args.taskId);
186
+
187
+ // Early return if already complete (idempotent)
188
+ if (!task || task.status === "completed") {
189
+ return null;
190
+ }
191
+
192
+ await ctx.db.patch("tasks", args.taskId, {
193
+ status: "completed",
194
+ completedAt: Date.now(),
195
+ });
196
+ return null;
197
+ },
198
+ });
199
+
200
+ // GOOD: Patch directly without reading first when possible
201
+ export const updateNote = mutation({
202
+ args: { id: v.id("notes"), content: v.string() },
203
+ returns: v.null(),
204
+ handler: async (ctx, args) => {
205
+ // Patch directly - ctx.db.patch throws if document doesn't exist
206
+ await ctx.db.patch("notes", args.id, { content: args.content });
207
+ return null;
208
+ },
209
+ });
210
+
211
+ // GOOD: Use Promise.all for parallel independent updates
212
+ export const reorderItems = mutation({
213
+ args: { itemIds: v.array(v.id("items")) },
214
+ returns: v.null(),
215
+ handler: async (ctx, args) => {
216
+ const updates = args.itemIds.map((id, index) =>
217
+ ctx.db.patch("items", id, { order: index }),
218
+ );
219
+ await Promise.all(updates);
220
+ return null;
221
+ },
222
+ });
223
+ ```
224
+
225
+ ### TypeScript Best Practices
226
+
227
+ ```typescript
228
+ import { Id, Doc } from "./_generated/dataModel";
229
+
230
+ // Use Id type for document references
231
+ type UserId = Id<"users">;
232
+
233
+ // Use Doc type for full documents
234
+ type User = Doc<"users">;
235
+
236
+ // Define Record types properly
237
+ const userScores: Record<Id<"users">, number> = {};
238
+ ```
239
+
240
+ ### Internal vs Public Functions
241
+
242
+ ```typescript
243
+ // Public function - exposed to clients
244
+ export const getUser = query({
245
+ args: { userId: v.id("users") },
246
+ returns: v.union(
247
+ v.null(),
248
+ v.object({
249
+ /* ... */
250
+ }),
251
+ ),
252
+ handler: async (ctx, args) => {
253
+ // ...
254
+ },
255
+ });
256
+
257
+ // Internal function - only callable from other Convex functions
258
+ export const _updateUserStats = internalMutation({
259
+ args: { userId: v.id("users") },
260
+ returns: v.null(),
261
+ handler: async (ctx, args) => {
262
+ // ...
263
+ },
264
+ });
265
+ ```
266
+
267
+ ## Examples
268
+
269
+ ### Complete CRUD Pattern
270
+
271
+ ```typescript
272
+ // convex/tasks.ts
273
+ import { query, mutation } from "./_generated/server";
274
+ import { v } from "convex/values";
275
+ import { ConvexError } from "convex/values";
276
+
277
+ const taskValidator = v.object({
278
+ _id: v.id("tasks"),
279
+ _creationTime: v.number(),
280
+ title: v.string(),
281
+ completed: v.boolean(),
282
+ userId: v.id("users"),
283
+ });
284
+
285
+ export const list = query({
286
+ args: { userId: v.id("users") },
287
+ returns: v.array(taskValidator),
288
+ handler: async (ctx, args) => {
289
+ return await ctx.db
290
+ .query("tasks")
291
+ .withIndex("by_user", (q) => q.eq("userId", args.userId))
292
+ .collect();
293
+ },
294
+ });
295
+
296
+ export const create = mutation({
297
+ args: {
298
+ title: v.string(),
299
+ userId: v.id("users"),
300
+ },
301
+ returns: v.id("tasks"),
302
+ handler: async (ctx, args) => {
303
+ return await ctx.db.insert("tasks", {
304
+ title: args.title,
305
+ completed: false,
306
+ userId: args.userId,
307
+ });
308
+ },
309
+ });
310
+
311
+ export const update = mutation({
312
+ args: {
313
+ taskId: v.id("tasks"),
314
+ title: v.optional(v.string()),
315
+ completed: v.optional(v.boolean()),
316
+ },
317
+ returns: v.null(),
318
+ handler: async (ctx, args) => {
319
+ const { taskId, ...updates } = args;
320
+
321
+ // Remove undefined values
322
+ const cleanUpdates = Object.fromEntries(
323
+ Object.entries(updates).filter(([_, v]) => v !== undefined),
324
+ );
325
+
326
+ if (Object.keys(cleanUpdates).length > 0) {
327
+ await ctx.db.patch("tasks", taskId, cleanUpdates);
328
+ }
329
+ return null;
330
+ },
331
+ });
332
+
333
+ export const remove = mutation({
334
+ args: { taskId: v.id("tasks") },
335
+ returns: v.null(),
336
+ handler: async (ctx, args) => {
337
+ await ctx.db.delete("tasks", args.taskId);
338
+ return null;
339
+ },
340
+ });
341
+ ```
342
+
343
+ ## Best Practices
344
+
345
+ - Never run `npx convex deploy` unless explicitly instructed
346
+ - Never run any git commands unless explicitly instructed
347
+ - Always define return validators for functions
348
+ - Use indexes for all queries that filter data
349
+ - Make mutations idempotent to handle retries gracefully
350
+ - Use ConvexError for user-facing error messages
351
+ - Organize functions by domain (users.ts, tasks.ts, etc.)
352
+ - Use internal functions for sensitive operations
353
+ - Leverage TypeScript's Id and Doc types
354
+
355
+ ## Common Pitfalls
356
+
357
+ 1. **Using filter instead of withIndex** - Always define indexes and use withIndex
358
+ 2. **Missing return validators** - Always specify the returns field
359
+ 3. **Non-idempotent mutations** - Check current state before updating
360
+ 4. **Reading before patching unnecessarily** - Patch directly when possible
361
+ 5. **Not handling null returns** - Document IDs might not exist
362
+
363
+ ## References
364
+
365
+ - Convex Documentation: https://docs.convex.dev/
366
+ - Convex LLMs.txt: https://docs.convex.dev/llms.txt
367
+ - Best Practices: https://docs.convex.dev/understanding/best-practices/
368
+ - Error Handling: https://docs.convex.dev/functions/error-handling
369
+ - Write Conflicts: https://docs.convex.dev/error#1
@@ -0,0 +1,3 @@
1
+ interface:
2
+ icon_small: "./assets/small-logo.svg"
3
+ icon_large: "./assets/large-logo.png"
@@ -0,0 +1,17 @@
1
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g clip-path="url(#clip0_3_23)">
3
+ <g clip-path="url(#clip1_3_23)">
4
+ <path d="M10.0643 12.5735C12.3769 12.3166 14.5572 11.0843 15.7577 9.02756C15.1892 14.1148 9.62646 17.3302 5.08583 15.356C4.66743 15.1746 4.30728 14.8728 4.06013 14.4848C3.03973 12.8825 2.7043 10.8437 3.18626 8.99344C4.56327 11.37 7.3632 12.8267 10.0643 12.5735Z" fill="#F3B01C"/>
5
+ <path d="M3.1018 7.50072C2.16436 9.66714 2.12376 12.2034 3.27303 14.2907C-0.771507 11.2479 -0.72737 4.7362 3.2236 1.72378C3.58904 1.44535 4.02333 1.2801 4.47881 1.25494C6.3519 1.15614 8.25501 1.88006 9.58963 3.22909C6.87799 3.25604 4.23695 4.99308 3.1018 7.50072Z" fill="#8D2676"/>
6
+ <path d="M10.8974 3.89562C9.52924 1.98794 7.38779 0.68921 5.04156 0.649695C9.57686 -1.40888 15.1555 1.92867 15.7629 6.86314C15.8194 7.32119 15.7452 7.78824 15.5421 8.20138C14.6948 9.92223 13.1236 11.2569 11.2876 11.7508C12.6328 9.25579 12.4668 6.20748 10.8974 3.89562Z" fill="#EE342F"/>
7
+ </g>
8
+ </g>
9
+ <defs>
10
+ <clipPath id="clip0_3_23">
11
+ <rect width="16" height="16" fill="white"/>
12
+ </clipPath>
13
+ <clipPath id="clip1_3_23">
14
+ <rect width="16" height="16" fill="white"/>
15
+ </clipPath>
16
+ </defs>
17
+ </svg>