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
@@ -1,6 +1,6 @@
1
1
  # /plan - Convert Ideas to Implementation Plans with CASCADE
2
2
 
3
- **Purpose:** Transform ideas into detailed 100-inference plans with automatic agent assignment and task breakdown.
3
+ **Purpose:** Transform ideas into detailed 100-cycle plans with automatic agent assignment and task breakdown.
4
4
 
5
5
  ## Core Functionality
6
6
 
@@ -11,7 +11,7 @@
11
11
  ```
12
12
 
13
13
  Generates:
14
- - ✅ 100-inference execution plan
14
+ - ✅ 100-cycle execution plan
15
15
  - ✅ Automatic agent assignments
16
16
  - ✅ Task dependencies & timeline
17
17
  - ✅ 6-dimension ontology mapping
@@ -31,10 +31,10 @@ Generates:
31
31
  ### Execution Management
32
32
 
33
33
  ```bash
34
- /now # Show current inference & task
35
- /next # Advance to next inference
34
+ /now # Show current cycle & task
35
+ /next # Advance to next cycle
36
36
  /done # Mark complete & advance
37
- /goto [N] # Jump to inference N
37
+ /goto [N] # Jump to cycle N
38
38
  ```
39
39
 
40
40
  ### Plan Filtering & Analysis
@@ -130,7 +130,7 @@ Support Specialists (Throughout):
130
130
  🚀 agent-ops: Sets up CI/CD, prepares deployment
131
131
 
132
132
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
133
- 📈 PHASE BREAKDOWN (100 Inferences)
133
+ 📈 PHASE BREAKDOWN (100 Cycles)
134
134
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
135
135
 
136
136
  Cycle 1-10: Foundation & Understanding
@@ -143,7 +143,7 @@ Cycle 1-10: Foundation & Understanding
143
143
  - Define people roles (creator, student, admin)
144
144
  - Create vision document
145
145
  - Break down features
146
- - Create 100-inference plan ← You are here!
146
+ - Create 100-cycle plan ← You are here!
147
147
 
148
148
  Cycle 11-20: Backend Schema & Services
149
149
  - Design Convex schema (groups, things, connections, events, knowledge)
@@ -352,7 +352,7 @@ Each plan includes:
352
352
  - Lists required connections
353
353
  - Determines event types
354
354
 
355
- ### 2. 100-Inference Breakdown
355
+ ### 2. 100-Cycle Breakdown
356
356
  - Foundation (Cycle 1-10)
357
357
  - Backend (Cycle 11-50)
358
358
  - Frontend (Cycle 21-80)
@@ -412,31 +412,31 @@ Output:
412
412
  🔗 Share: /plan share
413
413
  ```
414
414
 
415
- ## Inference Workflow Integration
415
+ ## Cycle Workflow Integration
416
416
 
417
417
  Once plan is created, use these commands:
418
418
 
419
419
  ```bash
420
- /now # Show current inference (Cycle 1)
421
- /next # Advance to next inference
420
+ /now # Show current cycle (Cycle 1)
421
+ /next # Advance to next cycle
422
422
  /done # Mark complete, capture lessons
423
- /goto [N] # Jump to specific inference
423
+ /goto [N] # Jump to specific cycle
424
424
  /build # Start building with agents
425
425
  ```
426
426
 
427
427
  ## Key Principles
428
428
 
429
- 1. **Ideas → Plans:** Convert any idea into actionable 100-inference plan
430
- 2. **Automatic Assignment:** Agent assignments happen automatically based on inference type
429
+ 1. **Ideas → Plans:** Convert any idea into actionable 100-cycle plan
430
+ 2. **Automatic Assignment:** Agent assignments happen automatically based on cycle type
431
431
  3. **Quality First:** Tests defined before implementation
432
432
  4. **Parallel Execution:** Maximize agent parallelization
433
- 5. **Complete Tracking:** Every inference tracked with status, dependencies, lessons
434
- 6. **Continuous Learning:** Capture lessons after each inference
433
+ 5. **Complete Tracking:** Every cycle tracked with status, dependencies, lessons
434
+ 6. **Continuous Learning:** Capture lessons after each cycle
435
435
 
436
436
  ---
437
437
 
438
438
  ## See Also
439
439
 
440
440
  - [CASCADE System](./cascade.md) - Full agent orchestration
441
- - [Inference Workflow](../commands/done.md) - Mark cycles complete
441
+ - [Cycle Workflow](../commands/done.md) - Mark cycles complete
442
442
  - [Agent Dashboard](./one.md) - View all agents
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  allowed-tools: Task(agent-ops:*)
3
- description: Release CLI to npm
3
+ description: Release CLI to npm (optimized)
4
4
  ---
5
5
 
6
- # /release - Release CLI to npm
6
+ # /release - Release CLI to npm (Optimized v2)
7
7
 
8
- Release the CLI to npm registry.
8
+ Release the CLI to npm registry with parallel sync and minimal duplication.
9
9
 
10
10
  ## Usage
11
11
 
@@ -16,28 +16,64 @@ Release the CLI to npm registry.
16
16
  /release sync # Sync files without version bump
17
17
  ```
18
18
 
19
- ## What It Does
19
+ ## What It Does (Optimized)
20
20
 
21
21
  Runs `./.claude/hooks/release-cli.sh [type]` which:
22
22
 
23
- 1. Syncs `.claude/*` to `cli/.claude/`
24
- 2. Syncs `/one/*` to `cli/one/`
25
- 3. Syncs root markdown files (CLAUDE.md, README.md, etc.)
26
- 4. Bumps version in `cli/package.json` (if not sync)
27
- 5. Builds the CLI
28
- 6. Publishes to npm registry
23
+ 1. **Syncs documentation** `/one/*` → `cli/one/` (all platform docs)
24
+ 2. **Syncs root markdown** (CLAUDE.md, README.md, LICENSE.md, SECURITY.md, AGENTS.md)
25
+ 3. **Hooks stay in root** - CLI references `./.claude/hooks/` (single source of truth, no duplication)
26
+ 4. **Parallel operations** - Uses background jobs for file copies
27
+ 5. **Bumps version** in `cli/package.json` (if not sync)
28
+ 6. **Builds CLI** with npm
29
+ 7. **Publishes to npm** registry
30
+ 8. **Verifies publication** on npm registry
31
+
32
+ ## Architecture
33
+
34
+ ```
35
+ Root Repository (.claude/hooks/)
36
+ ↓ (referenced by)
37
+ CLI Repo (cli/)
38
+ ├── cli/one/* (synced documentation)
39
+ ├── cli/*.md (synced markdown files)
40
+ └── package.json (version bumped & published)
41
+ ```
42
+
43
+ **Key Benefit:** Hooks are maintained in ONE place - the root repository. No duplication, no sync issues.
44
+
45
+ ## Performance
46
+
47
+ - **Before:** Synced 17 hook files + documentation (~50+ files)
48
+ - **After:** Syncs only documentation + 5 markdown files (~200 files in /one/)
49
+ - **Result:** Faster, cleaner, single source of truth
29
50
 
30
51
  ## Your Task
31
52
 
32
- Delegate to agent-ops to run the script:
53
+ Delegate to agent-ops to run the optimized release:
33
54
 
34
55
  ```typescript
35
56
  Task({
36
57
  subagent_type: "agent-ops",
37
- description: "Release CLI to npm",
38
- prompt: `Run: ./.claude/hooks/release-cli.sh ${releaseType}
58
+ description: "Execute optimized CLI release with hooks merge",
59
+ prompt: `Run optimized CLI release:
60
+
61
+ 1. Execute: ./.claude/hooks/release-cli.sh ${releaseType}
62
+ - Syncs /one/* to cli/one/
63
+ - Syncs root markdown files
64
+ - Hooks reference root .claude/ (no copy)
65
+ - Bumps version (if not sync)
66
+ - Publishes to npm
67
+
68
+ 2. Wait for completion and verify publication
39
69
 
40
- Wait for completion and report success with the new version.`,
70
+ 3. Report:
71
+ - New version number (if version bumped)
72
+ - npm publication success/failure
73
+ - Release duration
74
+ - Any errors or warnings
75
+
76
+ Do not copy .claude/ to cli/ - hooks stay in root.`,
41
77
  });
42
78
  ```
43
79
 
@@ -48,3 +84,18 @@ Install the new version:
48
84
  ```bash
49
85
  npx oneie@latest --version
50
86
  ```
87
+
88
+ ## Testing
89
+
90
+ Verify the release locally:
91
+
92
+ ```bash
93
+ # Test the script
94
+ ./.claude/hooks/release-cli.sh sync
95
+
96
+ # Check CLI was built
97
+ ls -la cli/dist/
98
+
99
+ # Check npm credentials
100
+ npm whoami
101
+ ```
@@ -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
+