oneie 3.6.24 → 3.6.26

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 (73) hide show
  1. package/.claude/agents/agent-backend.md +2 -2
  2. package/.claude/agents/agent-builder.md +226 -198
  3. package/.claude/agents/agent-designer.md +167 -11
  4. package/.claude/agents/agent-director.md +180 -112
  5. package/.claude/agents/agent-frontend.md +154 -8
  6. package/.claude/agents/agent-onboard.md +1 -1
  7. package/.claude/agents/agent-ontology.md +2 -2
  8. package/.claude/agents/agent-ops.md +58 -38
  9. package/.claude/agents/agent-quality.md +377 -0
  10. package/.claude/agents/agent-sales.md +3 -3
  11. package/.claude/commands/cascade.md +21 -21
  12. package/.claude/commands/create.md +19 -19
  13. package/.claude/commands/deploy.md +82 -104
  14. package/.claude/commands/mcp-on.md +191 -0
  15. package/.claude/commands/one.md +267 -92
  16. package/.claude/commands/plan.md +17 -17
  17. package/.claude/commands/release.md +65 -14
  18. package/.claude/hooks/PULL-BEFORE-PUSH-GUIDE.md +473 -0
  19. package/.claude/hooks/README-knowledge-hooks.md +451 -0
  20. package/.claude/hooks/README-root-cleanup.md +200 -0
  21. package/.claude/hooks/README.md +284 -0
  22. package/.claude/hooks/__pycache__/done.cpython-313.pyc +0 -0
  23. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  24. package/.claude/hooks/check-filenames.py +177 -0
  25. package/.claude/hooks/clean-post.py +468 -0
  26. package/.claude/hooks/clean-pre.py +393 -0
  27. package/.claude/hooks/clean-root-markdown.sh +73 -0
  28. package/.claude/hooks/commit-push.sh +95 -0
  29. package/.claude/hooks/done.py +236 -0
  30. package/.claude/hooks/format-hook.sh +163 -0
  31. package/.claude/hooks/hook-logger.sh +173 -0
  32. package/.claude/hooks/knowledge-post.py +355 -0
  33. package/.claude/hooks/knowledge-pre.py +245 -0
  34. package/.claude/hooks/mcp-on.sh +134 -0
  35. package/.claude/hooks/notification-hook.sh +279 -0
  36. package/.claude/hooks/push.sh +101 -0
  37. package/.claude/hooks/release-cli.sh +16 -8
  38. package/.claude/hooks/root-cleanup.py +217 -0
  39. package/.claude/hooks/security-hook.sh +397 -0
  40. package/.claude/hooks/tag-all-docs.py +464 -0
  41. package/.claude/hooks/test-validate-ontology.sh +170 -0
  42. package/.claude/hooks/todo.py +368 -0
  43. package/.claude/hooks/track-changes.sh +101 -0
  44. package/.claude/hooks/validate-ontology-structure-summary.md +243 -0
  45. package/.claude/hooks/validate-ontology-structure.py +518 -0
  46. package/.claude/skills/INDEX.md +1 -1
  47. package/.claude/skills/ontology/README.md +1 -1
  48. package/CLAUDE.md +105 -0
  49. package/dist/commands/agent.d.ts +18 -0
  50. package/dist/commands/agent.d.ts.map +1 -0
  51. package/dist/commands/agent.js +271 -0
  52. package/dist/commands/agent.js.map +1 -0
  53. package/dist/commands/init.js +1 -1
  54. package/dist/commands/init.js.map +1 -1
  55. package/dist/index.js +20 -0
  56. package/dist/index.js.map +1 -1
  57. package/dist/lib/agent-detection.d.ts +19 -0
  58. package/dist/lib/agent-detection.d.ts.map +1 -0
  59. package/dist/lib/agent-detection.js +87 -0
  60. package/dist/lib/agent-detection.js.map +1 -0
  61. package/dist/lib/detect.d.ts +45 -0
  62. package/dist/lib/detect.d.ts.map +1 -0
  63. package/dist/lib/detect.js +221 -0
  64. package/dist/lib/detect.js.map +1 -0
  65. package/llms.txt +257 -0
  66. package/one/knowledge/games-english.md +691 -0
  67. package/one/knowledge/games.md +1082 -0
  68. package/one/things/plans/npx-agent-safety.md +785 -0
  69. package/one/things/plans/npx-agent.md +1089 -0
  70. package/one/things/plans/remove-backend-development-from-agents.md +1331 -0
  71. package/package.json +3 -2
  72. package/.claude/commands/mcp-toggle.md +0 -93
  73. package/.claude/commands/npx.md +0 -84
@@ -0,0 +1,473 @@
1
+ # Pull Before Push: The Anti-Divergence Guide
2
+
3
+ **CRITICAL RULE:** Always pull before push. This prevents branch divergence forever.
4
+
5
+ ---
6
+
7
+ ## The Problem
8
+
9
+ Branch divergence happens when:
10
+
11
+ ```
12
+ Local: 5daac2b4 → b871c846 (your commit)
13
+ Remote: 5daac2b4 → c0430725 (someone else's commit)
14
+ ↑
15
+ Same parent, but different children
16
+ → DIVERGED! (requires manual resolution)
17
+ ```
18
+
19
+ **How it happens:**
20
+ 1. Remote gets a commit you don't have
21
+ 2. You make a local commit
22
+ 3. You try to push
23
+ 4. Git says "rejected - remote is ahead"
24
+ 5. You're now in "diverged" state
25
+
26
+ **Time to recover:** 5-10 minutes (pull, resolve conflicts, push again)
27
+
28
+ ---
29
+
30
+ ## The Solution: Pull Before Push
31
+
32
+ ```bash
33
+ # Always use this sequence:
34
+ git add -A
35
+ git commit -m "Your message"
36
+ git pull origin main # ← ALWAYS pull first
37
+ git push origin main # ← Then push
38
+ ```
39
+
40
+ **Why it works:**
41
+ - If remote is ahead, you get their commits
42
+ - If you're ahead, pull is a no-op (fast-forward)
43
+ - If both diverged, pull merges and you fix conflicts once
44
+ - After pull, your branch is always in sync
45
+ - Push always succeeds (never rejected)
46
+
47
+ ---
48
+
49
+ ## How ONE Platform Enforces This
50
+
51
+ We have **THREE LAYERS** of protection:
52
+
53
+ ### Layer 1: Git Config (Local)
54
+ ```bash
55
+ git config pull.ff only
56
+ ```
57
+ - Forces fast-forward only pulls
58
+ - Git refuses to pull if it would create divergence
59
+ - You get immediate feedback if something's wrong
60
+
61
+ ### Layer 2: Claude Hooks (.claude/hooks/)
62
+
63
+ #### push.sh
64
+ ```bash
65
+ ./.claude/hooks/push.sh main # or: all, one, web, oneie
66
+ ```
67
+ - Automatically pulls before pushing
68
+ - Tries fast-forward first, falls back to merge
69
+ - Shows progress: pull → push
70
+
71
+ #### commit-push.sh
72
+ ```bash
73
+ ./.claude/hooks/commit-push.sh "Your message"
74
+ ```
75
+ - All-in-one: stage → commit → pull → push
76
+ - Same pull logic as push.sh
77
+ - Fully automated workflow
78
+
79
+ ### Layer 3: Git Hook (Server-Side)
80
+ ```bash
81
+ .git/hooks/pre-push
82
+ ```
83
+ - Final safety check before ANY push
84
+ - Runs automatically on `git push`
85
+ - Detects divergence and prevents push if not synced
86
+ - Suggests fix: "git pull origin main"
87
+
88
+ ---
89
+
90
+ ## Workflows
91
+
92
+ ### Workflow 1: Using commit-push.sh (Easiest)
93
+
94
+ **Command:**
95
+ ```bash
96
+ ./.claude/hooks/commit-push.sh "Your commit message"
97
+ ```
98
+
99
+ **What happens:**
100
+ 1. ✅ Stages all changes
101
+ 2. ✅ Creates commit
102
+ 3. ✅ Pulls latest from remote
103
+ 4. ✅ Pushes to origin
104
+ 5. ✅ Shows summary
105
+
106
+ **Result:** Always synced, zero divergence.
107
+
108
+ ### Workflow 2: Using push.sh
109
+
110
+ **Commands:**
111
+ ```bash
112
+ git add -A
113
+ git commit -m "Your message"
114
+ ./.claude/hooks/push.sh main
115
+ ```
116
+
117
+ **What happens:**
118
+ 1. ✅ You create commits locally
119
+ 2. ✅ push.sh pulls before pushing
120
+ 3. ✅ push.sh pushes all your commits
121
+
122
+ **Result:** Always synced, zero divergence.
123
+
124
+ ### Workflow 3: Manual (Most Control)
125
+
126
+ **Commands:**
127
+ ```bash
128
+ git add -A
129
+ git commit -m "Your message"
130
+ git pull origin main
131
+ git push origin main
132
+ ```
133
+
134
+ **What happens:**
135
+ 1. ✅ You do everything manually
136
+ 2. ✅ pre-push hook validates before push
137
+ 3. ✅ pre-push hook prevents bad pushes
138
+
139
+ **Result:** Manual control, still safe.
140
+
141
+ ---
142
+
143
+ ## What If Divergence Already Happened?
144
+
145
+ ### Symptom
146
+ ```
147
+ error: failed to push some refs
148
+ hint: Updates were rejected because the tip of your current branch is behind
149
+ ```
150
+
151
+ ### Fix
152
+ ```bash
153
+ # 1. Pull to get remote commits
154
+ git pull origin main
155
+
156
+ # 2. Resolve conflicts if they occur
157
+ # (edit conflicted files)
158
+
159
+ # 3. Complete merge
160
+ git add -A
161
+ git commit -m "Merge remote changes"
162
+
163
+ # 4. Push (now safe)
164
+ git push origin main
165
+ ```
166
+
167
+ **Time:** 5-10 minutes
168
+
169
+ ---
170
+
171
+ ## Git Config Details
172
+
173
+ ### Current Settings
174
+ ```bash
175
+ git config pull.ff only
176
+ ```
177
+
178
+ ### What This Does
179
+ - ✅ `git pull` succeeds if fast-forward possible
180
+ - ❌ `git pull` fails if would create divergence
181
+ - Forces you to explicitly handle divergence
182
+
183
+ ### Verify It's Set
184
+ ```bash
185
+ git config --get pull.ff
186
+ # Output: only
187
+ ```
188
+
189
+ ### If You Want to Change
190
+ ```bash
191
+ # Allow merges on divergence (less safe)
192
+ git config pull.ff false
193
+
194
+ # Restore safety (recommended)
195
+ git config pull.ff only
196
+ ```
197
+
198
+ ---
199
+
200
+ ## Hook Details
201
+
202
+ ### pre-push Hook
203
+
204
+ **Location:** `.git/hooks/pre-push`
205
+
206
+ **What it does:**
207
+ 1. Fetches latest from remote
208
+ 2. Checks if local and remote are in sync
209
+ 3. If diverged: prevents push, suggests fix
210
+ 4. If synced: allows push
211
+ 5. Shows progress with colors
212
+
213
+ **Triggers:** Automatically on `git push` (all types)
214
+
215
+ **Can't bypass:** This hook is local, you control it
216
+
217
+ ### .claude/hooks/push.sh
218
+
219
+ **Location:** `.claude/hooks/push.sh`
220
+
221
+ **Usage:**
222
+ ```bash
223
+ ./.claude/hooks/push.sh [all|main|one|web|oneie]
224
+ ```
225
+
226
+ **Options:**
227
+ - `all` - Push to all remotes (main, one, web, oneie)
228
+ - `main` - Push only main repo (one-ie/one)
229
+ - `one` - Push only /one subtree (one-ie/ontology)
230
+ - `web` - Push only /web subtree (one-ie/web)
231
+ - `oneie` - Push only one.ie directory
232
+
233
+ **Pull logic:**
234
+ ```bash
235
+ git pull origin main --ff-only # Try fast-forward
236
+ # If that fails:
237
+ git pull origin main --no-rebase # Fall back to merge
238
+ ```
239
+
240
+ ### .claude/hooks/commit-push.sh
241
+
242
+ **Location:** `.claude/hooks/commit-push.sh`
243
+
244
+ **Usage:**
245
+ ```bash
246
+ ./.claude/hooks/commit-push.sh "Your commit message"
247
+ ```
248
+
249
+ **Workflow:**
250
+ 1. Check for changes
251
+ 2. Stage all changes
252
+ 3. Create commit
253
+ 4. Pull latest (with fallback to merge)
254
+ 5. Push to origin
255
+ 6. Show summary
256
+
257
+ **Benefits:**
258
+ - One command instead of 4
259
+ - Automatic pull-before-push
260
+ - Clear progress output
261
+ - Shows commit hash and file count
262
+
263
+ ---
264
+
265
+ ## Testing the Setup
266
+
267
+ ### Test 1: Verify Config
268
+ ```bash
269
+ git config --get pull.ff
270
+ # Expected: only
271
+ ```
272
+
273
+ ### Test 2: Verify Hooks Exist
274
+ ```bash
275
+ ls -la .git/hooks/pre-push
276
+ # Expected: -rwxr-xr-x (executable)
277
+
278
+ ls -la .claude/hooks/push.sh
279
+ # Expected: -rwxr-xr-x (executable)
280
+
281
+ ls -la .claude/hooks/commit-push.sh
282
+ # Expected: -rwxr-xr-x (executable)
283
+ ```
284
+
285
+ ### Test 3: Simulate Push
286
+ ```bash
287
+ # Create a test commit
288
+ echo "test" > test.txt
289
+ git add test.txt
290
+ ./.claude/hooks/commit-push.sh "test: verify push workflow"
291
+
292
+ # If successful, hooks are working!
293
+ # Clean up
294
+ git reset --soft HEAD~1
295
+ git rm test.txt
296
+ git checkout test.txt
297
+ ```
298
+
299
+ ---
300
+
301
+ ## Common Scenarios
302
+
303
+ ### Scenario 1: Fast Development (Multiple Commits)
304
+
305
+ ```bash
306
+ # Commit 1
307
+ git add file1.js
308
+ git commit -m "feat: add feature 1"
309
+
310
+ # Commit 2
311
+ git add file2.js
312
+ git commit -m "feat: add feature 2"
313
+
314
+ # Push both together (pull happens once)
315
+ ./.claude/hooks/push.sh main
316
+ ```
317
+
318
+ **Result:** Both commits pushed, no divergence.
319
+
320
+ ### Scenario 2: Concurrent Work
321
+
322
+ **Person A:**
323
+ ```bash
324
+ git add feature-a.js
325
+ ./.claude/hooks/commit-push.sh "feat: feature A"
326
+ # Pushes successfully
327
+ ```
328
+
329
+ **Person B (at same time):**
330
+ ```bash
331
+ git add feature-b.js
332
+ ./.claude/hooks/commit-push.sh "feat: feature B"
333
+ # push.sh pulls A's commit, then pushes B
334
+ ```
335
+
336
+ **Result:** Both commits pushed in order, no conflicts.
337
+
338
+ ### Scenario 3: Long-Running Branch
339
+
340
+ ```bash
341
+ # Day 1
342
+ git commit -m "work in progress"
343
+ ./.claude/hooks/commit-push.sh "wip: day 1"
344
+
345
+ # Day 2 (remote got other commits)
346
+ git commit -m "more work"
347
+ ./.claude/hooks/commit-push.sh "wip: day 2"
348
+ # push.sh pulls day-1 commits, pushes day-2
349
+ ```
350
+
351
+ **Result:** Always synced despite long time between commits.
352
+
353
+ ---
354
+
355
+ ## Troubleshooting
356
+
357
+ ### Problem: Pre-push hook blocks push
358
+
359
+ **Message:**
360
+ ```
361
+ PUSH REJECTED: Branches have diverged!
362
+ ```
363
+
364
+ **Cause:** Remote and local have different commits.
365
+
366
+ **Fix:**
367
+ ```bash
368
+ git pull origin main
369
+ git push origin main
370
+ ```
371
+
372
+ ### Problem: Merge conflicts during pull
373
+
374
+ **Message:**
375
+ ```
376
+ CONFLICT (content): Merge conflict in file.js
377
+ ```
378
+
379
+ **Cause:** You and someone else edited same file.
380
+
381
+ **Fix:**
382
+ ```bash
383
+ # 1. Open conflicted file
384
+ vim file.js
385
+
386
+ # 2. Resolve conflicts (look for <<<<, ====, >>>>)
387
+
388
+ # 3. Mark resolved
389
+ git add file.js
390
+
391
+ # 4. Complete merge
392
+ git commit -m "Merge remote changes"
393
+
394
+ # 5. Push
395
+ git push origin main
396
+ ```
397
+
398
+ ### Problem: Hook script not executable
399
+
400
+ **Message:**
401
+ ```
402
+ permission denied: .claude/hooks/push.sh
403
+ ```
404
+
405
+ **Fix:**
406
+ ```bash
407
+ chmod +x .claude/hooks/push.sh
408
+ chmod +x .claude/hooks/commit-push.sh
409
+ chmod +x .git/hooks/pre-push
410
+ ```
411
+
412
+ ### Problem: Config not working
413
+
414
+ **Verify:**
415
+ ```bash
416
+ git config --get pull.ff
417
+ # Should return: only
418
+ ```
419
+
420
+ **If not set:**
421
+ ```bash
422
+ git config pull.ff only
423
+ ```
424
+
425
+ ---
426
+
427
+ ## Philosophy
428
+
429
+ **Why we do this:**
430
+
431
+ 1. **Prevention > Recovery**
432
+ - Preventing divergence (5 seconds) < Fixing divergence (10 minutes)
433
+
434
+ 2. **Safety First**
435
+ - Triple-layer protection means mistakes are impossible
436
+ - Hooks auto-correct most issues
437
+
438
+ 3. **Simple Rule**
439
+ - One rule: Always pull before push
440
+ - Easy to remember, easy to implement
441
+
442
+ 4. **Automation**
443
+ - Hooks do the pulling automatically
444
+ - You just run one command
445
+
446
+ ---
447
+
448
+ ## Quick Reference
449
+
450
+ | Task | Command | Time | Safety |
451
+ |------|---------|------|--------|
452
+ | Quick commit & push | `./.claude/hooks/commit-push.sh "msg"` | 10s | ✅✅✅ |
453
+ | Push existing commits | `./.claude/hooks/push.sh main` | 5s | ✅✅✅ |
454
+ | Manual (full control) | `git pull && git push` | 5s | ✅✅ |
455
+ | No hooks (dangerous) | `git push origin main` | 2s | ✅ (only pre-push hook) |
456
+
457
+ ---
458
+
459
+ ## Success Criteria
460
+
461
+ ✅ **You've successfully implemented anti-divergence if:**
462
+
463
+ - [ ] `git config pull.ff only` is set
464
+ - [ ] `.git/hooks/pre-push` exists and is executable
465
+ - [ ] `.claude/hooks/push.sh` pulls before pushing
466
+ - [ ] `.claude/hooks/commit-push.sh` pulls before pushing
467
+ - [ ] You always use `commit-push.sh` or `push.sh` (never raw `git push`)
468
+ - [ ] No more divergence errors when pushing
469
+
470
+ ---
471
+
472
+ **Remember:** Pull before push, every time. It's that simple. 🔒
473
+