oneie 3.6.7 → 3.6.11
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-backend.md +83 -0
- package/.claude/agents/agent-designer.md +97 -0
- package/.claude/agents/agent-director.md +118 -7
- package/.claude/agents/agent-documenter.md +93 -0
- package/.claude/agents/agent-frontend.md +96 -0
- package/.claude/agents/agent-ops.md +182 -25
- package/.claude/agents/agent-problem-solver.md +166 -0
- package/.claude/agents/agent-quality.md +127 -0
- package/.claude/commands/build.md +293 -0
- package/.claude/commands/cascade.md +231 -127
- package/.claude/commands/mcp-toggle.md +93 -0
- package/.claude/commands/one.md +198 -116
- package/.claude/commands/plan.md +394 -80
- package/.claude/commands/release.md +41 -19
- package/.claude/commands/server.md +2 -0
- package/.claude/hooks/root-cleanup.py +75 -0
- package/.claude/skills/INDEX.md +523 -0
- package/.claude/skills/REGISTRY.md +529 -0
- package/.claude/skills/agent-backend-create-mutation.md +319 -0
- package/.claude/skills/agent-designer-create-wireframe.md +341 -0
- package/.claude/skills/agent-frontend-create-page.md +413 -0
- package/.claude/skills/agents/README.md +238 -0
- package/dist/clone-web.js +1 -1
- package/dist/clone-web.js.map +1 -1
- package/folders.yaml +1 -1
- package/one/.obsidian/workspace.json +38 -38
- package/one/connections/api/queries-reference.md +842 -0
- package/one/connections/api-reference.md +1011 -0
- package/one/connections/integration-examples.md +875 -0
- package/one/connections/integration-guide.md +869 -0
- package/one/connections/integration-phase2.md +736 -0
- package/one/events/API_ROUTES_FIXES_SUMMARY.md +262 -0
- package/one/events/ASTRO-INTEGRATION-EXAMPLES.md +636 -0
- package/one/events/BEFORE_AFTER_COMPARISON.md +960 -0
- package/one/events/CONNECTIONS_DEMO.md +501 -0
- package/one/events/DELIVERABLES.md +432 -0
- package/one/events/DEMO-GROUPS-PAGE.md +392 -0
- package/one/events/DEMO-TESTING-SUMMARY.md +518 -0
- package/one/events/DEMO_COMPONENTS.md +487 -0
- package/one/events/DEMO_HOOKS_INDEX.md +334 -0
- package/one/events/DEMO_INFRASTRUCTURE.md +905 -0
- package/one/events/DEMO_INFRASTRUCTURE_SUMMARY.md +570 -0
- package/one/events/DEMO_INTEGRATION_CHECKLIST.md +431 -0
- package/one/events/DEMO_QUICK_REFERENCE.md +441 -0
- package/one/events/DEMO_SETUP.md +476 -0
- package/one/events/EFFECT_TS_API_PATTERN.md +478 -0
- package/one/events/GROUPS_DEMO_IMPLEMENTATION.md +414 -0
- package/one/events/HOOKS-DEMO.md +441 -0
- package/one/events/ONTOLOGY-HOOKS-README.md +700 -0
- package/one/events/ONTOLOGY-INTEGRATION-MANIFEST.md +365 -0
- package/one/events/QA-CHECKLIST.md +674 -0
- package/one/events/QUICK-START-ONTOLOGY.md +408 -0
- package/one/events/SEARCH_DEMO_CODE_REFERENCE.md +639 -0
- package/one/events/SEARCH_DEMO_DELIVERY.md +415 -0
- package/one/events/SEARCH_DEMO_SUMMARY.md +303 -0
- package/one/events/SEARCH_DEMO_VISUAL_GUIDE.md +381 -0
- package/one/events/TEST-PLAN-INDEX.md +346 -0
- package/one/events/TEST-PLAN.md +1417 -0
- package/one/events/TESTING-DELIVERY.txt +372 -0
- package/one/events/TRANSITIONS-QUICK-START.md +141 -0
- package/one/events/TYPESCRIPT_FIXES.md +152 -0
- package/one/events/TYPESCRIPT_FIXES_COMPLETE.txt +412 -0
- package/one/events/TYPESCRIPT_FIXES_INDEX.md +341 -0
- package/one/events/VIEW-TRANSITIONS.md +428 -0
- package/one/events/backend-integration-tests.md +606 -0
- package/one/events/backend-structure-diagram.txt +393 -0
- package/one/events/backend-structure-summary.txt +269 -0
- package/one/events/cloudflare-pages-infrastructure-setup.md +264 -0
- package/one/events/convex-analysis-index.md +304 -0
- package/one/events/convex-structure-analysis.md +700 -0
- package/one/events/design-spec-complete.md +208 -0
- package/one/events/ontology-test-examples.md +562 -0
- package/one/events/phase1-backend-implementation-complete.md +518 -0
- package/one/events/test-dashboard.md +345 -0
- package/one/events/test-index.md +361 -0
- package/one/events/test-report-ontology.md +582 -0
- package/one/events/testing-summary.md +344 -0
- package/one/groups/features.md +2878 -0
- package/one/groups/strategy copy.md +869 -0
- package/one/knowledge/backend-api-reference.md +710 -0
- package/one/knowledge/documentation-summary.md +285 -0
- package/one/knowledge/lessons-learned.md +294 -4
- package/one/knowledge/ontology-visual-guide.md +360 -0
- package/one/knowledge/ontology.md +9 -17
- package/one/things/demo-accessibility-animations.md +999 -0
- package/one/things/demo-components.md +1304 -0
- package/one/things/demo-design-summary.md +629 -0
- package/one/things/demo-design-system.md +919 -0
- package/one/things/demo-page-layouts.md +989 -0
- package/one/things/designs/accessibility-audit.md +790 -0
- package/one/things/designs/component-specifications.md +757 -0
- package/one/things/designs/design-overview.md +318 -0
- package/one/things/designs/design-tokens.md +414 -0
- package/one/things/designs/wireframes-dashboard.md +653 -0
- package/one/things/docs/api-requests.md +923 -0
- package/one/things/features/0 All Features.md +2 -0
- package/one/things/implementation/backend-guide.md +412 -0
- package/one/things/plans/2-backend-agnostic-frontend.md +11 -8
- package/one/things/plans/ai-elements.md +1259 -0
- package/one/things/plans/ai-integration.md +947 -0
- package/one/things/plans/ai-sdk.md +761 -0
- package/one/things/plans/app.md +1 -1
- package/one/things/plans/architecture-summary.md +283 -0
- package/one/things/plans/async-ai-agents.md +215 -0
- package/one/things/plans/backend-agnostic-frontend.md +11 -6
- package/one/things/plans/backend-cleanup-quickstart.md +346 -0
- package/one/things/plans/backend-ontology-conformance.md +416 -0
- package/one/things/plans/backend-status.md +541 -0
- package/one/things/plans/backend-structure.md +799 -0
- package/one/things/plans/backend-target-structure.md +438 -0
- package/one/things/plans/backend.md +1133 -0
- package/one/things/plans/better-auth-any-backend.md +11 -11
- package/one/things/plans/cli-updates-required.md +280 -0
- package/one/things/plans/complete-step-by-step.md +1302 -0
- package/one/things/plans/convex-agents.md +1005 -0
- package/one/things/plans/deployment-architecture.md +426 -0
- package/one/things/plans/development-plan.md +1220 -0
- package/one/things/plans/effect.md +808 -48
- package/one/things/plans/integrate-frontend-and-backend.md +579 -0
- package/one/things/plans/mcp-clear-context-prompt.md +60 -0
- package/one/things/plans/mcp-simple.md +228 -0
- package/one/things/plans/one.md +8 -7
- package/one/things/plans/ontology-6-dimensions.md +20 -14
- package/one/things/plans/quick-wins.md +1273 -0
- package/one/things/plans/readme-backend-cleanup.md +361 -0
- package/one/things/plans/separate-demo.md +830 -0
- package/one/things/plans/separate.md +3 -3
- package/one/things/plans/sequence.md +1897 -0
- package/one/things/plans/sync-checklist.md +321 -0
- package/one/things/plans/unified-implementation-plan.md +3 -3
- package/one/things/plans/update-demos.md +513 -0
- package/package.json +1 -1
- package/.claude/agents/backend-specialist.md +0 -169
- package/.claude/agents/designer.md +0 -216
- package/.claude/agents/frontend-specialist.md +0 -236
- package/.claude/commands/done.md +0 -35
- package/.claude/commands/infer.md +0 -138
- package/.claude/commands/next.md +0 -53
- package/.claude/commands/one copy.md +0 -565
- package/.claude/commands/one-template.md +0 -106
- package/.claude/commands/one-v1.md +0 -609
- package/.claude/hooks/__pycache__/knowledge-post.cpython-313.pyc +0 -0
- package/.claude/hooks/__pycache__/knowledge-pre.cpython-313.pyc +0 -0
- package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
- package/one/groups/nine-padel-customers.md +0 -138
- package/one/groups/nine-padel-data-structure.md +0 -167
- package/one/groups/nine-padel-ontology-specification.md +0 -359
- package/one/groups/nine-padel-ontology.md +0 -143
- package/one/groups/nine-padel-strategy.md +0 -234
- package/one/groups/nine-padel.md +0 -211
- package/one/groups/nine-padle-contents.baked.md +0 -1252
- package/one/groups/nine-padle-contents.md +0 -6
- package/one/things/features/1-1-agent-prompts/design.md +0 -470
- package/one/things/features/1-1-agent-prompts/tests.md +0 -264
- package/one/things/features/1-2-yaml-orchestrator/design.md +0 -497
- package/one/things/features/1-2-yaml-orchestrator/tests.md +0 -227
- package/one/things/features/1-3-event-coordination/design.md +0 -544
- package/one/things/features/1-3-event-coordination/tests.md +0 -223
- package/one/things/features/1-4-knowledge-management/design.md +0 -609
- package/one/things/features/1-4-knowledge-management/tests.md +0 -195
- package/one/things/features/1-5-quality-loops/design.md +0 -797
- package/one/things/features/1-5-quality-loops/tests.md +0 -212
- package/one/things/features/1-6-numbering-structure/design.md +0 -610
- package/one/things/features/1-6-numbering-structure/tests.md +0 -213
- package/one/things/features/dataprovider-interface/1-tests.md +0 -1522
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-frontend:create-page
|
|
3
|
+
description: Generate Astro 5 pages with SSR, React islands, Convex queries, and 6-dimension ontology data binding
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Agent-Frontend: Create Page
|
|
7
|
+
|
|
8
|
+
## Purpose
|
|
9
|
+
|
|
10
|
+
Generate production-ready Astro pages that:
|
|
11
|
+
- Use server-side rendering (SSR) for fast initial load
|
|
12
|
+
- Fetch ontology data at build time
|
|
13
|
+
- Render static HTML when possible
|
|
14
|
+
- Use strategic React islands for interactivity
|
|
15
|
+
- Achieve 90+ Lighthouse scores
|
|
16
|
+
- Implement role-based access control
|
|
17
|
+
|
|
18
|
+
## When to Use This Skill
|
|
19
|
+
|
|
20
|
+
- Creating new pages for features
|
|
21
|
+
- Building public-facing pages with SSR
|
|
22
|
+
- Implementing list pages, detail pages, forms
|
|
23
|
+
- Integrating Convex data
|
|
24
|
+
- Optimizing Core Web Vitals
|
|
25
|
+
|
|
26
|
+
## Instructions
|
|
27
|
+
|
|
28
|
+
### 1. Understand Astro Islands Architecture
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
Page Structure:
|
|
32
|
+
├── Astro Component (SSR, runs at build time)
|
|
33
|
+
│ ├── Fetch data from Convex
|
|
34
|
+
│ ├── Render static HTML
|
|
35
|
+
│ └── Embed React islands for interactivity
|
|
36
|
+
└── React Islands (client-side, hydrated on demand)
|
|
37
|
+
├── Forms and inputs
|
|
38
|
+
├── Real-time updates
|
|
39
|
+
└── User interactions
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 2. SSR Data Fetching Pattern
|
|
43
|
+
|
|
44
|
+
```astro
|
|
45
|
+
---
|
|
46
|
+
// This runs at build time (server-side)
|
|
47
|
+
import { ConvexHttpClient } from 'convex/browser';
|
|
48
|
+
import { api } from '@/convex/_generated/api';
|
|
49
|
+
import Layout from '@/layouts/Layout.astro';
|
|
50
|
+
import { CourseCard } from '@/components/CourseCard';
|
|
51
|
+
import { EnrollButton } from '@/components/EnrollButton';
|
|
52
|
+
|
|
53
|
+
// Get organization from URL params
|
|
54
|
+
const { orgId } = Astro.params;
|
|
55
|
+
|
|
56
|
+
// Fetch data at build time
|
|
57
|
+
const convex = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
|
|
58
|
+
const courses = await convex.query(api.queries.entities.list, {
|
|
59
|
+
groupId: orgId,
|
|
60
|
+
type: 'course',
|
|
61
|
+
status: 'published',
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const metadata = {
|
|
65
|
+
title: 'Courses',
|
|
66
|
+
description: 'Browse available courses',
|
|
67
|
+
};
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
<Layout {...metadata}>
|
|
71
|
+
<div class="course-grid">
|
|
72
|
+
{courses.map(course => (
|
|
73
|
+
<article class="course-card">
|
|
74
|
+
<!-- Static content (no JS needed) -->
|
|
75
|
+
<CourseCard course={course} />
|
|
76
|
+
|
|
77
|
+
<!-- Interactive island (hydrated only when needed) -->
|
|
78
|
+
<EnrollButton client:load courseId={course._id} />
|
|
79
|
+
</article>
|
|
80
|
+
))}
|
|
81
|
+
</div>
|
|
82
|
+
</Layout>
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### 3. Hydration Directive Selection
|
|
86
|
+
|
|
87
|
+
| Directive | Use Case | When Hydrated |
|
|
88
|
+
|-----------|----------|---------------|
|
|
89
|
+
| `client:load` | Critical interactivity | Immediately (blocks rendering) |
|
|
90
|
+
| `client:idle` | Non-critical features | When browser idle |
|
|
91
|
+
| `client:visible` | Below-fold content | When visible in viewport |
|
|
92
|
+
| `client:media` | Responsive features | When media query matches |
|
|
93
|
+
| `client:only` | Framework-specific | Never SSR |
|
|
94
|
+
|
|
95
|
+
**Rule:** Use the laziest directive that still works.
|
|
96
|
+
|
|
97
|
+
```astro
|
|
98
|
+
---
|
|
99
|
+
// Every interactive element needs a directive
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
<div>
|
|
103
|
+
<!-- Static: No directive needed -->
|
|
104
|
+
<h1>{course.name}</h1>
|
|
105
|
+
<p>{course.properties.description}</p>
|
|
106
|
+
|
|
107
|
+
<!-- Critical: Use client:load -->
|
|
108
|
+
<EnrollButton client:load courseId={course._id} />
|
|
109
|
+
|
|
110
|
+
<!-- Search/filter: Use client:idle -->
|
|
111
|
+
<SearchBox client:idle />
|
|
112
|
+
|
|
113
|
+
<!-- Comments section: Use client:visible -->
|
|
114
|
+
<CommentsSection client:visible courseId={course._id} />
|
|
115
|
+
|
|
116
|
+
<!-- Mobile menu: Use client:media -->
|
|
117
|
+
<MobileNav client:media query="(max-width: 768px)" />
|
|
118
|
+
</div>
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### 4. Organization Scoping
|
|
122
|
+
|
|
123
|
+
```astro
|
|
124
|
+
---
|
|
125
|
+
// ALWAYS scope to organization
|
|
126
|
+
const { orgId } = Astro.params;
|
|
127
|
+
|
|
128
|
+
// Validate organization access
|
|
129
|
+
const org = await convex.query(api.queries.organizations.get, { id: orgId });
|
|
130
|
+
if (!org || org.status === "inactive") {
|
|
131
|
+
return Astro.redirect('/404');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// Fetch org-scoped data
|
|
135
|
+
const courses = await convex.query(api.queries.entities.list, {
|
|
136
|
+
groupId: orgId, // REQUIRED: Always filter by organization
|
|
137
|
+
type: 'course',
|
|
138
|
+
});
|
|
139
|
+
---
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 5. Role-Based Rendering
|
|
143
|
+
|
|
144
|
+
```astro
|
|
145
|
+
---
|
|
146
|
+
const { userId, userRole } = Astro.locals;
|
|
147
|
+
|
|
148
|
+
// Query to get user's role in organization
|
|
149
|
+
const userOrg = await convex.query(api.queries.people.getInOrg, {
|
|
150
|
+
userId,
|
|
151
|
+
orgId,
|
|
152
|
+
});
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
<div>
|
|
156
|
+
<!-- Everyone sees this -->
|
|
157
|
+
<CourseInfo course={course} />
|
|
158
|
+
|
|
159
|
+
<!-- Only org_owner sees this -->
|
|
160
|
+
{userOrg.role === 'org_owner' && (
|
|
161
|
+
<AdminPanel course={course} client:load />
|
|
162
|
+
)}
|
|
163
|
+
|
|
164
|
+
<!-- Only org_user or higher sees this -->
|
|
165
|
+
{['org_owner', 'org_user'].includes(userOrg.role) && (
|
|
166
|
+
<EditButton course={course} client:idle />
|
|
167
|
+
)}
|
|
168
|
+
</div>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
### 6. Performance Optimization
|
|
172
|
+
|
|
173
|
+
```astro
|
|
174
|
+
---
|
|
175
|
+
// Image optimization
|
|
176
|
+
import { Image } from 'astro:assets';
|
|
177
|
+
import thumbnail from '@/images/course-thumb.jpg';
|
|
178
|
+
|
|
179
|
+
// Responsive images
|
|
180
|
+
const imageOptions = {
|
|
181
|
+
widths: [300, 600, 900],
|
|
182
|
+
formats: ['webp', 'jpeg'],
|
|
183
|
+
};
|
|
184
|
+
---
|
|
185
|
+
|
|
186
|
+
<!-- Optimized image: lazy loaded, WebP format, responsive -->
|
|
187
|
+
<Image
|
|
188
|
+
src={thumbnail}
|
|
189
|
+
alt="Course thumbnail"
|
|
190
|
+
{...imageOptions}
|
|
191
|
+
loading="lazy"
|
|
192
|
+
/>
|
|
193
|
+
|
|
194
|
+
<!-- Critical image: load immediately -->
|
|
195
|
+
<Image
|
|
196
|
+
src={logo}
|
|
197
|
+
alt="Logo"
|
|
198
|
+
loading="eager"
|
|
199
|
+
/>
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### 7. Template: List Page
|
|
203
|
+
|
|
204
|
+
```astro
|
|
205
|
+
---
|
|
206
|
+
// pages/[orgId]/courses/index.astro
|
|
207
|
+
import Layout from '@/layouts/Layout.astro';
|
|
208
|
+
import { CourseCard } from '@/components/CourseCard';
|
|
209
|
+
import { CreateCourseButton } from '@/components/CreateCourseButton';
|
|
210
|
+
|
|
211
|
+
const { orgId } = Astro.params;
|
|
212
|
+
|
|
213
|
+
// Fetch courses at build time
|
|
214
|
+
const convex = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
|
|
215
|
+
const courses = await convex.query(api.queries.entities.list, {
|
|
216
|
+
groupId: orgId,
|
|
217
|
+
type: 'course',
|
|
218
|
+
status: 'published',
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
const metadata = {
|
|
222
|
+
title: 'Courses',
|
|
223
|
+
description: 'Explore our course catalog',
|
|
224
|
+
};
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
<Layout {...metadata}>
|
|
228
|
+
<div class="courses-header">
|
|
229
|
+
<h1>Courses</h1>
|
|
230
|
+
<!-- Interactive button: hydrate on load for org_owner -->
|
|
231
|
+
<CreateCourseButton client:load orgId={orgId} />
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<div class="course-grid">
|
|
235
|
+
{courses.map(course => (
|
|
236
|
+
<CourseCard key={course._id} course={course} />
|
|
237
|
+
))}
|
|
238
|
+
</div>
|
|
239
|
+
</Layout>
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### 8. Template: Detail Page
|
|
243
|
+
|
|
244
|
+
```astro
|
|
245
|
+
---
|
|
246
|
+
// pages/[orgId]/courses/[courseId]/index.astro
|
|
247
|
+
import Layout from '@/layouts/Layout.astro';
|
|
248
|
+
import { CourseDetail } from '@/components/CourseDetail';
|
|
249
|
+
import { EnrollButton } from '@/components/EnrollButton';
|
|
250
|
+
|
|
251
|
+
const { orgId, courseId } = Astro.params;
|
|
252
|
+
|
|
253
|
+
// Fetch course at build time
|
|
254
|
+
const convex = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
|
|
255
|
+
const course = await convex.query(api.queries.entities.get, {
|
|
256
|
+
id: courseId,
|
|
257
|
+
groupId: orgId,
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
if (!course) {
|
|
261
|
+
return Astro.redirect('/404');
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Fetch related entities
|
|
265
|
+
const lessons = await convex.query(api.queries.entities.list, {
|
|
266
|
+
groupId: orgId,
|
|
267
|
+
type: 'lesson',
|
|
268
|
+
properties: { courseId },
|
|
269
|
+
});
|
|
270
|
+
---
|
|
271
|
+
|
|
272
|
+
<Layout title={course.name} description={course.properties.description}>
|
|
273
|
+
<article class="course-detail">
|
|
274
|
+
<!-- Static content -->
|
|
275
|
+
<CourseDetail course={course} lessons={lessons} />
|
|
276
|
+
|
|
277
|
+
<!-- Interactive enrollment (client island) -->
|
|
278
|
+
<EnrollButton client:load courseId={courseId} />
|
|
279
|
+
</article>
|
|
280
|
+
</Layout>
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Critical Rules
|
|
284
|
+
|
|
285
|
+
1. **Fetch at build time** - Use `await` in Astro frontmatter, not useEffect
|
|
286
|
+
2. **Static first** - Render HTML statically, add JS only when needed
|
|
287
|
+
3. **Scope by organization** - Always include `groupId` in queries
|
|
288
|
+
4. **Validate access** - Check org status and user role
|
|
289
|
+
5. **Lazy load islands** - Use `client:visible` or `client:idle` when possible
|
|
290
|
+
6. **Optimize images** - Use Astro Image component with responsive formats
|
|
291
|
+
7. **Test performance** - Aim for 90+ Lighthouse score
|
|
292
|
+
|
|
293
|
+
## Example: Full Course Page
|
|
294
|
+
|
|
295
|
+
```astro
|
|
296
|
+
---
|
|
297
|
+
// pages/[orgId]/courses/[courseId].astro
|
|
298
|
+
import { ConvexHttpClient } from 'convex/browser';
|
|
299
|
+
import { api } from '@/convex/_generated/api';
|
|
300
|
+
import Layout from '@/layouts/Layout.astro';
|
|
301
|
+
import { CourseHeader } from '@/components/course/Header';
|
|
302
|
+
import { LessonList } from '@/components/course/LessonList';
|
|
303
|
+
import { EnrollmentCard } from '@/components/course/EnrollmentCard';
|
|
304
|
+
import { ReviewsSection } from '@/components/course/ReviewsSection';
|
|
305
|
+
import { RelatedCourses } from '@/components/course/RelatedCourses';
|
|
306
|
+
|
|
307
|
+
const { orgId, courseId } = Astro.params;
|
|
308
|
+
|
|
309
|
+
// Initialize Convex client
|
|
310
|
+
const convex = new ConvexHttpClient(import.meta.env.PUBLIC_CONVEX_URL);
|
|
311
|
+
|
|
312
|
+
// Fetch course
|
|
313
|
+
const course = await convex.query(api.queries.entities.get, {
|
|
314
|
+
id: courseId,
|
|
315
|
+
groupId: orgId,
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
if (!course) {
|
|
319
|
+
return Astro.redirect('/404');
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
// Fetch lessons (static)
|
|
323
|
+
const lessons = await convex.query(api.queries.connections.getRelated, {
|
|
324
|
+
fromThingId: courseId,
|
|
325
|
+
relationshipType: 'contains',
|
|
326
|
+
targetType: 'lesson',
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
// Fetch reviews (static)
|
|
330
|
+
const reviews = await convex.query(api.queries.events.getByTarget, {
|
|
331
|
+
targetId: courseId,
|
|
332
|
+
eventType: 'course_reviewed',
|
|
333
|
+
limit: 10,
|
|
334
|
+
});
|
|
335
|
+
|
|
336
|
+
// Fetch related courses (static)
|
|
337
|
+
const relatedCourses = await convex.query(api.queries.entities.list, {
|
|
338
|
+
groupId: orgId,
|
|
339
|
+
type: 'course',
|
|
340
|
+
status: 'published',
|
|
341
|
+
limit: 3,
|
|
342
|
+
});
|
|
343
|
+
---
|
|
344
|
+
|
|
345
|
+
<Layout
|
|
346
|
+
title={course.name}
|
|
347
|
+
description={course.properties.description}
|
|
348
|
+
image={course.properties.thumbnail}
|
|
349
|
+
>
|
|
350
|
+
<!-- Header: Static content -->
|
|
351
|
+
<CourseHeader course={course} />
|
|
352
|
+
|
|
353
|
+
<div class="course-container">
|
|
354
|
+
<!-- Lessons: Static list -->
|
|
355
|
+
<section class="lessons">
|
|
356
|
+
<h2>Course Content</h2>
|
|
357
|
+
<LessonList lessons={lessons} />
|
|
358
|
+
</section>
|
|
359
|
+
|
|
360
|
+
<!-- Enrollment: Interactive island -->
|
|
361
|
+
<aside class="enrollment-sidebar">
|
|
362
|
+
<EnrollmentCard
|
|
363
|
+
client:load
|
|
364
|
+
courseId={courseId}
|
|
365
|
+
price={course.properties.price}
|
|
366
|
+
/>
|
|
367
|
+
</aside>
|
|
368
|
+
</div>
|
|
369
|
+
|
|
370
|
+
<!-- Reviews: Interactive below-fold -->
|
|
371
|
+
<ReviewsSection
|
|
372
|
+
client:visible
|
|
373
|
+
courseId={courseId}
|
|
374
|
+
reviews={reviews}
|
|
375
|
+
/>
|
|
376
|
+
|
|
377
|
+
<!-- Related: Static cards -->
|
|
378
|
+
<section class="related">
|
|
379
|
+
<h2>More Courses</h2>
|
|
380
|
+
<RelatedCourses courses={relatedCourses} />
|
|
381
|
+
</section>
|
|
382
|
+
</Layout>
|
|
383
|
+
|
|
384
|
+
<style>
|
|
385
|
+
.course-container {
|
|
386
|
+
display: grid;
|
|
387
|
+
grid-template-columns: 1fr 300px;
|
|
388
|
+
gap: 2rem;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
@media (max-width: 768px) {
|
|
392
|
+
.course-container {
|
|
393
|
+
grid-template-columns: 1fr;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
</style>
|
|
397
|
+
```
|
|
398
|
+
|
|
399
|
+
## Related Skills
|
|
400
|
+
|
|
401
|
+
- `agent-frontend:create-component` - Build React components for islands
|
|
402
|
+
- `agent-frontend:optimize-performance` - Improve Lighthouse scores
|
|
403
|
+
- `agent-frontend:implement-forms` - Build form components
|
|
404
|
+
|
|
405
|
+
## Related Documentation
|
|
406
|
+
|
|
407
|
+
- [Astro SSR](https://docs.astro.build/en/guides/server-side-rendering/)
|
|
408
|
+
- [Islands Architecture](https://docs.astro.build/en/concepts/islands/)
|
|
409
|
+
- [Frontend Agent](../agents/agent-frontend.md)
|
|
410
|
+
|
|
411
|
+
## Version History
|
|
412
|
+
|
|
413
|
+
- **1.0.0** (2025-10-27): Initial implementation with islands architecture
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Agent Skills
|
|
2
|
+
|
|
3
|
+
This directory contains specialized skills for each ONE Platform agent. Each agent has a dedicated skills directory with task-specific capabilities.
|
|
4
|
+
|
|
5
|
+
## Skill Organization
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
.claude/skills/agents/
|
|
9
|
+
├── agent-backend/ # Backend specialist skills
|
|
10
|
+
├── agent-frontend/ # Frontend specialist skills
|
|
11
|
+
├── agent-designer/ # Design specialist skills
|
|
12
|
+
├── agent-director/ # Director/orchestration skills
|
|
13
|
+
├── agent-quality/ # Quality assurance skills
|
|
14
|
+
├── agent-documenter/ # Documentation skills
|
|
15
|
+
├── agent-ops/ # DevOps/operations skills
|
|
16
|
+
└── ... # One directory per agent
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## How Agent Skills Work
|
|
20
|
+
|
|
21
|
+
1. **Skill Discovery**: When an agent is invoked, Claude Code automatically discovers skills in the agent's directory
|
|
22
|
+
2. **Progressive Loading**: Metadata (name, description) loads immediately; detailed instructions load on-demand
|
|
23
|
+
3. **Auto-Invocation**: Claude uses skills when relevant to the task without explicit user request
|
|
24
|
+
4. **Context Efficiency**: Skills are modular, reducing token overhead
|
|
25
|
+
|
|
26
|
+
## Skill File Structure
|
|
27
|
+
|
|
28
|
+
Each skill is a markdown file with YAML frontmatter:
|
|
29
|
+
|
|
30
|
+
```markdown
|
|
31
|
+
---
|
|
32
|
+
name: skill-name
|
|
33
|
+
description: What this skill does (max 1024 chars)
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
# Skill Name
|
|
37
|
+
|
|
38
|
+
## Purpose
|
|
39
|
+
What problem does this solve?
|
|
40
|
+
|
|
41
|
+
## Instructions
|
|
42
|
+
Step-by-step guidance for using this skill.
|
|
43
|
+
|
|
44
|
+
## Examples
|
|
45
|
+
Concrete code or usage examples.
|
|
46
|
+
|
|
47
|
+
## Related Skills
|
|
48
|
+
Links to complementary skills.
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## Naming Convention
|
|
52
|
+
|
|
53
|
+
- Skill files: `lowercase-with-hyphens.md`
|
|
54
|
+
- Skill names: `agent-name:skill-name` (e.g., `agent-backend:create-mutation`)
|
|
55
|
+
- Maximum 64 characters for `name` field
|
|
56
|
+
|
|
57
|
+
## Examples
|
|
58
|
+
|
|
59
|
+
### Backend Skills
|
|
60
|
+
- `create-mutation.md` - Generate Convex mutations with validation
|
|
61
|
+
- `create-query.md` - Generate Convex queries with filtering
|
|
62
|
+
- `design-schema.md` - Design 6-dimension ontology schema
|
|
63
|
+
|
|
64
|
+
### Frontend Skills
|
|
65
|
+
- `create-page.md` - Generate Astro pages with SSR
|
|
66
|
+
- `create-component.md` - Generate React components
|
|
67
|
+
- `optimize-performance.md` - Optimize Lighthouse scores
|
|
68
|
+
|
|
69
|
+
### Designer Skills
|
|
70
|
+
- `create-wireframe.md` - Generate wireframes from tests
|
|
71
|
+
- `define-components.md` - Define component specifications
|
|
72
|
+
- `set-design-tokens.md` - Generate design tokens
|
|
73
|
+
|
|
74
|
+
## Usage in Agent Files
|
|
75
|
+
|
|
76
|
+
Add skills to an agent's frontmatter (`.claude/agents/agent-*.md`):
|
|
77
|
+
|
|
78
|
+
```yaml
|
|
79
|
+
---
|
|
80
|
+
name: agent-backend
|
|
81
|
+
description: Backend specialist...
|
|
82
|
+
tools: Read, Write, Edit, Bash, Grep, Glob
|
|
83
|
+
skills: create-mutation, create-query, design-schema
|
|
84
|
+
---
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
When this agent is invoked, these skills will be available for auto-discovery.
|
|
88
|
+
|
|
89
|
+
## Creating a New Skill
|
|
90
|
+
|
|
91
|
+
1. Create the skill file in the agent's directory
|
|
92
|
+
2. Add YAML frontmatter with `name` and `description`
|
|
93
|
+
3. Add instructions and examples
|
|
94
|
+
4. Reference from agent's `skills:` field
|
|
95
|
+
|
|
96
|
+
Example:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
# Create skill for agent-backend
|
|
100
|
+
cat > .claude/skills/agents/agent-backend/design-schema.md << 'EOF'
|
|
101
|
+
---
|
|
102
|
+
name: design-schema
|
|
103
|
+
description: Design Convex schema for 6-dimension ontology
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
# Design Schema
|
|
107
|
+
|
|
108
|
+
## Purpose
|
|
109
|
+
Generate Convex schema that implements the 6-dimension ontology...
|
|
110
|
+
EOF
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Best Practices
|
|
114
|
+
|
|
115
|
+
### 1. Keep Skills Focused
|
|
116
|
+
- One skill = one clear task
|
|
117
|
+
- Examples: "create-mutation", "validate-query", "optimize-index"
|
|
118
|
+
|
|
119
|
+
### 2. Include Examples
|
|
120
|
+
- Concrete code samples
|
|
121
|
+
- Before/after comparisons
|
|
122
|
+
- Real-world use cases
|
|
123
|
+
|
|
124
|
+
### 3. Document Dependencies
|
|
125
|
+
- Link to related skills
|
|
126
|
+
- Mention prerequisites
|
|
127
|
+
- Note version compatibility
|
|
128
|
+
|
|
129
|
+
### 4. Version Your Skills
|
|
130
|
+
- Track changes in version history
|
|
131
|
+
- Update when agent requirements change
|
|
132
|
+
- Maintain backwards compatibility when possible
|
|
133
|
+
|
|
134
|
+
### 5. Progressive Detail
|
|
135
|
+
- Metadata (name, description) ~100 tokens
|
|
136
|
+
- Instructions ~500 tokens
|
|
137
|
+
- Examples/resources ~2000+ tokens (loaded on-demand)
|
|
138
|
+
|
|
139
|
+
## Skill Discovery
|
|
140
|
+
|
|
141
|
+
Claude Code automatically discovers skills when:
|
|
142
|
+
|
|
143
|
+
1. Agent is invoked via Task tool with `subagent_type`
|
|
144
|
+
2. Skills directory exists at `.claude/skills/agents/{agent-name}/`
|
|
145
|
+
3. SKILL.md files have valid YAML frontmatter
|
|
146
|
+
4. Skill names are referenced in agent's `skills:` field
|
|
147
|
+
|
|
148
|
+
## Examples by Agent
|
|
149
|
+
|
|
150
|
+
### Agent-Backend Skills
|
|
151
|
+
Used for Convex implementation:
|
|
152
|
+
- `create-mutation` - Mutation generators
|
|
153
|
+
- `create-query` - Query generators
|
|
154
|
+
- `design-schema` - Schema design
|
|
155
|
+
- `validate-types` - TypeScript validation
|
|
156
|
+
|
|
157
|
+
### Agent-Frontend Skills
|
|
158
|
+
Used for Astro + React:
|
|
159
|
+
- `create-page` - Astro page generation
|
|
160
|
+
- `create-component` - React component generation
|
|
161
|
+
- `optimize-performance` - Lighthouse optimization
|
|
162
|
+
- `style-with-tailwind` - Tailwind v4 styling
|
|
163
|
+
|
|
164
|
+
### Agent-Designer Skills
|
|
165
|
+
Used for design systems:
|
|
166
|
+
- `create-wireframe` - Wireframe generation
|
|
167
|
+
- `define-components` - Component specifications
|
|
168
|
+
- `set-design-tokens` - Token generation
|
|
169
|
+
- `validate-accessibility` - WCAG compliance
|
|
170
|
+
|
|
171
|
+
## Performance Considerations
|
|
172
|
+
|
|
173
|
+
### Token Usage
|
|
174
|
+
- Metadata only: ~50 tokens per skill
|
|
175
|
+
- With instructions: ~500 tokens
|
|
176
|
+
- With examples: ~2000 tokens
|
|
177
|
+
- Total budget per agent: 3000 tokens
|
|
178
|
+
|
|
179
|
+
### Caching
|
|
180
|
+
- Metadata cached at startup
|
|
181
|
+
- Instructions cached per session
|
|
182
|
+
- Examples loaded on first use
|
|
183
|
+
|
|
184
|
+
### Optimization Tips
|
|
185
|
+
- Keep instructions under 5K tokens
|
|
186
|
+
- Use examples sparingly (on-demand)
|
|
187
|
+
- Link to detailed docs in knowledge base
|
|
188
|
+
- Reference patterns from ontology
|
|
189
|
+
|
|
190
|
+
## Integration with Agent Lifecycle
|
|
191
|
+
|
|
192
|
+
```
|
|
193
|
+
Agent Invoked
|
|
194
|
+
↓
|
|
195
|
+
Skills Discovered
|
|
196
|
+
↓
|
|
197
|
+
Metadata Loaded (~50 tokens)
|
|
198
|
+
↓
|
|
199
|
+
[Agent works on task]
|
|
200
|
+
↓
|
|
201
|
+
Skill Needed?
|
|
202
|
+
↓
|
|
203
|
+
Instructions Loaded (~500 tokens)
|
|
204
|
+
↓
|
|
205
|
+
Example Code Loaded (on-demand)
|
|
206
|
+
↓
|
|
207
|
+
Agent Executes Skill
|
|
208
|
+
↓
|
|
209
|
+
Task Complete
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Troubleshooting
|
|
213
|
+
|
|
214
|
+
### Skill Not Found
|
|
215
|
+
- Check directory: `.claude/skills/agents/{agent-name}/`
|
|
216
|
+
- Verify YAML frontmatter
|
|
217
|
+
- Check skill is referenced in agent's `skills:` field
|
|
218
|
+
|
|
219
|
+
### Token Overload
|
|
220
|
+
- Reduce instruction size
|
|
221
|
+
- Move examples to linked resources
|
|
222
|
+
- Use knowledge base for detailed docs
|
|
223
|
+
|
|
224
|
+
### Outdated Skill
|
|
225
|
+
- Update version in `## Version History`
|
|
226
|
+
- Test with actual agent
|
|
227
|
+
- Document breaking changes
|
|
228
|
+
|
|
229
|
+
## Related Documentation
|
|
230
|
+
|
|
231
|
+
- [Claude Code Agent System](../agents/README.md)
|
|
232
|
+
- [6-Dimension Ontology](../../one/knowledge/ontology.md)
|
|
233
|
+
- [Agent Skills Overview](https://docs.claude.com/en/docs/agents-and-tools/agent-skills/overview)
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
**Last Updated:** 2025-10-27
|
|
238
|
+
**Status:** Foundation Phase
|
package/dist/clone-web.js
CHANGED
|
@@ -10,7 +10,7 @@ export async function cloneWeb(orgProfile) {
|
|
|
10
10
|
console.log("⚠️ Web directory already exists, skipping clone");
|
|
11
11
|
return { alreadyExists: true };
|
|
12
12
|
}
|
|
13
|
-
// Clone repository
|
|
13
|
+
// Clone web repository (single source of truth)
|
|
14
14
|
console.log("Cloning web repository...");
|
|
15
15
|
await execAsync("git clone https://github.com/one-ie/web.git web", {
|
|
16
16
|
cwd: process.cwd(),
|
package/dist/clone-web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"clone-web.js","sourceRoot":"","sources":["../src/clone-web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,UAI9B;IACC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;IAElD,8BAA8B;IAC9B,IAAI,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;QAChE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IACjC,CAAC;IAED,
|
|
1
|
+
{"version":3,"file":"clone-web.js","sourceRoot":"","sources":["../src/clone-web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AACjC,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,IAAI,MAAM,MAAM,CAAC;AAExB,MAAM,SAAS,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAElC,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,UAI9B;IACC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,KAAK,CAAC,CAAC;IAElD,8BAA8B;IAC9B,IAAI,MAAM,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC/C,OAAO,CAAC,GAAG,CAAC,kDAAkD,CAAC,CAAC;QAChE,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC;IACjC,CAAC;IAED,gDAAgD;IAChD,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IACzC,MAAM,SAAS,CACb,iDAAiD,EACjD;QACE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;KACnB,CACF,CAAC;IAEF,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC,CAAC;IAEvC,uBAAuB;IACvB,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC,CAAC;IAC1C,MAAM,SAAS,CAAC,aAAa,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC;IACnD,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;IAExC,8CAA8C;IAC9C,MAAM,UAAU,GAAG;wBACG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;;;mBAG7B,UAAU,CAAC,IAAI;mBACf,UAAU,CAAC,IAAI;qBACb,UAAU,CAAC,MAAM;;;;;;;;;;;;;;;CAerC,CAAC;IAEA,MAAM,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,YAAY,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IAEpC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;AAC1B,CAAC"}
|