oneie 3.6.5 → 3.6.6

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 (94) hide show
  1. package/.claude/commands/one copy.md +565 -0
  2. package/.claude/hooks/README-knowledge-hooks.md +265 -0
  3. package/.claude/hooks/__pycache__/knowledge-post.cpython-313.pyc +0 -0
  4. package/.claude/hooks/__pycache__/knowledge-pre.cpython-313.pyc +0 -0
  5. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  6. package/.claude/hooks/check-filenames.py +40 -0
  7. package/.claude/hooks/clean-post.py +301 -0
  8. package/.claude/hooks/clean-pre.py +308 -0
  9. package/.claude/hooks/done.py +175 -0
  10. package/.claude/hooks/format-hook.sh +75 -0
  11. package/.claude/hooks/hook-logger.sh +59 -0
  12. package/.claude/hooks/knowledge-post.py +251 -0
  13. package/.claude/hooks/knowledge-pre.py +150 -0
  14. package/.claude/hooks/notification-hook.sh +112 -0
  15. package/.claude/hooks/security-hook.sh +157 -0
  16. package/.claude/hooks/tag-all-docs.py +338 -0
  17. package/.claude/hooks/todo.py +298 -0
  18. package/.claude/hooks/validate-ontology-structure.py +455 -0
  19. package/.claude/skills/astro/add-content-collection.md +30 -0
  20. package/.claude/skills/astro/check-build.md +29 -0
  21. package/.claude/skills/astro/create-component.md +29 -0
  22. package/.claude/skills/astro/create-page.md +30 -0
  23. package/.claude/skills/astro/optimize-performance.md +21 -0
  24. package/.claude/skills/convex/check-deployment.md +46 -0
  25. package/.claude/skills/convex/create-mutation.md +405 -0
  26. package/.claude/skills/convex/create-query.md +52 -0
  27. package/.claude/skills/convex/read-schema.md +373 -0
  28. package/.claude/skills/convex/test-function.md +50 -0
  29. package/.claude/skills/deployment/check-deployment-health.md +20 -0
  30. package/.claude/skills/deployment/create-release.md +21 -0
  31. package/.claude/skills/deployment/deploy-cloudflare.md +31 -0
  32. package/.claude/skills/deployment/deploy-convex.md +30 -0
  33. package/.claude/skills/deployment/sync-repositories.md +19 -0
  34. package/.claude/skills/design/check-accessibility.md +21 -0
  35. package/.claude/skills/design/create-component-spec.md +27 -0
  36. package/.claude/skills/design/generate-design-tokens.md +24 -0
  37. package/.claude/skills/design/generate-wireframe.md +30 -0
  38. package/.claude/skills/documentation/create-migration-guide.md +20 -0
  39. package/.claude/skills/documentation/generate-api-docs.md +27 -0
  40. package/.claude/skills/documentation/generate-readme.md +22 -0
  41. package/.claude/skills/documentation/update-knowledge.md +20 -0
  42. package/.claude/skills/integration/connect-external-system.md +21 -0
  43. package/.claude/skills/integration/implement-a2a.md +20 -0
  44. package/.claude/skills/integration/implement-acp.md +20 -0
  45. package/.claude/skills/integration/verify-integration.md +20 -0
  46. package/.claude/skills/ontology/README.md +255 -0
  47. package/.claude/skills/ontology/check-dimension.md +307 -0
  48. package/.claude/skills/ontology/generate-entity-type.md +339 -0
  49. package/.claude/skills/ontology/validate-schema.md +229 -0
  50. package/.claude/skills/ontology/verify-relationships.md +310 -0
  51. package/.claude/skills/problem-solving/analyze-test-failure.md +21 -0
  52. package/.claude/skills/problem-solving/identify-root-cause.md +20 -0
  53. package/.claude/skills/problem-solving/propose-solution.md +29 -0
  54. package/.claude/skills/problem-solving/verify-fix.md +21 -0
  55. package/.claude/skills/sales/generate-demo-script.md +21 -0
  56. package/.claude/skills/sales/qualify-lead.md +30 -0
  57. package/.claude/skills/sales/track-trial.md +20 -0
  58. package/.claude/skills/sales/verify-kyc.md +20 -0
  59. package/.claude/skills/testing/analyze-coverage.md +24 -0
  60. package/.claude/skills/testing/generate-tests.md +24 -0
  61. package/.claude/skills/testing/run-tests.md +27 -0
  62. package/.claude/skills/testing/validate-e2e.md +25 -0
  63. package/.mcp.json +30 -3
  64. package/dist/commands/init.d.ts.map +1 -1
  65. package/dist/commands/init.js +13 -6
  66. package/dist/commands/init.js.map +1 -1
  67. package/dist/utils/launch-claude.d.ts +3 -2
  68. package/dist/utils/launch-claude.d.ts.map +1 -1
  69. package/dist/utils/launch-claude.js +64 -29
  70. package/dist/utils/launch-claude.js.map +1 -1
  71. package/one/.obsidian/workspace.json +22 -22
  72. package/one/events/CREATE-WEBSITE.md +442 -0
  73. package/one/events/CUSTOM-DOMAIN.md +357 -0
  74. package/one/events/DEPLOYMENT copy.md +426 -0
  75. package/one/events/ECOMMERCE-BEFORE-AFTER.md +251 -0
  76. package/one/events/ECOMMERCE-ENHANCEMENTS.md +576 -0
  77. package/one/events/ECOMMERCE-HIGH-CONVERTING-ELEMENTS.md +421 -0
  78. package/one/events/ECOMMERCE-REFACTOR-SUMMARY.md +196 -0
  79. package/one/events/ECOMMERCE-SETUP-SUMMARY.md +396 -0
  80. package/one/events/INSTALLATION_FOLDERS.md +516 -0
  81. package/one/events/INSTALLATION_FOLDERS_FILES.md +205 -0
  82. package/one/events/INSTALLATION_FOLDERS_SUMMARY.md +419 -0
  83. package/one/events/LICENSE.md +89 -0
  84. package/one/events/MCP-CONFIGURATION.md +336 -0
  85. package/one/events/MCP-SETUP-COMPLETE.md +205 -0
  86. package/one/events/NODE-UPGRADE.md +111 -0
  87. package/one/events/PACKAGE-STRUCTURE.md +310 -0
  88. package/one/events/PLAYBOOK-SETUP-SUMMARY.md +331 -0
  89. package/one/events/PROMPT_FIX_FRONTEND_ONLY.md +567 -0
  90. package/one/events/SIMPLE_FIX_FRONTEND_ONLY.md +262 -0
  91. package/one/events/STRIPE-INTEGRATION.md +414 -0
  92. package/one/events/STRIPE-SETUP-GUIDE.md +462 -0
  93. package/one/events/TRANSPARENCY-FIXES.md +275 -0
  94. package/package.json +4 -2
@@ -0,0 +1,405 @@
1
+ # Create Convex Mutation
2
+
3
+ **Category:** convex
4
+ **Version:** 1.0.0
5
+ **Used By:** agent-backend, agent-builder
6
+
7
+ ## Purpose
8
+
9
+ Generates a complete, production-ready Convex mutation function from a Plain English description, including validation, error handling, ontology compliance, and event logging.
10
+
11
+ ## Inputs
12
+
13
+ - **operationDescription** (string): What the mutation should do in Plain English
14
+ - **targetTable** (string): Primary table being modified (e.g., "things", "connections")
15
+ - **operationType** (string): create, update, delete, or custom
16
+ - **includeAuth** (boolean, optional): Add authentication checks. Default: true
17
+ - **includeEvents** (boolean, optional): Log events dimension. Default: true
18
+ - **includeValidation** (boolean, optional): Add input validation. Default: true
19
+
20
+ ## Outputs
21
+
22
+ - **functionCode** (string): Complete TypeScript mutation code
23
+ - **functionName** (string): Suggested function name (e.g., "createBlogPost")
24
+ - **argsSchema** (object): Input argument schema
25
+ - **testCases** (array): Suggested test cases
26
+ - **dependencies** (array): Required imports and utilities
27
+
28
+ ## Prerequisites
29
+
30
+ - Schema exists and has been validated
31
+ - Target table is defined in schema
32
+ - Operation type is valid
33
+ - Authentication setup exists (if includeAuth=true)
34
+
35
+ ## Steps
36
+
37
+ 1. **Load Schema**
38
+ - USE SKILL: `skills/convex/read-schema.md`
39
+ - Get target table definition
40
+ - Verify table exists
41
+ - Extract field types and constraints
42
+
43
+ 2. **Parse Operation Description**
44
+ - Identify entities involved
45
+ - Extract input requirements
46
+ - Determine success criteria
47
+ - Identify error conditions
48
+
49
+ 3. **Generate Function Name**
50
+ - Follow convention: operationType + EntityName
51
+ - Examples: createBlogPost, updateProduct, deleteUser
52
+ - Ensure name is descriptive and follows camelCase
53
+
54
+ 4. **Define Arguments Schema**
55
+ - Extract required fields from operation description
56
+ - Map to Convex validators (v.string(), v.number(), etc.)
57
+ - Add groupId for multi-tenancy (unless global entity)
58
+ - Include optional fields as v.optional()
59
+
60
+ 5. **Generate Validation Logic** (if includeValidation=true)
61
+ - Check required fields are present
62
+ - Validate field types and constraints
63
+ - Verify foreign key references exist
64
+ - Return descriptive error messages
65
+
66
+ 6. **Add Authentication** (if includeAuth=true)
67
+ - Get user identity from ctx.auth
68
+ - Verify user has permission
69
+ - Check role-based access control
70
+ - Return unauthorized error if needed
71
+
72
+ 7. **Generate Core Logic**
73
+ - For CREATE: Insert new document with ctx.db.insert()
74
+ - For UPDATE: Get existing doc, validate, update with ctx.db.patch()
75
+ - For DELETE: Get existing doc, verify, delete with ctx.db.delete()
76
+ - For CUSTOM: Implement specific business logic
77
+
78
+ 8. **Add Event Logging** (if includeEvents=true)
79
+ - Determine event type (entity_created, entity_updated, etc.)
80
+ - Insert event record with actorId, targetId, timestamp
81
+ - Include relevant metadata
82
+ - Link to events table
83
+
84
+ 9. **Generate Error Handling**
85
+ - Wrap in try/catch if needed
86
+ - Return typed errors with clear messages
87
+ - Handle common failure cases
88
+ - Provide actionable error information
89
+
90
+ 10. **Add Timestamps**
91
+ - Set createdAt on creation
92
+ - Update updatedAt on modification
93
+ - Use Date.now() for consistency
94
+
95
+ 11. **Return Complete Function**
96
+ - Export mutation with proper typing
97
+ - Include JSDoc comments
98
+ - Format code consistently
99
+ - Add inline comments for complex logic
100
+
101
+ ## Examples
102
+
103
+ ### Example 1: Create Blog Post
104
+
105
+ **Input:**
106
+ ```typescript
107
+ operationDescription: "Create a new blog post with title, content, and author"
108
+ targetTable: "things"
109
+ operationType: "create"
110
+ includeAuth: true
111
+ includeEvents: true
112
+ includeValidation: true
113
+ ```
114
+
115
+ **Output:**
116
+
117
+ **functionCode:**
118
+ ```typescript
119
+ import { mutation } from "./_generated/server";
120
+ import { v } from "convex/values";
121
+
122
+ /**
123
+ * Create a new blog post
124
+ * @param groupId - Organization the post belongs to
125
+ * @param title - Post title
126
+ * @param content - Post content (markdown)
127
+ * @param authorId - ID of the creator entity (author)
128
+ * @returns ID of created blog post
129
+ */
130
+ export const createBlogPost = mutation({
131
+ args: {
132
+ groupId: v.id("groups"),
133
+ title: v.string(),
134
+ content: v.string(),
135
+ authorId: v.id("things"),
136
+ tags: v.optional(v.array(v.string())),
137
+ excerpt: v.optional(v.string()),
138
+ },
139
+ handler: async (ctx, args) => {
140
+ // Authentication check
141
+ const identity = await ctx.auth.getUserIdentity();
142
+ if (!identity) {
143
+ throw new Error("Authentication required");
144
+ }
145
+
146
+ // Validation: Check author exists and is a creator
147
+ const author = await ctx.db.get(args.authorId);
148
+ if (!author) {
149
+ throw new Error(`Author with ID ${args.authorId} not found`);
150
+ }
151
+ if (author.type !== "creator") {
152
+ throw new Error("Author must be a creator entity");
153
+ }
154
+
155
+ // Validation: Check group exists
156
+ const group = await ctx.db.get(args.groupId);
157
+ if (!group) {
158
+ throw new Error(`Group with ID ${args.groupId} not found`);
159
+ }
160
+
161
+ // Generate URL-friendly slug
162
+ const slug = args.title
163
+ .toLowerCase()
164
+ .replace(/[^a-z0-9]+/g, "-")
165
+ .replace(/^-|-$/g, "");
166
+
167
+ // Create blog post entity
168
+ const now = Date.now();
169
+ const blogPostId = await ctx.db.insert("things", {
170
+ groupId: args.groupId,
171
+ type: "blog_post",
172
+ name: args.title,
173
+ status: "draft",
174
+ properties: {
175
+ content: args.content,
176
+ excerpt: args.excerpt,
177
+ tags: args.tags || [],
178
+ slug,
179
+ authorId: args.authorId,
180
+ publishDate: null,
181
+ seoTitle: args.title,
182
+ seoDescription: args.excerpt || args.content.substring(0, 160),
183
+ },
184
+ createdAt: now,
185
+ updatedAt: now,
186
+ });
187
+
188
+ // Create authored connection
189
+ await ctx.db.insert("connections", {
190
+ groupId: args.groupId,
191
+ sourceId: args.authorId,
192
+ targetId: blogPostId,
193
+ type: "authored",
194
+ metadata: {
195
+ role: "primary_author",
196
+ contributionDate: now,
197
+ },
198
+ createdAt: now,
199
+ updatedAt: now,
200
+ });
201
+
202
+ // Log entity_created event
203
+ await ctx.db.insert("events", {
204
+ groupId: args.groupId,
205
+ type: "entity_created",
206
+ actorId: identity.tokenIdentifier,
207
+ targetId: blogPostId,
208
+ timestamp: now,
209
+ metadata: {
210
+ entityType: "blog_post",
211
+ title: args.title,
212
+ },
213
+ createdAt: now,
214
+ });
215
+
216
+ return blogPostId;
217
+ },
218
+ });
219
+ ```
220
+
221
+ **functionName:** `createBlogPost`
222
+
223
+ **argsSchema:**
224
+ ```json
225
+ {
226
+ "groupId": "Id<'groups'>",
227
+ "title": "string",
228
+ "content": "string",
229
+ "authorId": "Id<'things'>",
230
+ "tags": "string[] (optional)",
231
+ "excerpt": "string (optional)"
232
+ }
233
+ ```
234
+
235
+ **testCases:**
236
+ ```json
237
+ [
238
+ {
239
+ "name": "Create blog post successfully",
240
+ "args": {
241
+ "groupId": "test_group",
242
+ "title": "My First Post",
243
+ "content": "This is the content",
244
+ "authorId": "test_author"
245
+ },
246
+ "expectedResult": "Returns blog post ID"
247
+ },
248
+ {
249
+ "name": "Fail with invalid author",
250
+ "args": {
251
+ "groupId": "test_group",
252
+ "title": "Test",
253
+ "content": "Content",
254
+ "authorId": "invalid_id"
255
+ },
256
+ "expectedError": "Author with ID invalid_id not found"
257
+ },
258
+ {
259
+ "name": "Fail without authentication",
260
+ "args": { "...": "..." },
261
+ "expectedError": "Authentication required"
262
+ }
263
+ ]
264
+ ```
265
+
266
+ **dependencies:**
267
+ ```json
268
+ [
269
+ "import { mutation } from './_generated/server'",
270
+ "import { v } from 'convex/values'"
271
+ ]
272
+ ```
273
+
274
+ ### Example 2: Update Product Inventory
275
+
276
+ **Input:**
277
+ ```typescript
278
+ operationDescription: "Update product inventory count"
279
+ targetTable: "things"
280
+ operationType: "update"
281
+ includeAuth: true
282
+ includeEvents: true
283
+ includeValidation: true
284
+ ```
285
+
286
+ **Output:**
287
+
288
+ **functionCode:**
289
+ ```typescript
290
+ import { mutation } from "./_generated/server";
291
+ import { v } from "convex/values";
292
+
293
+ /**
294
+ * Update product inventory count
295
+ * @param productId - ID of the product to update
296
+ * @param newInventory - New inventory count
297
+ * @returns Updated product
298
+ */
299
+ export const updateProductInventory = mutation({
300
+ args: {
301
+ productId: v.id("things"),
302
+ newInventory: v.number(),
303
+ },
304
+ handler: async (ctx, args) => {
305
+ // Authentication check
306
+ const identity = await ctx.auth.getUserIdentity();
307
+ if (!identity) {
308
+ throw new Error("Authentication required");
309
+ }
310
+
311
+ // Validation: Check product exists
312
+ const product = await ctx.db.get(args.productId);
313
+ if (!product) {
314
+ throw new Error(`Product with ID ${args.productId} not found`);
315
+ }
316
+
317
+ // Validation: Verify it's a product entity
318
+ if (product.type !== "product") {
319
+ throw new Error("Entity is not a product");
320
+ }
321
+
322
+ // Validation: Inventory must be non-negative
323
+ if (args.newInventory < 0) {
324
+ throw new Error("Inventory cannot be negative");
325
+ }
326
+
327
+ // Store old inventory for event logging
328
+ const oldInventory = product.properties.inventory;
329
+
330
+ // Update product inventory
331
+ await ctx.db.patch(args.productId, {
332
+ properties: {
333
+ ...product.properties,
334
+ inventory: args.newInventory,
335
+ },
336
+ updatedAt: Date.now(),
337
+ });
338
+
339
+ // Log inventory_updated event
340
+ const now = Date.now();
341
+ await ctx.db.insert("events", {
342
+ groupId: product.groupId,
343
+ type: "inventory_updated",
344
+ actorId: identity.tokenIdentifier,
345
+ targetId: args.productId,
346
+ timestamp: now,
347
+ metadata: {
348
+ oldInventory,
349
+ newInventory: args.newInventory,
350
+ change: args.newInventory - oldInventory,
351
+ },
352
+ createdAt: now,
353
+ });
354
+
355
+ // Return updated product
356
+ return await ctx.db.get(args.productId);
357
+ },
358
+ });
359
+ ```
360
+
361
+ ## Error Handling
362
+
363
+ - **Table Not Found:** Check schema, provide list of valid tables
364
+ - **Invalid Operation:** Suggest valid operation types (create, update, delete)
365
+ - **Missing Required Fields:** List required fields from schema
366
+ - **Type Mismatch:** Show expected vs actual types
367
+
368
+ ## Dependencies
369
+
370
+ - **Tools:** Write (to generate files)
371
+ - **Skills:**
372
+ - `skills/convex/read-schema.md` - Load target table schema
373
+ - `skills/ontology/check-dimension.md` - Verify ontology compliance
374
+ - **Docs:**
375
+ - `https://docs.convex.dev/functions/mutation-functions` - Convex mutations
376
+ - `/one/knowledge/ontology.md` - Event types and patterns
377
+
378
+ ## Tests
379
+
380
+ 1. **Test Create Mutation:** Generate complete create function
381
+ 2. **Test Update Mutation:** Generate update with validation
382
+ 3. **Test Delete Mutation:** Generate soft delete (status change)
383
+ 4. **Test With Auth:** Verify authentication checks included
384
+ 5. **Test With Events:** Verify event logging included
385
+ 6. **Test Without Validation:** Generate minimal mutation
386
+ 7. **Test Error Cases:** Generate proper error handling
387
+
388
+ ## Performance
389
+
390
+ - **Generation Time:** < 2 seconds for typical mutation
391
+ - **No External Calls:** Pure code generation
392
+ - **Template-Based:** Use templates for common patterns
393
+
394
+ ## Lessons Learned
395
+
396
+ - **Always Validate Inputs:** Even "trusted" inputs should be validated
397
+ - **Log Everything:** Events dimension provides invaluable audit trail
398
+ - **Check Auth Early:** Fail fast if user not authenticated
399
+ - **Use Descriptive Errors:** Error messages should guide user to fix
400
+ - **Timestamps Matter:** createdAt and updatedAt are essential
401
+ - **Foreign Keys First:** Check referenced entities exist before proceeding
402
+
403
+ ## Version History
404
+
405
+ - **1.0.0** (2025-10-18): Initial implementation with full ontology support
@@ -0,0 +1,52 @@
1
+ # Create Convex Query
2
+
3
+ **Category:** convex
4
+ **Version:** 1.0.0
5
+ **Used By:** agent-backend, agent-builder
6
+
7
+ ## Purpose
8
+
9
+ Generates optimized Convex query functions with proper indexing, filtering, and pagination.
10
+
11
+ ## Inputs
12
+
13
+ - **queryDescription** (string): What data to retrieve
14
+ - **targetTable** (string): Table to query
15
+ - **filters** (array, optional): Filter conditions
16
+ - **includePagination** (boolean, optional): Add pagination. Default: false
17
+
18
+ ## Outputs
19
+
20
+ - **functionCode** (string): Complete query code
21
+ - **functionName** (string): Suggested name
22
+ - **optimizations** (array): Performance tips
23
+
24
+ ## Example
25
+
26
+ ```typescript
27
+ export const listBlogPosts = query({
28
+ args: {
29
+ groupId: v.id("groups"),
30
+ status: v.optional(v.string()),
31
+ limit: v.optional(v.number()),
32
+ },
33
+ handler: async (ctx, args) => {
34
+ let q = ctx.db
35
+ .query("things")
36
+ .withIndex("by_group_and_type", (q) =>
37
+ q.eq("groupId", args.groupId).eq("type", "blog_post")
38
+ );
39
+
40
+ if (args.status) {
41
+ q = q.filter((q) => q.eq(q.field("status"), args.status));
42
+ }
43
+
44
+ const posts = await q.take(args.limit ?? 20);
45
+ return posts;
46
+ },
47
+ });
48
+ ```
49
+
50
+ ## Version History
51
+
52
+ - **1.0.0** (2025-10-18): Initial implementation