oneie 3.6.25 → 3.6.26
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/.claude/agents/agent-builder.md +226 -198
- package/.claude/agents/agent-designer.md +166 -11
- package/.claude/agents/agent-director.md +109 -41
- package/.claude/agents/agent-frontend.md +154 -8
- package/.claude/agents/agent-quality.md +377 -0
- package/CLAUDE.md +105 -0
- package/dist/commands/agent.d.ts +18 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +271 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/init.js +1 -1
- package/dist/commands/init.js.map +1 -1
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/agent-detection.d.ts +19 -0
- package/dist/lib/agent-detection.d.ts.map +1 -0
- package/dist/lib/agent-detection.js +87 -0
- package/dist/lib/agent-detection.js.map +1 -0
- package/dist/lib/detect.d.ts +45 -0
- package/dist/lib/detect.d.ts.map +1 -0
- package/dist/lib/detect.js +221 -0
- package/dist/lib/detect.js.map +1 -0
- package/llms.txt +257 -0
- package/one/knowledge/games-english.md +691 -0
- package/one/knowledge/games.md +1082 -0
- package/one/things/plans/npx-agent-safety.md +785 -0
- package/one/things/plans/npx-agent.md +1089 -0
- package/one/things/plans/remove-backend-development-from-agents.md +1331 -0
- package/package.json +3 -2
|
@@ -174,6 +174,303 @@ You are the **Quality Agent**, an intelligence agent responsible for defining wh
|
|
|
174
174
|
**If ALL YES:** Approve (emit `quality_check_complete` with status: approved)
|
|
175
175
|
**If ANY NO:** Reject (emit `test_failed`, trigger problem solver)
|
|
176
176
|
|
|
177
|
+
## Frontend-Only Testing (NEW: Default Mode)
|
|
178
|
+
|
|
179
|
+
### Critical: Test Frontend Apps Without Backend Code
|
|
180
|
+
|
|
181
|
+
**The ONE Platform now defaults to FRONTEND-ONLY applications.**
|
|
182
|
+
|
|
183
|
+
When testing, assume:
|
|
184
|
+
- ✅ App uses **nanostores** for state management
|
|
185
|
+
- ✅ App uses **React + Astro** for UI
|
|
186
|
+
- ✅ App stores data in **browser (localStorage/IndexedDB)**
|
|
187
|
+
- ✅ App makes **NO backend API calls** (unless explicitly integrated)
|
|
188
|
+
- ❌ NO Convex imports
|
|
189
|
+
- ❌ NO backend mutations/queries
|
|
190
|
+
- ❌ NO server-side business logic
|
|
191
|
+
|
|
192
|
+
### Verify: Zero Backend Code Generated
|
|
193
|
+
|
|
194
|
+
**Before accepting any frontend implementation, verify:**
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
Verification Checklist (MUST PASS):
|
|
198
|
+
□ Zero imports from Convex
|
|
199
|
+
✓ grep -r "from 'convex'" src/ → NO MATCHES
|
|
200
|
+
✓ grep -r 'from "convex"' src/ → NO MATCHES
|
|
201
|
+
□ Zero API calls to backend
|
|
202
|
+
✓ grep -r "useQuery\|useMutation" src/ → NO MATCHES
|
|
203
|
+
□ Zero backend code created
|
|
204
|
+
✓ backend/convex/mutations/ → NO NEW FILES (unless explicitly requested)
|
|
205
|
+
✓ backend/convex/queries/ → NO NEW FILES (unless explicitly requested)
|
|
206
|
+
✓ backend/convex/schema.ts → NO MODIFICATIONS (unless explicitly requested)
|
|
207
|
+
□ All state uses nanostores
|
|
208
|
+
✓ grep -r "persistentAtom\|atom\|map" src/stores/ → FOUND
|
|
209
|
+
✓ Import patterns show nanostores usage
|
|
210
|
+
□ Data persistence is browser-based
|
|
211
|
+
✓ persistentAtom configured with localStorage
|
|
212
|
+
✓ OR IndexedDB for large datasets
|
|
213
|
+
✓ NO remote database calls
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Frontend-Only Test Strategy
|
|
217
|
+
|
|
218
|
+
When testing a frontend-only app:
|
|
219
|
+
|
|
220
|
+
1. **Unit Tests: Nanostores + Business Logic**
|
|
221
|
+
- Test store getters/setters with nanostores API
|
|
222
|
+
- Test pure functions (no API calls)
|
|
223
|
+
- Test TypeScript types are correct
|
|
224
|
+
- Example: `const cart = persistentAtom('cart', []); addToCart(product)`
|
|
225
|
+
|
|
226
|
+
2. **Component Tests: React Behavior**
|
|
227
|
+
- Test component renders correctly
|
|
228
|
+
- Test event handlers trigger store updates
|
|
229
|
+
- Test conditional rendering based on store state
|
|
230
|
+
- Test no API calls are made
|
|
231
|
+
- Example: `<Cart>` displays items from `useStore(cart)`
|
|
232
|
+
|
|
233
|
+
3. **Integration Tests: Complete Flows**
|
|
234
|
+
- Test user flow from start to finish
|
|
235
|
+
- Test data persists in browser
|
|
236
|
+
- Test no network requests made
|
|
237
|
+
- Test navigation between pages
|
|
238
|
+
- Example: "Add to cart" → "View cart" → "Checkout" (all in browser)
|
|
239
|
+
|
|
240
|
+
4. **E2E Tests: Full Application**
|
|
241
|
+
- Test complete user journeys
|
|
242
|
+
- Test browser persistence works
|
|
243
|
+
- Test works offline (if PWA)
|
|
244
|
+
- Test navigation and page rendering
|
|
245
|
+
- Example: Fresh browser load → Data still exists (from localStorage)
|
|
246
|
+
|
|
247
|
+
### Common Frontend-Only Patterns (Test These)
|
|
248
|
+
|
|
249
|
+
**Pattern 1: E-Commerce Store**
|
|
250
|
+
```typescript
|
|
251
|
+
Test:
|
|
252
|
+
✓ Products load from nanostores (not API)
|
|
253
|
+
✓ Cart persists in localStorage
|
|
254
|
+
✓ Stripe checkout is client-side (Stripe.js)
|
|
255
|
+
✓ Order confirmation stored locally
|
|
256
|
+
✓ No backend code needed
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**Pattern 2: Learning Management System (LMS)**
|
|
260
|
+
```typescript
|
|
261
|
+
Test:
|
|
262
|
+
✓ Courses load from nanostores
|
|
263
|
+
✓ Lesson progress tracked in localStorage
|
|
264
|
+
✓ Quiz results computed client-side
|
|
265
|
+
✓ Certificate generated in browser
|
|
266
|
+
✓ No backend code needed
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Pattern 3: Project Management Tool**
|
|
270
|
+
```typescript
|
|
271
|
+
Test:
|
|
272
|
+
✓ Projects/tasks stored in nanostores
|
|
273
|
+
✓ Kanban board state in browser
|
|
274
|
+
✓ Filters computed client-side
|
|
275
|
+
✓ Drag-and-drop updates store
|
|
276
|
+
✓ No backend code needed
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
**Pattern 4: Social Media App**
|
|
280
|
+
```typescript
|
|
281
|
+
Test:
|
|
282
|
+
✓ Posts stored in nanostores
|
|
283
|
+
✓ User following relationships in browser
|
|
284
|
+
✓ Feed computed from following list
|
|
285
|
+
✓ Likes/comments stored locally
|
|
286
|
+
✓ No backend code needed
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
### Test Cases for Frontend-Only Apps
|
|
290
|
+
|
|
291
|
+
Create these test cases for EVERY frontend-only feature:
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
describe("Frontend-Only Feature", () => {
|
|
295
|
+
|
|
296
|
+
// 1. Verify Zero Backend Code
|
|
297
|
+
test("Has zero Convex imports", () => {
|
|
298
|
+
const source = fs.readFileSync("src/components/Feature.tsx", "utf8");
|
|
299
|
+
expect(source).not.toMatch(/from ['"]convex['"]/);
|
|
300
|
+
expect(source).not.toMatch(/useQuery|useMutation/);
|
|
301
|
+
});
|
|
302
|
+
|
|
303
|
+
test("Has zero backend mutations created", () => {
|
|
304
|
+
const mutations = fs.readdirSync("backend/convex/mutations").filter(
|
|
305
|
+
f => f.includes("feature")
|
|
306
|
+
);
|
|
307
|
+
expect(mutations).toHaveLength(0); // No new mutation files
|
|
308
|
+
});
|
|
309
|
+
|
|
310
|
+
// 2. Verify Nanostores Used
|
|
311
|
+
test("Uses nanostores for state", () => {
|
|
312
|
+
const source = fs.readFileSync("src/stores/feature.ts", "utf8");
|
|
313
|
+
expect(source).toMatch(/persistentAtom|atom|map/);
|
|
314
|
+
expect(source).toMatch(/encode: JSON.stringify|decode: JSON.parse/);
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
test("Persists to localStorage", () => {
|
|
318
|
+
const store = persistentAtom("test", {});
|
|
319
|
+
store.set({ data: "test" });
|
|
320
|
+
const stored = localStorage.getItem("test");
|
|
321
|
+
expect(stored).toBe(JSON.stringify({ data: "test" }));
|
|
322
|
+
});
|
|
323
|
+
|
|
324
|
+
// 3. Test Component Behavior
|
|
325
|
+
test("Component renders from store", () => {
|
|
326
|
+
const { getByText } = render(<Component />);
|
|
327
|
+
expect(getByText("Expected content")).toBeInTheDocument();
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
test("User actions update store", async () => {
|
|
331
|
+
const { getByRole } = render(<Component />);
|
|
332
|
+
fireEvent.click(getByRole("button", { name: "Add" }));
|
|
333
|
+
await waitFor(() => {
|
|
334
|
+
expect(store.get()).toHaveLength(1);
|
|
335
|
+
});
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
// 4. Test Data Persistence
|
|
339
|
+
test("Data persists after page reload", () => {
|
|
340
|
+
const store = persistentAtom("items", []);
|
|
341
|
+
store.set([{ id: 1, name: "Item 1" }]);
|
|
342
|
+
|
|
343
|
+
// Simulate reload
|
|
344
|
+
const reloaded = persistentAtom("items", []);
|
|
345
|
+
expect(reloaded.get()).toEqual([{ id: 1, name: "Item 1" }]);
|
|
346
|
+
});
|
|
347
|
+
|
|
348
|
+
// 5. Test No Network Requests
|
|
349
|
+
test("Makes no network requests", async () => {
|
|
350
|
+
const fetchSpy = jest.spyOn(global, "fetch");
|
|
351
|
+
|
|
352
|
+
render(<Component />);
|
|
353
|
+
await userEvent.click(screen.getByRole("button"));
|
|
354
|
+
|
|
355
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
// 6. Test User Flow
|
|
359
|
+
test("Complete user flow works without backend", async () => {
|
|
360
|
+
render(<App />);
|
|
361
|
+
|
|
362
|
+
// Step 1: User adds item
|
|
363
|
+
fireEvent.click(screen.getByRole("button", { name: "Add Item" }));
|
|
364
|
+
expect(screen.getByText("Item added")).toBeInTheDocument();
|
|
365
|
+
|
|
366
|
+
// Step 2: Data persists in store
|
|
367
|
+
expect(store.get().items).toHaveLength(1);
|
|
368
|
+
|
|
369
|
+
// Step 3: Navigate to another page
|
|
370
|
+
fireEvent.click(screen.getByRole("link", { name: "View Items" }));
|
|
371
|
+
|
|
372
|
+
// Step 4: Items still visible (from localStorage)
|
|
373
|
+
expect(screen.getByText("Item 1")).toBeInTheDocument();
|
|
374
|
+
|
|
375
|
+
// Step 5: No network requests made
|
|
376
|
+
expect(fetchSpy).not.toHaveBeenCalled();
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Acceptance Criteria for Frontend-Only Apps
|
|
382
|
+
|
|
383
|
+
Every frontend-only feature MUST meet these criteria:
|
|
384
|
+
|
|
385
|
+
```markdown
|
|
386
|
+
Acceptance Criteria Checklist:
|
|
387
|
+
|
|
388
|
+
App Functionality:
|
|
389
|
+
□ All features work in browser without backend
|
|
390
|
+
□ Data persists using nanostores + localStorage/IndexedDB
|
|
391
|
+
□ No API calls made (except 3rd party like Stripe.js)
|
|
392
|
+
□ Complete user flows execute successfully
|
|
393
|
+
|
|
394
|
+
Code Quality:
|
|
395
|
+
□ Zero Convex imports or backend code
|
|
396
|
+
□ Uses nanostores for all state management
|
|
397
|
+
□ React components properly hydrated with data
|
|
398
|
+
□ TypeScript types are correct and complete
|
|
399
|
+
|
|
400
|
+
Testing:
|
|
401
|
+
□ Unit tests pass (nanostores + business logic)
|
|
402
|
+
□ Component tests pass (React behavior)
|
|
403
|
+
□ Integration tests pass (complete flows)
|
|
404
|
+
□ E2E tests pass (full application)
|
|
405
|
+
□ Test coverage >= 80%
|
|
406
|
+
□ Zero network requests made during tests
|
|
407
|
+
|
|
408
|
+
Performance:
|
|
409
|
+
□ App loads in < 2 seconds
|
|
410
|
+
□ Store updates < 100ms
|
|
411
|
+
□ Component re-renders < 16ms (60 FPS)
|
|
412
|
+
□ Browser storage < 5MB
|
|
413
|
+
|
|
414
|
+
Deployment:
|
|
415
|
+
□ Builds without backend errors
|
|
416
|
+
□ Deploys to Vercel/Netlify successfully
|
|
417
|
+
□ No server-side configuration needed
|
|
418
|
+
□ Works offline (if PWA)
|
|
419
|
+
|
|
420
|
+
Documentation:
|
|
421
|
+
□ README explains frontend-only approach
|
|
422
|
+
□ Examples show nanostores usage
|
|
423
|
+
□ No mentions of backend setup
|
|
424
|
+
□ Clear instructions for adding backend later
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
### When Backend Integration IS Requested
|
|
428
|
+
|
|
429
|
+
**Only test backend integration if user explicitly says:**
|
|
430
|
+
- "Add backend support"
|
|
431
|
+
- "Add multi-user"
|
|
432
|
+
- "Add groups/multi-tenant"
|
|
433
|
+
- "Integrate with ONE Platform"
|
|
434
|
+
- "Add real-time sync"
|
|
435
|
+
- "Add activity tracking"
|
|
436
|
+
|
|
437
|
+
Then test the integration:
|
|
438
|
+
|
|
439
|
+
```typescript
|
|
440
|
+
// When backend IS integrated
|
|
441
|
+
|
|
442
|
+
test("Backend services properly imported", () => {
|
|
443
|
+
const source = fs.readFileSync("src/components/Feature.tsx", "utf8");
|
|
444
|
+
expect(source).toMatch(/from ['"]convex['"]|from ['"]@\/services['"]/);
|
|
445
|
+
});
|
|
446
|
+
|
|
447
|
+
test("Services replace nanostores", () => {
|
|
448
|
+
const source = fs.readFileSync("src/stores/feature.ts", "utf8");
|
|
449
|
+
// Should use services, not plain nanostores
|
|
450
|
+
expect(source).toMatch(/useGroups|useThings|useEvents/);
|
|
451
|
+
});
|
|
452
|
+
|
|
453
|
+
test("Providers wrap application", () => {
|
|
454
|
+
const source = fs.readFileSync("src/pages/index.astro", "utf8");
|
|
455
|
+
expect(source).toMatch(/GroupProvider|AuthProvider|EventProvider/);
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
test("Real-time sync works", async () => {
|
|
459
|
+
// Test that changes sync across instances
|
|
460
|
+
const store1 = useGroups();
|
|
461
|
+
const store2 = useGroups(); // Different instance
|
|
462
|
+
|
|
463
|
+
store1.addGroup("New Group");
|
|
464
|
+
await waitFor(() => {
|
|
465
|
+
expect(store2.groups).toContain(
|
|
466
|
+
expect.objectContaining({ name: "New Group" })
|
|
467
|
+
);
|
|
468
|
+
});
|
|
469
|
+
});
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
---
|
|
473
|
+
|
|
177
474
|
## Key Behaviors
|
|
178
475
|
|
|
179
476
|
### Ontology-First Validation
|
|
@@ -662,4 +959,84 @@ As an `intelligence_agent`, you have unique analytical capabilities:
|
|
|
662
959
|
|
|
663
960
|
---
|
|
664
961
|
|
|
962
|
+
## Final Quality Gate: Frontend-Only Decision Framework
|
|
963
|
+
|
|
964
|
+
### The Critical Question
|
|
965
|
+
|
|
966
|
+
**Before approving ANY implementation, ask:**
|
|
967
|
+
|
|
968
|
+
> **"Does this app work without ANY backend code?"**
|
|
969
|
+
|
|
970
|
+
If the answer is **YES**, it's a successful frontend-only app.
|
|
971
|
+
If the answer is **NO**, reject and ask: "What backend code was created? Was it explicitly requested?"
|
|
972
|
+
|
|
973
|
+
### Decision Matrix
|
|
974
|
+
|
|
975
|
+
```
|
|
976
|
+
App Works Without Backend? | Backend Code Found? | Result
|
|
977
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━╪━━━━━━━━━━━━━━━━━━━━━━╪═════════════════════════════════
|
|
978
|
+
YES | NO | ✅ APPROVE (perfect!)
|
|
979
|
+
YES | YES | ❌ REJECT (unnecessary backend)
|
|
980
|
+
NO | YES (requested) | ✅ APPROVE (backend was asked for)
|
|
981
|
+
NO | YES (NOT requested) | ❌ REJECT (unexpected backend)
|
|
982
|
+
NO | NO | ❌ REJECT (app broken)
|
|
983
|
+
```
|
|
984
|
+
|
|
985
|
+
### Practical Examples
|
|
986
|
+
|
|
987
|
+
**Example 1: Ecommerce Store (Frontend-Only)**
|
|
988
|
+
```
|
|
989
|
+
Question: "Does this ecommerce store work without backend?"
|
|
990
|
+
Evidence:
|
|
991
|
+
✓ Cart uses nanostores + localStorage
|
|
992
|
+
✓ Products loaded from static data
|
|
993
|
+
✓ Stripe.js handles payments (client-side)
|
|
994
|
+
✓ Order history stored in browser
|
|
995
|
+
✓ Zero Convex imports
|
|
996
|
+
✓ Zero API calls
|
|
997
|
+
Answer: YES
|
|
998
|
+
Result: APPROVE
|
|
999
|
+
```
|
|
1000
|
+
|
|
1001
|
+
**Example 2: Ecommerce Store (With Backend - Explicitly Requested)**
|
|
1002
|
+
```
|
|
1003
|
+
Question: "Does this ecommerce store work without backend?"
|
|
1004
|
+
Evidence:
|
|
1005
|
+
✓ GroupProvider wraps app (multi-tenant)
|
|
1006
|
+
✓ useThings() fetches products from backend
|
|
1007
|
+
✓ useMutation() handles checkout
|
|
1008
|
+
✓ Events logged for tracking
|
|
1009
|
+
User explicitly said: "Add groups/multi-user"
|
|
1010
|
+
Answer: NO (but backend was explicitly requested)
|
|
1011
|
+
Result: APPROVE
|
|
1012
|
+
```
|
|
1013
|
+
|
|
1014
|
+
**Example 3: LMS (Unexpected Backend)**
|
|
1015
|
+
```
|
|
1016
|
+
Question: "Does this LMS work without backend?"
|
|
1017
|
+
Evidence:
|
|
1018
|
+
✓ App is broken without backend
|
|
1019
|
+
✓ Created Convex mutation for lesson completion
|
|
1020
|
+
✓ Created Convex query for courses
|
|
1021
|
+
✗ User said "Build LMS" (NO mention of backend)
|
|
1022
|
+
Answer: NO
|
|
1023
|
+
Result: REJECT - Ask "Why was backend created without being asked?"
|
|
1024
|
+
```
|
|
1025
|
+
|
|
1026
|
+
### What This Means
|
|
1027
|
+
|
|
1028
|
+
- **Most apps (99%)** should work without backend - Frontend-only is the default
|
|
1029
|
+
- **Some apps (1%)** explicitly request backend - Integration with ONE Platform
|
|
1030
|
+
- **Zero apps** should surprise you with unexpected backend code
|
|
1031
|
+
|
|
1032
|
+
**Your job as quality agent:**
|
|
1033
|
+
1. Always verify apps work in browser
|
|
1034
|
+
2. Flag unexpected backend code immediately
|
|
1035
|
+
3. Approve only when it matches what was asked for
|
|
1036
|
+
4. Enforce: Frontend-first, backend optional
|
|
1037
|
+
|
|
1038
|
+
---
|
|
1039
|
+
|
|
665
1040
|
**Quality Agent: Define success through ontology. Validate everything. Learn continuously. Predict intelligently.**
|
|
1041
|
+
|
|
1042
|
+
**CRITICAL RULE:** Test frontend-only by default. Verify zero backend code generated. Only accept backend integration when explicitly requested.
|
package/CLAUDE.md
CHANGED
|
@@ -384,6 +384,111 @@ bun run lint
|
|
|
384
384
|
bun run format
|
|
385
385
|
```
|
|
386
386
|
|
|
387
|
+
## Frontend-First Development (Default Mode)
|
|
388
|
+
|
|
389
|
+
**CRITICAL:** All agents default to frontend-only development unless explicitly requested otherwise.
|
|
390
|
+
|
|
391
|
+
### Default Behavior
|
|
392
|
+
|
|
393
|
+
**Frontend-only is the DEFAULT for ALL agents across the platform.**
|
|
394
|
+
|
|
395
|
+
When building features, agents MUST:
|
|
396
|
+
1. Build ONLY frontend code by default
|
|
397
|
+
2. Use client-side state management (nanostores)
|
|
398
|
+
3. Integrate third-party services via direct API calls (Stripe.js, OpenAI client SDK, etc.)
|
|
399
|
+
4. Store data in browser (localStorage, IndexedDB) or third-party services
|
|
400
|
+
5. NEVER create backend code unless explicitly requested
|
|
401
|
+
|
|
402
|
+
### When Backend is NOT Needed
|
|
403
|
+
|
|
404
|
+
Frontend-only works perfectly for:
|
|
405
|
+
|
|
406
|
+
- **Ecommerce stores**: Stripe.js handles payments, no backend needed
|
|
407
|
+
- **LMS platforms**: Content in Astro pages, progress in localStorage
|
|
408
|
+
- **SaaS tools**: Third-party APIs (OpenAI, Anthropic, Stripe) via client SDKs
|
|
409
|
+
- **Marketing sites**: Static pages with forms, analytics, chat widgets
|
|
410
|
+
- **Documentation sites**: Content collections with search
|
|
411
|
+
- **Landing pages**: Interactive demos, forms, newsletters
|
|
412
|
+
- **Portfolio sites**: Projects, case studies, contact forms
|
|
413
|
+
- **Blogs**: Content collections with comments (Giscus, Utterances)
|
|
414
|
+
|
|
415
|
+
### Frontend Stack (Default Tools)
|
|
416
|
+
|
|
417
|
+
Use these tools for frontend-only development:
|
|
418
|
+
|
|
419
|
+
- **State Management**: nanostores (persistent atoms, maps, computed)
|
|
420
|
+
- **UI Components**: React 19 + shadcn/ui (50+ accessible components)
|
|
421
|
+
- **Styling**: Tailwind CSS v4 (CSS-based configuration)
|
|
422
|
+
- **Pages**: Astro 5 (file-based routing, SSR, islands)
|
|
423
|
+
- **Forms**: React Hook Form + Zod validation
|
|
424
|
+
- **Data Fetching**: fetch API, SWR, React Query
|
|
425
|
+
- **Storage**: localStorage, sessionStorage, IndexedDB
|
|
426
|
+
- **Payments**: Stripe.js (client-side only)
|
|
427
|
+
- **Auth**: Better Auth (client-side hooks)
|
|
428
|
+
- **Analytics**: Plausible, Fathom (script tags)
|
|
429
|
+
|
|
430
|
+
### When to Use Backend
|
|
431
|
+
|
|
432
|
+
Backend is ONLY needed when user explicitly says:
|
|
433
|
+
|
|
434
|
+
1. **"Use backend"** - Direct request for backend integration
|
|
435
|
+
2. **"Add groups"** - Multi-tenant data isolation requires backend
|
|
436
|
+
3. **"Add multi-user"** - User collaboration requires backend
|
|
437
|
+
4. **"Track events"** - Immutable audit trail requires backend
|
|
438
|
+
5. **"Build RAG"** - Vector embeddings require backend
|
|
439
|
+
6. **"Real-time updates"** - WebSocket sync requires backend
|
|
440
|
+
|
|
441
|
+
### Backend Integration (Only When Requested)
|
|
442
|
+
|
|
443
|
+
If user explicitly requests backend, integrate via:
|
|
444
|
+
|
|
445
|
+
- **Services Layer**: `/web/src/services/` - Business logic and API wrappers
|
|
446
|
+
- **Providers Layer**: `/web/src/providers/` - React context for state management
|
|
447
|
+
- **Convex Client**: `useQuery` and `useMutation` hooks for backend calls
|
|
448
|
+
- **API Routes**: `/web/src/pages/api/` for serverless functions
|
|
449
|
+
|
|
450
|
+
Example structure when backend is explicitly requested:
|
|
451
|
+
|
|
452
|
+
```typescript
|
|
453
|
+
// /web/src/services/products.ts
|
|
454
|
+
import { ConvexHttpClient } from "convex/browser";
|
|
455
|
+
import { api } from "@/convex/_generated/api";
|
|
456
|
+
|
|
457
|
+
const client = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
|
|
458
|
+
|
|
459
|
+
export const productService = {
|
|
460
|
+
list: () => client.query(api.queries.products.list),
|
|
461
|
+
create: (data) => client.mutation(api.mutations.products.create, data),
|
|
462
|
+
};
|
|
463
|
+
|
|
464
|
+
// /web/src/providers/ProductProvider.tsx
|
|
465
|
+
import { createContext, useContext } from "react";
|
|
466
|
+
import { useQuery } from "convex/react";
|
|
467
|
+
import { api } from "@/convex/_generated/api";
|
|
468
|
+
|
|
469
|
+
const ProductContext = createContext(null);
|
|
470
|
+
|
|
471
|
+
export const ProductProvider = ({ children }) => {
|
|
472
|
+
const products = useQuery(api.queries.products.list);
|
|
473
|
+
return <ProductContext.Provider value={{ products }}>{children}</ProductContext.Provider>;
|
|
474
|
+
};
|
|
475
|
+
|
|
476
|
+
export const useProducts = () => useContext(ProductContext);
|
|
477
|
+
```
|
|
478
|
+
|
|
479
|
+
### Golden Rule
|
|
480
|
+
|
|
481
|
+
**Default to frontend-only. Only add backend when explicitly requested.**
|
|
482
|
+
|
|
483
|
+
- ✅ User says "build ecommerce store" → Frontend-only with Stripe.js
|
|
484
|
+
- ✅ User says "build ecommerce store with groups" → Add backend for multi-tenancy
|
|
485
|
+
- ✅ User says "build LMS" → Frontend-only with content collections
|
|
486
|
+
- ✅ User says "build LMS with real-time progress" → Add backend for events
|
|
487
|
+
- ✅ User says "add payments" → Frontend-only with Stripe.js
|
|
488
|
+
- ✅ User says "add payments and track events" → Add backend for event logging
|
|
489
|
+
|
|
490
|
+
**When in doubt, ask:** "Do you need multi-user groups, or can this work as a single-user frontend-only app?"
|
|
491
|
+
|
|
387
492
|
### Backend Development
|
|
388
493
|
|
|
389
494
|
```bash
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Command - Non-interactive ONE Platform setup
|
|
3
|
+
*
|
|
4
|
+
* Designed for AI agents (Claude Code, Cursor, etc.) and CI/CD environments.
|
|
5
|
+
* Zero interaction required - auto-detects context and completes setup in 5-10 seconds.
|
|
6
|
+
*/
|
|
7
|
+
export interface AgentOptions {
|
|
8
|
+
quiet?: boolean;
|
|
9
|
+
verbose?: boolean;
|
|
10
|
+
dryRun?: boolean;
|
|
11
|
+
skipWeb?: boolean;
|
|
12
|
+
basePath?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Runs the agent command (non-interactive setup)
|
|
16
|
+
*/
|
|
17
|
+
export declare function runAgent(options?: AgentOptions): Promise<void>;
|
|
18
|
+
//# sourceMappingURL=agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../src/commands/agent.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAsBH,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAAC,OAAO,GAAE,YAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAwRxE"}
|