oneie 3.6.5 → 3.6.7
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/commands/onboard.md +179 -0
- package/.claude/commands/one copy.md +565 -0
- package/.claude/commands/one.md +125 -487
- package/.claude/commands/server.md +333 -0
- package/.claude/hooks/README-knowledge-hooks.md +265 -0
- 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/.claude/hooks/check-filenames.py +40 -0
- package/.claude/hooks/clean-post.py +301 -0
- package/.claude/hooks/clean-pre.py +308 -0
- package/.claude/hooks/done.py +175 -0
- package/.claude/hooks/format-hook.sh +75 -0
- package/.claude/hooks/hook-logger.sh +59 -0
- package/.claude/hooks/knowledge-post.py +251 -0
- package/.claude/hooks/knowledge-pre.py +150 -0
- package/.claude/hooks/notification-hook.sh +112 -0
- package/.claude/hooks/security-hook.sh +157 -0
- package/.claude/hooks/tag-all-docs.py +338 -0
- package/.claude/hooks/todo.py +298 -0
- package/.claude/hooks/validate-ontology-structure.py +455 -0
- package/.claude/skills/astro/add-content-collection.md +30 -0
- package/.claude/skills/astro/check-build.md +29 -0
- package/.claude/skills/astro/create-component.md +29 -0
- package/.claude/skills/astro/create-page.md +30 -0
- package/.claude/skills/astro/optimize-performance.md +21 -0
- package/.claude/skills/convex/check-deployment.md +46 -0
- package/.claude/skills/convex/create-mutation.md +405 -0
- package/.claude/skills/convex/create-query.md +52 -0
- package/.claude/skills/convex/read-schema.md +373 -0
- package/.claude/skills/convex/test-function.md +50 -0
- package/.claude/skills/deployment/check-deployment-health.md +20 -0
- package/.claude/skills/deployment/create-release.md +21 -0
- package/.claude/skills/deployment/deploy-cloudflare.md +31 -0
- package/.claude/skills/deployment/deploy-convex.md +30 -0
- package/.claude/skills/deployment/sync-repositories.md +19 -0
- package/.claude/skills/design/check-accessibility.md +21 -0
- package/.claude/skills/design/create-component-spec.md +27 -0
- package/.claude/skills/design/generate-design-tokens.md +24 -0
- package/.claude/skills/design/generate-wireframe.md +30 -0
- package/.claude/skills/documentation/create-migration-guide.md +20 -0
- package/.claude/skills/documentation/generate-api-docs.md +27 -0
- package/.claude/skills/documentation/generate-readme.md +22 -0
- package/.claude/skills/documentation/update-knowledge.md +20 -0
- package/.claude/skills/integration/connect-external-system.md +21 -0
- package/.claude/skills/integration/implement-a2a.md +20 -0
- package/.claude/skills/integration/implement-acp.md +20 -0
- package/.claude/skills/integration/verify-integration.md +20 -0
- package/.claude/skills/ontology/README.md +255 -0
- package/.claude/skills/ontology/check-dimension.md +307 -0
- package/.claude/skills/ontology/generate-entity-type.md +339 -0
- package/.claude/skills/ontology/validate-schema.md +229 -0
- package/.claude/skills/ontology/verify-relationships.md +310 -0
- package/.claude/skills/problem-solving/analyze-test-failure.md +21 -0
- package/.claude/skills/problem-solving/identify-root-cause.md +20 -0
- package/.claude/skills/problem-solving/propose-solution.md +29 -0
- package/.claude/skills/problem-solving/verify-fix.md +21 -0
- package/.claude/skills/sales/generate-demo-script.md +21 -0
- package/.claude/skills/sales/qualify-lead.md +30 -0
- package/.claude/skills/sales/track-trial.md +20 -0
- package/.claude/skills/sales/verify-kyc.md +20 -0
- package/.claude/skills/testing/analyze-coverage.md +24 -0
- package/.claude/skills/testing/generate-tests.md +24 -0
- package/.claude/skills/testing/run-tests.md +27 -0
- package/.claude/skills/testing/validate-e2e.md +25 -0
- package/.mcp.json +30 -3
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +13 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/utils/launch-claude.d.ts +3 -2
- package/dist/utils/launch-claude.d.ts.map +1 -1
- package/dist/utils/launch-claude.js +64 -29
- package/dist/utils/launch-claude.js.map +1 -1
- package/folders.yaml +1 -1
- package/one/.obsidian/workspace.json +22 -22
- package/one/events/CREATE-WEBSITE.md +442 -0
- package/one/events/CUSTOM-DOMAIN.md +357 -0
- package/one/events/DEPLOYMENT copy.md +426 -0
- package/one/events/ECOMMERCE-BEFORE-AFTER.md +251 -0
- package/one/events/ECOMMERCE-ENHANCEMENTS.md +576 -0
- package/one/events/ECOMMERCE-HIGH-CONVERTING-ELEMENTS.md +421 -0
- package/one/events/ECOMMERCE-REFACTOR-SUMMARY.md +196 -0
- package/one/events/ECOMMERCE-SETUP-SUMMARY.md +396 -0
- package/one/events/INSTALLATION_FOLDERS.md +516 -0
- package/one/events/INSTALLATION_FOLDERS_FILES.md +205 -0
- package/one/events/INSTALLATION_FOLDERS_SUMMARY.md +419 -0
- package/one/events/LICENSE.md +89 -0
- package/one/events/MCP-CONFIGURATION.md +336 -0
- package/one/events/MCP-SETUP-COMPLETE.md +205 -0
- package/one/events/NODE-UPGRADE.md +111 -0
- package/one/events/PACKAGE-STRUCTURE.md +310 -0
- package/one/events/PLAYBOOK-SETUP-SUMMARY.md +331 -0
- package/one/events/PROMPT_FIX_FRONTEND_ONLY.md +567 -0
- package/one/events/SIMPLE_FIX_FRONTEND_ONLY.md +262 -0
- package/one/events/STRIPE-INTEGRATION.md +414 -0
- package/one/events/STRIPE-SETUP-GUIDE.md +462 -0
- package/one/events/TRANSPARENCY-FIXES.md +275 -0
- package/package.json +4 -2
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
# /server - Development Server Management
|
|
2
|
+
|
|
3
|
+
## Instructions for Claude
|
|
4
|
+
|
|
5
|
+
When user types `/server [action]`, manage the ONE Platform development server.
|
|
6
|
+
|
|
7
|
+
### Supported Actions
|
|
8
|
+
|
|
9
|
+
- `/server` or `/server status` - Check server status
|
|
10
|
+
- `/server start` - Start development server
|
|
11
|
+
- `/server stop` - Stop development server
|
|
12
|
+
- `/server restart` - Restart development server
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Action: Status (Default)
|
|
17
|
+
|
|
18
|
+
Check if server is running on port 4321:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
lsof -ti:4321 2>/dev/null
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**If running (PID returned):**
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
28
|
+
✅ Dev Server Running
|
|
29
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
30
|
+
|
|
31
|
+
URL: http://localhost:4321
|
|
32
|
+
PID: [process-id]
|
|
33
|
+
|
|
34
|
+
Commands:
|
|
35
|
+
• /server stop - Stop server
|
|
36
|
+
• /server restart - Restart server
|
|
37
|
+
|
|
38
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**If not running:**
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
45
|
+
⭕ Dev Server Not Running
|
|
46
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
47
|
+
|
|
48
|
+
Start it with:
|
|
49
|
+
• /server start
|
|
50
|
+
|
|
51
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## Action: Start
|
|
57
|
+
|
|
58
|
+
Start the development server if not already running.
|
|
59
|
+
|
|
60
|
+
### Step 1: Check if Already Running
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
lsof -ti:4321 2>/dev/null
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
If running, show:
|
|
67
|
+
|
|
68
|
+
```
|
|
69
|
+
⚠️ Server already running on port 4321
|
|
70
|
+
|
|
71
|
+
URL: http://localhost:4321
|
|
72
|
+
|
|
73
|
+
Use /server restart to restart it.
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### Step 2: Verify web Directory Exists
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
[ -d web ] && echo "exists" || echo "missing"
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
If missing, show error:
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
❌ web/ directory not found
|
|
86
|
+
|
|
87
|
+
Are you in the ONE Platform root directory?
|
|
88
|
+
|
|
89
|
+
Current directory: [pwd]
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Step 3: Start Server in Background
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
cd web && bun run dev > /dev/null 2>&1 &
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Step 4: Wait and Verify (2 seconds)
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
sleep 2 && lsof -ti:4321 2>/dev/null
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Step 5: Open Start Page in Browser
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
open http://localhost:4321/start 2>/dev/null || xdg-open http://localhost:4321/start 2>/dev/null || start http://localhost:4321/start 2>/dev/null
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**If started successfully:**
|
|
111
|
+
|
|
112
|
+
```
|
|
113
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
114
|
+
🚀 Dev Server Started!
|
|
115
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
116
|
+
|
|
117
|
+
URL: http://localhost:4321/start
|
|
118
|
+
PID: [process-id]
|
|
119
|
+
|
|
120
|
+
Opening start page in your browser...
|
|
121
|
+
|
|
122
|
+
The server is running in the background.
|
|
123
|
+
|
|
124
|
+
Commands:
|
|
125
|
+
• /server stop - Stop server
|
|
126
|
+
• /server restart - Restart server
|
|
127
|
+
• /server status - Check status
|
|
128
|
+
|
|
129
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**If failed to start:**
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
❌ Failed to start dev server
|
|
136
|
+
|
|
137
|
+
Check for errors:
|
|
138
|
+
cd web && bun run dev
|
|
139
|
+
|
|
140
|
+
Possible issues:
|
|
141
|
+
• Port 4321 already in use
|
|
142
|
+
• Missing dependencies (run: bun install)
|
|
143
|
+
• Build errors in web/
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
## Action: Stop
|
|
149
|
+
|
|
150
|
+
Stop the development server if running.
|
|
151
|
+
|
|
152
|
+
### Step 1: Find Process
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
lsof -ti:4321 2>/dev/null
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**If not running:**
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
⚠️ No server running on port 4321
|
|
162
|
+
|
|
163
|
+
Nothing to stop!
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
### Step 2: Kill Process
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
lsof -ti:4321 | xargs kill 2>/dev/null
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Step 3: Verify Stopped
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
sleep 1 && lsof -ti:4321 2>/dev/null || echo "stopped"
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
**If stopped successfully:**
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
182
|
+
⭕ Dev Server Stopped
|
|
183
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
184
|
+
|
|
185
|
+
Start it again with:
|
|
186
|
+
• /server start
|
|
187
|
+
|
|
188
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
**If failed to stop:**
|
|
192
|
+
|
|
193
|
+
```
|
|
194
|
+
❌ Failed to stop server gracefully
|
|
195
|
+
|
|
196
|
+
Force kill with:
|
|
197
|
+
lsof -ti:4321 | xargs kill -9
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Action: Restart
|
|
203
|
+
|
|
204
|
+
Restart the development server (stop then start).
|
|
205
|
+
|
|
206
|
+
### Step 1: Stop Server
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
lsof -ti:4321 | xargs kill 2>/dev/null
|
|
210
|
+
sleep 1
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Step 2: Start Server
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
cd web && bun run dev > /dev/null 2>&1 &
|
|
217
|
+
sleep 2
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Step 3: Verify Running
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
lsof -ti:4321 2>/dev/null
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Step 4: Open Start Page in Browser
|
|
227
|
+
|
|
228
|
+
```bash
|
|
229
|
+
open http://localhost:4321/start 2>/dev/null || xdg-open http://localhost:4321/start 2>/dev/null || start http://localhost:4321/start 2>/dev/null
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
**If restarted successfully:**
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
236
|
+
🔄 Dev Server Restarted!
|
|
237
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
238
|
+
|
|
239
|
+
URL: http://localhost:4321/start
|
|
240
|
+
PID: [process-id]
|
|
241
|
+
|
|
242
|
+
Fresh server instance running.
|
|
243
|
+
Opening start page in your browser...
|
|
244
|
+
|
|
245
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
**If restart failed:**
|
|
249
|
+
|
|
250
|
+
```
|
|
251
|
+
❌ Failed to restart server
|
|
252
|
+
|
|
253
|
+
Try manually:
|
|
254
|
+
1. /server stop
|
|
255
|
+
2. /server start
|
|
256
|
+
|
|
257
|
+
Or check logs:
|
|
258
|
+
cd web && bun run dev
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## Backend Server (Convex)
|
|
264
|
+
|
|
265
|
+
If user mentions "backend server" or "convex dev":
|
|
266
|
+
|
|
267
|
+
```
|
|
268
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
269
|
+
🔧 Backend Server (Convex)
|
|
270
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
271
|
+
|
|
272
|
+
The backend runs on Convex Cloud:
|
|
273
|
+
URL: https://shocking-falcon-870.convex.cloud
|
|
274
|
+
|
|
275
|
+
For local backend development:
|
|
276
|
+
cd backend && npx convex dev
|
|
277
|
+
|
|
278
|
+
For production deployment:
|
|
279
|
+
cd backend && npx convex deploy
|
|
280
|
+
|
|
281
|
+
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Key Principles
|
|
287
|
+
|
|
288
|
+
1. **FAST** - Server starts in < 3 seconds
|
|
289
|
+
2. **BACKGROUND** - Run server in background, don't block user
|
|
290
|
+
3. **RELIABLE** - Always verify server status before/after actions
|
|
291
|
+
4. **CLEAR** - Show clear status and actionable commands
|
|
292
|
+
5. **SAFE** - Graceful shutdown, verify before killing processes
|
|
293
|
+
6. **HELPFUL** - Auto-open start page (http://localhost:4321/start) after successful start/restart
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
## Error Handling
|
|
298
|
+
|
|
299
|
+
**Port already in use:**
|
|
300
|
+
|
|
301
|
+
```
|
|
302
|
+
❌ Port 4321 is already in use
|
|
303
|
+
|
|
304
|
+
Kill the process:
|
|
305
|
+
lsof -ti:4321 | xargs kill
|
|
306
|
+
|
|
307
|
+
Or use a different port:
|
|
308
|
+
cd web && bun run dev -- --port 4322
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
**Missing dependencies:**
|
|
312
|
+
|
|
313
|
+
```
|
|
314
|
+
❌ Server failed to start - missing dependencies
|
|
315
|
+
|
|
316
|
+
Install dependencies:
|
|
317
|
+
cd web && bun install
|
|
318
|
+
|
|
319
|
+
Then try again:
|
|
320
|
+
/server start
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
**Build errors:**
|
|
324
|
+
|
|
325
|
+
```
|
|
326
|
+
❌ Server failed to start - build errors
|
|
327
|
+
|
|
328
|
+
Check for TypeScript errors:
|
|
329
|
+
cd web && bunx astro check
|
|
330
|
+
|
|
331
|
+
View detailed output:
|
|
332
|
+
cd web && bun run dev
|
|
333
|
+
```
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
# Knowledge Tagging Hooks
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
The knowledge tagging hooks automatically tag all created/modified artifacts as **knowledge** in the 6-dimension ontology. This enables:
|
|
6
|
+
|
|
7
|
+
- 📚 Automatic knowledge base building
|
|
8
|
+
- 🏷️ Semantic labeling of all artifacts
|
|
9
|
+
- 🔍 RAG-ready artifact indexing
|
|
10
|
+
- 📊 Knowledge tracking per inference
|
|
11
|
+
- 🧠 Complete audit trail of created knowledge
|
|
12
|
+
|
|
13
|
+
## How It Works
|
|
14
|
+
|
|
15
|
+
### Pre-Hook: `knowledge-pre.py`
|
|
16
|
+
|
|
17
|
+
Runs **before** Write/Edit operations to validate and prepare knowledge tagging:
|
|
18
|
+
|
|
19
|
+
1. ✅ Validates artifact type (code, docs, tests, config, design)
|
|
20
|
+
2. 🏷️ Prepares labels based on file path and type
|
|
21
|
+
3. 📋 Displays what will be tagged after creation
|
|
22
|
+
4. ⚠️ Skips temporary and generated files
|
|
23
|
+
|
|
24
|
+
**Example Output:**
|
|
25
|
+
```
|
|
26
|
+
📚 Knowledge Pre-Hook
|
|
27
|
+
Artifact: EntityList.tsx
|
|
28
|
+
Type: code
|
|
29
|
+
Labels: component, frontend, ui, code
|
|
30
|
+
→ Will be tagged in knowledge dimension after creation
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Post-Hook: `knowledge-post.py`
|
|
34
|
+
|
|
35
|
+
Runs **after** Write/Edit operations to create knowledge entries:
|
|
36
|
+
|
|
37
|
+
1. 📝 Creates knowledge entry with metadata
|
|
38
|
+
2. 🏷️ Tags with labels (file type, dimension, feature)
|
|
39
|
+
3. 🔗 Links to current inference context
|
|
40
|
+
4. 💾 Saves to daily knowledge log (~/.claude/knowledge-log/)
|
|
41
|
+
5. 🔐 Generates content hash for versioning
|
|
42
|
+
|
|
43
|
+
**Example Output:**
|
|
44
|
+
```
|
|
45
|
+
✨ Knowledge Tagged
|
|
46
|
+
Artifact: EntityList.tsx
|
|
47
|
+
Type: code
|
|
48
|
+
Labels: component, frontend, ui, code
|
|
49
|
+
Inference: 22/100
|
|
50
|
+
Hash: a3f9d2c1b4e5f6a7
|
|
51
|
+
→ Logged to: knowledge-2025-10-14.jsonl
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Knowledge Entry Structure
|
|
55
|
+
|
|
56
|
+
Each knowledge entry is saved as JSON:
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"type": "knowledge_item",
|
|
61
|
+
"artifact_type": "code",
|
|
62
|
+
"file_path": "/Users/toc/Server/ONE/web/src/components/EntityList.tsx",
|
|
63
|
+
"file_name": "EntityList.tsx",
|
|
64
|
+
"labels": ["component", "frontend", "ui", "code"],
|
|
65
|
+
"content_hash": "a3f9d2c1b4e5f6a7",
|
|
66
|
+
"created_at": "2025-10-14T02:30:45.123456",
|
|
67
|
+
"inference_number": 22,
|
|
68
|
+
"feature": "Entity Management",
|
|
69
|
+
"organization": "Default Org",
|
|
70
|
+
"created_by_role": "platform_owner",
|
|
71
|
+
"content_preview": "import { useQuery } from 'convex/react'...",
|
|
72
|
+
"metadata": {
|
|
73
|
+
"file_size": 1234,
|
|
74
|
+
"directory": "/Users/toc/Server/ONE/web/src/components",
|
|
75
|
+
"extension": ".tsx"
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Artifact Types
|
|
81
|
+
|
|
82
|
+
The hooks recognize 5 artifact types:
|
|
83
|
+
|
|
84
|
+
| Type | Extensions | Labels |
|
|
85
|
+
|------|-----------|--------|
|
|
86
|
+
| **code** | .py, .ts, .tsx, .js, .jsx, .astro, .json, .yaml | `code` |
|
|
87
|
+
| **documentation** | .md, .mdx, .txt | `documentation` |
|
|
88
|
+
| **test** | .test.ts, .spec.ts, etc. | `test`, `quality` |
|
|
89
|
+
| **config** | .json, .yaml, .yml, .toml, .ini | `config` |
|
|
90
|
+
| **design** | .fig, .sketch, .svg, .png, .jpg | `design` |
|
|
91
|
+
|
|
92
|
+
## Smart Labeling
|
|
93
|
+
|
|
94
|
+
Labels are automatically generated based on file path:
|
|
95
|
+
|
|
96
|
+
| Path Pattern | Auto Labels |
|
|
97
|
+
|-------------|-------------|
|
|
98
|
+
| `/web/src/components` | `component`, `frontend`, `ui` |
|
|
99
|
+
| `/web/src/pages` | `page`, `frontend`, `routing` |
|
|
100
|
+
| `/backend/convex/queries` | `query`, `backend`, `database` |
|
|
101
|
+
| `/backend/convex/mutations` | `mutation`, `backend`, `database` |
|
|
102
|
+
| `/backend/convex/services` | `service`, `backend`, `business-logic` |
|
|
103
|
+
| `/one/things` | `documentation`, `ontology`, `things` |
|
|
104
|
+
| `/one/connections` | `documentation`, `ontology`, `connections` |
|
|
105
|
+
| `/one/events` | `documentation`, `ontology`, `events` |
|
|
106
|
+
| `/one/knowledge` | `documentation`, `ontology`, `knowledge` |
|
|
107
|
+
| `/test` | `test`, `quality`, `validation` |
|
|
108
|
+
|
|
109
|
+
## Knowledge Logs
|
|
110
|
+
|
|
111
|
+
Knowledge entries are saved to `~/.claude/knowledge-log/` as daily JSONL files:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
~/.claude/knowledge-log/
|
|
115
|
+
├── knowledge-2025-10-14.jsonl
|
|
116
|
+
├── knowledge-2025-10-13.jsonl
|
|
117
|
+
└── knowledge-2025-10-12.jsonl
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Each line is a complete JSON knowledge entry. This format enables:
|
|
121
|
+
|
|
122
|
+
- 📊 Easy aggregation and analysis
|
|
123
|
+
- 🔍 Fast searching with grep/jq
|
|
124
|
+
- 📈 Knowledge growth tracking
|
|
125
|
+
- 🧠 RAG corpus building
|
|
126
|
+
|
|
127
|
+
## Inference Context Integration
|
|
128
|
+
|
|
129
|
+
The hooks integrate with the inference tracking system (`todo.py`):
|
|
130
|
+
|
|
131
|
+
- 📍 Current inference number (1-100)
|
|
132
|
+
- 🎯 Feature being implemented
|
|
133
|
+
- 🏢 Organization context
|
|
134
|
+
- 👤 Person role (platform_owner, org_owner, etc.)
|
|
135
|
+
|
|
136
|
+
This links every knowledge artifact back to the inference that created it.
|
|
137
|
+
|
|
138
|
+
## Filtering Rules
|
|
139
|
+
|
|
140
|
+
The hooks **skip** tagging for:
|
|
141
|
+
|
|
142
|
+
- ❌ Temporary files (`/tmp/`, `/.temp/`)
|
|
143
|
+
- ❌ Generated files (`/_generated/`, `/node_modules/`)
|
|
144
|
+
- ❌ Non-recognized artifact types
|
|
145
|
+
- ❌ Non-Write/Edit operations (Read, Bash, etc.)
|
|
146
|
+
|
|
147
|
+
## Usage Example
|
|
148
|
+
|
|
149
|
+
When you create a new component:
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
// Write: frontend/src/components/TokenBalance.tsx
|
|
153
|
+
import { useQuery } from 'convex/react';
|
|
154
|
+
export function TokenBalance({ userId }) { ... }
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
**Pre-Hook Output:**
|
|
158
|
+
```
|
|
159
|
+
📚 Knowledge Pre-Hook
|
|
160
|
+
Artifact: TokenBalance.tsx
|
|
161
|
+
Type: code
|
|
162
|
+
Labels: component, frontend, ui, code
|
|
163
|
+
→ Will be tagged in knowledge dimension after creation
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
**Post-Hook Output:**
|
|
167
|
+
```
|
|
168
|
+
✨ Knowledge Tagged
|
|
169
|
+
Artifact: TokenBalance.tsx
|
|
170
|
+
Type: code
|
|
171
|
+
Labels: component, frontend, ui, code
|
|
172
|
+
Inference: 22/100
|
|
173
|
+
Hash: b8c3d4e5f6a7b8c9
|
|
174
|
+
→ Logged to: knowledge-2025-10-14.jsonl
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Querying Knowledge Logs
|
|
178
|
+
|
|
179
|
+
Use `jq` to query knowledge logs:
|
|
180
|
+
|
|
181
|
+
```bash
|
|
182
|
+
# All artifacts created today
|
|
183
|
+
cat ~/.claude/knowledge-log/knowledge-$(date +%Y-%m-%d).jsonl | jq .
|
|
184
|
+
|
|
185
|
+
# All code artifacts
|
|
186
|
+
cat ~/.claude/knowledge-log/*.jsonl | jq 'select(.artifact_type == "code")'
|
|
187
|
+
|
|
188
|
+
# All artifacts for inference 22
|
|
189
|
+
cat ~/.claude/knowledge-log/*.jsonl | jq 'select(.inference_number == 22)'
|
|
190
|
+
|
|
191
|
+
# All frontend components
|
|
192
|
+
cat ~/.claude/knowledge-log/*.jsonl | jq 'select(.labels | contains(["component", "frontend"]))'
|
|
193
|
+
|
|
194
|
+
# Count by artifact type
|
|
195
|
+
cat ~/.claude/knowledge-log/*.jsonl | jq -r '.artifact_type' | sort | uniq -c
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Integration with 6-Dimension Ontology
|
|
199
|
+
|
|
200
|
+
These hooks implement **Dimension 6: Knowledge** of the ontology:
|
|
201
|
+
|
|
202
|
+
```
|
|
203
|
+
Organizations → Multi-tenant isolation
|
|
204
|
+
People → Authorization & roles
|
|
205
|
+
Things → Entities (66+ types)
|
|
206
|
+
Connections → Relationships (25+ types)
|
|
207
|
+
Events → Actions (67+ types)
|
|
208
|
+
Knowledge → 🟢 Labels + embeddings + vectors (YOU ARE HERE)
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Every artifact created is:
|
|
212
|
+
1. ✅ Tagged as a **knowledge_item** (thing type)
|
|
213
|
+
2. 🏷️ Labeled with semantic metadata
|
|
214
|
+
3. 🔗 Linked to inference context (event)
|
|
215
|
+
4. 📊 Indexed for RAG search
|
|
216
|
+
|
|
217
|
+
## Future Enhancements
|
|
218
|
+
|
|
219
|
+
Planned improvements:
|
|
220
|
+
|
|
221
|
+
- 🧠 Auto-generate embeddings with OpenAI/Anthropic
|
|
222
|
+
- 🔍 Vector search across all knowledge
|
|
223
|
+
- 📊 Knowledge dashboard visualization
|
|
224
|
+
- 🤖 RAG-powered code search
|
|
225
|
+
- 📈 Knowledge growth metrics
|
|
226
|
+
- 🔗 Link artifacts to related things (features, tasks, tests)
|
|
227
|
+
|
|
228
|
+
## Troubleshooting
|
|
229
|
+
|
|
230
|
+
### Hooks not running?
|
|
231
|
+
|
|
232
|
+
Check that hooks are executable:
|
|
233
|
+
```bash
|
|
234
|
+
chmod +x .claude/hooks/knowledge-*.py
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### Knowledge logs not created?
|
|
238
|
+
|
|
239
|
+
Ensure directory exists:
|
|
240
|
+
```bash
|
|
241
|
+
mkdir -p ~/.claude/knowledge-log
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
### Want to disable temporarily?
|
|
245
|
+
|
|
246
|
+
Remove from `.claude/settings.local.json`:
|
|
247
|
+
```json
|
|
248
|
+
// Remove these blocks
|
|
249
|
+
{
|
|
250
|
+
"type": "command",
|
|
251
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.claude/hooks/knowledge-pre.py",
|
|
252
|
+
"timeout": 5
|
|
253
|
+
}
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
## See Also
|
|
257
|
+
|
|
258
|
+
- **`validate-ontology-structure.py`**: Validates 6-dimension ontology structure
|
|
259
|
+
- **`todo.py`**: Inference context tracking (Infer 1-100)
|
|
260
|
+
- **`done.py`**: Marks inferences complete
|
|
261
|
+
- **`one/knowledge/ontology.md`**: Complete 6-dimension ontology spec
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
**Built with clarity, simplicity, and infinite scale in mind.**
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Check for files that don't follow kebab-case naming"""
|
|
3
|
+
import os
|
|
4
|
+
import re
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
|
|
7
|
+
one_dir = Path("/Users/toc/Server/ONE/one")
|
|
8
|
+
pattern = re.compile(r'^[a-z0-9]+(-[a-z0-9]+)*\.(md|yaml|yml|json)$')
|
|
9
|
+
|
|
10
|
+
invalid_files = []
|
|
11
|
+
|
|
12
|
+
for root, dirs, files in os.walk(one_dir):
|
|
13
|
+
# Skip .git and .obsidian
|
|
14
|
+
dirs[:] = [d for d in dirs if d not in ['.git', '.obsidian']]
|
|
15
|
+
|
|
16
|
+
for filename in files:
|
|
17
|
+
if filename.endswith(('.md', '.yaml', '.yml', '.json')):
|
|
18
|
+
if not pattern.match(filename):
|
|
19
|
+
filepath = os.path.join(root, filename)
|
|
20
|
+
# Suggest kebab-case name
|
|
21
|
+
suggested = filename.lower()
|
|
22
|
+
suggested = re.sub(r'[^a-z0-9.]+', '-', suggested)
|
|
23
|
+
suggested = re.sub(r'-+', '-', suggested)
|
|
24
|
+
suggested = re.sub(r'^-|-$', '', suggested)
|
|
25
|
+
|
|
26
|
+
invalid_files.append({
|
|
27
|
+
'path': filepath,
|
|
28
|
+
'filename': filename,
|
|
29
|
+
'suggested': suggested
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
if invalid_files:
|
|
33
|
+
print(f"Found {len(invalid_files)} files with invalid naming:\n")
|
|
34
|
+
for item in invalid_files:
|
|
35
|
+
print(f"❌ {item['path']}")
|
|
36
|
+
print(f" Current: {item['filename']}")
|
|
37
|
+
print(f" Suggested: {item['suggested']}")
|
|
38
|
+
print()
|
|
39
|
+
else:
|
|
40
|
+
print("✅ All files follow kebab-case naming convention!")
|