oneie 3.6.26 → 3.6.28

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 (37) hide show
  1. package/.claude/agents/TROUBLESHOOTING.md +530 -0
  2. package/.claude/agents/agent-claude.md +645 -0
  3. package/.claude/agents/agent-clone.md +2 -0
  4. package/.claude/agents/agent-frontend.md +162 -21
  5. package/.claude/agents/agent-writer.md +722 -0
  6. package/.claude/commands/chat.md +504 -0
  7. package/.claude/commands/create.md +134 -18
  8. package/.claude/commands/fast.md +531 -0
  9. package/.claude/commands/one.md +79 -90
  10. package/.claude/commands/optimize.md +74 -0
  11. package/.claude/commands/plan.md +420 -373
  12. package/.claude/commands/review.md +99 -0
  13. package/.claude/commands/server.md +97 -48
  14. package/.claude/commands/start.md +182 -0
  15. package/.claude/commands/test.md +197 -0
  16. package/.claude/commands/validate.md +140 -0
  17. package/.claude/hooks/__pycache__/todo.cpython-312.pyc +0 -0
  18. package/.claude/hooks/auto-format.sh +106 -0
  19. package/.claude/hooks/formatting.py +187 -0
  20. package/.claude/hooks/ontology-validation.py +255 -0
  21. package/.claude/hooks/validate-imports.py +182 -0
  22. package/.claude/hooks/validate-ontology.py +140 -0
  23. package/.claude/hooks/write-news.sh +194 -0
  24. package/CLAUDE.md +150 -1057
  25. package/one/knowledge/cascading-context-specification.md +1617 -0
  26. package/one/knowledge/claude-code-integration.md +1293 -0
  27. package/one/knowledge/development-commands.md +251 -0
  28. package/one/knowledge/guidelines.md +314 -0
  29. package/one/knowledge/parallel-agents.md +932 -0
  30. package/one/knowledge/performance.md +459 -0
  31. package/one/knowledge/troubleshooting.md +434 -0
  32. package/one/things/plans/dsl-claude-code.md +1011 -0
  33. package/one/things/plans/video-backend.md +638 -0
  34. package/one/things/plans/video-frontend.md +432 -0
  35. package/one/things/plans/video-old-archived.md +656 -0
  36. package/package.json +1 -1
  37. package/.claude/agents/AUDIT-agent-ops-alignment.md +0 -379
@@ -0,0 +1,504 @@
1
+ # /chat - Conversational Onboarding & Strategy
2
+
3
+ **Transform ideas into validated feature plans through natural conversation**
4
+
5
+ When user types `/chat [idea]` or just `/chat`, engage in a conversational discovery process to understand their vision, extract brand identity, and validate feasibility.
6
+
7
+ ---
8
+
9
+ ## Purpose
10
+
11
+ The `/chat` command is your strategic partner for:
12
+
13
+ - **Understanding vision** - What are you building and why?
14
+ - **Extracting brand identity** - Colors, tone, personality, values
15
+ - **Market positioning** - Who's it for? What makes it different?
16
+ - **Requirement gathering** - What features matter most?
17
+ - **Ontology validation** - Can this map to the 6 dimensions?
18
+ - **Readiness assessment** - Ready to build or need more clarity?
19
+
20
+ **Golden Rule:** Have a real conversation. Don't interrogate. Ask follow-up questions. Build understanding organically.
21
+
22
+ ---
23
+
24
+ ## Conversational Flow
25
+
26
+ ### Phase 1: Discovery (Natural Questions)
27
+
28
+ Start with open-ended questions to understand their vision:
29
+
30
+ ```
31
+ "Tell me about what you want to build. What's the core idea?"
32
+
33
+ "Who is this for? What problem does it solve for them?"
34
+
35
+ "What makes your approach different from what exists today?"
36
+ ```
37
+
38
+ **Listen for:**
39
+ - Core entities (users, content, products, courses, etc.)
40
+ - Key relationships (who connects to what?)
41
+ - Critical actions (purchase, learn, create, share)
42
+ - Success metrics (revenue, engagement, impact)
43
+
44
+ ### Phase 2: Brand Identity (If Building Public-Facing Product)
45
+
46
+ Extract brand personality through conversation:
47
+
48
+ ```
49
+ "What feeling should people get when they use this?"
50
+
51
+ "If your product was a person, how would you describe them?"
52
+
53
+ "Any specific colors, fonts, or design inspiration in mind?"
54
+ ```
55
+
56
+ **Capture:**
57
+ - Primary colors (hex codes if mentioned)
58
+ - Tone of voice (professional, playful, empowering, etc.)
59
+ - Design inspiration (minimal, bold, elegant, etc.)
60
+ - Key values (transparency, speed, community, etc.)
61
+
62
+ ### Phase 3: Feature Priorities (What Matters Most)
63
+
64
+ Understand what to build first:
65
+
66
+ ```
67
+ "What's the one feature that has to work perfectly on day one?"
68
+
69
+ "What would make this a 'must-have' vs 'nice-to-have' for users?"
70
+
71
+ "Are there any features you know you DON'T want?"
72
+ ```
73
+
74
+ **Identify:**
75
+ - MVP scope (minimum viable product)
76
+ - Nice-to-have features (future iterations)
77
+ - Deal-breakers (what would make them not launch)
78
+
79
+ ### Phase 4: Technical Context (Backend vs Frontend-Only)
80
+
81
+ Determine architecture needs through natural questions:
82
+
83
+ ```
84
+ "Will multiple people be collaborating on the same data?"
85
+ → If yes: Backend needed for multi-tenant groups
86
+
87
+ "Do you need to track every action for compliance or analytics?"
88
+ → If yes: Backend needed for immutable event log
89
+
90
+ "Is this more like a Stripe checkout (frontend-only) or a Slack workspace (backend)?"
91
+ → Helps them understand the distinction
92
+ ```
93
+
94
+ **Decision Matrix:**
95
+
96
+ | User Says | Architecture | Why |
97
+ |-----------|-------------|-----|
98
+ | "Just me using it" | Frontend-only | No multi-user needed |
99
+ | "Team collaboration" | Backend | Groups + real-time sync |
100
+ | "Simple checkout flow" | Frontend-only | Stripe.js handles it |
101
+ | "Track purchase history" | Backend | Events table needed |
102
+ | "Static course content" | Frontend-only | Astro content collections |
103
+ | "Live progress tracking" | Backend | Real-time events |
104
+
105
+ ### Phase 5: Ontology Validation (Internal Check)
106
+
107
+ **Silently validate** (don't overwhelm user with ontology jargon):
108
+
109
+ Ask yourself:
110
+ 1. **Groups** - Can I identify hierarchical containers? (organizations, teams, friend circles)
111
+ 2. **People** - Are there clear roles? (owners, users, customers)
112
+ 3. **Things** - What are the core entities? (users, products, courses, content)
113
+ 4. **Connections** - What relationships exist? (owns, enrolled_in, purchased)
114
+ 5. **Events** - What actions need tracking? (created, purchased, completed)
115
+ 6. **Knowledge** - Is search/RAG needed? (embeddings, vectors, semantic search)
116
+
117
+ **If mapping is unclear:**
118
+ - Ask clarifying questions
119
+ - Suggest concrete examples
120
+ - Help them articulate the structure
121
+
122
+ **If it doesn't map:**
123
+ - This is rare (the ontology is universal)
124
+ - Help them reframe their idea
125
+ - Explain what would need to change
126
+
127
+ ---
128
+
129
+ ## Output Format
130
+
131
+ After the conversation, summarize what you learned:
132
+
133
+ ```
134
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
135
+
136
+ 🎯 VISION SUMMARY
137
+
138
+ **What:** [One sentence description]
139
+ **Who:** [Target users]
140
+ **Why:** [Core problem being solved]
141
+ **Different:** [Unique positioning]
142
+
143
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
144
+
145
+ 🎨 BRAND IDENTITY (if applicable)
146
+
147
+ **Colors:** [Primary color palette]
148
+ **Tone:** [Voice and personality]
149
+ **Style:** [Design approach]
150
+ **Values:** [Core principles]
151
+
152
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
153
+
154
+ ✨ CORE FEATURES
155
+
156
+ **MVP (Must-Have):**
157
+ 1. [Feature 1]
158
+ 2. [Feature 2]
159
+ 3. [Feature 3]
160
+
161
+ **Future (Nice-to-Have):**
162
+ - [Feature 4]
163
+ - [Feature 5]
164
+
165
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
166
+
167
+ 🏗️ ARCHITECTURE
168
+
169
+ **Recommendation:** [Frontend-only OR Backend + Frontend]
170
+ **Reasoning:** [Why this choice makes sense]
171
+
172
+ **Key Components:**
173
+ - [Component 1]: [Purpose]
174
+ - [Component 2]: [Purpose]
175
+
176
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
177
+
178
+ 📋 ONTOLOGY MAPPING
179
+
180
+ **Groups:** [Hierarchical containers identified]
181
+ **People:** [Roles and permissions]
182
+ **Things:** [Core entities]
183
+ **Connections:** [Key relationships]
184
+ **Events:** [Actions to track]
185
+ **Knowledge:** [Search/RAG needs]
186
+
187
+ ✅ **Validation:** All features map cleanly to 6-dimension ontology
188
+
189
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
190
+
191
+ 🚀 NEXT STEPS
192
+
193
+ Ready to build? Here are your options:
194
+
195
+ 1. **Create Implementation Plan**
196
+ `/plan convert "[feature description]"`
197
+ → Generates 100-cycle breakdown with specialist assignments
198
+
199
+ 2. **Refine Vision**
200
+ Continue chatting to clarify requirements
201
+
202
+ 3. **Start Building**
203
+ `/create [specific-feature]`
204
+ → Jump straight to implementation
205
+
206
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
207
+ ```
208
+
209
+ ---
210
+
211
+ ## State Persistence
212
+
213
+ **Save conversation insights to:** `.claude/state/onboarding.json`
214
+
215
+ ```json
216
+ {
217
+ "timestamp": 1234567890,
218
+ "vision": {
219
+ "what": "AI-powered course platform",
220
+ "who": "Solo creators and educators",
221
+ "why": "Existing LMS tools are too complex",
222
+ "different": "AI tutors provide personalized learning"
223
+ },
224
+ "brand": {
225
+ "colors": ["#6366F1", "#F59E0B", "#10B981"],
226
+ "tone": "Empowering, accessible, modern",
227
+ "style": "Clean, minimal, bold typography",
228
+ "values": ["Simplicity", "Personalization", "Accessibility"]
229
+ },
230
+ "features": {
231
+ "mvp": [
232
+ "Course content management",
233
+ "AI tutor chat interface",
234
+ "Progress tracking"
235
+ ],
236
+ "future": [
237
+ "Live cohorts",
238
+ "Certificates",
239
+ "Community forum"
240
+ ]
241
+ },
242
+ "architecture": {
243
+ "type": "backend",
244
+ "reasoning": "Needs real-time progress tracking and multi-user support"
245
+ },
246
+ "ontology": {
247
+ "groups": ["organization (school/creator)", "cohort (students)"],
248
+ "people": ["creator (owner)", "student (customer)"],
249
+ "things": ["course", "lesson", "ai_tutor", "progress"],
250
+ "connections": ["enrolled_in", "completed", "taught_by"],
251
+ "events": ["lesson_completed", "tutor_interaction", "certificate_earned"],
252
+ "knowledge": ["course_embeddings", "tutor_personality", "student_queries"]
253
+ },
254
+ "validated": true,
255
+ "readyToBuild": true
256
+ }
257
+ ```
258
+
259
+ **Use this file for:**
260
+ - Resuming conversations (context continuity)
261
+ - Generating installation folder docs
262
+ - Pre-filling `/plan` generation
263
+ - Customizing agent behavior
264
+
265
+ ---
266
+
267
+ ## Integration with Other Commands
268
+
269
+ ### → /plan
270
+
271
+ After `/chat` captures vision, use insights to generate plan:
272
+
273
+ ```
274
+ /plan convert "Build [vision.what] for [vision.who]"
275
+ ```
276
+
277
+ The plan generator reads `.claude/state/onboarding.json` and creates cycles aligned with:
278
+ - Brand identity → Design cycles
279
+ - Architecture choice → Backend/Frontend cycles
280
+ - Feature priorities → Implementation sequence
281
+
282
+ ### → /create
283
+
284
+ If user wants to skip planning and build specific feature:
285
+
286
+ ```
287
+ /create ai-tutor-chat
288
+ ```
289
+
290
+ Agent uses onboarding context for brand consistency.
291
+
292
+ ### → /onboard
293
+
294
+ For analyzing existing websites/brands:
295
+
296
+ ```
297
+ /onboard https://example.com
298
+ ```
299
+
300
+ Extracts brand identity, feature list, and generates onboarding.json automatically.
301
+
302
+ ---
303
+
304
+ ## Example Conversations
305
+
306
+ ### Example 1: Course Platform
307
+
308
+ **User:** `/chat I want to build an online course platform`
309
+
310
+ **Assistant:**
311
+ ```
312
+ Tell me more about this course platform idea!
313
+
314
+ What type of courses are you thinking? (e.g., coding bootcamps,
315
+ professional development, creative skills, etc.)
316
+ ```
317
+
318
+ **User:** It's for solo creators who want to sell courses on their own site, not through a marketplace.
319
+
320
+ **Assistant:**
321
+ ```
322
+ Ah, so giving creators full control of their brand and pricing - I like it!
323
+
324
+ What's the experience you want for students? Just watch videos, or
325
+ something more interactive?
326
+ ```
327
+
328
+ **User:** I want AI tutors that can answer questions about the course content in real-time.
329
+
330
+ **Assistant:**
331
+ ```
332
+ That's powerful! So the AI becomes like a teaching assistant available 24/7.
333
+
334
+ A few quick questions to help me understand the scope:
335
+
336
+ 1. Is this just for one creator (your courses), or will you have multiple
337
+ creators each with their own branded sites?
338
+
339
+ 2. Do students need progress tracking? (like "you're 60% through the course")
340
+
341
+ 3. Are courses static content, or will there be live elements like cohorts
342
+ or group discussions?
343
+ ```
344
+
345
+ **User:** Multiple creators, yes to progress tracking, mostly static content but might add live cohorts later.
346
+
347
+ **Assistant:**
348
+ ```
349
+ Perfect! Here's what I'm hearing:
350
+
351
+ 🎯 **What:** White-label course platform with AI tutoring
352
+ 🎯 **Who:** Solo creators who want their own branded course sites
353
+ 🎯 **Why:** Escape marketplace fees, keep full control and brand
354
+
355
+ For the architecture - with multiple creators and progress tracking,
356
+ you'll need a backend. Here's why:
357
+
358
+ - Each creator is a separate "group" (multi-tenant isolation)
359
+ - Progress tracking needs an immutable event log
360
+ - AI tutor needs access to course embeddings and chat history
361
+
362
+ Does this make sense? I can break down the full architecture and create
363
+ a 100-cycle implementation plan whenever you're ready.
364
+
365
+ What should we discuss next? Brand identity? Feature priorities?
366
+ Or ready to jump into building?
367
+ ```
368
+
369
+ ### Example 2: E-commerce Store
370
+
371
+ **User:** `/chat simple shopify alternative`
372
+
373
+ **Assistant:**
374
+ ```
375
+ I love the simplicity angle! Shopify can be overwhelming.
376
+
377
+ What are you selling? (physical products, digital downloads, services?)
378
+ ```
379
+
380
+ **User:** Digital downloads - fonts, templates, design assets
381
+
382
+ **Assistant:**
383
+ ```
384
+ Perfect use case for going lightweight!
385
+
386
+ For digital downloads, you probably don't need a backend at all.
387
+ Here's what you could do with just frontend:
388
+
389
+ - Product pages built with Astro (static, lightning fast)
390
+ - Stripe Checkout handles payment + download delivery
391
+ - No database needed (Stripe stores everything)
392
+
393
+ Would you want customer accounts? Or just one-time checkout?
394
+ ```
395
+
396
+ **User:** Just one-time checkout for now. Maybe accounts later.
397
+
398
+ **Assistant:**
399
+ ```
400
+ Then we can start 100% frontend-only! Here's the plan:
401
+
402
+ ✅ **Now (Frontend-Only):**
403
+ - Astro pages for product catalog
404
+ - Stripe Checkout for purchases
405
+ - Automatic download delivery via Stripe
406
+
407
+ 🔮 **Later (Add Backend When Needed):**
408
+ - Customer accounts → Groups + People tables
409
+ - Purchase history → Events table
410
+ - Wishlists → Connections table
411
+
412
+ Want me to create a plan for the frontend-only version first?
413
+ Or want to chat about brand identity and design?
414
+ ```
415
+
416
+ ---
417
+
418
+ ## Key Principles
419
+
420
+ ### 1. Be Conversational, Not Robotic
421
+
422
+ **❌ Bad:**
423
+ ```
424
+ Question 1: What is your product?
425
+ Question 2: Who is your target user?
426
+ Question 3: What features do you need?
427
+ ```
428
+
429
+ **✅ Good:**
430
+ ```
431
+ Tell me about what you're building! What's the big idea?
432
+
433
+ [User responds]
434
+
435
+ That's interesting! So you're solving [X] for [Y]. What made you
436
+ realize this was a problem worth solving?
437
+ ```
438
+
439
+ ### 2. Validate Through Questions, Not Lectures
440
+
441
+ **❌ Bad:**
442
+ ```
443
+ Your feature must map to our 6-dimension ontology. Please identify
444
+ the groups, people, things, connections, events, and knowledge.
445
+ ```
446
+
447
+ **✅ Good:**
448
+ ```
449
+ So students enroll in courses - got it. Will there be any grouping?
450
+ Like cohorts, or classes, or is everyone learning solo?
451
+
452
+ [This naturally uncovers Groups dimension without jargon]
453
+ ```
454
+
455
+ ### 3. Suggest, Don't Prescribe
456
+
457
+ **❌ Bad:**
458
+ ```
459
+ You must use a backend because you mentioned multi-user.
460
+ ```
461
+
462
+ **✅ Good:**
463
+ ```
464
+ With multiple users collaborating, you have two options:
465
+
466
+ 1. **Frontend + Third-party** - Use Firestore or Supabase for real-time data
467
+ 2. **Frontend + Convex Backend** - Full control, type-safety, 6D ontology
468
+
469
+ What's more important: getting started fast, or having full control?
470
+ ```
471
+
472
+ ### 4. Connect Dots to Ontology Silently
473
+
474
+ Internally validate against 6 dimensions, but speak user language:
475
+
476
+ **User says:** "Students can bookmark lessons they like"
477
+
478
+ **You think:** `Connection type: "bookmarked" between Person→Thing`
479
+
480
+ **You say:** "Nice! So each student has their own saved list. Should they be able to share these bookmarks with others?"
481
+
482
+ ---
483
+
484
+ ## Context Optimization
485
+
486
+ **This file: ~400 tokens**
487
+
488
+ **During conversation:**
489
+ - Load `.claude/state/onboarding.json` if it exists (< 200 tokens)
490
+ - Reference `one/knowledge/ontology.md` only when validation needed (< 1K tokens)
491
+ - Total context: ~1.5K tokens per chat session
492
+
493
+ **After conversation:**
494
+ - Save insights to `onboarding.json`
495
+ - Pass to `/plan` with < 500 tokens
496
+ - No need to re-explain vision
497
+
498
+ ---
499
+
500
+ ## No Functionality Here
501
+
502
+ This file only describes behavior. The actual slash command is invoked when user types `/chat [optional-idea]`.
503
+
504
+ The conversation is handled by Claude directly, following this guide's principles.
@@ -78,25 +78,75 @@ To start a NEW feature, run:
78
78
 
79
79
  ---
80
80
 
81
- ## Available Features Ready to Build
81
+ ## Ready-to-Build Projects (Optimized Plans Available)
82
82
 
83
- ### Shop (E-commerce)
83
+ **Use `/plan [project]` to see full optimized plan, or `/create [project]` to start building:**
84
+
85
+ ### 1. Blog (30 cycles · Frontend-only)
86
+ ```bash
87
+ /plan blog # See full plan with quick wins
88
+ /create blog # Start building article publishing system
89
+ /fast blog-post # Quick: Create single blog post page
90
+ ```
91
+ **Features:** Article publishing, categories, tags, search, RSS, SEO
92
+ **Quick Win:** Working blog by Cycle 3, MVP by Cycle 10
93
+ **Architecture:** Frontend-only (Astro content collections)
94
+
95
+ ### 2. Pages (20 cycles · Frontend-only)
96
+ ```bash
97
+ /plan pages # See full plan with quick wins
98
+ /create pages # Start building landing page builder
99
+ /fast landing # Quick: Create single landing page
100
+ ```
101
+ **Features:** Hero sections, features, testimonials, CTAs, responsive design
102
+ **Quick Win:** Hero section by Cycle 3, MVP by Cycle 8
103
+ **Architecture:** Frontend-only (static pages)
104
+
105
+ ### 3. Shop (28 cycles · Frontend + Stripe)
106
+ ```bash
107
+ /plan shop # See full plan with quick wins
108
+ /create shop # Start building e-commerce store
109
+ /fast product # Quick: Add single product page
110
+ ```
111
+ **Features:** Product catalog, cart, checkout, Stripe payments, orders
112
+ **Quick Win:** Product listing by Cycle 3, first sale by Cycle 8
113
+ **Architecture:** Frontend-only + Stripe.js (no backend initially)
114
+
115
+ ### 4. Dashboard (40 cycles · Backend + Frontend)
84
116
  ```bash
85
- /create shop # Customize shop page
86
- /create shop-product-cards # Add product card variants
87
- /create shop-recommendations # Add AI product recommendations
88
- /create shop-reviews # Add product review section
117
+ /plan dashboard # See full plan with quick wins
118
+ /create dashboard # Start building analytics dashboard
89
119
  ```
90
- **Location:** `/web/src/pages/shop.astro`
91
- **Components:** Cart, checkout, product filters, payment integration
92
- **Cycles:** 20-35 cycles (frontend-only)
120
+ **Features:** Real-time metrics, charts, activity feed, team management
121
+ **Quick Win:** Backend schema by Cycle 3, 3 metrics live by Cycle 8
122
+ **Architecture:** Backend (Convex real-time) + Frontend
93
123
 
94
- ### Blog (Content)
124
+ ### 5. Email (45 cycles · Backend + Frontend)
95
125
  ```bash
96
- /create blog-featured # Add featured articles section
97
- /create blog-search # Add blog search & filtering
98
- /create blog-categories # Add category navigation
99
- /create blog-newsletter # Add newsletter signup
126
+ /plan email # See full plan with quick wins
127
+ /create email # Start building messaging system
128
+ ```
129
+ **Features:** Conversations, threads, search, notifications, attachments
130
+ **Quick Win:** Backend schema by Cycle 3, send/receive by Cycle 8
131
+ **Architecture:** Backend (Convex real-time) + Frontend
132
+
133
+ ### 6. Website (55 cycles · Backend + Frontend)
134
+ ```bash
135
+ /plan website # See full plan with quick wins
136
+ /create website # Start building website builder
137
+ ```
138
+ **Features:** Page builder, CMS, templates, multi-language, SEO tools
139
+ **Quick Win:** Backend schema by Cycle 3, page editor by Cycle 8
140
+ **Architecture:** Backend (Convex CMS) + Frontend
141
+
142
+ ---
143
+
144
+ ## Or Build Custom Features
145
+
146
+ ### Single Component/Page
147
+ ```bash
148
+ /fast [feature] # Build in minutes (< 5 files)
149
+ /create [feature-name] # Build specific feature (plan generated)
100
150
  ```
101
151
  **Location:** `/web/src/pages/blog/`
102
152
  **Components:** Article cards, RSS feeds, tags, archives
@@ -175,9 +225,73 @@ To start a NEW feature, run:
175
225
  /create backend invoice-system # Invoice/billing system (70-100 cycles)
176
226
  ```
177
227
 
228
+ ## Before You Start: Search for Existing Code
229
+
230
+ **CRITICAL:** Before implementing anything new:
231
+
232
+ 1. **Search for existing implementations:**
233
+ ```bash
234
+ # Frontend components
235
+ find /Users/toc/Server/ONE/web/src/components -name "*.tsx"
236
+
237
+ # Pages
238
+ find /Users/toc/Server/ONE/web/src/pages -name "*.astro" -o -name "*.tsx"
239
+
240
+ # Backend functions
241
+ find /Users/toc/Server/ONE/backend/convex -name "*.ts"
242
+
243
+ # Search by keyword (example: "product")
244
+ grep -r "Product" /Users/toc/Server/ONE/web/src/ /Users/toc/Server/ONE/backend/convex/
245
+ ```
246
+
247
+ 2. **Ask yourself:**
248
+ - Does a similar component/function exist?
249
+ - Can I extend it instead of creating new?
250
+ - What patterns are already established?
251
+
252
+ 3. **Build on what exists:**
253
+ - ✅ Extend ThingCard, not create ProductCard
254
+ - ✅ Add prop to existing component
255
+ - ✅ Enhance existing mutation
256
+ - ❌ Duplicate patterns
257
+
258
+ **Pattern convergence = 98% accuracy. Pattern divergence = 30% accuracy.**
259
+
260
+ ---
261
+
178
262
  ## Workflow
179
263
 
180
- ### Step 1: Describe What You Want
264
+ ### Step 1: Discover Existing Code (MANDATORY)
265
+
266
+ **Before generating ANY code:**
267
+
268
+ 1. **Search codebase:**
269
+ ```bash
270
+ # Components
271
+ ls -la /Users/toc/Server/ONE/web/src/components/features/
272
+
273
+ # Pages
274
+ ls -la /Users/toc/Server/ONE/web/src/pages/
275
+
276
+ # Backend
277
+ ls -la /Users/toc/Server/ONE/backend/convex/mutations/
278
+ ls -la /Users/toc/Server/ONE/backend/convex/queries/
279
+
280
+ # Search for patterns (replace <keyword> with your feature)
281
+ grep -r "<keyword>" /Users/toc/Server/ONE/web/src/
282
+ grep -r "<keyword>" /Users/toc/Server/ONE/backend/convex/
283
+ ```
284
+
285
+ 2. **Document what exists:**
286
+ - Existing components that might be reusable
287
+ - Existing mutations/queries to extend
288
+ - Established patterns to follow
289
+
290
+ 3. **Decision:**
291
+ - ✅ Extend existing code (90% of cases)
292
+ - ⚠️ Create new only if truly different (10% of cases)
293
+
294
+ ### Step 2: Describe What You Want
181
295
 
182
296
  ```bash
183
297
  /create shop-recommendations
@@ -187,7 +301,7 @@ To start a NEW feature, run:
187
301
  /create backend ai-tutors
188
302
  ```
189
303
 
190
- ### Step 2: Agent-Director Validates & Plans
304
+ ### Step 3: Agent-Director Validates & Plans
191
305
 
192
306
  1. **Check existing /web components**
193
307
  2. **Decide: Frontend-only or Backend-required?**
@@ -195,7 +309,9 @@ To start a NEW feature, run:
195
309
  4. **Assign to specialist(s)** (agent-frontend, agent-backend, etc.)
196
310
  5. **Load dependencies** from cycle context
197
311
 
198
- ### Step 3: See Your Plan
312
+ **Rule:** Prefer extending over creating new code.
313
+
314
+ ### Step 4: See Your Plan
199
315
 
200
316
  ```bash
201
317
  /plan show
@@ -206,7 +322,7 @@ To start a NEW feature, run:
206
322
  # - Dependencies & parallel opportunities
207
323
  ```
208
324
 
209
- ### Step 4: Execute Cycles
325
+ ### Step 5: Execute Cycles
210
326
 
211
327
  Follow the cycle workflow:
212
328
  ```bash