oneie 3.6.11 → 3.6.13
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.
- package/.claude/agents/agent-ops.md +138 -63
- package/.claude/commands/deploy.md +56 -17
- package/.claude/commands/one.md +46 -177
- package/.claude/commands/push.md +75 -14
- package/.claude/commands/release.md +91 -49
- package/.claude/commands/server.md +64 -5
- package/.claude/hooks/__pycache__/todo.cpython-313.pyc +0 -0
- package/folders.yaml +1 -1
- package/one/.obsidian/workspace.json +2 -2
- package/one/things/plans/2-sites.md +895 -0
- package/package.json +1 -1
|
@@ -10,8 +10,9 @@ You are the Ops Agent, a DevOps specialist responsible for releasing software, m
|
|
|
10
10
|
|
|
11
11
|
## Core Responsibilities
|
|
12
12
|
|
|
13
|
-
- **Release Management:** Execute full release pipeline (npm, GitHub, Cloudflare Pages)
|
|
14
|
-
- **
|
|
13
|
+
- **Release Management:** Execute full release pipeline for two-site architecture (npm, GitHub, Cloudflare Pages)
|
|
14
|
+
- **Two-Site Architecture:** Manage production site (oneie/) and auto-generated starter (web/)
|
|
15
|
+
- **Deployment Automation:** Automate deployments across all environments using Cloudflare Global API Key
|
|
15
16
|
- **Infrastructure Management:** Manage Cloudflare Pages, Workers, KV, D1, R2
|
|
16
17
|
- **CI/CD Orchestration:** Coordinate build, test, deploy pipelines
|
|
17
18
|
- **Domain Management:** Configure custom domains, DNS, SSL/TLS
|
|
@@ -19,6 +20,53 @@ You are the Ops Agent, a DevOps specialist responsible for releasing software, m
|
|
|
19
20
|
- **Version Control:** Manage git workflows, tags, releases
|
|
20
21
|
- **Environment Configuration:** Manage environment variables, secrets, configurations
|
|
21
22
|
|
|
23
|
+
## Cloudflare Global API Key Setup
|
|
24
|
+
|
|
25
|
+
**CRITICAL:** Always use CLOUDFLARE_GLOBAL_API_KEY for automated deployments. This provides:
|
|
26
|
+
|
|
27
|
+
- ✅ Full programmatic access to Cloudflare API
|
|
28
|
+
- ✅ Zero-confirmation deployments (fully automated)
|
|
29
|
+
- ✅ Works in CI/CD pipelines and automation
|
|
30
|
+
- ✅ Supports all Cloudflare services (Pages, Workers, KV, etc.)
|
|
31
|
+
|
|
32
|
+
**Required Environment Variables (set in root `.env`):**
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
CLOUDFLARE_GLOBAL_API_KEY=your-global-api-key # Full API access
|
|
36
|
+
CLOUDFLARE_ACCOUNT_ID=your-account-id # Cloudflare account ID
|
|
37
|
+
CLOUDFLARE_EMAIL=your-email@domain.com # Email associated with Cloudflare account
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**How It Works:**
|
|
41
|
+
|
|
42
|
+
1. Scripts automatically load `.env` from root directory
|
|
43
|
+
2. Global API Key is used for all Cloudflare API calls
|
|
44
|
+
3. Falls back to CLOUDFLARE_API_TOKEN if Global Key not available
|
|
45
|
+
4. All deployment scripts (`cloudflare-deploy.sh`, `release.sh`) support both methods
|
|
46
|
+
|
|
47
|
+
**Deployment Command with Global Key:**
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
# Automatic (loads from .env)
|
|
51
|
+
./scripts/cloudflare-deploy.sh deploy web apps/one/web/dist production
|
|
52
|
+
|
|
53
|
+
# Manual (explicit credentials)
|
|
54
|
+
export CLOUDFLARE_GLOBAL_API_KEY=your-key
|
|
55
|
+
export CLOUDFLARE_ACCOUNT_ID=your-id
|
|
56
|
+
export CLOUDFLARE_EMAIL=your-email
|
|
57
|
+
./scripts/cloudflare-deploy.sh deploy web apps/one/web/dist production
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
**Release with Global Key:**
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
# Automatically uses Global API Key from .env
|
|
64
|
+
./scripts/release.sh patch
|
|
65
|
+
|
|
66
|
+
# Or specify explicitly
|
|
67
|
+
CLOUDFLARE_GLOBAL_API_KEY=... ./scripts/release.sh patch
|
|
68
|
+
```
|
|
69
|
+
|
|
22
70
|
## PARALLEL EXECUTION: New Capability
|
|
23
71
|
|
|
24
72
|
### Early Infrastructure Setup
|
|
@@ -263,71 +311,81 @@ git push origin main
|
|
|
263
311
|
|
|
264
312
|
### 4. Release Scripts
|
|
265
313
|
|
|
266
|
-
**
|
|
267
|
-
|
|
268
|
-
|
|
314
|
+
**Two-Site Architecture:**
|
|
315
|
+
|
|
316
|
+
```
|
|
317
|
+
/Users/toc/Server/ONE/
|
|
318
|
+
├── oneie/ # Production site (source of truth)
|
|
319
|
+
│ ├── src/ # Full production codebase
|
|
320
|
+
│ ├── scripts/
|
|
321
|
+
│ │ └── generate-starter.sh # Transform script
|
|
322
|
+
│ └── package.json # Has build:starter script
|
|
323
|
+
│
|
|
324
|
+
└── web/ # Starter template (AUTO-GENERATED)
|
|
325
|
+
├── src/ # Simplified starter code
|
|
326
|
+
├── README.md # ⚠️ AUTO-GENERATED warning
|
|
327
|
+
└── package.json # name: "oneie-starter"
|
|
269
328
|
```
|
|
270
329
|
|
|
271
|
-
**
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
330
|
+
**Golden Rule:** NEVER edit web/ directly. It is generated from oneie/ via:
|
|
331
|
+
```bash
|
|
332
|
+
cd oneie && bun run build:starter
|
|
333
|
+
```
|
|
275
334
|
|
|
276
|
-
**
|
|
335
|
+
**Primary Script:**
|
|
277
336
|
```bash
|
|
278
|
-
./scripts/release.sh patch
|
|
279
|
-
./scripts/release.sh patch demo # Deploy demo site only
|
|
280
|
-
./scripts/release.sh patch # Deploy both sites
|
|
337
|
+
./scripts/release.sh [major|minor|patch]
|
|
281
338
|
```
|
|
282
339
|
|
|
283
340
|
**What it does:**
|
|
284
341
|
1. Pre-flight validation (repos, files, structure)
|
|
285
|
-
2.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
-
|
|
290
|
-
-
|
|
291
|
-
-
|
|
292
|
-
|
|
293
|
-
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
342
|
+
2. **Generate starter template:**
|
|
343
|
+
```bash
|
|
344
|
+
cd oneie && bun run build:starter
|
|
345
|
+
```
|
|
346
|
+
- Copies oneie/ → web/
|
|
347
|
+
- Replaces homepage with simple template chooser
|
|
348
|
+
- Simplifies Sidebar to 2 items (Stream, License)
|
|
349
|
+
- Reduces content (1 blog, 3 products)
|
|
350
|
+
- Updates package.json name to "oneie-starter"
|
|
351
|
+
3. Push core repos:
|
|
352
|
+
- oneie/ → github.com/one-ie/oneie
|
|
353
|
+
- web/ → github.com/one-ie/web
|
|
354
|
+
- one/ → github.com/one-ie/one-ontology
|
|
355
|
+
4. Sync documentation (518+ files to cli/ and apps/)
|
|
356
|
+
5. Version bump (cli/package.json)
|
|
357
|
+
6. Git status summary
|
|
358
|
+
7. Commit & push CLI to one-ie/cli
|
|
359
|
+
8. npm publish instructions (manual)
|
|
360
|
+
9. Build and deploy to Cloudflare Pages:
|
|
361
|
+
- oneie/ → oneie project → one.ie
|
|
362
|
+
- web/ → web project → web.one.ie
|
|
305
363
|
|
|
306
364
|
**Files Synced:**
|
|
307
|
-
- `/one/*` → `cli/one/` and `apps/
|
|
308
|
-
- `/.claude/*` → `cli/.claude/` and `apps/
|
|
309
|
-
- `/
|
|
365
|
+
- `/one/*` → `cli/one/` and `apps/one/one/`
|
|
366
|
+
- `/.claude/*` → `cli/.claude/` and `apps/one/one/.claude/`
|
|
367
|
+
- `/oneie/*` → `apps/oneie/` (production site)
|
|
368
|
+
- `/web/*` → `apps/one/web/` (starter template)
|
|
310
369
|
- `CLAUDE.md`, `README.md`, `LICENSE.md`, `SECURITY.md` → all targets
|
|
311
|
-
- `
|
|
312
|
-
- `web/.env.{target}` → `apps/{target}/web/.env.local`
|
|
370
|
+
- `oneie/AGENTS.md` → `apps/one/one/AGENTS.md`
|
|
313
371
|
|
|
314
372
|
### 5. Slash Commands
|
|
315
373
|
|
|
316
374
|
**/release** - Execute full release process
|
|
317
375
|
```bash
|
|
318
|
-
/release major
|
|
319
|
-
/release minor
|
|
320
|
-
/release patch
|
|
376
|
+
/release major # Major release (2.0.10 → 3.0.0)
|
|
377
|
+
/release minor # Minor release (2.0.10 → 2.1.0)
|
|
378
|
+
/release patch # Patch release (2.0.10 → 2.0.11)
|
|
321
379
|
```
|
|
322
380
|
|
|
323
|
-
**
|
|
324
|
-
- **
|
|
325
|
-
- **
|
|
381
|
+
**Two-Site Deployment:**
|
|
382
|
+
- **oneie/:** https://one.ie (Wrangler project: oneie) - Full production site
|
|
383
|
+
- **web/:** https://web.one.ie (Wrangler project: web) - Auto-generated starter
|
|
326
384
|
- **Repos:**
|
|
327
|
-
- `one-ie/oneie` → one.ie (
|
|
328
|
-
- `one-ie/
|
|
329
|
-
- `one-ie/web` → single source of truth (website code)
|
|
385
|
+
- `one-ie/oneie` → one.ie (production site, source of truth)
|
|
386
|
+
- `one-ie/web` → web.one.ie + npx oneie (AUTO-GENERATED starter)
|
|
330
387
|
- `one-ie/cli` → npm package
|
|
388
|
+
- `one-ie/one-ontology` → documentation
|
|
331
389
|
|
|
332
390
|
## Decision Framework
|
|
333
391
|
|
|
@@ -374,13 +432,17 @@ cd web && bun run build
|
|
|
374
432
|
|
|
375
433
|
**Execute Release:**
|
|
376
434
|
```bash
|
|
377
|
-
#
|
|
378
|
-
|
|
435
|
+
# Step 1: Generate starter template
|
|
436
|
+
cd oneie && bun run build:starter
|
|
437
|
+
|
|
438
|
+
# Step 2: Run release script
|
|
439
|
+
cd .. && ./scripts/release.sh major
|
|
379
440
|
|
|
380
441
|
# This automatically:
|
|
442
|
+
# - Generates web/ from oneie/
|
|
381
443
|
# - Syncs 518+ files
|
|
382
444
|
# - Bumps version 2.0.10 → 3.0.0
|
|
383
|
-
# - Commits & pushes
|
|
445
|
+
# - Commits & pushes oneie/ and web/ automatically
|
|
384
446
|
# - Prompts for cli commit/push
|
|
385
447
|
```
|
|
386
448
|
|
|
@@ -392,21 +454,34 @@ cd cli && npm publish --access public
|
|
|
392
454
|
# 2. Verify npm
|
|
393
455
|
npm view oneie version
|
|
394
456
|
|
|
395
|
-
# 3. Deploy to Cloudflare
|
|
396
|
-
|
|
457
|
+
# 3. Deploy production site to Cloudflare
|
|
458
|
+
./scripts/deploy-oneie.sh
|
|
459
|
+
|
|
460
|
+
# 4. Deploy starter template to Cloudflare
|
|
461
|
+
./scripts/deploy-web.sh
|
|
397
462
|
|
|
398
|
-
#
|
|
463
|
+
# 5. Create GitHub releases
|
|
399
464
|
gh release create v3.0.0 --title "Release v3.0.0" --generate-notes
|
|
400
465
|
|
|
401
|
-
#
|
|
466
|
+
# 6. Test installation
|
|
402
467
|
npx oneie@latest --version
|
|
403
468
|
```
|
|
404
469
|
|
|
470
|
+
**Deployment Scripts** (located in `/scripts/`):
|
|
471
|
+
- `deploy-oneie.sh` - Deploy production site to one.ie
|
|
472
|
+
- `deploy-web.sh` - Deploy starter template to web.one.ie
|
|
473
|
+
|
|
474
|
+
Both scripts:
|
|
475
|
+
- Load credentials from `.env`
|
|
476
|
+
- Build the site
|
|
477
|
+
- Deploy via wrangler with explicit credentials
|
|
478
|
+
- Avoid authentication conflicts by unsetting CLOUDFLARE_API_TOKEN
|
|
479
|
+
|
|
405
480
|
### 2. Domain Management
|
|
406
481
|
|
|
407
482
|
**Current Architecture:**
|
|
408
|
-
- **oneie project** → one.ie (
|
|
409
|
-
- **
|
|
483
|
+
- **oneie project** → one.ie (production site)
|
|
484
|
+
- **web project** → web.one.ie (starter template)
|
|
410
485
|
|
|
411
486
|
**Add Custom Domain:**
|
|
412
487
|
```bash
|
|
@@ -423,13 +498,13 @@ curl -X POST \
|
|
|
423
498
|
-H "Content-Type: application/json" \
|
|
424
499
|
--data '{"name":"one.ie"}'
|
|
425
500
|
|
|
426
|
-
# Add domain to
|
|
501
|
+
# Add domain to web project (web.one.ie)
|
|
427
502
|
curl -X POST \
|
|
428
|
-
"https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects/
|
|
503
|
+
"https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/pages/projects/web/domains" \
|
|
429
504
|
-H "X-Auth-Email: $EMAIL" \
|
|
430
505
|
-H "X-Auth-Key: $API_KEY" \
|
|
431
506
|
-H "Content-Type: application/json" \
|
|
432
|
-
--data '{"name":"
|
|
507
|
+
--data '{"name":"web.one.ie"}'
|
|
433
508
|
```
|
|
434
509
|
|
|
435
510
|
**Remove Domain:**
|
|
@@ -444,14 +519,14 @@ curl -X DELETE \
|
|
|
444
519
|
|
|
445
520
|
Use agent-ops to create both projects and configure domains:
|
|
446
521
|
|
|
447
|
-
1. **Create oneie project** (
|
|
522
|
+
1. **Create oneie project** (production site):
|
|
448
523
|
```bash
|
|
449
524
|
wrangler pages project create oneie
|
|
450
525
|
```
|
|
451
526
|
|
|
452
|
-
2. **Create
|
|
527
|
+
2. **Create web project** (starter template):
|
|
453
528
|
```bash
|
|
454
|
-
wrangler pages project create
|
|
529
|
+
wrangler pages project create web
|
|
455
530
|
```
|
|
456
531
|
|
|
457
532
|
3. **Add custom domains via Cloudflare API** (as shown above)
|
|
@@ -459,7 +534,7 @@ Use agent-ops to create both projects and configure domains:
|
|
|
459
534
|
4. **Verify DNS propagation:**
|
|
460
535
|
```bash
|
|
461
536
|
dig one.ie +short
|
|
462
|
-
dig
|
|
537
|
+
dig web.one.ie +short
|
|
463
538
|
```
|
|
464
539
|
|
|
465
540
|
### 3. Environment Configuration
|
|
@@ -3,31 +3,55 @@ allowed-tools: Bash(*), Read(*), Edit(*)
|
|
|
3
3
|
description: Deploy web to Cloudflare Pages
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
-
# /deploy - Deploy
|
|
6
|
+
# /deploy - Deploy Sites to Cloudflare Pages
|
|
7
7
|
|
|
8
|
-
**Purpose:** Build and deploy
|
|
8
|
+
**Purpose:** Build and deploy ONE Platform sites to Cloudflare Pages with automated deployment scripts.
|
|
9
9
|
|
|
10
|
-
##
|
|
11
|
-
|
|
12
|
-
This command builds the Astro web application and deploys it to Cloudflare Pages using wrangler.
|
|
10
|
+
## Two-Site Architecture
|
|
13
11
|
|
|
14
|
-
**
|
|
15
|
-
|
|
16
|
-
2. Build production bundle (with React 19 edge support)
|
|
17
|
-
3. Deploy to Cloudflare Pages
|
|
18
|
-
4. Report deployment URL and status
|
|
12
|
+
- **oneie/** → https://one.ie (production site - source of truth)
|
|
13
|
+
- **web/** → https://web.one.ie (starter template - AUTO-GENERATED)
|
|
19
14
|
|
|
20
15
|
## Quick Deploy
|
|
21
16
|
|
|
17
|
+
**Deploy Production Site (oneie):**
|
|
18
|
+
```bash
|
|
19
|
+
./scripts/deploy-oneie.sh
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**Deploy Starter Template (web):**
|
|
22
23
|
```bash
|
|
23
|
-
|
|
24
|
-
cd web && bun run build && wrangler pages deploy dist --project-name=web --commit-dirty=true
|
|
24
|
+
./scripts/deploy-web.sh
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
+
**Deploy Both:**
|
|
28
|
+
```bash
|
|
29
|
+
./scripts/deploy-oneie.sh && ./scripts/deploy-web.sh
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## How It Works
|
|
33
|
+
|
|
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
|
|
48
|
+
|
|
27
49
|
## Requirements
|
|
28
50
|
|
|
29
51
|
**Before deploying, ensure:**
|
|
30
|
-
- ✅
|
|
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`
|
|
31
55
|
- ✅ React 19 edge alias is configured in `astro.config.mjs`
|
|
32
56
|
- ✅ Environment variables set in `wrangler.toml`
|
|
33
57
|
|
|
@@ -82,20 +106,35 @@ Without this, deployment fails with `MessageChannel is not defined`.
|
|
|
82
106
|
|
|
83
107
|
## Common Issues
|
|
84
108
|
|
|
109
|
+
**Authentication failed:**
|
|
110
|
+
```bash
|
|
111
|
+
# Make sure all Cloudflare variables are set:
|
|
112
|
+
echo $CLOUDFLARE_GLOBAL_API_KEY
|
|
113
|
+
echo $CLOUDFLARE_ACCOUNT_ID
|
|
114
|
+
echo $CLOUDFLARE_EMAIL
|
|
115
|
+
|
|
116
|
+
# Or fallback to API Token if Global Key not available:
|
|
117
|
+
export CLOUDFLARE_API_TOKEN=your-scoped-token
|
|
118
|
+
```
|
|
119
|
+
|
|
85
120
|
**MessageChannel error:**
|
|
86
121
|
```bash
|
|
87
122
|
# Fix: Add edge alias to astro.config.mjs
|
|
88
123
|
'react-dom/server': 'react-dom/server.edge'
|
|
89
124
|
```
|
|
90
125
|
|
|
91
|
-
**
|
|
126
|
+
**Build errors:**
|
|
92
127
|
```bash
|
|
93
|
-
|
|
128
|
+
cd web && bun run check
|
|
94
129
|
```
|
|
95
130
|
|
|
96
|
-
**
|
|
131
|
+
**Credentials not recognized:**
|
|
97
132
|
```bash
|
|
98
|
-
|
|
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=...
|
|
99
138
|
```
|
|
100
139
|
|
|
101
140
|
## Customer Deployment
|