oneie 3.6.24 → 3.6.25

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 (47) hide show
  1. package/.claude/agents/agent-backend.md +2 -2
  2. package/.claude/agents/agent-designer.md +1 -0
  3. package/.claude/agents/agent-director.md +71 -71
  4. package/.claude/agents/agent-onboard.md +1 -1
  5. package/.claude/agents/agent-ontology.md +2 -2
  6. package/.claude/agents/agent-ops.md +58 -38
  7. package/.claude/agents/agent-sales.md +3 -3
  8. package/.claude/commands/cascade.md +21 -21
  9. package/.claude/commands/create.md +19 -19
  10. package/.claude/commands/deploy.md +82 -104
  11. package/.claude/commands/mcp-on.md +191 -0
  12. package/.claude/commands/one.md +267 -92
  13. package/.claude/commands/plan.md +17 -17
  14. package/.claude/commands/release.md +65 -14
  15. package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +473 -0
  16. package/.claude/hooks/README-knowledge-hooks.md +451 -0
  17. package/.claude/hooks/README-root-cleanup.md +200 -0
  18. package/.claude/hooks/README.md +284 -0
  19. package/.claude/hooks/__pycache__/done.cpython-313.pyc +0 -0
  20. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  21. package/.claude/hooks/check-filenames.py +177 -0
  22. package/.claude/hooks/clean-post.py +468 -0
  23. package/.claude/hooks/clean-pre.py +393 -0
  24. package/.claude/hooks/clean-root-markdown.sh +73 -0
  25. package/.claude/hooks/commit-push.sh +95 -0
  26. package/.claude/hooks/done.py +236 -0
  27. package/.claude/hooks/format-hook.sh +163 -0
  28. package/.claude/hooks/hook-logger.sh +173 -0
  29. package/.claude/hooks/knowledge-post.py +355 -0
  30. package/.claude/hooks/knowledge-pre.py +245 -0
  31. package/.claude/hooks/mcp-on.sh +134 -0
  32. package/.claude/hooks/notification-hook.sh +279 -0
  33. package/.claude/hooks/push.sh +101 -0
  34. package/.claude/hooks/release-cli.sh +16 -8
  35. package/.claude/hooks/root-cleanup.py +217 -0
  36. package/.claude/hooks/security-hook.sh +397 -0
  37. package/.claude/hooks/tag-all-docs.py +464 -0
  38. package/.claude/hooks/test-validate-ontology.sh +170 -0
  39. package/.claude/hooks/todo.py +368 -0
  40. package/.claude/hooks/track-changes.sh +101 -0
  41. package/.claude/hooks/validate-ontology-structure-summary.md +243 -0
  42. package/.claude/hooks/validate-ontology-structure.py +518 -0
  43. package/.claude/skills/INDEX.md +1 -1
  44. package/.claude/skills/ontology/README.md +1 -1
  45. package/package.json +1 -1
  46. package/.claude/commands/mcp-toggle.md +0 -93
  47. package/.claude/commands/npx.md +0 -84
@@ -0,0 +1,243 @@
1
+ # Ontology Structure Validation Hook - Update Summary
2
+
3
+ **Date:** 2025-11-03
4
+ **Status:** ✅ Complete and Tested
5
+ **Hook:** `.claude/hooks/validate-ontology-structure.py`
6
+
7
+ ## Changes Made
8
+
9
+ ### 1. Enhanced Documentation Header
10
+
11
+ Added comprehensive documentation explaining:
12
+ - The 6-dimension ontology (groups, people, things, connections, events, knowledge)
13
+ - Database implementation (5 tables mapping to 6 dimensions)
14
+ - Expected directory structure for `/one/`
15
+ - Clarification that people are stored as things with `type: 'creator'`
16
+
17
+ ### 2. Updated Dimension Definitions
18
+
19
+ Each dimension now includes:
20
+ - **Simplified aliases** (removed variants like "organisations/organizations")
21
+ - **Clear descriptions** aligned with ontology.md
22
+ - **Example files** showing what belongs in each dimension
23
+ - **Type counts** (66 thing types, 25 connection types, 67 event types)
24
+ - **Special notes** (e.g., people stored as things with role metadata)
25
+
26
+ #### Dimension Structure:
27
+
28
+ ```
29
+ 📁 /one/groups/
30
+ Hierarchical containers - friend circles → DAOs → governments
31
+ Examples: groups.md, revenue.md, vision.md
32
+
33
+ 📁 /one/people/
34
+ Authorization & governance - roles, permissions, organization
35
+ Examples: people.md, roles.md, governance.md
36
+ Note: People are stored as things (type: 'creator') with role metadata
37
+
38
+ 📁 /one/things/
39
+ All entities - users, agents, content, tokens, courses (66 types)
40
+ Examples: agents/, plans/, specifications/
41
+
42
+ 📁 /one/connections/
43
+ All relationships - owns, purchased, enrolled_in (25 types)
44
+ Examples: protocols.md, workflow.md, integrations/
45
+
46
+ 📁 /one/events/
47
+ All actions - created, updated, purchased, completed (67 types)
48
+ Examples: deployment/, releases/, test-results/
49
+
50
+ 📁 /one/knowledge/
51
+ AI understanding - embeddings, search, RAG (labels, chunks, vectors)
52
+ Examples: ontology.md, architecture.md, patterns/
53
+ ```
54
+
55
+ ### 3. Added EXPECTED_STRUCTURE Constant
56
+
57
+ New constant defining what should go in each dimension directory:
58
+ - **groups:** Group definitions, hierarchies, vision, strategy, revenue
59
+ - **people:** Roles, governance, team structure, organization
60
+ - **things:** Entity specifications, agent definitions, plans, components
61
+ - **connections:** Protocols, workflows, integrations, relationships, patterns
62
+ - **events:** Deployment plans, release notes, test results, agent execution summaries
63
+ - **knowledge:** Architecture docs, implementation guides, patterns, rules, tutorials
64
+
65
+ ### 4. Improved Error Messages
66
+
67
+ Enhanced error output to include:
68
+ - Visual separators (======= lines)
69
+ - Emoji indicators for each dimension (📁)
70
+ - Example files for each dimension
71
+ - Notes about special cases (e.g., people as things)
72
+ - Clear database implementation mapping (5 tables → 6 dimensions)
73
+ - Current file location and detected dimension
74
+
75
+ ### 5. Created Comprehensive Test Suite
76
+
77
+ New file: `.claude/hooks/test-validate-ontology.sh`
78
+
79
+ Tests 14 scenarios:
80
+ - ✅ Valid files in all 6 dimensions
81
+ - ✅ Invalid dimension detection
82
+ - ✅ Invalid filename detection (uppercase, spaces, CamelCase)
83
+ - ✅ Files outside `/one/` are ignored
84
+ - ✅ All tests passing
85
+
86
+ ## Ontology Alignment Verification
87
+
88
+ ### ✅ Aligned with ontology.md
89
+
90
+ 1. **6 Dimensions Confirmed:**
91
+ - groups - Hierarchical containers (friend circles → governments)
92
+ - people - Authorization & governance (who can do what)
93
+ - things - All entities (66 types)
94
+ - connections - All relationships (25 types)
95
+ - events - All actions (67 types)
96
+ - knowledge - AI understanding (embeddings, search, RAG)
97
+
98
+ 2. **Database Implementation (5 tables):**
99
+ - groups table → groups dimension ✅
100
+ - things table → things + people dimensions ✅
101
+ - connections table → connections dimension ✅
102
+ - events table → events dimension ✅
103
+ - knowledge table → knowledge dimension ✅
104
+
105
+ 3. **Key Insight: People as Things**
106
+ - People are stored in the `things` table with `type: 'creator'`
107
+ - The `/one/people/` directory contains role/governance docs
108
+ - Hook correctly notes this relationship
109
+
110
+ ### ✅ Directory Structure Validation
111
+
112
+ The hook validates that all files in `/one/` follow the ontology:
113
+
114
+ ```
115
+ /one/
116
+ ├── groups/ ✅ Group definitions, vision, strategy
117
+ ├── people/ ✅ Roles, governance, organization
118
+ ├── things/ ✅ Entity specs, agents, plans
119
+ ├── connections/ ✅ Protocols, workflows, integrations
120
+ ├── events/ ✅ Deployment, releases, test results
121
+ └── knowledge/ ✅ Architecture, patterns, guides
122
+ ```
123
+
124
+ ### ✅ Validation Rules
125
+
126
+ 1. **File location:** Must be in one of the 6 dimension directories
127
+ 2. **File naming:** kebab-case only (lowercase-with-hyphens.md)
128
+ 3. **File extensions:** .md, .yaml, .yml, .json only
129
+ 4. **Thing types:** Validates against 66 defined types
130
+ 5. **Connection types:** Validates against 25 relationship types
131
+ 6. **Event types:** Validates against 67 action types
132
+ 7. **Protocol metadata:** Ensures protocols stored in metadata.protocol field
133
+
134
+ ## Test Results
135
+
136
+ ```bash
137
+ $ ./.claude/hooks/test-validate-ontology.sh
138
+
139
+ =======================================================================
140
+ Testing Ontology Structure Validation Hook
141
+ =======================================================================
142
+
143
+ Testing valid files in each dimension...
144
+ ✅ Valid file in /one/groups/
145
+ ✅ Valid file in /one/people/
146
+ ✅ Valid file in /one/things/
147
+ ✅ Valid file in /one/connections/
148
+ ✅ Valid file in /one/events/
149
+ ✅ Valid file in /one/knowledge/
150
+
151
+ Testing invalid dimensions...
152
+ ✅ Invalid dimension /one/invalid/ (correctly failed)
153
+ ✅ File directly in /one/ (correctly failed)
154
+
155
+ Testing invalid filenames...
156
+ ✅ Uppercase filename (correctly failed)
157
+ ✅ Spaces in filename (correctly failed)
158
+ ✅ CamelCase filename (correctly failed)
159
+
160
+ Testing files outside /one (should be ignored)...
161
+ ✅ File in /web (correctly ignored)
162
+ ✅ File in /backend (correctly ignored)
163
+ ✅ File in root (correctly ignored)
164
+
165
+ =======================================================================
166
+ Test Summary
167
+ =======================================================================
168
+ Total tests: 14
169
+ Passed: 14
170
+ Failed: 0
171
+
172
+ ✅ All tests passed!
173
+ ```
174
+
175
+ ## Usage
176
+
177
+ ### Manual Testing
178
+
179
+ ```bash
180
+ # Test the hook manually
181
+ python3 .claude/hooks/validate-ontology-structure.py <<EOF
182
+ {
183
+ "hook_event_name": "PostToolUse",
184
+ "tool_name": "Write",
185
+ "tool_input": {
186
+ "file_path": "/path/to/file.md",
187
+ "content": "# Test content"
188
+ }
189
+ }
190
+ EOF
191
+ ```
192
+
193
+ ### Run Test Suite
194
+
195
+ ```bash
196
+ # Run all tests
197
+ ./.claude/hooks/test-validate-ontology.sh
198
+ ```
199
+
200
+ ### Integration with Claude Code
201
+
202
+ The hook automatically runs when:
203
+ - Using the `Write` tool on files in `/one/`
204
+ - Using the `Edit` tool on files in `/one/`
205
+ - Using the `MultiEdit` tool on files in `/one/`
206
+
207
+ Files outside `/one/` are ignored and not validated.
208
+
209
+ ## Benefits
210
+
211
+ 1. **Enforces ontology structure** - Prevents misplaced documentation
212
+ 2. **Maintains consistency** - All files follow kebab-case naming
213
+ 3. **Educates developers** - Clear error messages explain the ontology
214
+ 4. **Automated validation** - Catches errors before they're committed
215
+ 5. **Comprehensive testing** - 14 test cases ensure reliability
216
+ 6. **Non-intrusive** - Only validates `/one/` directory, ignores others
217
+
218
+ ## Future Enhancements
219
+
220
+ Potential improvements for future iterations:
221
+
222
+ 1. **Auto-fix mode** - Automatically move misplaced files to correct dimensions
223
+ 2. **Content validation** - Deeper validation of file contents against schemas
224
+ 3. **Integration with git hooks** - Pre-commit validation
225
+ 4. **VS Code extension** - Real-time validation in editor
226
+ 5. **Documentation links** - Suggest relevant ontology docs based on errors
227
+
228
+ ## Files Modified
229
+
230
+ - `.claude/hooks/validate-ontology-structure.py` - Updated validation logic and error messages
231
+
232
+ ## Files Created
233
+
234
+ - `.claude/hooks/test-validate-ontology.sh` - Comprehensive test suite
235
+ - `.claude/hooks/validate-ontology-structure-summary.md` - This summary document
236
+
237
+ ## Conclusion
238
+
239
+ The ontology validation hook is now fully aligned with the 6-dimension ontology specification in `/one/knowledge/ontology.md`. It enforces proper directory structure, validates file naming conventions, and provides clear, educational error messages that help developers understand the ontology structure.
240
+
241
+ **Status: ✅ Production Ready**
242
+
243
+ All tests passing. Hook is active and validating files in `/one/` directory.