oneie 3.6.25 → 3.6.27

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 (55) hide show
  1. package/.claude/agents/TROUBLESHOOTING.md +530 -0
  2. package/.claude/agents/agent-builder.md +226 -198
  3. package/.claude/agents/agent-claude.md +645 -0
  4. package/.claude/agents/agent-designer.md +166 -11
  5. package/.claude/agents/agent-director.md +109 -41
  6. package/.claude/agents/agent-frontend.md +314 -27
  7. package/.claude/agents/agent-quality.md +377 -0
  8. package/.claude/commands/chat.md +504 -0
  9. package/.claude/commands/create.md +134 -18
  10. package/.claude/commands/fast.md +531 -0
  11. package/.claude/commands/one.md +12 -85
  12. package/.claude/commands/optimize.md +74 -0
  13. package/.claude/commands/plan.md +420 -373
  14. package/.claude/commands/review.md +99 -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.md +105 -0
  24. package/dist/commands/agent.d.ts +18 -0
  25. package/dist/commands/agent.d.ts.map +1 -0
  26. package/dist/commands/agent.js +271 -0
  27. package/dist/commands/agent.js.map +1 -0
  28. package/dist/commands/init.js +1 -1
  29. package/dist/commands/init.js.map +1 -1
  30. package/dist/index.js +20 -0
  31. package/dist/index.js.map +1 -1
  32. package/dist/lib/agent-detection.d.ts +19 -0
  33. package/dist/lib/agent-detection.d.ts.map +1 -0
  34. package/dist/lib/agent-detection.js +87 -0
  35. package/dist/lib/agent-detection.js.map +1 -0
  36. package/dist/lib/detect.d.ts +45 -0
  37. package/dist/lib/detect.d.ts.map +1 -0
  38. package/dist/lib/detect.js +221 -0
  39. package/dist/lib/detect.js.map +1 -0
  40. package/llms.txt +257 -0
  41. package/one/knowledge/cascading-context-specification.md +1617 -0
  42. package/one/knowledge/claude-code-integration.md +1293 -0
  43. package/one/knowledge/development-commands.md +251 -0
  44. package/one/knowledge/games-english.md +691 -0
  45. package/one/knowledge/games.md +1082 -0
  46. package/one/knowledge/guidelines.md +314 -0
  47. package/one/knowledge/parallel-agents.md +932 -0
  48. package/one/knowledge/performance.md +459 -0
  49. package/one/knowledge/troubleshooting.md +434 -0
  50. package/one/things/plans/dsl-claude-code.md +1011 -0
  51. package/one/things/plans/npx-agent-safety.md +785 -0
  52. package/one/things/plans/npx-agent.md +1089 -0
  53. package/one/things/plans/remove-backend-development-from-agents.md +1331 -0
  54. package/package.json +3 -2
  55. package/.claude/agents/AUDIT-agent-ops-alignment.md +0 -379
@@ -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.**