@defai.digital/automatosx 12.8.7 → 13.1.3

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 (130) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +48 -754
  3. package/dist/bin.d.ts +8 -0
  4. package/dist/bin.d.ts.map +1 -0
  5. package/dist/bin.js +16 -0
  6. package/dist/bin.js.map +1 -0
  7. package/dist/index.d.ts +8 -2
  8. package/dist/index.d.ts.map +1 -0
  9. package/dist/index.js +7 -74239
  10. package/dist/index.js.map +1 -0
  11. package/package.json +35 -160
  12. package/.github/assets/ax-cli.png +0 -0
  13. package/.github/assets/axlogo.png +0 -0
  14. package/CHANGELOG.md +0 -81
  15. package/SECURITY.md +0 -173
  16. package/dist/mcp/index.d.ts +0 -2
  17. package/dist/mcp/index.js +0 -43627
  18. package/examples/AGENTS_INFO.md +0 -187
  19. package/examples/README.md +0 -434
  20. package/examples/abilities/accessibility.md +0 -115
  21. package/examples/abilities/api-design.md +0 -168
  22. package/examples/abilities/best-practices.md +0 -102
  23. package/examples/abilities/caching-strategy.md +0 -165
  24. package/examples/abilities/ci-cd.md +0 -61
  25. package/examples/abilities/clean-code.md +0 -398
  26. package/examples/abilities/code-generation.md +0 -333
  27. package/examples/abilities/code-review.md +0 -51
  28. package/examples/abilities/component-architecture.md +0 -112
  29. package/examples/abilities/content-creation.md +0 -97
  30. package/examples/abilities/data-modeling.md +0 -171
  31. package/examples/abilities/data-validation.md +0 -50
  32. package/examples/abilities/db-modeling.md +0 -167
  33. package/examples/abilities/debugging.md +0 -52
  34. package/examples/abilities/design-patterns.md +0 -437
  35. package/examples/abilities/design-system-implementation.md +0 -126
  36. package/examples/abilities/documentation.md +0 -54
  37. package/examples/abilities/etl-pipelines.md +0 -44
  38. package/examples/abilities/feasibility-study.md +0 -20
  39. package/examples/abilities/general-assistance.md +0 -26
  40. package/examples/abilities/idea-evaluation.md +0 -21
  41. package/examples/abilities/infra-as-code.md +0 -57
  42. package/examples/abilities/job-orchestration.md +0 -44
  43. package/examples/abilities/literature-review.md +0 -19
  44. package/examples/abilities/longform-report.md +0 -25
  45. package/examples/abilities/mathematical-reasoning.md +0 -170
  46. package/examples/abilities/observability.md +0 -61
  47. package/examples/abilities/orbital-mechanics.md +0 -50
  48. package/examples/abilities/our-architecture-decisions.md +0 -180
  49. package/examples/abilities/our-code-review-checklist.md +0 -149
  50. package/examples/abilities/our-coding-standards.md +0 -369
  51. package/examples/abilities/our-project-structure.md +0 -183
  52. package/examples/abilities/performance.md +0 -89
  53. package/examples/abilities/problem-solving.md +0 -50
  54. package/examples/abilities/propulsion-systems.md +0 -50
  55. package/examples/abilities/quantum-algorithm-design.md +0 -54
  56. package/examples/abilities/quantum-error-correction.md +0 -56
  57. package/examples/abilities/quantum-frameworks-transpilation.md +0 -53
  58. package/examples/abilities/quantum-noise-modeling.md +0 -58
  59. package/examples/abilities/refactoring.md +0 -223
  60. package/examples/abilities/release-strategy.md +0 -58
  61. package/examples/abilities/secrets-policy.md +0 -61
  62. package/examples/abilities/secure-coding-review.md +0 -60
  63. package/examples/abilities/software-architecture.md +0 -394
  64. package/examples/abilities/solid-principles.md +0 -341
  65. package/examples/abilities/sql-optimization.md +0 -84
  66. package/examples/abilities/state-management.md +0 -96
  67. package/examples/abilities/task-planning.md +0 -65
  68. package/examples/abilities/technical-writing.md +0 -77
  69. package/examples/abilities/telemetry-diagnostics.md +0 -51
  70. package/examples/abilities/testing.md +0 -56
  71. package/examples/abilities/threat-modeling.md +0 -58
  72. package/examples/abilities/troubleshooting.md +0 -80
  73. package/examples/abilities/typescript-zod-validation.md +0 -830
  74. package/examples/agents/AGENTS_INTEGRATION.md +0 -99
  75. package/examples/agents/aerospace-scientist.yaml +0 -159
  76. package/examples/agents/architecture.yaml +0 -244
  77. package/examples/agents/automatosx.config.json +0 -286
  78. package/examples/agents/backend.yaml +0 -141
  79. package/examples/agents/ceo.yaml +0 -105
  80. package/examples/agents/creative-marketer.yaml +0 -173
  81. package/examples/agents/cto.yaml +0 -118
  82. package/examples/agents/data-scientist.yaml +0 -200
  83. package/examples/agents/data.yaml +0 -106
  84. package/examples/agents/design.yaml +0 -115
  85. package/examples/agents/devops.yaml +0 -124
  86. package/examples/agents/frontend.yaml +0 -171
  87. package/examples/agents/fullstack.yaml +0 -172
  88. package/examples/agents/mobile.yaml +0 -185
  89. package/examples/agents/product.yaml +0 -103
  90. package/examples/agents/quality.yaml +0 -117
  91. package/examples/agents/quantum-engineer.yaml +0 -166
  92. package/examples/agents/researcher.yaml +0 -122
  93. package/examples/agents/security.yaml +0 -115
  94. package/examples/agents/standard.yaml +0 -214
  95. package/examples/agents/writer.yaml +0 -122
  96. package/examples/providers/README.md +0 -117
  97. package/examples/providers/claude/CLAUDE_INTEGRATION.md +0 -302
  98. package/examples/providers/claude/mcp/automatosx.json +0 -244
  99. package/examples/providers/codex/CODEX_INTEGRATION.md +0 -593
  100. package/examples/providers/codex/README.md +0 -349
  101. package/examples/providers/codex/usage-examples.ts +0 -421
  102. package/examples/providers/gemini/GEMINI_INTEGRATION.md +0 -236
  103. package/examples/providers/gemini/README.md +0 -76
  104. package/examples/providers/openai-codex-example.ts +0 -421
  105. package/examples/pytorch_resnet50_training.py +0 -289
  106. package/examples/specs/automatosx-release.ax.yaml +0 -380
  107. package/examples/specs/enterprise.ax.yaml +0 -121
  108. package/examples/specs/enterprise.yaml.mustache +0 -121
  109. package/examples/specs/government.ax.yaml +0 -148
  110. package/examples/specs/government.yaml.mustache +0 -148
  111. package/examples/specs/minimal.ax.yaml +0 -21
  112. package/examples/specs/minimal.yaml.mustache +0 -21
  113. package/examples/teams/business.yaml +0 -56
  114. package/examples/teams/core.yaml +0 -60
  115. package/examples/teams/design.yaml +0 -58
  116. package/examples/teams/engineering.yaml +0 -69
  117. package/examples/teams/research.yaml +0 -56
  118. package/examples/use-cases/01-web-app-development.md +0 -374
  119. package/examples/workflows/analyst.yaml +0 -60
  120. package/examples/workflows/assistant.yaml +0 -48
  121. package/examples/workflows/basic-agent.yaml +0 -28
  122. package/examples/workflows/code-reviewer.yaml +0 -52
  123. package/examples/workflows/debugger.yaml +0 -63
  124. package/examples/workflows/designer.yaml +0 -69
  125. package/examples/workflows/developer.yaml +0 -60
  126. package/examples/workflows/fullstack-developer.yaml +0 -395
  127. package/examples/workflows/qa-specialist.yaml +0 -71
  128. package/schema/ability-metadata.json +0 -21
  129. package/schema/config.json +0 -703
  130. package/schema/spec-schema.json +0 -608
@@ -1,289 +0,0 @@
1
- """
2
- Mixed precision ResNet-50 training loop for image classification.
3
-
4
- Author: Mira — "From architecture to inference - I build models that ship."
5
-
6
- This script focuses on the core PyTorch 2.x training primitives:
7
- - ImageFolder-based DataLoader with realistic augmentations
8
- - Transfer learning from torchvision's pretrained ResNet-50
9
- - Mixed precision training via torch.amp.autocast + GradScaler
10
- - torch.compile() to squeeze extra throughput from the forward pass
11
-
12
- Expected directory structure for the dataset:
13
- data_root/
14
- train/
15
- class_a/*.jpg
16
- class_b/*.jpg
17
- val/
18
- class_a/*.jpg
19
- class_b/*.jpg
20
-
21
- Run:
22
- python examples/pytorch_resnet50_training.py --data-root /path/to/data
23
- """
24
-
25
- from __future__ import annotations
26
-
27
- import argparse
28
- import random
29
- import time
30
- from dataclasses import dataclass
31
- from pathlib import Path
32
- from typing import Tuple
33
-
34
- import torch
35
- from torch import nn
36
- from torch.amp import GradScaler, autocast
37
- from torch.optim import Optimizer
38
- from torch.optim.lr_scheduler import CosineAnnealingLR
39
- from torch.utils.data import DataLoader
40
- from torchvision import datasets, transforms
41
- from torchvision.models import ResNet50_Weights, resnet50
42
- from tqdm import tqdm
43
-
44
-
45
- @dataclass
46
- class TrainConfig:
47
- data_root: Path
48
- batch_size: int = 64
49
- num_workers: int = 8
50
- epochs: int = 20
51
- learning_rate: float = 5e-4
52
- weight_decay: float = 0.01
53
- seed: int = 17
54
- output_dir: Path = Path("artifacts/checkpoints")
55
- log_every: int = 25
56
- num_classes: int | None = None
57
-
58
-
59
- def set_seed(seed: int) -> None:
60
- random.seed(seed)
61
- torch.manual_seed(seed)
62
- torch.cuda.manual_seed_all(seed)
63
- torch.backends.cudnn.deterministic = False
64
- torch.backends.cudnn.benchmark = True
65
-
66
-
67
- def build_dataloaders(cfg: TrainConfig) -> Tuple[DataLoader, DataLoader, int]:
68
- """Construct train/val DataLoaders and infer class count."""
69
- train_dir = cfg.data_root / "train"
70
- val_dir = cfg.data_root / "val"
71
-
72
- if not train_dir.is_dir() or not val_dir.is_dir():
73
- raise FileNotFoundError(
74
- f"Expecting 'train' and 'val' subdirectories under {cfg.data_root}"
75
- )
76
-
77
- train_tfms = transforms.Compose(
78
- [
79
- transforms.RandomResizedCrop(224, scale=(0.6, 1.0)),
80
- transforms.RandomHorizontalFlip(),
81
- transforms.ColorJitter(0.2, 0.2, 0.2, 0.1),
82
- transforms.RandomApply(
83
- [transforms.GaussianBlur(kernel_size=3, sigma=(0.1, 2.0))], p=0.3
84
- ),
85
- transforms.ToTensor(),
86
- transforms.Normalize(
87
- mean=ResNet50_Weights.IMAGENET1K_V2.meta["mean"],
88
- std=ResNet50_Weights.IMAGENET1K_V2.meta["std"],
89
- ),
90
- ]
91
- )
92
-
93
- eval_tfms = transforms.Compose(
94
- [
95
- transforms.Resize(256),
96
- transforms.CenterCrop(224),
97
- transforms.ToTensor(),
98
- transforms.Normalize(
99
- mean=ResNet50_Weights.IMAGENET1K_V2.meta["mean"],
100
- std=ResNet50_Weights.IMAGENET1K_V2.meta["std"],
101
- ),
102
- ]
103
- )
104
-
105
- train_dataset = datasets.ImageFolder(train_dir, transform=train_tfms)
106
- val_dataset = datasets.ImageFolder(val_dir, transform=eval_tfms)
107
- num_classes = len(train_dataset.classes)
108
-
109
- loader_kwargs = dict(
110
- batch_size=cfg.batch_size,
111
- num_workers=cfg.num_workers,
112
- pin_memory=True,
113
- persistent_workers=cfg.num_workers > 0,
114
- )
115
-
116
- train_loader = DataLoader(train_dataset, shuffle=True, drop_last=True, **loader_kwargs)
117
- val_loader = DataLoader(val_dataset, shuffle=False, drop_last=False, **loader_kwargs)
118
-
119
- return train_loader, val_loader, num_classes
120
-
121
-
122
- def build_model(num_classes: int) -> nn.Module:
123
- """Load pretrained ResNet-50 and replace the classification head."""
124
- base_model = resnet50(weights=ResNet50_Weights.IMAGENET1K_V2)
125
- in_features = base_model.fc.in_features
126
- base_model.fc = nn.Sequential(
127
- nn.Dropout(p=0.2),
128
- nn.Linear(in_features, num_classes),
129
- )
130
- return base_model
131
-
132
-
133
- def accuracy(output: torch.Tensor, target: torch.Tensor) -> torch.Tensor:
134
- preds = output.argmax(dim=1)
135
- return (preds == target).float().mean()
136
-
137
-
138
- def train_one_epoch(
139
- model: nn.Module,
140
- loader: DataLoader,
141
- optimizer: Optimizer,
142
- scaler: GradScaler,
143
- device: torch.device,
144
- epoch: int,
145
- cfg: TrainConfig,
146
- ) -> Tuple[float, float]:
147
- model.train()
148
- running_loss = 0.0
149
- running_acc = 0.0
150
-
151
- for step, (images, labels) in enumerate(tqdm(loader, desc=f"Epoch {epoch} [train]")):
152
- images = images.to(device, non_blocking=True)
153
- labels = labels.to(device, non_blocking=True)
154
-
155
- optimizer.zero_grad(set_to_none=True)
156
-
157
- with autocast(device_type=device.type, dtype=torch.float16 if device.type == "cuda" else torch.bfloat16):
158
- logits = model(images)
159
- loss = nn.functional.cross_entropy(logits, labels)
160
-
161
- scaler.scale(loss).backward()
162
- scaler.unscale_(optimizer)
163
- torch.nn.utils.clip_grad_norm_(model.parameters(), max_norm=1.0)
164
- scaler.step(optimizer)
165
- scaler.update()
166
-
167
- with torch.no_grad():
168
- running_loss += loss.item()
169
- running_acc += accuracy(logits, labels).item()
170
-
171
- if step % cfg.log_every == 0:
172
- current_lr = optimizer.param_groups[0]["lr"]
173
- print(
174
- f"Epoch {epoch} | step {step:04d} | lr {current_lr:.2e} | "
175
- f"loss {loss.item():.4f}"
176
- )
177
-
178
- steps = len(loader)
179
- return running_loss / steps, running_acc / steps
180
-
181
-
182
- @torch.no_grad()
183
- def evaluate(
184
- model: nn.Module,
185
- loader: DataLoader,
186
- device: torch.device,
187
- ) -> Tuple[float, float]:
188
- model.eval()
189
- total_loss = 0.0
190
- total_acc = 0.0
191
-
192
- for images, labels in tqdm(loader, desc="Validation"):
193
- images = images.to(device, non_blocking=True)
194
- labels = labels.to(device, non_blocking=True)
195
-
196
- logits = model(images)
197
- total_loss += nn.functional.cross_entropy(logits, labels).item()
198
- total_acc += accuracy(logits, labels).item()
199
-
200
- steps = len(loader)
201
- return total_loss / steps, total_acc / steps
202
-
203
-
204
- def save_checkpoint(
205
- model: nn.Module,
206
- optimizer: Optimizer,
207
- epoch: int,
208
- cfg: TrainConfig,
209
- metric: float,
210
- ) -> None:
211
- cfg.output_dir.mkdir(parents=True, exist_ok=True)
212
- ckpt = {
213
- "epoch": epoch,
214
- "state_dict": model.state_dict(),
215
- "optimizer_state": optimizer.state_dict(),
216
- "val_top1": metric,
217
- }
218
- torch.save(ckpt, cfg.output_dir / f"resnet50_epoch{epoch:03d}_acc{metric:.3f}.pt")
219
-
220
-
221
- def train_model(cfg: TrainConfig) -> None:
222
- set_seed(cfg.seed)
223
-
224
- train_loader, val_loader, inferred_classes = build_dataloaders(cfg)
225
- num_classes = cfg.num_classes or inferred_classes
226
-
227
- device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
228
- print(f"Using device: {device}")
229
-
230
- torch.set_float32_matmul_precision("high")
231
- model = build_model(num_classes).to(device)
232
- model = torch.compile(model) # PyTorch 2.x graph capture for extra throughput
233
-
234
- optimizer = torch.optim.AdamW(
235
- model.parameters(), lr=cfg.learning_rate, weight_decay=cfg.weight_decay
236
- )
237
- scheduler = CosineAnnealingLR(optimizer, T_max=cfg.epochs)
238
- scaler = GradScaler(device.type if device.type == "cuda" else "cpu")
239
-
240
- best_acc = 0.0
241
-
242
- for epoch in range(1, cfg.epochs + 1):
243
- epoch_start = time.time()
244
-
245
- train_loss, train_acc = train_one_epoch(
246
- model, train_loader, optimizer, scaler, device, epoch, cfg
247
- )
248
- val_loss, val_acc = evaluate(model, val_loader, device)
249
- scheduler.step()
250
-
251
- elapsed = time.time() - epoch_start
252
- print(
253
- f"Epoch {epoch:02d} finished in {elapsed:.1f}s | "
254
- f"train loss {train_loss:.4f}, train acc {train_acc*100:.2f}% | "
255
- f"val loss {val_loss:.4f}, val acc {val_acc*100:.2f}%"
256
- )
257
-
258
- if val_acc > best_acc:
259
- best_acc = val_acc
260
- save_checkpoint(model, optimizer, epoch, cfg, metric=val_acc)
261
-
262
-
263
- def parse_args() -> TrainConfig:
264
- parser = argparse.ArgumentParser(description="ResNet-50 mixed precision training")
265
- parser.add_argument("--data-root", type=Path, required=True, help="Dataset root path")
266
- parser.add_argument("--epochs", type=int, default=20)
267
- parser.add_argument("--batch-size", type=int, default=64)
268
- parser.add_argument("--num-workers", type=int, default=8)
269
- parser.add_argument("--lr", type=float, default=5e-4)
270
- parser.add_argument("--weight-decay", type=float, default=0.01)
271
- parser.add_argument("--seed", type=int, default=17)
272
- parser.add_argument("--output-dir", type=Path, default=Path("artifacts/checkpoints"))
273
- args = parser.parse_args()
274
-
275
- return TrainConfig(
276
- data_root=args.data_root,
277
- epochs=args.epochs,
278
- batch_size=args.batch_size,
279
- num_workers=args.num_workers,
280
- learning_rate=args.lr,
281
- weight_decay=args.weight_decay,
282
- seed=args.seed,
283
- output_dir=args.output_dir,
284
- )
285
-
286
-
287
- if __name__ == "__main__":
288
- config = parse_args()
289
- train_model(config)
@@ -1,380 +0,0 @@
1
- version: "1.0"
2
-
3
- metadata:
4
- id: automatosx-release
5
- name: AutomatosX Release Workflow
6
- description: |
7
- Complete release orchestration for AutomatosX using Spec-Kit.
8
- Demonstrates "dogfooding" - using AutomatosX to manage its own releases.
9
-
10
- This spec covers the entire release process:
11
- - Pre-flight validation
12
- - Version bumping and synchronization
13
- - CHANGELOG updates
14
- - Building and testing
15
- - Git operations (commit, tag, push)
16
- - GitHub release creation
17
- - CI/CD monitoring
18
-
19
- tags:
20
- - release
21
- - ci-cd
22
- - automation
23
- - dogfooding
24
- author: AutomatosX Team
25
- created: "2025-11-01"
26
-
27
- # Policy: Use most reliable providers for release automation
28
- policy:
29
- goal: reliability
30
- constraints:
31
- latency:
32
- p95: 5000 # 5s max latency
33
- reliability:
34
- minAvailability: 0.99 # 99% availability required
35
- maxErrorRate: 0.01 # 1% max error rate
36
-
37
- # Actors: Specialized agents for each release stage
38
- actors:
39
- - id: validator
40
- agent: quality
41
- description: Validates release readiness (tests, build, git status)
42
- delegation:
43
- maxDepth: 1
44
-
45
- - id: version-manager
46
- agent: backend
47
- description: Handles version bumping and synchronization
48
- delegation:
49
- maxDepth: 1
50
-
51
- - id: changelog-writer
52
- agent: documentation
53
- description: Updates and validates CHANGELOG entries
54
- delegation:
55
- maxDepth: 1
56
-
57
- - id: builder
58
- agent: backend
59
- description: Builds and tests the project
60
- delegation:
61
- maxDepth: 1
62
-
63
- - id: git-operator
64
- agent: devops
65
- description: Handles git operations (commit, tag, push)
66
- delegation:
67
- maxDepth: 1
68
-
69
- - id: release-publisher
70
- agent: devops
71
- description: Creates GitHub releases and monitors CI/CD
72
- delegation:
73
- maxDepth: 2
74
-
75
- # Execution stages
76
- stages:
77
- # Stage 1: Pre-flight validation
78
- - id: preflight
79
- actor: validator
80
- description: "Pre-flight validation checks"
81
- prompt: |
82
- Run comprehensive pre-flight validation checks for AutomatosX release:
83
-
84
- CHECKS REQUIRED:
85
- 1. Git status is clean (no uncommitted changes)
86
- 2. On main branch
87
- 3. All tests pass (npm test)
88
- 4. TypeScript compiles (npm run typecheck)
89
- 5. Build succeeds (npm run build)
90
- 6. No npm audit vulnerabilities (moderate+)
91
- 7. package.json has required fields
92
-
93
- Use the existing tools/check-release.js script to perform validation.
94
-
95
- OUTPUT FORMAT:
96
- - List each check with ✓ (pass) or ✗ (fail)
97
- - If any checks fail, provide detailed error messages
98
- - Recommend fixes for failed checks
99
- - Return READY or NOT_READY status
100
- timeout: 300000 # 5 minutes
101
- saveToMemory: true
102
- dependencies: []
103
-
104
- # Stage 2: Version determination
105
- - id: version-bump
106
- actor: version-manager
107
- description: "Determine and apply version bump"
108
- prompt: |
109
- Determine version bump type and update package.json:
110
-
111
- CURRENT VERSION: ${preflight.currentVersion}
112
-
113
- BUMP TYPE RULES:
114
- - patch: Bug fixes, minor improvements (x.x.X)
115
- - minor: New features, backwards compatible (x.X.0)
116
- - major: Breaking changes (X.0.0)
117
-
118
- TASKS:
119
- 1. Analyze recent commits to suggest bump type
120
- 2. Apply version bump using npm version
121
- 3. Run tools/sync-all-versions.js to update all references
122
- 4. Verify version sync in README.md and CLAUDE.md
123
-
124
- OUTPUT:
125
- - Current version
126
- - New version
127
- - Bump type
128
- - Files updated
129
- timeout: 120000 # 2 minutes
130
- saveToMemory: true
131
- dependencies: [preflight]
132
-
133
- # Stage 3: CHANGELOG update
134
- - id: changelog
135
- actor: changelog-writer
136
- description: "Validate or generate CHANGELOG entry"
137
- prompt: |
138
- Validate CHANGELOG.md has entry for new version:
139
-
140
- NEW VERSION: ${version-bump.newVersion}
141
-
142
- TASKS:
143
- 1. Check if CHANGELOG.md contains ## [${version-bump.newVersion}]
144
- 2. If missing, extract recent changes from git commits
145
- 3. Generate CHANGELOG entry following existing format
146
- 4. Include:
147
- - Features (feat: commits)
148
- - Bug fixes (fix: commits)
149
- - Breaking changes (BREAKING CHANGE)
150
- - Documentation updates (docs: commits)
151
- 5. Add proper date and version header
152
-
153
- CHANGELOG FORMAT:
154
- ```markdown
155
- ## [X.Y.Z] - YYYY-MM-DD
156
-
157
- ### Features
158
- - Description of feature
159
-
160
- ### Bug Fixes
161
- - Description of fix
162
-
163
- ### Documentation
164
- - Description of doc update
165
- ```
166
-
167
- OUTPUT:
168
- - CHANGELOG status (exists/created)
169
- - Entry preview
170
- timeout: 180000 # 3 minutes
171
- saveToMemory: true
172
- dependencies: [version-bump]
173
-
174
- # Stage 4: Build and test
175
- - id: build-test
176
- actor: builder
177
- description: "Build and test with new version"
178
- prompt: |
179
- Build and test the project with new version:
180
-
181
- VERSION: ${version-bump.newVersion}
182
-
183
- TASKS:
184
- 1. Run npm run build
185
- 2. Verify build output in dist/
186
- 3. Run full test suite (npm test)
187
- 4. Verify all tests pass
188
- 5. Check for any warnings or errors
189
-
190
- VALIDATION:
191
- - Build must succeed (exit code 0)
192
- - All tests must pass (exit code 0)
193
- - No TypeScript errors
194
- - No critical warnings
195
-
196
- OUTPUT:
197
- - Build status
198
- - Test results summary
199
- - Any warnings/errors
200
- timeout: 600000 # 10 minutes
201
- saveToMemory: true
202
- dependencies: [changelog]
203
-
204
- # Stage 5: Git commit and tag
205
- - id: git-commit
206
- actor: git-operator
207
- description: "Commit changes and create git tag"
208
- prompt: |
209
- Commit release changes and create git tag:
210
-
211
- VERSION: ${version-bump.newVersion}
212
-
213
- TASKS:
214
- 1. Stage changes:
215
- - package.json
216
- - README.md
217
- - CHANGELOG.md
218
- - CLAUDE.md
219
- 2. Create commit with message:
220
- "chore: Release v${version-bump.newVersion}"
221
- 3. Create annotated git tag: v${version-bump.newVersion}
222
- 4. Verify commit and tag created
223
-
224
- GIT COMMIT MESSAGE FORMAT:
225
- ```
226
- chore: Release v${version-bump.newVersion}
227
-
228
- Auto-generated release commit
229
-
230
- - Updated package.json to v${version-bump.newVersion}
231
- - Updated CHANGELOG.md
232
- - Synced version references
233
- - Verified build and tests passing
234
- ```
235
-
236
- OUTPUT:
237
- - Commit SHA
238
- - Tag name
239
- - Staged files
240
- timeout: 60000 # 1 minute
241
- saveToMemory: true
242
- dependencies: [build-test]
243
-
244
- # Stage 6: Push to GitHub
245
- - id: git-push
246
- actor: git-operator
247
- description: "Push commit and tags to GitHub"
248
- prompt: |
249
- Push release commit and tag to GitHub:
250
-
251
- VERSION: ${version-bump.newVersion}
252
- COMMIT: ${git-commit.commitSHA}
253
-
254
- TASKS:
255
- 1. Push main branch: git push origin main
256
- 2. Push tag: git push origin v${version-bump.newVersion}
257
- 3. Verify push succeeded
258
- 4. Get remote commit SHA for verification
259
-
260
- SAFETY CHECKS:
261
- - Verify we're on main branch
262
- - Verify remote is correct (origin -> github.com/defai-digital/automatosx)
263
- - Confirm push to main branch (interactive confirmation)
264
-
265
- OUTPUT:
266
- - Push status
267
- - Remote commit SHA
268
- - Tag on remote
269
- timeout: 120000 # 2 minutes
270
- saveToMemory: true
271
- dependencies: [git-commit]
272
-
273
- # Stage 7: Create GitHub release
274
- - id: github-release
275
- actor: release-publisher
276
- description: "Create GitHub release with notes"
277
- prompt: |
278
- Create GitHub release using gh CLI:
279
-
280
- VERSION: ${version-bump.newVersion}
281
- TAG: v${version-bump.newVersion}
282
-
283
- TASKS:
284
- 1. Extract release notes from CHANGELOG.md for v${version-bump.newVersion}
285
- 2. Create GitHub release using gh CLI:
286
- gh release create v${version-bump.newVersion} \
287
- --title "v${version-bump.newVersion}" \
288
- --notes <extracted-notes>
289
- 3. Verify release created successfully
290
- 4. Get release URL
291
-
292
- RELEASE NOTES FORMAT:
293
- - Extract section from CHANGELOG.md between version headers
294
- - Include Features, Bug Fixes, Documentation sections
295
- - Format as markdown
296
- - Add installation instructions
297
-
298
- OUTPUT:
299
- - Release URL
300
- - Release status
301
- - Release notes preview
302
- timeout: 180000 # 3 minutes
303
- saveToMemory: true
304
- dependencies: [git-push]
305
-
306
- # Stage 8: Monitor CI/CD
307
- - id: cicd-monitor
308
- actor: release-publisher
309
- description: "Monitor GitHub Actions workflow"
310
- prompt: |
311
- Monitor GitHub Actions workflow for release:
312
-
313
- VERSION: ${version-bump.newVersion}
314
- RELEASE: ${github-release.releaseURL}
315
-
316
- TASKS:
317
- 1. Wait for GitHub Actions workflow to start (10-15 seconds)
318
- 2. Get latest workflow run ID: gh run list --limit 1
319
- 3. Monitor workflow status: gh run view <run-id>
320
- 4. Wait for workflow completion or timeout (15 minutes)
321
- 5. Report final status
322
-
323
- EXPECTED WORKFLOW:
324
- - Build and test
325
- - Publish to npm
326
- - Create npm release
327
-
328
- OUTPUT:
329
- - Workflow status (pending/running/completed/failed)
330
- - Workflow URL
331
- - npm publish status
332
- - Any errors or warnings
333
- timeout: 1200000 # 20 minutes
334
- saveToMemory: true
335
- dependencies: [github-release]
336
-
337
- # Observability
338
- observability:
339
- metrics:
340
- enabled: true
341
- labels:
342
- project: automatosx
343
- workflow: release
344
- type: automation
345
-
346
- audit:
347
- enabled: true
348
- retention: 90 # 90 days
349
-
350
- tracing:
351
- enabled: true
352
- samplingRate: 1.0 # Capture all release executions
353
-
354
- # Retry and error handling
355
- execution:
356
- parallel: false # Sequential execution
357
- continueOnError: false # Stop on first error
358
-
359
- retry:
360
- enabled: true
361
- maxRetries: 2
362
- backoffMs: 5000
363
-
364
- # Expected outputs
365
- outputs:
366
- version:
367
- description: "Released version number"
368
- from: version-bump.newVersion
369
-
370
- releaseURL:
371
- description: "GitHub release URL"
372
- from: github-release.releaseURL
373
-
374
- npmURL:
375
- description: "npm package URL"
376
- value: "https://www.npmjs.com/package/@defai.digital/automatosx"
377
-
378
- status:
379
- description: "Overall release status"
380
- from: cicd-monitor.workflowStatus