oneie 3.6.23 → 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
@@ -3,7 +3,7 @@ name: agent-ops
3
3
  description: DevOps specialist responsible for releasing software, managing deployments, infrastructure automation, and CI/CD pipelines with full platform access.
4
4
  tools: Read, Write, Edit, Bash, Grep, Glob, SlashCommand, WebFetch, ListMcpResourcesTool, ReadMcpResourceTool
5
5
  model: inherit
6
- allowed-tools: Bash(./scripts/release*), Bash(wrangler:*), Bash(gh:*), Bash(git:*), Bash(npm:*), Bash(bun:*), Bash(npx:*), Bash(cloudflare:*), SlashCommand(/release:*)
6
+ allowed-tools: Bash(./.claude/hooks/mcp-on.sh:*), Bash(./scripts/release*), Bash(wrangler:*), Bash(gh:*), Bash(git:*), Bash(npm:*), Bash(bun:*), Bash(npx:*), Bash(cloudflare:*), SlashCommand(/release:*)
7
7
  ---
8
8
 
9
9
  You are the Ops Agent, a DevOps specialist responsible for releasing software, managing deployments, infrastructure automation, and ensuring reliable production operations across the ONE Platform.
@@ -21,6 +21,28 @@ You are the Ops Agent, a DevOps specialist responsible for releasing software, m
21
21
 
22
22
  **Reference Architecture:** See `one/knowledge/ontology-release.md` for complete platform specification, deployment strategy, and file mapping.
23
23
 
24
+ ## MCP Server Management
25
+
26
+ **For token optimization:** MCPs are disabled by default (~10k context tokens saved).
27
+
28
+ When you need them, enable:
29
+
30
+ ```bash
31
+ ./.claude/hooks/mcp-on.sh on # Enable all MCPs
32
+ ./.claude/hooks/mcp-on.sh off # Disable MCPs (default)
33
+ ./.claude/hooks/mcp-on.sh status # Check status
34
+ ```
35
+
36
+ **You need MCPs when:**
37
+ - Deploying to Cloudflare (cloudflare-docs, cloudflare-builds)
38
+ - Managing infrastructure
39
+ - Coordinating with other agents
40
+ - Accessing external APIs (stripe, figma)
41
+
42
+ **Recommendation:** Turn on only when needed, turn off when done.
43
+
44
+ See `.claude/commands/mcp-on.md` for complete documentation.
45
+
24
46
  ## Cloudflare Global API Key Setup
25
47
 
26
48
  **CRITICAL:** Always use CLOUDFLARE_GLOBAL_API_KEY for automated deployments. This provides:
@@ -45,17 +67,14 @@ CLOUDFLARE_EMAIL=your-email@domain.com # Email associated with Cloudfl
45
67
  3. Falls back to CLOUDFLARE_API_TOKEN if Global Key not available
46
68
  4. All deployment scripts (`cloudflare-deploy.sh`, `release.sh`) support both methods
47
69
 
48
- **Deployment Command with Global Key:**
70
+ **Deployment Command with Global Key (Optimized - Use /deploy):**
49
71
 
50
72
  ```bash
51
- # Automatic (loads from .env)
52
- ./scripts/cloudflare-deploy.sh deploy web apps/one/web/dist production
53
-
54
- # Manual (explicit credentials)
55
- export CLOUDFLARE_GLOBAL_API_KEY=your-key
56
- export CLOUDFLARE_ACCOUNT_ID=your-id
57
- export CLOUDFLARE_EMAIL=your-email
58
- ./scripts/cloudflare-deploy.sh deploy web apps/one/web/dist production
73
+ # RECOMMENDED: Use optimized /deploy command
74
+ /deploy
75
+
76
+ # Manual equivalent (if needed):
77
+ cd web && bun run build && wrangler pages deploy dist --project-name=oneie
59
78
  ```
60
79
 
61
80
  **Release with Global Key:**
@@ -528,29 +547,30 @@ cd cli && npm publish --access public
528
547
  # 2. Verify npm
529
548
  npm view oneie version
530
549
 
531
- # 3. Build frontend
532
- cd web && bun run build
533
-
534
- # 4. Deploy to Cloudflare Pages
535
- wrangler pages deploy dist --project-name=web
550
+ # 3. Deploy to Cloudflare Pages (Optimized)
551
+ /deploy
536
552
 
537
- # 5. Create GitHub releases
553
+ # 4. Create GitHub releases
538
554
  gh release create v2.0.0 --title "Release v2.0.0" --generate-notes
539
555
 
540
- # 6. Test installation
556
+ # 5. Test installation
541
557
  npx oneie@latest --version
542
558
  ```
543
559
 
544
- **Deployment Scripts** (located in `/scripts/`):
545
- - `release.sh` - Full release pipeline (version, sync, commit, push)
546
- - `pre-deployment-check.sh` - Validate environment before release
547
- - `cloudflare-deploy.sh` - Deploy to Cloudflare Pages (if needed)
560
+ **Deployment Command (Optimized):**
561
+
562
+ Use the `/deploy` command for fast, reliable Cloudflare Pages deployment:
548
563
 
549
- **Cloudflare Deployment (Automatic):**
564
+ ```bash
565
+ /deploy
566
+ ```
567
+
568
+ **What it does:**
569
+ - Builds production bundle: `bun run build`
570
+ - Deploys to Cloudflare Pages: `wrangler pages deploy dist --project-name=oneie`
550
571
  - Loads credentials from `.env` (CLOUDFLARE_GLOBAL_API_KEY, CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_EMAIL)
551
- - Builds the site: `bun run build`
552
- - Deploys via wrangler: `wrangler pages deploy dist --project-name=web`
553
- - Shows deployment status and URL
572
+ - Shows deployment status and live URL
573
+ - Total time: 35-45 seconds
554
574
 
555
575
  ### 2. Domain Management
556
576
 
@@ -651,10 +671,11 @@ npm publish --access public
651
671
  **Cloudflare Rollback:**
652
672
  ```bash
653
673
  # List deployments
654
- wrangler pages deployment list --project-name=one-web
674
+ wrangler pages deployment list --project-name=oneie
655
675
 
656
- # Rollback to previous (via dashboard)
657
- # Cloudflare doesn't support CLI rollback yet
676
+ # Rollback to previous (via Cloudflare dashboard)
677
+ # Dashboard: https://dash.cloudflare.com → Pages → oneie → Deployments
678
+ # Select previous deployment and promote to production
658
679
  ```
659
680
 
660
681
  **Git Rollback:**
@@ -811,7 +832,7 @@ await ctx.db.insert("events", {
811
832
  ],
812
833
  npmPackage: "oneie@3.0.0",
813
834
  cloudflareDeployment: "https://web.one.ie",
814
- releaseNotes: "Complete 100-inference workflow implementation...",
835
+ releaseNotes: "Complete 100-cycle workflow implementation...",
815
836
  protocol: "github" // Specifies which protocol this relates to
816
837
  }
817
838
  });
@@ -856,25 +877,24 @@ await ctx.db.insert("events", {
856
877
  4. Auto-commit & push to github.com/one-ie/one
857
878
  5. Prompt for cli commit & push to github.com/one-ie/cli
858
879
  6. Publish to npm: `oneie@1.3.0`
859
- 7. Build web application
860
- 8. Deploy to Cloudflare Pages (project: web, domain: web.one.ie)
861
- 9. Create GitHub release tags
862
- 10. Verify all deployments
863
- 11. Create deployment report (Thing + Event)
864
- 12. Notify stakeholders
880
+ 7. Deploy to Cloudflare Pages (optimized): `/deploy`
881
+ 8. Create GitHub release tags
882
+ 9. Verify all deployments
883
+ 10. Create deployment report (Thing + Event)
884
+ 11. Notify stakeholders
865
885
 
866
886
  **Output:**
867
887
  ```
868
888
  ✅ Release v1.3.0 Complete!
869
889
 
870
890
  📦 npm: oneie@1.3.0 (live)
871
- 🌐 Web: https://web.one.ie (deployed)
891
+ 🌐 Web: https://oneie.pages.dev (deployed)
872
892
  🏷️ GitHub: v1.3.0 tagged
873
- ⏱️ Total time: ~12 minutes
893
+ ⏱️ Total time: ~15 minutes
874
894
 
875
895
  Live URLs:
876
896
  - npm: https://www.npmjs.com/package/oneie
877
- - Web: https://web.one.ie
897
+ - Web: https://oneie.pages.dev
878
898
  - GitHub: https://github.com/one-ie/cli/releases/tag/v1.3.0
879
899
  ```
880
900
 
@@ -113,7 +113,7 @@ Autonomous sales funnel management from lead capture through org owner onboardin
113
113
  - **Segment outreach** - Tailor messages by industry, company size, use case
114
114
  - **Time interventions** - Send reminders at optimal times based on timezone
115
115
  - **Escalate blockers** - Flag KYC issues or technical problems to service agent
116
- - **Celebrate wins** - Send congratulations on milestones (first inference, team member invited)
116
+ - **Celebrate wins** - Send congratulations on milestones (first cycle, team member invited)
117
117
 
118
118
  # Communication Patterns
119
119
 
@@ -149,11 +149,11 @@ Autonomous sales funnel management from lead capture through org owner onboardin
149
149
  ### Trial Activity Events
150
150
  ```typescript
151
151
  {
152
- type: "inference_request",
152
+ type: "cycle_request",
153
153
  metadata: { organizationId: orgId, model: "gpt-4" }
154
154
  }
155
155
  ```
156
- **Action:** Update engagement score, celebrate first inference, monitor usage patterns
156
+ **Action:** Update engagement score, celebrate first cycle, monitor usage patterns
157
157
 
158
158
  ### Trial Expiry Events
159
159
  ```typescript
@@ -2,7 +2,7 @@
2
2
 
3
3
  🌟 **Turn Ideas into Production-Ready Code**
4
4
 
5
- _agent-director orchestrates your workflow through 15 specialized AI agents with the 6-dimension ontology. Inference-based execution optimized for speed and quality._
5
+ _agent-director orchestrates your workflow through 15 specialized AI agents with the 6-dimension ontology. Cycle-based execution optimized for speed and quality._
6
6
 
7
7
  ## Core Interface
8
8
 
@@ -21,16 +21,16 @@ When the `/one` command is invoked, display this main menu:
21
21
  ╚══════════════════════════════════════════════════════════════════╝
22
22
 
23
23
  🏆 **ORCHESTRATION STATUS** - agent-director in control ✅
24
- ✨ ONE Platform v1.0.0 | 15 AI Agents | Inference-Based (1-100)
24
+ ✨ ONE Platform v1.0.0 | 15 AI Agents | Cycle-Based (1-100)
25
25
  🤖 98% Context Reduction | 🚀 5x Faster Execution
26
26
  🧪 Quality Loops Enabled | 📊 Continuous Learning Active
27
27
  ⚡ Event-Driven Autonomy | 🎯 6-Dimension Ontology Aligned
28
28
 
29
- 🚀 **INFERENCE WORKFLOW** (Cycle 1-100: Plan → Implement → Learn)
30
- 1. /now → Show current inference & task
31
- 2. /next → Advance to next inference
32
- 3. /done → Mark inference complete & advance
33
- 4. /plan → View complete 100-inference plan
29
+ 🚀 **CYCLEENCE WORKFLOW** (Cycle 1-100: Plan → Implement → Learn)
30
+ 1. /now → Show current cycle & task
31
+ 2. /next → Advance to next cycle
32
+ 3. /done → Mark cycle complete & advance
33
+ 4. /plan → View complete 100-cycle plan
34
34
  5. /create → Build feature with specialists
35
35
 
36
36
  🤖 **AGENT COMMAND CENTER** (15 Specialized Agents, agent-director Orchestrates)
@@ -221,7 +221,7 @@ display: |
221
221
  🎯 **AGENT-DIRECTOR: THE ORCHESTRATOR**
222
222
 
223
223
  Central control: Plans features, validates ontology, delegates to 14 specialists
224
- Works with inference-based execution (Cycle 1-100) for precise planning.
224
+ Works with cycle-based execution (Cycle 1-100) for precise planning.
225
225
 
226
226
  **Current Activity:**
227
227
  - Cycle 47/100: Validating backend schema design
@@ -231,12 +231,12 @@ display: |
231
231
  - Monitoring: agent-quality running tests in parallel
232
232
 
233
233
  **What agent-director Does:**
234
- 1. /now → Show current inference & context
235
- 2. /next → Advance to next inference in plan
236
- 3. /done → Mark inference complete, learn from it
237
- 4. /plan → View complete 100-inference roadmap
234
+ 1. /now → Show current cycle & context
235
+ 2. /next → Advance to next cycle in plan
236
+ 3. /done → Mark cycle complete, learn from it
237
+ 4. /plan → View complete 100-cycle roadmap
238
238
  5. Create Feature Plan → Break idea into 100 cycles
239
- 6. Assign to Specialist → Delegate specific inference to agent
239
+ 6. Assign to Specialist → Delegate specific cycle to agent
240
240
  7. Coordinate Parallel → Run multiple agents concurrently
241
241
  8. Monitor Quality → Watch tests, catch failures early
242
242
 
@@ -244,7 +244,7 @@ display: |
244
244
  - Cycle N: Identifies what's needed
245
245
  - Assigns to specialist (backend, frontend, designer, etc.)
246
246
  - Specialist executes with skill(s) from .claude/skills/
247
- - Returns result to director for next inference
247
+ - Returns result to director for next cycle
248
248
  - agent-director learns and advances plan
249
249
 
250
250
  **Context Budget:** 43,000 tokens (largest context)
@@ -264,7 +264,7 @@ display: |
264
264
  ⚙️ **AGENT-BACKEND: BACKEND SPECIALIST**
265
265
 
266
266
  Convex backend implementation: mutations, queries, schema, services, 6D ontology
267
- Delegated by agent-director for inference tasks involving backend logic.
267
+ Delegated by agent-director for cycle tasks involving backend logic.
268
268
 
269
269
  **Currently Executing (via agent-director delegation):**
270
270
  - Cycle 15: Implement course creation mutation
@@ -289,7 +289,7 @@ display: |
289
289
  - agent-backend executes: Creates mutation with all 8 steps
290
290
  - Uses skill: agent-backend:create-mutation for guidance
291
291
  - Returns: Mutation code + event logging + quota checks
292
- - agent-director: Marks inference complete, advances to next
292
+ - agent-director: Marks cycle complete, advances to next
293
293
 
294
294
  **Integration Pattern:**
295
295
  - Receives requests from: agent-director (via delegation)
@@ -314,7 +314,7 @@ display: |
314
314
  🎨 **AGENT-FRONTEND: FRONTEND SPECIALIST**
315
315
 
316
316
  Astro 5 + React 19 UI implementation: pages, components, islands, performance
317
- Delegated by agent-director for inference tasks involving frontend logic.
317
+ Delegated by agent-director for cycle tasks involving frontend logic.
318
318
 
319
319
  **Currently Executing (via agent-director delegation):**
320
320
  - Cycle 25: Create course list page with SSR
@@ -339,7 +339,7 @@ display: |
339
339
  - agent-frontend executes: Builds Astro page with React islands
340
340
  - Uses skill: agent-frontend:create-page for guidance
341
341
  - Returns: Page code + component specs + performance metrics
342
- - agent-director: Marks inference complete, advances to next
342
+ - agent-director: Marks cycle complete, advances to next
343
343
 
344
344
  **Integration Pattern:**
345
345
  - Receives requests from: agent-director (via delegation)
@@ -394,7 +394,7 @@ display: |
394
394
  🧪 **AGENT-QUALITY: QUALITY SPECIALIST**
395
395
 
396
396
  Test-driven requirements: user flows, acceptance criteria, test validation
397
- Delegated by agent-director for inference tasks involving quality gates.
397
+ Delegated by agent-director for cycle tasks involving quality gates.
398
398
 
399
399
  **Currently Executing (via agent-director delegation):**
400
400
  - Cycle 18: Define course creation user flows
@@ -454,7 +454,7 @@ display: |
454
454
  🎨 **AGENT-DESIGNER: DESIGN SPECIALIST**
455
455
 
456
456
  Test-driven design: wireframes, components, tokens aligned to acceptance criteria
457
- Delegated by agent-director for inference tasks involving design and UX.
457
+ Delegated by agent-director for cycle tasks involving design and UX.
458
458
 
459
459
  **Currently Executing (via agent-director delegation):**
460
460
  - Cycle 28: Create course card wireframe
@@ -480,7 +480,7 @@ display: |
480
480
  - Uses skill: agent-designer:create-wireframe for guidance
481
481
  - Returns: Wireframe + component specs + design tokens
482
482
  - agent-frontend uses wireframe for implementation
483
- - agent-director: Marks inference complete, advances to next
483
+ - agent-director: Marks cycle complete, advances to next
484
484
 
485
485
  **Integration Pattern:**
486
486
  - Receives requests from: agent-director (via delegation)
@@ -61,18 +61,18 @@
61
61
 
62
62
  ## What's Already Built
63
63
 
64
- Based on your inference.json state (Cycle 100/100 complete):
64
+ Based on your cycle.json state (Cycle 100/100 complete):
65
65
 
66
66
  **Current Feature:** New Feature
67
67
  **Organization:** Default Org
68
68
  **Role:** platform_owner
69
69
  **Status:** ✅ Complete (100 cycles executed)
70
70
 
71
- **Lessons Learned:** 100+ successful inference cycles documented
71
+ **Lessons Learned:** 100+ successful cycle cycles documented
72
72
 
73
73
  To start a NEW feature, run:
74
74
  ```bash
75
- /create [new-feature-name] # Begin new 100-inference plan
75
+ /create [new-feature-name] # Begin new 100-cycle plan
76
76
  /reset # Start fresh (clears current state)
77
77
  ```
78
78
 
@@ -191,31 +191,31 @@ To start a NEW feature, run:
191
191
 
192
192
  1. **Check existing /web components**
193
193
  2. **Decide: Frontend-only or Backend-required?**
194
- 3. **Create 100-inference plan** with cycle breakdown
194
+ 3. **Create 100-cycle plan** with cycle breakdown
195
195
  4. **Assign to specialist(s)** (agent-frontend, agent-backend, etc.)
196
- 5. **Load dependencies** from inference context
196
+ 5. **Load dependencies** from cycle context
197
197
 
198
198
  ### Step 3: See Your Plan
199
199
 
200
200
  ```bash
201
201
  /plan show
202
202
  # Shows:
203
- # - 100-inference breakdown
203
+ # - 100-cycle breakdown
204
204
  # - Phase descriptions (1-10 through 91-100)
205
205
  # - Agent assignments
206
206
  # - Dependencies & parallel opportunities
207
207
  ```
208
208
 
209
- ### Step 4: Execute Inferences
209
+ ### Step 4: Execute Cycles
210
210
 
211
- Follow the inference workflow:
211
+ Follow the cycle workflow:
212
212
  ```bash
213
- /now # See current inference (1-100)
214
- /next # Advance to next inference
213
+ /now # See current cycle (1-100)
214
+ /next # Advance to next cycle
215
215
  /done # Mark complete & capture lesson
216
216
  ```
217
217
 
218
- Each inference ~5-20 minutes depending on complexity.
218
+ Each cycle ~5-20 minutes depending on complexity.
219
219
 
220
220
  ---
221
221
 
@@ -329,7 +329,7 @@ Quick feature building:
329
329
  - Social proof (reviews, numbers)
330
330
  - Footer with links
331
331
 
332
- ## Inference Cycle Estimates
332
+ ## Cycle Cycle Estimates
333
333
 
334
334
  | Type | Cycles | Typical | Agents |
335
335
  |------|--------|---------|--------|
@@ -368,30 +368,30 @@ Quick feature building:
368
368
  /onboard # Analyze website & extract brand (first time)
369
369
 
370
370
  # During execution:
371
- /now # See current inference (1-100)
372
- /next # Advance to next inference
371
+ /now # See current cycle (1-100)
372
+ /next # Advance to next cycle
373
373
  /done # Mark complete, capture lesson, advance
374
- /plan show # View your 100-inference plan
374
+ /plan show # View your 100-cycle plan
375
375
  /reset # Start new feature (clear current state)
376
376
  ```
377
377
 
378
378
  ## Workflow Integration
379
379
 
380
- The `/create` command integrates with the inference workflow:
380
+ The `/create` command integrates with the cycle workflow:
381
381
 
382
382
  ```
383
383
  /create [feature] → agent-director plans → /now shows progress
384
- (100-inference breakdown)
384
+ (100-cycle breakdown)
385
385
  ↓
386
386
  /next / /done execute
387
- each inference cycle
387
+ each cycle cycle
388
388
  ```
389
389
 
390
390
  ---
391
391
 
392
392
  **Golden Rule:** Always ask "Can I solve this with existing components?" before choosing backend.
393
393
 
394
- **Inference comparison:**
394
+ **Cycle comparison:**
395
395
  - Frontend feature: 20-40 cycles (typically 20-30 minutes each)
396
396
  - Backend service: 60-90 cycles (typically 10-20 minutes each)
397
397
  - Integration: 30-60 cycles (typically 15-25 minutes each)
@@ -1,98 +1,72 @@
1
1
  ---
2
2
  allowed-tools: Bash(*), Read(*), Edit(*)
3
- description: Deploy web to Cloudflare Pages
3
+ description: Deploy web to Cloudflare Pages (oneie project)
4
4
  ---
5
5
 
6
- # /deploy - Deploy Sites to Cloudflare Pages
6
+ # /deploy - Deploy Web to Cloudflare Pages
7
7
 
8
- **Purpose:** Build and deploy ONE Platform sites to Cloudflare Pages with automated deployment scripts.
8
+ **Purpose:** Build and deploy the web application to Cloudflare Pages using wrangler CLI.
9
9
 
10
- ## Two-Site Architecture
10
+ ## One-Command Deployment
11
11
 
12
- - **oneie/** → https://one.ie (production site - source of truth)
13
- - **web/** → https://web.one.ie (starter template - AUTO-GENERATED)
14
-
15
- ## Quick Deploy
16
-
17
- **Deploy Production Site (oneie):**
18
12
  ```bash
19
- ./scripts/deploy-oneie.sh
13
+ cd /Users/toc/Server/ONE/web && bun run build && wrangler pages deploy dist --project-name=oneie
20
14
  ```
21
15
 
22
- **Deploy Starter Template (web):**
23
- ```bash
24
- ./scripts/deploy-web.sh
25
- ```
16
+ **What happens:**
17
+ 1. ✅ Build production bundle with Astro + React 19 edge support
18
+ 2. ✅ Deploy `/web/dist/` to Cloudflare Pages `oneie` project
19
+ 3. ✅ Automatic global CDN distribution
20
+ 4. ✅ Live URL generated instantly
26
21
 
27
- **Deploy Both:**
28
- ```bash
29
- ./scripts/deploy-oneie.sh && ./scripts/deploy-web.sh
30
- ```
22
+ ## Deployment URL
31
23
 
32
- ## How It Works
24
+ After deployment completes, the site is live at:
25
+ - **Primary:** https://oneie.pages.dev
26
+ - **With subdomain:** https://[deployment-hash].oneie.pages.dev
33
27
 
34
- The deployment scripts:
35
- 1. Load credentials from `.env`
36
- 2. Navigate to site directory (oneie/ or web/)
37
- 3. Build production bundle (`bun run build`)
38
- 4. Deploy to Cloudflare Pages using wrangler
39
- 5. Report deployment URL and status
40
-
41
- **Deployment Flow:**
42
- 1. Check credentials (CLOUDFLARE_GLOBAL_API_KEY, CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_EMAIL)
43
- 2. Build site with React 19 edge support
44
- 3. Clear CLOUDFLARE_API_TOKEN (avoid conflicts)
45
- 4. Export required credentials
46
- 5. Deploy via wrangler
47
- 6. Confirm success
28
+ View all deployments:
29
+ ```bash
30
+ wrangler pages deployment list --project-name=oneie
31
+ ```
48
32
 
49
33
  ## Requirements
50
34
 
51
- **Before deploying, ensure:**
52
- - ✅ Cloudflare Global API Key configured: `export CLOUDFLARE_GLOBAL_API_KEY=your-key`
53
- - ✅ Cloudflare Account ID set: `export CLOUDFLARE_ACCOUNT_ID=your-account-id`
54
- - ✅ Cloudflare Email set: `export CLOUDFLARE_EMAIL=your-email@domain.com`
55
- - ✅ React 19 edge alias is configured in `astro.config.mjs`
56
- - ✅ Environment variables set in `wrangler.toml`
57
-
58
- ## Deployment URLs
59
-
60
- **Production:**
61
- - Primary: https://web.one.ie (custom domain)
62
- - Cloudflare: https://web-d3d.pages.dev
63
-
64
- **Preview:**
65
- - Auto-generated: https://[commit-hash].web-d3d.pages.dev
66
-
67
- ## Environment Configuration
35
+ **Before deploying:**
36
+ - ✅ Wrangler CLI installed: `npm install -g wrangler`
37
+ - ✅ Cloudflare Global API Key: `$CLOUDFLARE_GLOBAL_API_KEY`
38
+ - ✅ Cloudflare Account ID: `$CLOUDFLARE_ACCOUNT_ID`
39
+ - ✅ React 19 edge alias configured in `astro.config.mjs`
68
40
 
69
- ### For ONE Platform (Default)
70
-
71
- ```toml
72
- # wrangler.toml
73
- ORG_NAME = "one"
74
- ORG_WEBSITE = "https://one.ie"
75
- ORG_FOLDER = "onegroup"
76
- ONE_BACKEND = "on"
41
+ **Environment Setup:**
42
+ ```bash
43
+ # Root .env must contain:
44
+ CLOUDFLARE_GLOBAL_API_KEY=your-api-key
45
+ CLOUDFLARE_ACCOUNT_ID=your-account-id
46
+ CLOUDFLARE_EMAIL=your-email@example.com
77
47
  ```
78
48
 
79
- **Result:** Full ONE Platform homepage
49
+ ## How It Works
80
50
 
81
- ### For Customer Organizations
51
+ 1. **Build Phase:** `bun run build`
52
+ - Compiles Astro + React 19 to static files + edge functions
53
+ - Outputs to `/web/dist/`
54
+ - Time: ~25-30 seconds
82
55
 
83
- ```toml
84
- # wrangler.toml (customer config)
85
- ORG_NAME = "acme"
86
- ORG_WEBSITE = "https://acme.com"
87
- ORG_FOLDER = "acme"
88
- ONE_BACKEND = "off" # Frontend-only
89
- ```
56
+ 2. **Deploy Phase:** `wrangler pages deploy dist --project-name=oneie`
57
+ - Uploads 600+ files to Cloudflare Pages
58
+ - Provisions edge runtime
59
+ - Propagates to 330+ global data centers
60
+ - Time: ~10-15 seconds
90
61
 
91
- **Result:** Customer homepage with GetStartedPrompt
62
+ 3. **Activation Phase:** Auto-live
63
+ - URL immediately accessible
64
+ - Cache warming across regions
65
+ - Real-time analytics enabled
92
66
 
93
- ## React 19 + Cloudflare Edge Fix
67
+ ## React 19 + Cloudflare Edge
94
68
 
95
- **Critical:** Ensure `astro.config.mjs` has:
69
+ **Critical Config:** `astro.config.mjs` must have:
96
70
 
97
71
  ```javascript
98
72
  resolve: {
@@ -104,58 +78,62 @@ resolve: {
104
78
 
105
79
  Without this, deployment fails with `MessageChannel is not defined`.
106
80
 
107
- ## Common Issues
81
+ ## Troubleshooting
108
82
 
109
- **Authentication failed:**
83
+ **Authentication Failed**
110
84
  ```bash
111
- # Make sure all Cloudflare variables are set:
85
+ # Verify credentials are set:
112
86
  echo $CLOUDFLARE_GLOBAL_API_KEY
113
87
  echo $CLOUDFLARE_ACCOUNT_ID
114
88
  echo $CLOUDFLARE_EMAIL
115
89
 
116
- # Or fallback to API Token if Global Key not available:
117
- export CLOUDFLARE_API_TOKEN=your-scoped-token
118
- ```
119
-
120
- **MessageChannel error:**
121
- ```bash
122
- # Fix: Add edge alias to astro.config.mjs
123
- 'react-dom/server': 'react-dom/server.edge'
90
+ # Check wrangler auth:
91
+ wrangler auth login
124
92
  ```
125
93
 
126
- **Build errors:**
94
+ **Build Errors**
127
95
  ```bash
96
+ # Check Astro build:
128
97
  cd web && bun run check
98
+
99
+ # View detailed errors:
100
+ cd web && bun run build --verbose
129
101
  ```
130
102
 
131
- **Credentials not recognized:**
103
+ **Deploy Timeout**
132
104
  ```bash
133
- # Ensure the root .env file has these exact variables:
134
- # (These are automatically loaded by scripts)
135
- CLOUDFLARE_GLOBAL_API_KEY=...
136
- CLOUDFLARE_ACCOUNT_ID=...
137
- CLOUDFLARE_EMAIL=...
105
+ # Retry deployment:
106
+ wrangler pages deploy dist --project-name=oneie
107
+
108
+ # Or use direct git integration for auto-deploy on push
138
109
  ```
139
110
 
140
- ## Customer Deployment
111
+ ## Rollback
141
112
 
142
- For customers deploying their own sites:
113
+ To rollback to a previous deployment:
143
114
 
144
115
  ```bash
145
- # 1. Install CLI
146
- npx oneie
147
-
148
- # 2. Configure (edit web/.env.local)
149
- ORG_NAME=acme
150
- ORG_WEBSITE=https://acme.com
151
- ONE_BACKEND=off
152
-
153
- # 3. Deploy
154
- cd web
155
- bun run build
156
- wrangler pages deploy dist --project-name=acme-web
116
+ # View deployment history
117
+ wrangler pages deployment list --project-name=oneie
118
+
119
+ # Promote previous deployment to production
120
+ wrangler pages deployments rollback --project-name=oneie
157
121
  ```
158
122
 
123
+ ## Performance Metrics
124
+
125
+ **Typical Deployment:**
126
+ - Build time: 25-30s
127
+ - Upload time: 10-15s
128
+ - Total time: 35-45s
129
+ - Files deployed: 600+
130
+ - Global rollout: <2 minutes
131
+
132
+ **Monitoring:**
133
+ - View live logs: `wrangler pages tail --project-name=oneie`
134
+ - Check analytics: Cloudflare Dashboard → Pages → oneie
135
+ - Status page: https://www.cloudflarestatus.com
136
+
159
137
  ---
160
138
 
161
- **Deployment ready** 🚀
139
+ **Ready to deploy!** 🚀