oneie 3.6.18 → 3.6.21

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 (58) hide show
  1. package/.claude/agents/agent-ops.md +63 -2
  2. package/.claude/commands/commit.md +95 -0
  3. package/.claude/commands/npx.md +2 -2
  4. package/.claude/commands/one.md +7 -1
  5. package/.claude/commands/push.md +113 -21
  6. package/.claude/commands/release.md +2 -2
  7. package/.claude/hooks/release-cli.sh +195 -0
  8. package/CLAUDE.md +131 -12
  9. package/README.md +778 -497
  10. package/one/groups/one.md +1 -1
  11. package/one/knowledge/architecture-frontend.md +5 -0
  12. package/one/knowledge/archived/ontology.old.md +1 -1
  13. package/one/knowledge/develop/design.md +364 -0
  14. package/one/knowledge/develop/index.md +145 -0
  15. package/one/knowledge/metadata-system.md +1 -1
  16. package/one/knowledge/ontology-engineering.md +1 -1
  17. package/one/knowledge/ontology.md +1 -1
  18. package/one/knowledge/patterns/design/index.md +160 -0
  19. package/one/knowledge/quick-start-ontology-mapping.md +773 -0
  20. package/one/knowledge/todo-template.md +100 -100
  21. package/one/knowledge/todo.md +100 -100
  22. package/one/people/anthony-o-connell.md +3 -3
  23. package/one/things/master-workflow-plan.md +2 -2
  24. package/one/things/plans/execution-strategy.md +243 -243
  25. package/one/things/plans/wave1-specialist-assignments.md +1 -1
  26. package/one/things/todo-ai.md +100 -100
  27. package/one/things/todo-assignment.md +21 -21
  28. package/one/things/todo-effects.md +100 -100
  29. package/one/things/todo-frontend-effects.md +100 -100
  30. package/one/things/todo-master-plan.md +1 -1
  31. package/one/things/todo-sequence.md +1 -1
  32. package/package.json +1 -1
  33. package/.claude/agents/NEWS-QUICKSTART.md +0 -321
  34. package/.claude/agents/NEWS-README.md +0 -353
  35. package/.claude/hooks/README-knowledge-hooks.md +0 -451
  36. package/.claude/hooks/README-root-cleanup.md +0 -200
  37. package/.claude/hooks/README.md +0 -284
  38. package/.claude/hooks/__pycache__/done.cpython-313.pyc +0 -0
  39. package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
  40. package/.claude/hooks/check-filenames.py +0 -177
  41. package/.claude/hooks/clean-post.py +0 -468
  42. package/.claude/hooks/clean-pre.py +0 -393
  43. package/.claude/hooks/clean-root-markdown.sh +0 -73
  44. package/.claude/hooks/done.py +0 -236
  45. package/.claude/hooks/format-hook.sh +0 -163
  46. package/.claude/hooks/hook-logger.sh +0 -173
  47. package/.claude/hooks/knowledge-post.py +0 -355
  48. package/.claude/hooks/knowledge-pre.py +0 -245
  49. package/.claude/hooks/notification-hook.sh +0 -279
  50. package/.claude/hooks/root-cleanup.py +0 -217
  51. package/.claude/hooks/security-hook.sh +0 -397
  52. package/.claude/hooks/tag-all-docs.py +0 -464
  53. package/.claude/hooks/test-validate-ontology.sh +0 -170
  54. package/.claude/hooks/todo.py +0 -368
  55. package/.claude/hooks/track-changes.sh +0 -101
  56. package/.claude/hooks/validate-ontology-structure-summary.md +0 -243
  57. package/.claude/hooks/validate-ontology-structure.py +0 -518
  58. package/TESTING-ONBOARDING.md +0 -185
@@ -447,6 +447,44 @@ git push origin main
447
447
  - **Is it documented?** → Update infrastructure docs
448
448
  - **Is it automated?** → Prefer IaC over manual changes
449
449
 
450
+ ## Git Workflow: Pull Before Push (Critical)
451
+
452
+ ### ⚠️ RULE: Always Pull Before Push
453
+
454
+ **This prevents branch divergence permanently.**
455
+
456
+ ```bash
457
+ # CORRECT sequence:
458
+ git add -A
459
+ git commit -m "Your message"
460
+ git pull origin main # ← ALWAYS pull first
461
+ git push origin main # ← Then push
462
+
463
+ # Set git config to enforce this:
464
+ git config pull.ff only # Forces fast-forward only
465
+ ```
466
+
467
+ **Why this matters:**
468
+ - Remote may have commits you don't have locally
469
+ - Pushing without pulling causes divergence
470
+ - Divergence requires manual conflict resolution
471
+ - Prevention is 100x easier than recovery
472
+
473
+ **Branch divergence symptoms:**
474
+ ```
475
+ error: failed to push some refs
476
+ hint: Updates were rejected because the tip of your current branch is behind
477
+ ```
478
+
479
+ **If divergence occurs:**
480
+ ```bash
481
+ git pull origin main # Merge remote changes
482
+ # Resolve conflicts if needed
483
+ git push origin main # Try again
484
+ ```
485
+
486
+ ---
487
+
450
488
  ## Key Behaviors
451
489
 
452
490
  ### 1. Release Pipeline Execution
@@ -459,10 +497,13 @@ git push origin main
459
497
  # 2. Check git status
460
498
  git status --short
461
499
 
462
- # 3. Verify tests pass
500
+ # 3. Pull latest (prevents divergence)
501
+ git pull origin main
502
+
503
+ # 4. Verify tests pass
463
504
  bun test
464
505
 
465
- # 4. Check build succeeds
506
+ # 5. Check build succeeds
466
507
  cd web && bun run build
467
508
  ```
468
509
 
@@ -671,6 +712,26 @@ git push --force origin main
671
712
  - Implements rollback strategies
672
713
  - Documents incident resolutions
673
714
 
715
+ ### Preventing Branch Divergence in Multi-Agent Scenarios
716
+
717
+ **Rule:** Only ONE agent should push at a time. No simultaneous push operations.
718
+
719
+ **If multiple agents are configured to auto-push:**
720
+ 1. Disable auto-push in hooks: Comment out lines in `.git/hooks/post-commit`
721
+ 2. Use manual, coordinated push operations
722
+ 3. Always: pull → push (strictly enforced)
723
+
724
+ **Configuration:**
725
+ ```bash
726
+ # Check if auto-push is enabled
727
+ cat .git/hooks/post-commit | grep -i push
728
+
729
+ # If found, comment it out:
730
+ # ./scripts/push.sh
731
+ ```
732
+
733
+ **Result:** No more divergence, even with multiple agents.
734
+
674
735
  ## Ontology Operations
675
736
 
676
737
  ### 1. Deployment Report (Thing)
@@ -0,0 +1,95 @@
1
+ ---
2
+ allowed-tools: Bash
3
+ description: Fast commit and push
4
+ ---
5
+
6
+ # /commit - Fast Commit + Push
7
+
8
+ ⚡ **Streamlined commit and push in one command**
9
+
10
+ ## Usage
11
+
12
+ ```bash
13
+ /commit "your commit message"
14
+ ```
15
+
16
+ ## Examples
17
+
18
+ ```bash
19
+ # Quick feature update
20
+ /commit "add new endpoint"
21
+
22
+ # Documentation fix
23
+ /commit "update readme"
24
+
25
+ # Cleanup
26
+ /commit "refactor code structure"
27
+
28
+ # Default (if no message provided)
29
+ /commit
30
+ # Uses: "chore: quick update"
31
+ ```
32
+
33
+ ## What It Does
34
+
35
+ The `/commit` command runs `./.claude/hooks/commit-push.sh` which:
36
+
37
+ 1. **Checks for changes** – Verifies there are files to commit
38
+ 2. **Stages everything** – Runs `git add -A`
39
+ 3. **Creates commit** – Writes commit message with Claude attribution
40
+ 4. **Pushes to origin** – Immediately syncs to `origin/main`
41
+ 5. **Reports summary** – Shows commit hash, file count, and status
42
+
43
+ ## Output Example
44
+
45
+ ```
46
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
47
+ Fast Commit + Push
48
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
49
+
50
+ Step 1: Check for changes
51
+ ✓ Found 3 file(s) to commit
52
+
53
+ Step 2: Stage all changes
54
+ ✓ Changes staged
55
+
56
+ Step 3: Create commit
57
+ ✓ Committed: a1b2c3d
58
+
59
+ Step 4: Push to origin
60
+ ✓ Pushed to origin/main
61
+
62
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
63
+ ✅ Commit + Push Complete!
64
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
+
66
+ Summary:
67
+ 📝 Commit: a1b2c3d
68
+ 📦 Files: 3
69
+ ✅ Status: Synced to origin/main
70
+ ```
71
+
72
+ ## When to Use
73
+
74
+ - **Quick fixes** – Single command instead of 3+ git commands
75
+ - **Iterative work** – Commit frequently while developing
76
+ - **Rapid prototyping** – Get changes live fast
77
+ - **Documentation updates** – Quick knowledge base syncs
78
+
79
+ ## Speed Benefits
80
+
81
+ Traditional git workflow:
82
+ ```bash
83
+ git add -A # Stage
84
+ git commit -m "message" # Commit
85
+ git push origin main # Push
86
+ ```
87
+
88
+ With `/commit`:
89
+ ```bash
90
+ /commit "message" # All 3 steps at once
91
+ ```
92
+
93
+ ---
94
+
95
+ **Fast, simple, and always synced to origin! 🚀**
@@ -2,7 +2,7 @@
2
2
 
3
3
  ⚡ **Automated ONE CLI Release & Publishing**
4
4
 
5
- _Execute the `./scripts/release-cli.sh` script to sync documentation, manage versioning, and publish to npm._
5
+ _Execute the `./.claude/hooks/release-cli.sh` script to sync documentation, manage versioning, and publish to npm._
6
6
 
7
7
  ## Quick Start
8
8
 
@@ -22,7 +22,7 @@ _Execute the `./scripts/release-cli.sh` script to sync documentation, manage ver
22
22
 
23
23
  ## What It Does
24
24
 
25
- The `/npx` command runs `./scripts/release-cli.sh` with the following workflow:
25
+ The `/npx` command runs `./.claude/hooks/release-cli.sh` with the following workflow:
26
26
 
27
27
  ```
28
28
  ┌─────────────────────────────────────────────────────────────────┐
@@ -17,6 +17,7 @@ lsof -ti:4321 2>/dev/null
17
17
  ```
18
18
 
19
19
  **Parse output:**
20
+
20
21
  - If output exists: Server is running on port 4321
21
22
  - If empty: Server is not running
22
23
 
@@ -29,6 +30,7 @@ find . -maxdepth 3 -name ".onboarding.json" -type f 2>/dev/null | head -1
29
30
  ```
30
31
 
31
32
  If found, read to extract:
33
+
32
34
  - `user.name`
33
35
  - `organization.name`
34
36
  - `website.url`
@@ -64,7 +66,7 @@ Dev Server: http://localhost:4321 [✓ Running / ⭕ Stopped]
64
66
  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
65
67
 
66
68
  /onboard - Get on board and configure your environment
67
- /plan [idea] - Plan your next moves (100-inference sequence)
69
+ /plan [idea] - Plan your next moves - create 100 cycle sequences automatically
68
70
  /create - Create your web app from scratch
69
71
  /deploy - Deploy from your computer to the edge
70
72
  /push - Push to GitHub
@@ -108,6 +110,7 @@ Dev Server: http://localhost:4321 [✓ Running / ⭕ Stopped]
108
110
  ## Implementation Notes
109
111
 
110
112
  **DO NOT:**
113
+
111
114
  - Start server automatically
112
115
  - Launch agent-onboard automatically
113
116
  - Block waiting for processes
@@ -115,6 +118,7 @@ Dev Server: http://localhost:4321 [✓ Running / ⭕ Stopped]
115
118
  - Execute `/plan convert` without user input
116
119
 
117
120
  **DO:**
121
+
118
122
  - Show current status (server running/stopped)
119
123
  - Display the welcome screen
120
124
  - Guide users to their next action (e.g., `/server start` or `/plan convert [idea]`)
@@ -123,6 +127,7 @@ Dev Server: http://localhost:4321 [✓ Running / ⭕ Stopped]
123
127
  - Highlight 15-specialist availability
124
128
 
125
129
  **Execution Flow:**
130
+
126
131
  1. Check server status (running/stopped)
127
132
  2. Read onboarding data if exists
128
133
  3. Display welcome screen (with or without onboarding data)
@@ -130,6 +135,7 @@ Dev Server: http://localhost:4321 [✓ Running / ⭕ Stopped]
130
135
  5. Wait for user input (DO NOT auto-execute anything)
131
136
 
132
137
  **Key Integration Points:**
138
+
133
139
  - `/plan convert` merges CASCADE planning into plan command
134
140
  - Agent assignments are automatic based on inference type
135
141
  - Dependencies are calculated and shown
@@ -2,9 +2,31 @@
2
2
 
3
3
  **Purpose:** Push changes to all ONE Platform repositories using the unified push script.
4
4
 
5
+ ## ⚠️ CRITICAL RULE: Always Pull Before Push
6
+
7
+ **Every push MUST be preceded by a pull.** This prevents branch divergence.
8
+
9
+ ```bash
10
+ # CORRECT workflow:
11
+ git add -A
12
+ git commit -m "Your message"
13
+ git pull origin main # ← ALWAYS pull first
14
+ git push origin main # ← Then push
15
+ ```
16
+
17
+ **Branch divergence happens when:**
18
+ - Remote has commits you don't have locally
19
+ - You try to push without pulling first
20
+ - Multiple processes push simultaneously without coordination
21
+
22
+ **Prevention:**
23
+ - Always run `git pull origin main` before `git push origin main`
24
+ - Configure git: `git config pull.ff only` (forces fast-forward only)
25
+ - This makes it impossible to accidentally diverge
26
+
5
27
  ## How It Works
6
28
 
7
- This command uses `./scripts/push.sh` to intelligently push to:
29
+ This command uses `./.claude/hooks/push.sh` to intelligently push to:
8
30
  - Main repository: `github.com/one-ie/one`
9
31
  - `/one` subtree: `github.com/one-ie/ontology`
10
32
  - `/web` subtree: `github.com/one-ie/web`
@@ -13,7 +35,7 @@ This command uses `./scripts/push.sh` to intelligently push to:
13
35
  ## Usage
14
36
 
15
37
  ```bash
16
- # Push to all remotes
38
+ # Push to all remotes (after pulling!)
17
39
  /push all
18
40
 
19
41
  # Push to specific remote
@@ -23,12 +45,34 @@ This command uses `./scripts/push.sh` to intelligently push to:
23
45
  /push oneie # one.ie directory only
24
46
  ```
25
47
 
48
+ ## Workflow: Safe Push (No Divergence)
49
+
50
+ **Always follow this sequence:**
51
+
52
+ ```bash
53
+ # 1. Make changes
54
+ git add -A
55
+ git commit -m "Your message"
56
+
57
+ # 2. Pull latest from remote (CRITICAL)
58
+ git pull origin main
59
+
60
+ # 3. Now push safely
61
+ /push main
62
+
63
+ # Or push to all:
64
+ /push all
65
+ ```
66
+
67
+ **Result:** Zero divergence, always in sync with remote.
68
+
26
69
  ## What the Script Does
27
70
 
28
- 1. **Analyzes changes** across all repositories
29
- 2. **Commits with generated messages** based on file changes
30
- 3. **Pushes to each remote** with appropriate branch handling
31
- 4. **Reports summary** of all pushed repositories
71
+ 1. **Pulls latest changes** from remote first (prevent divergence)
72
+ 2. **Analyzes changes** across all repositories
73
+ 3. **Commits with generated messages** based on file changes
74
+ 4. **Pushes to each remote** with appropriate branch handling
75
+ 5. **Reports summary** of all pushed repositories
32
76
 
33
77
  ## Your Task
34
78
 
@@ -36,7 +80,7 @@ When the user runs `/push [option]`, you MUST:
36
80
 
37
81
  1. **Run the push script** with the appropriate argument:
38
82
  ```bash
39
- ./scripts/push.sh [all|main|one|web|oneie]
83
+ ./.claude/hooks/push.sh [all|main|one|web|oneie]
40
84
  ```
41
85
 
42
86
  2. **Handle errors gracefully**:
@@ -60,21 +104,21 @@ When the user runs `/push [option]`, you MUST:
60
104
  **Push all remotes:**
61
105
  ```
62
106
  User: /push all
63
- → Runs: ./scripts/push.sh all
107
+ → Runs: ./.claude/hooks/push.sh all
64
108
  → Pushes to all 4 remotes
65
109
  ```
66
110
 
67
111
  **Push specific remote:**
68
112
  ```
69
113
  User: /push oneie
70
- → Runs: ./scripts/push.sh oneie
114
+ → Runs: ./.claude/hooks/push.sh oneie
71
115
  → Pushes to one-ie/one.ie only
72
116
  ```
73
117
 
74
118
  **Push main repo:**
75
119
  ```
76
120
  User: /push main
77
- → Runs: ./scripts/push.sh main
121
+ → Runs: ./.claude/hooks/push.sh main
78
122
  → Pushes to one-ie/one only
79
123
  ```
80
124
 
@@ -85,20 +129,68 @@ User: /push main
85
129
  - Each push operation is isolated - failures in one don't block others
86
130
  - Run from the project root directory
87
131
 
88
- ## Error Handling
132
+ ## Common Issues & Solutions
133
+
134
+ ### Issue: "Rejected - non-fast-forward"
135
+
136
+ **Cause:** Remote is ahead of your local branch (you didn't pull first).
137
+
138
+ **Fix:**
139
+ ```bash
140
+ # Pull the latest changes
141
+ git pull origin main
142
+
143
+ # Now push safely
144
+ /push main
145
+ ```
146
+
147
+ ### Issue: "Branches have diverged"
148
+
149
+ **Cause:** Remote and local have different commits (push without pull happened).
89
150
 
90
- If push fails:
151
+ **Fix:**
152
+ ```bash
153
+ # Pull and merge (or rebase)
154
+ git pull origin main
155
+
156
+ # Resolve any conflicts if they occur
157
+ # Then push
158
+ /push main
91
159
  ```
92
- ❌ Push failed for [remote]
93
- Reason: [git error message]
94
-
95
- Suggested action:
96
- - Check git status: git status
97
- - Pull latest: git pull [remote] main
98
- - Resolve conflicts if any
99
- - Retry push
160
+
161
+ **Prevention:** Always pull before push.
162
+
163
+ ### Issue: Multiple Processes Pushing Simultaneously
164
+
165
+ **Cause:** Background hooks, slash commands, and manual operations running at once.
166
+
167
+ **Fix:**
168
+ 1. **Wait for all background operations to complete**
169
+ 2. **Run one operation at a time**
170
+ 3. **Follow the pull-before-push rule strictly**
171
+
172
+ **Prevention:**
173
+ - Disable auto-push hooks: Comment out lines in `.git/hooks/post-commit`
174
+ - Use one unified push command, not multiple parallel operations
175
+ - Always: pull → push sequence
176
+
177
+ ---
178
+
179
+ ## Setup: Prevent Divergence Permanently
180
+
181
+ **Configure git to reject pushes without pull:**
182
+
183
+ ```bash
184
+ # This forces fast-forward only (prevents divergence)
185
+ git config pull.ff only
186
+
187
+ # Verify it worked
188
+ git config --get pull.ff
189
+ # Should output: only
100
190
  ```
101
191
 
192
+ **Result:** If you try to push without pulling, git will refuse.
193
+
102
194
  ---
103
195
 
104
- **Simple, unified push to all repositories! 🚀**
196
+ **Safe, reliable push to all repositories! 🚀**
@@ -18,7 +18,7 @@ Release the CLI to npm registry.
18
18
 
19
19
  ## What It Does
20
20
 
21
- Runs `/Users/toc/Server/ONE/scripts/release-cli.sh [type]` which:
21
+ Runs `./.claude/hooks/release-cli.sh [type]` which:
22
22
 
23
23
  1. Syncs `.claude/*` to `cli/.claude/`
24
24
  2. Syncs `/one/*` to `cli/one/`
@@ -35,7 +35,7 @@ Delegate to agent-ops to run the script:
35
35
  Task({
36
36
  subagent_type: "agent-ops",
37
37
  description: "Release CLI to npm",
38
- prompt: `Run: /Users/toc/Server/ONE/scripts/release-cli.sh ${releaseType}
38
+ prompt: `Run: ./.claude/hooks/release-cli.sh ${releaseType}
39
39
 
40
40
  Wait for completion and report success with the new version.`,
41
41
  });
@@ -0,0 +1,195 @@
1
+ #!/bin/bash
2
+
3
+ # ============================================================
4
+ # ONE CLI Release Script (OPTIMIZED v2)
5
+ # ============================================================
6
+ # Syncs /one to cli/one/, publishes to npm
7
+ # Optimized for parallel execution and performance
8
+ # Hooks stay in root repository (single source of truth)
9
+ #
10
+ # Usage: ./scripts/release-cli.sh [patch|minor|major|sync]
11
+ #
12
+ # Examples:
13
+ # ./scripts/release-cli.sh patch # Bug fix release
14
+ # ./scripts/release-cli.sh minor # New feature release
15
+ # ./scripts/release-cli.sh major # Breaking change release
16
+ # ./scripts/release-cli.sh sync # Sync files without version bump
17
+ # ============================================================
18
+
19
+ set -e
20
+
21
+ # Colors
22
+ GREEN='\033[0;32m'
23
+ BLUE='\033[0;34m'
24
+ YELLOW='\033[1;33m'
25
+ RED='\033[0;31m'
26
+ NC='\033[0m'
27
+
28
+ # Version bump (default: sync)
29
+ VERSION_BUMP="${1:-sync}"
30
+
31
+ # Validate input
32
+ if [[ ! "$VERSION_BUMP" =~ ^(patch|minor|major|sync)$ ]]; then
33
+ echo -e "${RED}Error: Invalid version bump. Use: patch, minor, major, or sync${NC}"
34
+ exit 1
35
+ fi
36
+
37
+ echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
38
+ echo -e "${BLUE} ONE CLI Release (${VERSION_BUMP}) v2${NC}"
39
+ echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
40
+ echo ""
41
+
42
+ # Get script directory and navigate to root
43
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
44
+ ROOT_DIR="$(dirname "$(dirname "$SCRIPT_DIR")")" # Up two levels: hooks -> .claude -> root
45
+ cd "$ROOT_DIR" || exit 1
46
+
47
+ # Track timing
48
+ RELEASE_START=$(date +%s)
49
+
50
+ # Step 1: Verify CLI directory exists
51
+ echo -e "${BLUE}Step 1: Verify CLI directory${NC}"
52
+ if [ ! -d "cli" ]; then
53
+ echo -e "${RED}✗ cli/ directory not found${NC}"
54
+ exit 1
55
+ fi
56
+ echo -e "${GREEN}✓ cli/ directory exists${NC}"
57
+ echo ""
58
+
59
+ # Step 2: Sync /one to cli/one/ (documentation)
60
+ echo -e "${BLUE}Step 2: Sync /one/ to cli/one/${NC}"
61
+ if [ -d "one" ]; then
62
+ mkdir -p cli/one
63
+ rsync -av --delete --quiet one/ cli/one/ 2>&1 | tail -1 || true
64
+ echo -e "${GREEN}✓ /one/ synced to cli/one/${NC}"
65
+ else
66
+ echo -e "${YELLOW}⚠ /one/ directory not found, skipping${NC}"
67
+ fi
68
+ echo ""
69
+
70
+ # Step 3: Sync root markdown files to cli/
71
+ echo -e "${BLUE}Step 3: Sync root markdown files (parallel)${NC}"
72
+ for file in CLAUDE.md README.md LICENSE.md SECURITY.md AGENTS.md; do
73
+ if [ -f "$file" ]; then
74
+ cp "$file" "cli/$file" &
75
+ fi
76
+ done
77
+ wait # Wait for all copies to complete
78
+ echo -e "${GREEN}✓ All markdown files synced${NC}"
79
+ echo ""
80
+
81
+ # Step 4: Hooks reference (important note)
82
+ echo -e "${BLUE}Step 4: Hooks configuration${NC}"
83
+ echo -e "${GREEN}✓ Hooks reference root .claude/ (no duplication)${NC}"
84
+ echo -e "${YELLOW} CLI uses root hooks via relative paths or environment setup${NC}"
85
+ echo ""
86
+
87
+ # Step 5: Version bump (if not sync)
88
+ if [[ "$VERSION_BUMP" != "sync" ]]; then
89
+ echo -e "${BLUE}Step 5: Version bump (${VERSION_BUMP})${NC}"
90
+ cd cli
91
+ OLD_VERSION=$(node -p "require('./package.json').version")
92
+ npm version "$VERSION_BUMP" --no-git-tag-version > /dev/null 2>&1
93
+ NEW_VERSION=$(node -p "require('./package.json').version")
94
+ echo -e "${GREEN}✓ Version bumped: ${OLD_VERSION} → ${NEW_VERSION}${NC}"
95
+ cd ..
96
+ echo ""
97
+ else
98
+ echo -e "${YELLOW}⚠ Skipping version bump${NC}"
99
+ echo ""
100
+ fi
101
+
102
+ # Step 6: Commit changes to cli/
103
+ echo -e "${BLUE}Step 6: Commit cli/ changes${NC}"
104
+ cd cli
105
+ if [[ -n $(git status -s) ]]; then
106
+ git add . > /dev/null 2>&1
107
+ git commit -m "chore: sync /one documentation and markdown files
108
+
109
+ Synced from root repository:
110
+ - /one/* → CLI documentation
111
+ - CLAUDE.md, README.md, LICENSE.md, SECURITY.md, AGENTS.md
112
+
113
+ Note: Hooks remain in root .claude/ directory (single source of truth)
114
+
115
+ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
116
+
117
+ Co-Authored-By: Claude <noreply@anthropic.com>" > /dev/null 2>&1
118
+ echo -e "${GREEN}✓ Changes committed${NC}"
119
+ else
120
+ echo -e "${YELLOW}⚠ No changes to commit${NC}"
121
+ fi
122
+ cd ..
123
+ echo ""
124
+
125
+ # Step 7: Build CLI
126
+ echo -e "${BLUE}Step 7: Build CLI${NC}"
127
+ cd cli
128
+ if npm run build > /dev/null 2>&1; then
129
+ echo -e "${GREEN}✓ Build successful${NC}"
130
+ else
131
+ echo -e "${RED}✗ Build failed${NC}"
132
+ exit 1
133
+ fi
134
+ cd ..
135
+ echo ""
136
+
137
+ # Step 8: Verify npm credentials (skip if sync-only)
138
+ if [[ "$VERSION_BUMP" != "sync" ]]; then
139
+ echo -e "${BLUE}Step 8: Verify npm credentials${NC}"
140
+ if npm whoami > /dev/null 2>&1; then
141
+ NPM_USER=$(npm whoami)
142
+ echo -e "${GREEN}✓ Logged in as: ${NPM_USER}${NC}"
143
+ else
144
+ echo -e "${RED}✗ Not logged in to npm. Run: npm login${NC}"
145
+ exit 1
146
+ fi
147
+ echo ""
148
+
149
+ # Step 9: Publish to npm
150
+ echo -e "${BLUE}Step 9: Publish to npm${NC}"
151
+ cd cli
152
+ if npm publish --access public > /dev/null 2>&1; then
153
+ PUBLISHED_VERSION=$(node -p "require('./package.json').version")
154
+ echo -e "${GREEN}✓ Published to npm: oneie@${PUBLISHED_VERSION}${NC}"
155
+
156
+ # Verify publication (non-blocking)
157
+ sleep 1
158
+ if npm view "oneie@${PUBLISHED_VERSION}" > /dev/null 2>&1; then
159
+ echo -e "${GREEN}✓ Package verified on npm${NC}"
160
+ else
161
+ echo -e "${YELLOW}⚠ Package not immediately visible on npm (may take a few seconds)${NC}"
162
+ fi
163
+ else
164
+ echo -e "${RED}✗ npm publish failed${NC}"
165
+ exit 1
166
+ fi
167
+ cd ..
168
+ echo ""
169
+ fi
170
+
171
+ # Calculate elapsed time
172
+ RELEASE_END=$(date +%s)
173
+ ELAPSED=$((RELEASE_END - RELEASE_START))
174
+
175
+ # Step 10: Summary
176
+ echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
177
+ echo -e "${GREEN}✅ CLI Release Complete! (${ELAPSED}s)${NC}"
178
+ echo -e "${GREEN}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
179
+ echo ""
180
+
181
+ if [[ "$VERSION_BUMP" != "sync" ]]; then
182
+ CURRENT_VERSION=$(node -p "require('./cli/package.json').version")
183
+ echo -e "${GREEN}📦 npm: oneie@${CURRENT_VERSION}${NC}"
184
+ echo -e "${GREEN}🔗 GitHub: https://github.com/one-ie/cli${NC}"
185
+ echo ""
186
+ echo -e "${BLUE}Test your release:${NC}"
187
+ echo " npx oneie@latest --version"
188
+ echo ""
189
+ fi
190
+
191
+ echo -e "${BLUE}Synced:${NC}"
192
+ echo " ✓ /one/* → cli/one/ (documentation)"
193
+ echo " ✓ CLAUDE.md, README.md, LICENSE.md, SECURITY.md, AGENTS.md"
194
+ echo " ✓ Hooks reference root .claude/ (no duplication)"
195
+ echo ""