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,251 @@
1
+ ---
2
+ title: Development Commands Reference
3
+ dimension: knowledge
4
+ category: development
5
+ tags: commands, development, workflow, tools
6
+ related_dimensions: all
7
+ scope: global
8
+ created: 2025-11-08
9
+ version: 1.0.0
10
+ ai_context: |
11
+ Complete reference of all development commands for frontend, backend, testing,
12
+ and deployment workflows in the ONE platform.
13
+ ---
14
+
15
+ # Development Commands Reference
16
+
17
+ **Quick reference for all development workflows.**
18
+
19
+ ---
20
+
21
+ ## Frontend Development
22
+
23
+ ```bash
24
+ cd web/
25
+
26
+ # Development server (localhost:4321)
27
+ bun run dev
28
+
29
+ # Build for production (includes type checking)
30
+ bun run build
31
+
32
+ # Type checking only
33
+ bunx astro check
34
+
35
+ # Generate content collection types
36
+ bunx astro sync
37
+
38
+ # Linting
39
+ bun run lint
40
+
41
+ # Formatting
42
+ bun run format
43
+ ```
44
+
45
+ ---
46
+
47
+ ## Backend Development
48
+
49
+ ```bash
50
+ cd backend/
51
+
52
+ # Start Convex dev server (watch mode)
53
+ npx convex dev
54
+
55
+ # Deploy to production
56
+ npx convex deploy
57
+
58
+ # Run query from CLI
59
+ npx convex run queries/entities:list '{"type": "user"}'
60
+
61
+ # View function logs
62
+ npx convex logs --history 50 --success
63
+ ```
64
+
65
+ ---
66
+
67
+ ## Testing
68
+
69
+ ```bash
70
+ cd web/
71
+
72
+ # Run all tests
73
+ bun test
74
+
75
+ # Run auth tests specifically
76
+ bun test test/auth
77
+
78
+ # Watch mode
79
+ bun test --watch
80
+ ```
81
+
82
+ **Test Coverage:**
83
+
84
+ - 50+ test cases for authentication (6 methods: email/password, OAuth, magic links, password reset, email verification, 2FA)
85
+ - Integration tests verify frontend → backend auth flows
86
+ - Backend connection: `https://shocking-falcon-870.convex.cloud`
87
+
88
+ ---
89
+
90
+ ## Cycle Workflow Commands
91
+
92
+ ```
93
+ ██████╗ ███╗ ██╗███████╗
94
+ ██╔═══██╗████╗ ██║██╔════╝
95
+ ██║ ██║██╔██╗ ██║█████╗
96
+ ██║ ██║██║╚██╗██║██╔══╝
97
+ ╚██████╔╝██║ ╚████║███████╗
98
+ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
99
+
100
+ Make Your Ideas Real
101
+
102
+ https://one.ie • npx oneie
103
+
104
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
105
+ /now /next /todo /done
106
+ /build /design /deploy /see
107
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
108
+ ```
109
+
110
+ **Workflow Commands:**
111
+ - `/now` - Display current cycle and what you're working on
112
+ - `/next` - Advance to next cycle and load context
113
+ - `/todo` - View complete task list (100-cycle sequence)
114
+ - `/done` - Mark current cycle complete and advance
115
+
116
+ **Creation Commands:**
117
+ - `/build` - Build features with AI specialists
118
+ - `/design` - Create wireframes & UI components
119
+ - `/deploy` - Ship to production
120
+
121
+ **Insight Commands:**
122
+ - `/see` - View analytics, refine vision, explore courses
123
+
124
+ ---
125
+
126
+ ## Deployment
127
+
128
+ ### Automated Release (v3.0.0+)
129
+
130
+ ```bash
131
+ # Patch release (bug fixes)
132
+ /release patch
133
+
134
+ # Minor release (new features)
135
+ /release minor
136
+
137
+ # Major release (breaking changes)
138
+ /release major
139
+
140
+ # Sync files without version bump
141
+ /release sync
142
+ ```
143
+
144
+ **Read full deployment guide:** `/.claude/commands/release.md`
145
+
146
+ ### Manual Deployment
147
+
148
+ **Web (Cloudflare Pages):**
149
+
150
+ ```bash
151
+ cd web/
152
+ bun run build
153
+ wrangler pages deploy dist --project-name=web
154
+ ```
155
+
156
+ **Backend (Convex Cloud):**
157
+
158
+ ```bash
159
+ cd backend/
160
+ npx convex deploy
161
+ ```
162
+
163
+ Convex automatically deploys on git push when connected to GitHub.
164
+
165
+ ---
166
+
167
+ ## Installation Management
168
+
169
+ ```bash
170
+ # Initialize new installation folder
171
+ npx oneie init
172
+
173
+ # Prompts for:
174
+ # - Organization name
175
+ # - Installation identifier
176
+ # Creates folder structure and updates .env.local
177
+ ```
178
+
179
+ ---
180
+
181
+ ## Common Command Sequences
182
+
183
+ **Starting a new feature:**
184
+ ```bash
185
+ # 1. Load current cycle
186
+ /now
187
+
188
+ # 2. Run dev servers (parallel terminals)
189
+ cd web && bun run dev # Terminal 1
190
+ cd backend && npx convex dev # Terminal 2
191
+
192
+ # 3. Work on feature...
193
+
194
+ # 4. Test changes
195
+ cd web && bun test
196
+
197
+ # 5. Mark cycle complete
198
+ /done
199
+ ```
200
+
201
+ **Deploying a release:**
202
+ ```bash
203
+ # All-in-one deployment
204
+ /release minor
205
+
206
+ # Manual deployment
207
+ cd web && bun run build && wrangler pages deploy dist
208
+ cd backend && npx convex deploy
209
+ ```
210
+
211
+ **Debugging an issue:**
212
+ ```bash
213
+ # Check types
214
+ cd web && bunx astro check
215
+
216
+ # Check backend logs
217
+ cd backend && npx convex logs --history 50
218
+
219
+ # Run specific tests
220
+ cd web && bun test test/auth/email-password.test.ts
221
+ ```
222
+
223
+ ---
224
+
225
+ ## Environment Setup
226
+
227
+ **Root (.env):**
228
+ ```bash
229
+ CLOUDFLARE_GLOBAL_API_KEY=your-key
230
+ CLOUDFLARE_ACCOUNT_ID=your-account-id
231
+ CLOUDFLARE_EMAIL=your-email
232
+ ```
233
+
234
+ **Web (.env.local):**
235
+ ```bash
236
+ PUBLIC_CONVEX_URL=https://shocking-falcon-870.convex.cloud
237
+ CONVEX_DEPLOYMENT=prod:shocking-falcon-870
238
+ BETTER_AUTH_SECRET=your-secret-key
239
+ BETTER_AUTH_URL=http://localhost:4321
240
+ ```
241
+
242
+ **Backend (.env.local):**
243
+ ```bash
244
+ CONVEX_DEPLOYMENT=prod:shocking-falcon-870
245
+ RESEND_API_KEY=your-resend-api-key
246
+ RESEND_FROM_EMAIL=noreply@yourdomain.com
247
+ ```
248
+
249
+ ---
250
+
251
+ **Quick access to the right command for the task at hand.**
@@ -0,0 +1,314 @@
1
+ ---
2
+ title: Important Development Guidelines
3
+ dimension: knowledge
4
+ category: development
5
+ tags: guidelines, best-practices, tailwind, react, cloudflare
6
+ related_dimensions: all
7
+ scope: global
8
+ created: 2025-11-08
9
+ version: 1.0.0
10
+ ai_context: |
11
+ Critical development guidelines for Tailwind v4, React 19, Cloudflare,
12
+ authentication, environment variables, and content collections.
13
+ ---
14
+
15
+ # Important Development Guidelines
16
+
17
+ **Critical patterns and conventions for ONE platform development.**
18
+
19
+ ---
20
+
21
+ ## Authentication
22
+
23
+ - Backend handles all auth logic (`backend/convex/auth.ts`)
24
+ - Frontend uses Better Auth client hooks
25
+ - 6 authentication methods supported:
26
+ 1. Email/Password
27
+ 2. OAuth (Google, GitHub, etc.)
28
+ 3. Magic Links
29
+ 4. Password Reset
30
+ 5. Email Verification
31
+ 6. Two-Factor Authentication (2FA)
32
+ - All auth pages under `/account/*` route
33
+ - Session management via Better Auth cookies
34
+ - Rate limiting via `@convex-dev/rate-limiter`
35
+
36
+ ---
37
+
38
+ ## Environment Variables
39
+
40
+ ### Root (.env) - CRITICAL FOR DEPLOYMENTS
41
+
42
+ ```bash
43
+ # Cloudflare Global API Key - FULL ACCESS to Cloudflare API
44
+ # This provides complete programmatic access for automated deployments
45
+ CLOUDFLARE_GLOBAL_API_KEY=your-cloudflare-global-api-key
46
+ CLOUDFLARE_ACCOUNT_ID=your-cloudflare-account-id
47
+ CLOUDFLARE_EMAIL=your-cloudflare-email
48
+
49
+ # Alternative: Cloudflare API Token (scoped access)
50
+ CLOUDFLARE_API_TOKEN=your-cloudflare-api-token
51
+ ```
52
+
53
+ **IMPORTANT:** The `CLOUDFLARE_GLOBAL_API_KEY` provides **FULL ACCESS** to the Cloudflare API. This enables automated deployments via `./scripts/cloudflare-deploy.sh` and the `/release` command without manual intervention. Keep this key secure and never commit `.env` to version control.
54
+
55
+ ### Web (.env.local)
56
+
57
+ ```bash
58
+ PUBLIC_CONVEX_URL=https://shocking-falcon-870.convex.cloud
59
+ CONVEX_DEPLOYMENT=prod:shocking-falcon-870
60
+ BETTER_AUTH_SECRET=your-secret-key
61
+ BETTER_AUTH_URL=http://localhost:4321
62
+ # OAuth credentials...
63
+ ```
64
+
65
+ ### Backend (.env.local)
66
+
67
+ ```bash
68
+ CONVEX_DEPLOYMENT=prod:shocking-falcon-870
69
+ RESEND_API_KEY=your-resend-api-key
70
+ RESEND_FROM_EMAIL=noreply@yourdomain.com
71
+ ```
72
+
73
+ ---
74
+
75
+ ## Tailwind v4 Specifics
76
+
77
+ **CRITICAL:** Tailwind v4 uses CSS-based configuration (no JS config file).
78
+
79
+ ### Core Principles
80
+
81
+ - **NO `tailwind.config.mjs` file** - Use CSS `@theme` blocks instead
82
+ - **ALWAYS use HSL format:** `--color-name: 0 0% 100%`
83
+ - **ALWAYS wrap with `hsl()`:** `hsl(var(--color-background))`
84
+ - **NO `@apply` directive** in Tailwind v4
85
+ - **Use `@variant dark (.dark &)`** for dark mode
86
+ - **Add `@source` directive** to scan component files
87
+
88
+ ### Example Configuration
89
+
90
+ ```css
91
+ /* src/styles/global.css */
92
+ @import "tailwindcss";
93
+
94
+ @theme {
95
+ --color-background: 0 0% 100%;
96
+ --color-foreground: 222.2 84% 4.9%;
97
+ --color-primary: 222.2 47.4% 11.2%;
98
+ }
99
+
100
+ /* Dark mode overrides */
101
+ @variant dark (.dark &);
102
+
103
+ .dark {
104
+ --color-background: 222.2 84% 4.9%;
105
+ --color-foreground: 210 40% 98%;
106
+ }
107
+
108
+ /* Use colors with hsl() wrapper */
109
+ .my-component {
110
+ background-color: hsl(var(--color-background));
111
+ color: hsl(var(--color-foreground));
112
+ }
113
+ ```
114
+
115
+ ### Common Mistakes
116
+
117
+ **WRONG:**
118
+ ```css
119
+ /* Don't use OKLCH or raw values */
120
+ --color-primary: oklch(0.5 0.2 180);
121
+ background: var(--color-background); /* Missing hsl() */
122
+ ```
123
+
124
+ **CORRECT:**
125
+ ```css
126
+ /* Use HSL with hsl() wrapper */
127
+ --color-primary: 222.2 47.4% 11.2%;
128
+ background: hsl(var(--color-background));
129
+ ```
130
+
131
+ ---
132
+
133
+ ## React 19 + Cloudflare
134
+
135
+ **SSR Compatibility:**
136
+
137
+ - Uses `react-dom/server.edge` for Cloudflare Workers compatibility
138
+ - Configured in `astro.config.mjs` with Vite alias:
139
+ ```javascript
140
+ vite: {
141
+ resolve: {
142
+ alias: {
143
+ 'react-dom/server': 'react-dom/server.edge'
144
+ }
145
+ }
146
+ }
147
+ ```
148
+ - Deployed to Cloudflare Pages with edge rendering
149
+ - Full React 19 features (Server Components, Actions, Hooks)
150
+
151
+ ### Islands Architecture
152
+
153
+ ```astro
154
+ <!-- Static (no JS) -->
155
+ <ProductCard product={product} />
156
+
157
+ <!-- Interactive (loads immediately) -->
158
+ <ShoppingCart client:load />
159
+
160
+ <!-- Deferred (loads when idle) -->
161
+ <SearchBox client:idle />
162
+
163
+ <!-- Lazy (loads when visible) -->
164
+ <RelatedProducts client:visible />
165
+ ```
166
+
167
+ ---
168
+
169
+ ## Content Collections
170
+
171
+ **Type-safe content management:**
172
+
173
+ - Blog posts in `src/content/blog/`
174
+ - Type-safe schemas in `src/content/config.ts`
175
+ - Run `bunx astro sync` after content changes
176
+ - Use `CollectionEntry<"blog">` type (lowercase)
177
+
178
+ ### Example Schema
179
+
180
+ ```typescript
181
+ // src/content/config.ts
182
+ import { defineCollection, z } from 'astro:content';
183
+
184
+ const blog = defineCollection({
185
+ schema: z.object({
186
+ title: z.string(),
187
+ description: z.string(),
188
+ pubDate: z.coerce.date(),
189
+ updatedDate: z.coerce.date().optional(),
190
+ tags: z.array(z.string()).optional(),
191
+ }),
192
+ });
193
+
194
+ export const collections = { blog };
195
+ ```
196
+
197
+ ### Usage
198
+
199
+ ```astro
200
+ ---
201
+ import { getCollection } from 'astro:content';
202
+ const posts = await getCollection('blog');
203
+ ---
204
+
205
+ {posts.map(post => (
206
+ <article>
207
+ <h2>{post.data.title}</h2>
208
+ <p>{post.data.description}</p>
209
+ </article>
210
+ ))}
211
+ ```
212
+
213
+ ---
214
+
215
+ ## Multi-Tenancy Guidelines
216
+
217
+ **CRITICAL:** Every mutation/query MUST scope by groupId.
218
+
219
+ ```typescript
220
+ // ALWAYS validate group
221
+ const group = await ctx.db.get(args.groupId);
222
+ if (!group || group.status !== "active") {
223
+ throw new Error("Invalid group");
224
+ }
225
+
226
+ // ALWAYS filter by groupId
227
+ const things = await ctx.db
228
+ .query("things")
229
+ .withIndex("group_type", q =>
230
+ q.eq("groupId", args.groupId).eq("type", args.type)
231
+ )
232
+ .collect();
233
+ ```
234
+
235
+ **Never query without groupId scope.** Cross-tenant data leaks = security catastrophe.
236
+
237
+ ---
238
+
239
+ ## Installation Folders
240
+
241
+ **Data isolation via groupId, NOT schema customization.**
242
+
243
+ ### Directory Structure
244
+
245
+ ```
246
+ /one/ # Global templates (everyone uses)
247
+ /<installation-name>/ # Organization-specific overrides
248
+ ├── knowledge/
249
+ │ ├── brand-guide.md
250
+ │ ├── features.md
251
+ │ └── rules.md
252
+ └── groups/<group-slug>/
253
+ ```
254
+
255
+ ### Security
256
+
257
+ - Never store secrets in installation folders
258
+ - Use `.env.local` for sensitive configuration
259
+ - Installation folders excluded from git by default
260
+
261
+ ---
262
+
263
+ ## Code Pattern Conventions
264
+
265
+ ### Import Aliases
266
+
267
+ ```typescript
268
+ import { api } from "@/convex/_generated/api";
269
+ import { Button } from "@/components/ui/button";
270
+ import { cn } from "@/lib/utils";
271
+ ```
272
+
273
+ ### TypeScript Strict Mode
274
+
275
+ - `strict: true` enabled
276
+ - No `any` except in entity `properties` field
277
+ - Use discriminated unions for errors (`_tag` field)
278
+
279
+ ### Error Handling
280
+
281
+ ```typescript
282
+ // Tagged union pattern
283
+ type Result<T> =
284
+ | { _tag: "success"; value: T }
285
+ | { _tag: "error"; error: string };
286
+ ```
287
+
288
+ ---
289
+
290
+ ## Performance Guidelines
291
+
292
+ ### Astro Islands
293
+
294
+ - Default to static HTML (no JS)
295
+ - Add interactivity strategically with `client:*` directives
296
+ - Use `client:idle` for non-critical components
297
+ - Use `client:visible` for below-the-fold content
298
+
299
+ ### Code Splitting
300
+
301
+ ```typescript
302
+ // Dynamic imports for heavy components
303
+ const HeavyChart = lazy(() => import('./HeavyChart'));
304
+ ```
305
+
306
+ ### Database Queries
307
+
308
+ - Always use indexes for queries
309
+ - Batch operations when possible
310
+ - Use `first()` instead of `collect()` for single items
311
+
312
+ ---
313
+
314
+ **Follow these guidelines for consistent, performant, secure development.**