oneie 3.6.4 → 3.6.6
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/one copy.md +565 -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/installation-setup.d.ts.map +1 -1
- package/dist/utils/installation-setup.js +9 -0
- package/dist/utils/installation-setup.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/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,455 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Ontology Structure Validator for ONE Platform
|
|
4
|
+
Ensures all files in /one follow the 6-dimension ontology structure
|
|
5
|
+
"""
|
|
6
|
+
import json
|
|
7
|
+
import sys
|
|
8
|
+
import os
|
|
9
|
+
import re
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
# ONE Platform 6-Dimension Ontology
|
|
13
|
+
VALID_DIMENSIONS = {
|
|
14
|
+
"groups": {
|
|
15
|
+
"aliases": ["groups", "group", "organisations", "organizations", "organisation", "organization"],
|
|
16
|
+
"description": "Hierarchical containers for collaboration - who belongs where and at what level"
|
|
17
|
+
},
|
|
18
|
+
"people": {
|
|
19
|
+
"aliases": ["people", "person"],
|
|
20
|
+
"description": "Authorization & governance - platform owner, org owners"
|
|
21
|
+
},
|
|
22
|
+
"things": {
|
|
23
|
+
"aliases": ["things", "thing"],
|
|
24
|
+
"description": "Every 'thing' - users, agents, content, tokens, courses",
|
|
25
|
+
"types": [
|
|
26
|
+
# Core
|
|
27
|
+
"creator", "ai_clone", "audience_member", "organization",
|
|
28
|
+
# Business Agents
|
|
29
|
+
"strategy_agent", "research_agent", "marketing_agent", "sales_agent",
|
|
30
|
+
"service_agent", "design_agent", "engineering_agent", "finance_agent",
|
|
31
|
+
"legal_agent", "intelligence_agent",
|
|
32
|
+
# Content
|
|
33
|
+
"blog_post", "video", "podcast", "social_post", "email", "course", "lesson",
|
|
34
|
+
# Products
|
|
35
|
+
"digital_product", "membership", "consultation", "nft",
|
|
36
|
+
# Community
|
|
37
|
+
"community", "conversation", "message",
|
|
38
|
+
# Token
|
|
39
|
+
"token", "token_contract",
|
|
40
|
+
# Knowledge
|
|
41
|
+
"knowledge_item", "embedding",
|
|
42
|
+
# Platform
|
|
43
|
+
"website", "landing_page", "template", "livestream", "recording", "media_asset",
|
|
44
|
+
# Business
|
|
45
|
+
"payment", "subscription", "invoice", "metric", "insight", "prediction", "report",
|
|
46
|
+
# Auth Session
|
|
47
|
+
"session", "oauth_account", "verification_token", "password_reset_token",
|
|
48
|
+
# UI Preferences
|
|
49
|
+
"ui_preferences",
|
|
50
|
+
# Marketing
|
|
51
|
+
"notification", "email_campaign", "announcement", "referral", "campaign", "lead",
|
|
52
|
+
# External
|
|
53
|
+
"external_agent", "external_workflow", "external_connection",
|
|
54
|
+
# Protocol
|
|
55
|
+
"mandate", "product",
|
|
56
|
+
# Workflow
|
|
57
|
+
"idea", "plan", "feature", "test", "design", "task", "lesson"
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"connections": {
|
|
61
|
+
"aliases": ["connections", "connection"],
|
|
62
|
+
"description": "Every relationship - owns, follows, taught_by, powers",
|
|
63
|
+
"types": [
|
|
64
|
+
# Ownership
|
|
65
|
+
"owns", "created_by",
|
|
66
|
+
# AI Relationships
|
|
67
|
+
"clone_of", "trained_on", "powers",
|
|
68
|
+
# Content Relationships
|
|
69
|
+
"authored", "generated_by", "published_to", "part_of", "references",
|
|
70
|
+
# Community Relationships
|
|
71
|
+
"member_of", "following", "moderates", "participated_in",
|
|
72
|
+
# Business Relationships
|
|
73
|
+
"manages", "reports_to", "collaborates_with",
|
|
74
|
+
# Token Relationships
|
|
75
|
+
"holds_tokens", "staked_in", "earned_from",
|
|
76
|
+
# Product Relationships
|
|
77
|
+
"purchased", "enrolled_in", "completed", "teaching",
|
|
78
|
+
# Consolidated
|
|
79
|
+
"transacted", "notified", "referred", "communicated", "delegated", "approved", "fulfilled"
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
"events": {
|
|
83
|
+
"aliases": ["events", "event"],
|
|
84
|
+
"description": "Every action - purchased, created, viewed, completed",
|
|
85
|
+
"types": [
|
|
86
|
+
# Entity Lifecycle
|
|
87
|
+
"entity_created", "entity_updated", "entity_deleted", "entity_archived",
|
|
88
|
+
# User Events
|
|
89
|
+
"user_registered", "user_verified", "user_login", "user_logout", "profile_updated",
|
|
90
|
+
# Authentication Events
|
|
91
|
+
"password_reset_requested", "password_reset_completed",
|
|
92
|
+
"email_verification_sent", "email_verified",
|
|
93
|
+
"two_factor_enabled", "two_factor_disabled",
|
|
94
|
+
# Organization Events
|
|
95
|
+
"organization_created", "organization_updated",
|
|
96
|
+
"user_invited_to_org", "user_joined_org", "user_removed_from_org",
|
|
97
|
+
# Dashboard UI Events
|
|
98
|
+
"dashboard_viewed", "settings_updated", "theme_changed", "preferences_updated",
|
|
99
|
+
# AI Clone Events
|
|
100
|
+
"clone_created", "clone_updated", "voice_cloned", "appearance_cloned",
|
|
101
|
+
# Agent Events
|
|
102
|
+
"agent_created", "agent_executed", "agent_completed", "agent_failed",
|
|
103
|
+
# Token Events
|
|
104
|
+
"token_created", "token_minted", "token_burned",
|
|
105
|
+
"tokens_purchased", "tokens_staked", "tokens_unstaked", "tokens_transferred",
|
|
106
|
+
# Course Events
|
|
107
|
+
"course_created", "course_enrolled", "lesson_completed", "course_completed", "certificate_earned",
|
|
108
|
+
# Analytics Events
|
|
109
|
+
"metric_calculated", "insight_generated", "prediction_made", "optimization_applied", "report_generated",
|
|
110
|
+
# Inference Events
|
|
111
|
+
"inference_request", "inference_completed", "inference_failed",
|
|
112
|
+
"inference_quota_exceeded", "inference_revenue_collected",
|
|
113
|
+
"org_revenue_generated", "revenue_share_distributed",
|
|
114
|
+
# Blockchain Events
|
|
115
|
+
"nft_minted", "nft_transferred", "tokens_bridged", "contract_deployed", "treasury_withdrawal",
|
|
116
|
+
# Consolidated Events
|
|
117
|
+
"content_event", "payment_event", "subscription_event", "commerce_event",
|
|
118
|
+
"livestream_event", "notification_event", "referral_event",
|
|
119
|
+
"communication_event", "task_event", "mandate_event", "price_event",
|
|
120
|
+
# Workflow Events
|
|
121
|
+
"plan_started", "feature_assigned", "tasks_created",
|
|
122
|
+
"feature_started", "implementation_complete", "task_started", "task_completed",
|
|
123
|
+
"quality_check_started", "quality_check_complete", "test_started", "test_passed", "test_failed",
|
|
124
|
+
"problem_analysis_started", "solution_proposed", "fix_started", "fix_complete",
|
|
125
|
+
"documentation_started", "documentation_complete", "lesson_learned_added",
|
|
126
|
+
"feature_complete", "plan_complete"
|
|
127
|
+
]
|
|
128
|
+
},
|
|
129
|
+
"knowledge": {
|
|
130
|
+
"aliases": ["knowledge"],
|
|
131
|
+
"description": "Labels + chunks + vectors powering RAG & search",
|
|
132
|
+
"types": ["label", "document", "chunk", "vector_only"]
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
# Protocol identifiers that should be in metadata
|
|
137
|
+
PROTOCOLS = ["a2a", "acp", "ap2", "x402", "ag-ui"]
|
|
138
|
+
|
|
139
|
+
def get_dimension_from_path(file_path):
|
|
140
|
+
"""Extract dimension from file path"""
|
|
141
|
+
parts = Path(file_path).parts
|
|
142
|
+
|
|
143
|
+
# Find 'one' in path and get next part
|
|
144
|
+
try:
|
|
145
|
+
one_index = parts.index('one')
|
|
146
|
+
if one_index + 1 < len(parts):
|
|
147
|
+
return parts[one_index + 1]
|
|
148
|
+
except ValueError:
|
|
149
|
+
return None
|
|
150
|
+
|
|
151
|
+
return None
|
|
152
|
+
|
|
153
|
+
def normalize_dimension(dimension):
|
|
154
|
+
"""Normalize dimension name to canonical form"""
|
|
155
|
+
if not dimension:
|
|
156
|
+
return None
|
|
157
|
+
|
|
158
|
+
dimension_lower = dimension.lower()
|
|
159
|
+
|
|
160
|
+
for canonical, config in VALID_DIMENSIONS.items():
|
|
161
|
+
if dimension_lower in [alias.lower() for alias in config["aliases"]]:
|
|
162
|
+
return canonical
|
|
163
|
+
|
|
164
|
+
return None
|
|
165
|
+
|
|
166
|
+
def to_kebab_case(filename):
|
|
167
|
+
"""Convert filename to kebab-case"""
|
|
168
|
+
# Split filename and extension
|
|
169
|
+
name, ext = os.path.splitext(filename)
|
|
170
|
+
|
|
171
|
+
# Convert to lowercase
|
|
172
|
+
name = name.lower()
|
|
173
|
+
|
|
174
|
+
# Replace spaces, underscores, and multiple hyphens with single hyphen
|
|
175
|
+
name = re.sub(r'[_\s]+', '-', name)
|
|
176
|
+
name = re.sub(r'-+', '-', name)
|
|
177
|
+
|
|
178
|
+
# Remove leading/trailing hyphens
|
|
179
|
+
name = name.strip('-')
|
|
180
|
+
|
|
181
|
+
# Keep extension lowercase
|
|
182
|
+
ext = ext.lower()
|
|
183
|
+
|
|
184
|
+
return name + ext
|
|
185
|
+
|
|
186
|
+
def validate_file_path(file_path):
|
|
187
|
+
"""Validate that file path follows ontology structure"""
|
|
188
|
+
issues = []
|
|
189
|
+
|
|
190
|
+
# Check if file is in /one directory
|
|
191
|
+
if '/one/' not in file_path:
|
|
192
|
+
return issues # Not in /one, skip validation
|
|
193
|
+
|
|
194
|
+
# Allow certain root-level files in /one
|
|
195
|
+
parts = Path(file_path).parts
|
|
196
|
+
try:
|
|
197
|
+
one_index = parts.index('one')
|
|
198
|
+
# If this is a direct child of /one (not in a subdirectory)
|
|
199
|
+
if one_index + 2 == len(parts):
|
|
200
|
+
# Allow specific root-level files
|
|
201
|
+
allowed_root_files = ['LICENSE.md', 'README.md', 'CONTRIBUTING.md', 'CHANGELOG.md', '.gitignore']
|
|
202
|
+
filename = Path(file_path).name
|
|
203
|
+
if filename in allowed_root_files:
|
|
204
|
+
return issues # Valid root-level file
|
|
205
|
+
except ValueError:
|
|
206
|
+
pass
|
|
207
|
+
|
|
208
|
+
# Extract dimension from path
|
|
209
|
+
dimension = get_dimension_from_path(file_path)
|
|
210
|
+
|
|
211
|
+
if not dimension:
|
|
212
|
+
issues.append("File is in /one but not in a dimension directory")
|
|
213
|
+
return issues
|
|
214
|
+
|
|
215
|
+
# Normalize and validate dimension
|
|
216
|
+
canonical_dimension = normalize_dimension(dimension)
|
|
217
|
+
|
|
218
|
+
if not canonical_dimension:
|
|
219
|
+
valid_dims = []
|
|
220
|
+
for dim_config in VALID_DIMENSIONS.values():
|
|
221
|
+
valid_dims.extend(dim_config["aliases"])
|
|
222
|
+
issues.append(
|
|
223
|
+
f"Invalid dimension '{dimension}'. Must be one of: {', '.join(valid_dims)}"
|
|
224
|
+
)
|
|
225
|
+
return issues
|
|
226
|
+
|
|
227
|
+
# Check file extension
|
|
228
|
+
valid_extensions = ['.md', '.yaml', '.yml', '.json']
|
|
229
|
+
if not any(file_path.endswith(ext) for ext in valid_extensions):
|
|
230
|
+
issues.append(
|
|
231
|
+
f"Invalid file extension. Files in /one must be: {', '.join(valid_extensions)}"
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
# Check for valid naming conventions
|
|
235
|
+
filename = Path(file_path).name
|
|
236
|
+
|
|
237
|
+
# Files should use kebab-case
|
|
238
|
+
if not re.match(r'^[a-z0-9]+(-[a-z0-9]+)*\.(md|yaml|yml|json)$', filename):
|
|
239
|
+
correct_name = to_kebab_case(filename)
|
|
240
|
+
issues.append(
|
|
241
|
+
f"Filename '{filename}' should use kebab-case (lowercase with hyphens). Suggested: '{correct_name}'"
|
|
242
|
+
)
|
|
243
|
+
|
|
244
|
+
return issues
|
|
245
|
+
|
|
246
|
+
def validate_file_content(file_path, content=None):
|
|
247
|
+
"""Validate file content follows ontology patterns"""
|
|
248
|
+
issues = []
|
|
249
|
+
|
|
250
|
+
# Only validate markdown files
|
|
251
|
+
if not file_path.endswith('.md'):
|
|
252
|
+
return issues
|
|
253
|
+
|
|
254
|
+
# Read content if not provided
|
|
255
|
+
if content is None:
|
|
256
|
+
try:
|
|
257
|
+
with open(file_path, 'r', encoding='utf-8') as f:
|
|
258
|
+
content = f.read()
|
|
259
|
+
except Exception as e:
|
|
260
|
+
issues.append(f"Could not read file: {e}")
|
|
261
|
+
return issues
|
|
262
|
+
|
|
263
|
+
dimension = normalize_dimension(get_dimension_from_path(file_path))
|
|
264
|
+
|
|
265
|
+
if not dimension:
|
|
266
|
+
return issues
|
|
267
|
+
|
|
268
|
+
# Check for dimension-specific patterns
|
|
269
|
+
if dimension == "things":
|
|
270
|
+
# Things should reference type
|
|
271
|
+
config = VALID_DIMENSIONS["things"]
|
|
272
|
+
if "type:" in content.lower() or "## type" in content.lower():
|
|
273
|
+
# Extract type mentions
|
|
274
|
+
type_pattern = r'\btype:\s*(\w+)'
|
|
275
|
+
types_found = re.findall(type_pattern, content, re.IGNORECASE)
|
|
276
|
+
|
|
277
|
+
for found_type in types_found:
|
|
278
|
+
if found_type not in config.get("types", []):
|
|
279
|
+
issues.append(
|
|
280
|
+
f"Unknown thing type '{found_type}'. "
|
|
281
|
+
f"Must be one of the 66 defined thing types"
|
|
282
|
+
)
|
|
283
|
+
|
|
284
|
+
elif dimension == "connections":
|
|
285
|
+
# Connections should reference relationship types
|
|
286
|
+
config = VALID_DIMENSIONS["connections"]
|
|
287
|
+
if "relationship" in content.lower() or "type:" in content.lower():
|
|
288
|
+
# Look for relationship type mentions
|
|
289
|
+
for rel_type in config.get("types", []):
|
|
290
|
+
if rel_type in content.lower():
|
|
291
|
+
break
|
|
292
|
+
else:
|
|
293
|
+
# No valid relationship type found, might be okay
|
|
294
|
+
pass
|
|
295
|
+
|
|
296
|
+
elif dimension == "events":
|
|
297
|
+
# Events should reference event types
|
|
298
|
+
config = VALID_DIMENSIONS["events"]
|
|
299
|
+
if "type:" in content.lower() or "event:" in content.lower():
|
|
300
|
+
# Look for event type mentions
|
|
301
|
+
for event_type in config.get("types", []):
|
|
302
|
+
if event_type in content.lower():
|
|
303
|
+
break
|
|
304
|
+
else:
|
|
305
|
+
# No valid event type found, might be okay
|
|
306
|
+
pass
|
|
307
|
+
|
|
308
|
+
# Check for protocol references
|
|
309
|
+
protocol_mentions = []
|
|
310
|
+
for protocol in PROTOCOLS:
|
|
311
|
+
if protocol.lower() in content.lower():
|
|
312
|
+
protocol_mentions.append(protocol)
|
|
313
|
+
|
|
314
|
+
if protocol_mentions and "metadata.protocol" not in content.lower():
|
|
315
|
+
issues.append(
|
|
316
|
+
f"Protocol references found ({', '.join(protocol_mentions)}) "
|
|
317
|
+
f"but no 'metadata.protocol' field mentioned. "
|
|
318
|
+
f"Protocols should be stored in metadata.protocol field"
|
|
319
|
+
)
|
|
320
|
+
|
|
321
|
+
return issues
|
|
322
|
+
|
|
323
|
+
def auto_fix_filename(file_path):
|
|
324
|
+
"""Automatically fix filename to kebab-case if needed"""
|
|
325
|
+
filename = Path(file_path).name
|
|
326
|
+
|
|
327
|
+
# Check if filename needs fixing
|
|
328
|
+
if re.match(r'^[a-z0-9]+(-[a-z0-9]+)*\.(md|yaml|yml|json)$', filename):
|
|
329
|
+
return None # Already valid
|
|
330
|
+
|
|
331
|
+
# Generate correct filename
|
|
332
|
+
correct_name = to_kebab_case(filename)
|
|
333
|
+
|
|
334
|
+
if correct_name == filename:
|
|
335
|
+
return None # No change needed
|
|
336
|
+
|
|
337
|
+
# Build new path
|
|
338
|
+
directory = os.path.dirname(file_path)
|
|
339
|
+
new_path = os.path.join(directory, correct_name)
|
|
340
|
+
|
|
341
|
+
# Rename the file
|
|
342
|
+
try:
|
|
343
|
+
if os.path.exists(file_path):
|
|
344
|
+
os.rename(file_path, new_path)
|
|
345
|
+
return {
|
|
346
|
+
'old_name': filename,
|
|
347
|
+
'new_name': correct_name,
|
|
348
|
+
'old_path': file_path,
|
|
349
|
+
'new_path': new_path
|
|
350
|
+
}
|
|
351
|
+
except Exception as e:
|
|
352
|
+
return {'error': str(e)}
|
|
353
|
+
|
|
354
|
+
return None
|
|
355
|
+
|
|
356
|
+
def main():
|
|
357
|
+
"""Main hook execution"""
|
|
358
|
+
try:
|
|
359
|
+
# Read hook input from stdin
|
|
360
|
+
hook_input = json.load(sys.stdin)
|
|
361
|
+
|
|
362
|
+
hook_event = hook_input.get("hook_event_name")
|
|
363
|
+
tool_name = hook_input.get("tool_name")
|
|
364
|
+
tool_input = hook_input.get("tool_input", {})
|
|
365
|
+
|
|
366
|
+
# Only validate Edit and Write operations
|
|
367
|
+
if tool_name not in ["Edit", "Write", "MultiEdit"]:
|
|
368
|
+
sys.exit(0)
|
|
369
|
+
|
|
370
|
+
file_path = tool_input.get("file_path")
|
|
371
|
+
if not file_path:
|
|
372
|
+
sys.exit(0)
|
|
373
|
+
|
|
374
|
+
# Skip validation for non-/one files
|
|
375
|
+
if '/one/' not in file_path:
|
|
376
|
+
sys.exit(0)
|
|
377
|
+
|
|
378
|
+
# For PostToolUse, try to auto-fix filename first
|
|
379
|
+
if hook_event == "PostToolUse":
|
|
380
|
+
fix_result = auto_fix_filename(file_path)
|
|
381
|
+
if fix_result:
|
|
382
|
+
if 'error' in fix_result:
|
|
383
|
+
print(f"⚠️ Could not auto-fix filename: {fix_result['error']}", file=sys.stderr)
|
|
384
|
+
else:
|
|
385
|
+
print(f"🔧 Auto-fixed filename: '{fix_result['old_name']}' → '{fix_result['new_name']}'")
|
|
386
|
+
# Update file_path for subsequent validation
|
|
387
|
+
file_path = fix_result['new_path']
|
|
388
|
+
|
|
389
|
+
issues = []
|
|
390
|
+
|
|
391
|
+
# Validate file path structure
|
|
392
|
+
path_issues = validate_file_path(file_path)
|
|
393
|
+
issues.extend(path_issues)
|
|
394
|
+
|
|
395
|
+
# For PostToolUse, also validate content
|
|
396
|
+
if hook_event == "PostToolUse":
|
|
397
|
+
content = tool_input.get("content") or tool_input.get("new_string")
|
|
398
|
+
content_issues = validate_file_content(file_path, content)
|
|
399
|
+
issues.extend(content_issues)
|
|
400
|
+
|
|
401
|
+
if issues:
|
|
402
|
+
# Build error message
|
|
403
|
+
dimension = get_dimension_from_path(file_path)
|
|
404
|
+
canonical = normalize_dimension(dimension)
|
|
405
|
+
|
|
406
|
+
error_msg = f"⚠️ Ontology Validation Failed for {file_path}\n\n"
|
|
407
|
+
error_msg += "Issues found:\n"
|
|
408
|
+
for i, issue in enumerate(issues, 1):
|
|
409
|
+
error_msg += f"{i}. {issue}\n"
|
|
410
|
+
|
|
411
|
+
error_msg += f"\nONE Ontology Structure:\n"
|
|
412
|
+
error_msg += "Files in /one must follow the 6-dimension ontology:\n\n"
|
|
413
|
+
|
|
414
|
+
for dim_name, dim_config in VALID_DIMENSIONS.items():
|
|
415
|
+
error_msg += f"• {dim_name}/\n"
|
|
416
|
+
error_msg += f" {dim_config['description']}\n"
|
|
417
|
+
if dim_config.get('types'):
|
|
418
|
+
count = len(dim_config['types'])
|
|
419
|
+
error_msg += f" ({count} defined types)\n"
|
|
420
|
+
|
|
421
|
+
error_msg += f"\nCurrent dimension: {dimension}"
|
|
422
|
+
if canonical and canonical != dimension:
|
|
423
|
+
error_msg += f" (normalized to: {canonical})"
|
|
424
|
+
error_msg += "\n"
|
|
425
|
+
|
|
426
|
+
# For PreToolUse, block with exit code 2
|
|
427
|
+
if hook_event == "PreToolUse":
|
|
428
|
+
print(error_msg, file=sys.stderr)
|
|
429
|
+
sys.exit(2) # Block the operation
|
|
430
|
+
else:
|
|
431
|
+
# For PostToolUse, just warn
|
|
432
|
+
print(error_msg, file=sys.stdout)
|
|
433
|
+
sys.exit(0)
|
|
434
|
+
|
|
435
|
+
# Success - show dimension info
|
|
436
|
+
dimension = get_dimension_from_path(file_path)
|
|
437
|
+
canonical = normalize_dimension(dimension)
|
|
438
|
+
|
|
439
|
+
if canonical:
|
|
440
|
+
success_msg = f"✅ Ontology structure validated: {canonical}/"
|
|
441
|
+
dim_config = VALID_DIMENSIONS[canonical]
|
|
442
|
+
success_msg += f" - {dim_config['description']}"
|
|
443
|
+
print(success_msg)
|
|
444
|
+
|
|
445
|
+
sys.exit(0)
|
|
446
|
+
|
|
447
|
+
except json.JSONDecodeError as e:
|
|
448
|
+
print(f"Error: Invalid JSON input: {e}", file=sys.stderr)
|
|
449
|
+
sys.exit(1)
|
|
450
|
+
except Exception as e:
|
|
451
|
+
print(f"Error validating ontology structure: {e}", file=sys.stderr)
|
|
452
|
+
sys.exit(1)
|
|
453
|
+
|
|
454
|
+
if __name__ == "__main__":
|
|
455
|
+
main()
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Add Content Collection
|
|
2
|
+
|
|
3
|
+
**Category:** astro
|
|
4
|
+
**Version:** 1.0.0
|
|
5
|
+
**Used By:** agent-frontend, agent-builder
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Creates Astro content collection with schema.
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { defineCollection, z } from 'astro:content';
|
|
15
|
+
|
|
16
|
+
const blog = defineCollection({
|
|
17
|
+
schema: z.object({
|
|
18
|
+
title: z.string(),
|
|
19
|
+
date: z.date(),
|
|
20
|
+
author: z.string(),
|
|
21
|
+
tags: z.array(z.string()),
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
export const collections = { blog };
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Version History
|
|
29
|
+
|
|
30
|
+
- **1.0.0** (2025-10-18): Initial implementation
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Check Astro Build
|
|
2
|
+
|
|
3
|
+
**Category:** astro
|
|
4
|
+
**Version:** 1.0.0
|
|
5
|
+
**Used By:** agent-quality, agent-ops
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Runs Astro build check and reports errors.
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
bunx astro check --minimumSeverity warning
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
**Output:**
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"success": true,
|
|
21
|
+
"errors": 0,
|
|
22
|
+
"warnings": 0,
|
|
23
|
+
"files": 252
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Version History
|
|
28
|
+
|
|
29
|
+
- **1.0.0** (2025-10-18): Initial implementation
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Create React Component
|
|
2
|
+
|
|
3
|
+
**Category:** astro
|
|
4
|
+
**Version:** 1.0.0
|
|
5
|
+
**Used By:** agent-frontend, agent-designer
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Generates React component with TypeScript and shadcn/ui.
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
interface PricingTableProps {
|
|
15
|
+
tiers: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function PricingTable({ tiers }: PricingTableProps) {
|
|
19
|
+
return (
|
|
20
|
+
<div className="grid gap-6 md:grid-cols-3">
|
|
21
|
+
{/* Pricing cards */}
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Version History
|
|
28
|
+
|
|
29
|
+
- **1.0.0** (2025-10-18): Initial implementation
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Create Astro Page
|
|
2
|
+
|
|
3
|
+
**Category:** astro
|
|
4
|
+
**Version:** 1.0.0
|
|
5
|
+
**Used By:** agent-frontend, agent-builder
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Generates Astro page with SSR, components, and proper routing.
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```astro
|
|
14
|
+
---
|
|
15
|
+
import Layout from '@/layouts/Layout.astro';
|
|
16
|
+
import { Hero } from '@/components/Hero';
|
|
17
|
+
import { PricingTable } from '@/components/PricingTable';
|
|
18
|
+
|
|
19
|
+
const posts = await convex.query(api.queries.posts.list);
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
<Layout title="Landing Page">
|
|
23
|
+
<Hero client:load />
|
|
24
|
+
<PricingTable tiers={3} />
|
|
25
|
+
</Layout>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Version History
|
|
29
|
+
|
|
30
|
+
- **1.0.0** (2025-10-18): Initial implementation
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Optimize Astro Performance
|
|
2
|
+
|
|
3
|
+
**Category:** astro
|
|
4
|
+
**Version:** 1.0.0
|
|
5
|
+
**Used By:** agent-clean, agent-quality
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Analyzes and optimizes Astro site performance.
|
|
10
|
+
|
|
11
|
+
## Recommendations
|
|
12
|
+
|
|
13
|
+
- Use `client:load` only when needed
|
|
14
|
+
- Minimize JavaScript with islands
|
|
15
|
+
- Optimize images with `@astrojs/image`
|
|
16
|
+
- Enable view transitions
|
|
17
|
+
- Use static generation where possible
|
|
18
|
+
|
|
19
|
+
## Version History
|
|
20
|
+
|
|
21
|
+
- **1.0.0** (2025-10-18): Initial implementation
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Check Convex Deployment
|
|
2
|
+
|
|
3
|
+
**Category:** convex
|
|
4
|
+
**Version:** 1.0.0
|
|
5
|
+
**Used By:** agent-ops, agent-quality
|
|
6
|
+
|
|
7
|
+
## Purpose
|
|
8
|
+
|
|
9
|
+
Verifies Convex backend deployment status and health.
|
|
10
|
+
|
|
11
|
+
## Inputs
|
|
12
|
+
|
|
13
|
+
- **deploymentName** (string, optional): Deployment to check. Default: from CONVEX_DEPLOYMENT env
|
|
14
|
+
|
|
15
|
+
## Outputs
|
|
16
|
+
|
|
17
|
+
- **isHealthy** (boolean): Deployment is healthy
|
|
18
|
+
- **functions** (array): List of deployed functions
|
|
19
|
+
- **schemaVersion** (string): Current schema version
|
|
20
|
+
- **errors** (array): Deployment errors if any
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
npx convex deploy --prod
|
|
26
|
+
|
|
27
|
+
# Check status
|
|
28
|
+
npx convex logs --success
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
**Output:**
|
|
32
|
+
```json
|
|
33
|
+
{
|
|
34
|
+
"isHealthy": true,
|
|
35
|
+
"functions": [
|
|
36
|
+
"mutations/entities:createBlogPost",
|
|
37
|
+
"queries/entities:listBlogPosts"
|
|
38
|
+
],
|
|
39
|
+
"schemaVersion": "1.0.0",
|
|
40
|
+
"errors": []
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Version History
|
|
45
|
+
|
|
46
|
+
- **1.0.0** (2025-10-18): Initial implementation
|