myaidev-method 0.2.4 โ†’ 0.2.6

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 (55) hide show
  1. package/USER_GUIDE.md +389 -8
  2. package/bin/cli.js +165 -30
  3. package/package.json +1 -1
  4. package/src/lib/ascii-banner.js +100 -0
  5. package/src/templates/claude/commands/myai-deploy-dev.md +500 -0
  6. package/src/templates/claude/commands/myai-deploy-prod.md +837 -0
  7. package/src/templates/claude/commands/myai-deploy-staging.md +331 -0
  8. package/src/templates/claude/commands/myai-git-hotfix.md +957 -0
  9. package/src/templates/claude/commands/myai-git-pr.md +200 -0
  10. package/src/templates/claude/commands/myai-git-release.md +806 -0
  11. package/src/templates/claude/commands/myai-git-sync.md +796 -0
  12. package/src/templates/codex/commands/myai-astro-publish.md +51 -0
  13. package/src/templates/codex/commands/myai-configure.md +185 -0
  14. package/src/templates/codex/commands/myai-content-writer.md +73 -0
  15. package/src/templates/codex/commands/myai-coolify-deploy.md +159 -0
  16. package/src/templates/codex/commands/myai-deploy-dev.md +379 -0
  17. package/src/templates/codex/commands/myai-deploy-prod.md +431 -0
  18. package/src/templates/codex/commands/myai-deploy-staging.md +275 -0
  19. package/src/templates/codex/commands/myai-dev-architect.md +69 -0
  20. package/src/templates/codex/commands/myai-dev-code.md +82 -0
  21. package/src/templates/codex/commands/myai-dev-docs.md +83 -0
  22. package/src/templates/codex/commands/myai-dev-review.md +85 -0
  23. package/src/templates/codex/commands/myai-dev-test.md +84 -0
  24. package/src/templates/codex/commands/myai-docusaurus-publish.md +42 -0
  25. package/src/templates/codex/commands/myai-git-hotfix.md +512 -0
  26. package/src/templates/codex/commands/myai-git-pr.md +196 -0
  27. package/src/templates/codex/commands/myai-git-release.md +516 -0
  28. package/src/templates/codex/commands/myai-git-sync.md +517 -0
  29. package/src/templates/codex/commands/myai-mintlify-publish.md +42 -0
  30. package/src/templates/codex/commands/myai-payloadcms-publish.md +42 -0
  31. package/src/templates/codex/commands/myai-sparc-workflow.md +185 -0
  32. package/src/templates/codex/commands/myai-wordpress-admin.md +143 -0
  33. package/src/templates/codex/commands/myai-wordpress-publish.md +66 -0
  34. package/src/templates/gemini/commands/myai-astro-publish.toml +76 -0
  35. package/src/templates/gemini/commands/myai-configure.toml +188 -0
  36. package/src/templates/gemini/commands/myai-content-writer.toml +76 -0
  37. package/src/templates/gemini/commands/myai-coolify-deploy.toml +138 -0
  38. package/src/templates/gemini/commands/myai-deploy-dev.toml +379 -0
  39. package/src/templates/gemini/commands/myai-deploy-prod.toml +438 -0
  40. package/src/templates/gemini/commands/myai-deploy-staging.toml +275 -0
  41. package/src/templates/gemini/commands/myai-dev-architect.toml +64 -0
  42. package/src/templates/gemini/commands/myai-dev-code.toml +75 -0
  43. package/src/templates/gemini/commands/myai-dev-docs.toml +76 -0
  44. package/src/templates/gemini/commands/myai-dev-review.toml +78 -0
  45. package/src/templates/gemini/commands/myai-dev-test.toml +77 -0
  46. package/src/templates/gemini/commands/myai-docusaurus-publish.toml +63 -0
  47. package/src/templates/gemini/commands/myai-git-hotfix.toml +953 -0
  48. package/src/templates/gemini/commands/myai-git-pr.toml +196 -0
  49. package/src/templates/gemini/commands/myai-git-release.toml +802 -0
  50. package/src/templates/gemini/commands/myai-git-sync.toml +792 -0
  51. package/src/templates/gemini/commands/myai-mintlify-publish.toml +67 -0
  52. package/src/templates/gemini/commands/myai-payloadcms-publish.toml +59 -0
  53. package/src/templates/gemini/commands/myai-sparc-workflow.toml +47 -0
  54. package/src/templates/gemini/commands/myai-wordpress-admin.toml +143 -0
  55. package/src/templates/gemini/commands/myai-wordpress-publish.toml +77 -0
@@ -0,0 +1,802 @@
1
+ prompt = """
2
+
3
+ Task: Create release - {{args}}
4
+
5
+ ## Release Management Workflow
6
+
7
+ ### 1. Pre-Release Validation
8
+
9
+ ```bash
10
+ echo \"๐Ÿ” Validating release prerequisites...\"
11
+
12
+ # Ensure on correct branch
13
+ current_branch=$(git branch --show-current)
14
+ if [[ \"$current_branch\" != \"main\" && \"$current_branch\" != \"master\" ]]; then
15
+ echo \"โš ๏ธ Not on main/master branch\"
16
+ read -p \"Continue from $current_branch? (yes/no): \" confirm
17
+ if [ \"$confirm\" != \"yes\" ]; then
18
+ exit 1
19
+ fi
20
+ fi
21
+
22
+ # Check for uncommitted changes
23
+ if ! git diff-index --quiet HEAD --; then
24
+ echo \"โŒ Uncommitted changes detected\"
25
+ git status
26
+ exit 1
27
+ fi
28
+
29
+ # Ensure branch is up to date
30
+ git fetch origin
31
+ if [ \"$(git rev-parse HEAD)\" != \"$(git rev-parse @{u})\" ]; then
32
+ echo \"โŒ Branch not in sync with remote\"
33
+ echo \"Run: git pull origin $current_branch\"
34
+ exit 1
35
+ fi
36
+
37
+ # Check if tests pass
38
+ echo \"๐Ÿงช Running tests before release...\"
39
+ npm test || {
40
+ echo \"โŒ Tests must pass before release\"
41
+ exit 1
42
+ }
43
+
44
+ echo \"โœ… Pre-release validation passed\"
45
+ ```
46
+
47
+ ### 2. Determine Version Bump
48
+
49
+ ```bash
50
+ determine_version_bump() {
51
+ echo \"๐Ÿ“Š Analyzing commits for version bump...\"
52
+
53
+ # Get current version
54
+ if [ -f \"package.json\" ]; then
55
+ current_version=$(jq -r '.version' package.json)
56
+ elif [ -f \"version.txt\" ]; then
57
+ current_version=$(cat version.txt)
58
+ else
59
+ current_version=\"0.0.0\"
60
+ fi
61
+
62
+ echo \"Current version: $current_version\"
63
+
64
+ # Get latest tag
65
+ latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo \"v0.0.0\")
66
+ echo \"Latest tag: $latest_tag\"
67
+
68
+ # Analyze commits since last tag
69
+ commits=$(git log $latest_tag..HEAD --oneline 2>/dev/null || git log --oneline)
70
+
71
+ # Determine bump type based on conventional commits
72
+ has_breaking=false
73
+ has_feature=false
74
+ has_fix=false
75
+
76
+ while IFS= read -r commit; do
77
+ commit_msg=$(echo \"$commit\" | cut -d' ' -f2-)
78
+
79
+ # Check for breaking changes
80
+ if echo \"$commit_msg\" | grep -qE \"^(BREAKING|breaking|BREAKING CHANGE|breaking change|!)\"; then
81
+ has_breaking=true
82
+ fi
83
+
84
+ # Check for features
85
+ if echo \"$commit_msg\" | grep -qE \"^(feat|feature|add|new):\"; then
86
+ has_feature=true
87
+ fi
88
+
89
+ # Check for fixes
90
+ if echo \"$commit_msg\" | grep -qE \"^(fix|bugfix|patch):\"; then
91
+ has_fix=true
92
+ fi
93
+ done <<< \"$commits\"
94
+
95
+ # Determine bump type
96
+ if [ \"$has_breaking\" = true ]; then
97
+ bump_type=\"major\"
98
+ elif [ \"$has_feature\" = true ]; then
99
+ bump_type=\"minor\"
100
+ elif [ \"$has_fix\" = true ]; then
101
+ bump_type=\"patch\"
102
+ else
103
+ bump_type=\"patch\"
104
+ fi
105
+
106
+ echo \"Recommended bump: $bump_type\"
107
+
108
+ # Calculate new version
109
+ IFS='.' read -r major minor patch <<< \"${current_version#v}\"
110
+
111
+ case $bump_type in
112
+ major)
113
+ major=$((major + 1))
114
+ minor=0
115
+ patch=0
116
+ ;;
117
+ minor)
118
+ minor=$((minor + 1))
119
+ patch=0
120
+ ;;
121
+ patch)
122
+ patch=$((patch + 1))
123
+ ;;
124
+ esac
125
+
126
+ new_version=\"$major.$minor.$patch\"
127
+ echo \"New version: $new_version\"
128
+
129
+ # Confirm version
130
+ read -p \"Accept version $new_version? (yes/no/custom): \" choice
131
+
132
+ case $choice in
133
+ yes)
134
+ echo \"$new_version\"
135
+ ;;
136
+ custom)
137
+ read -p \"Enter custom version: \" custom_version
138
+ echo \"$custom_version\"
139
+ ;;
140
+ *)
141
+ echo \"Release cancelled\"
142
+ exit 1
143
+ ;;
144
+ esac
145
+ }
146
+
147
+ # Get new version
148
+ new_version=$(determine_version_bump)
149
+ echo \"Releasing version: $new_version\"
150
+ ```
151
+
152
+ ### 3. Generate Changelog
153
+
154
+ ```bash
155
+ generate_changelog() {
156
+ local version=$1
157
+ local previous_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo \"\")
158
+
159
+ echo \"๐Ÿ“ Generating changelog for v$version...\"
160
+
161
+ # Create changelog file
162
+ changelog_file=\"CHANGELOG-v$version.md\"
163
+
164
+ cat > \"$changelog_file\" << EOF
165
+ # Release v$version
166
+
167
+ **Release Date:** $(date +%Y-%m-%d)
168
+
169
+ ## Changes
170
+
171
+ EOF
172
+
173
+ # Get commits since last tag
174
+ if [ -n \"$previous_tag\" ]; then
175
+ commits=$(git log $previous_tag..HEAD --pretty=format:\"%s|%an|%h\" 2>/dev/null)
176
+ else
177
+ commits=$(git log --pretty=format:\"%s|%an|%h\")
178
+ fi
179
+
180
+ # Categorize commits
181
+ declare -A categories
182
+ categories=(
183
+ [\"๐Ÿ’ฅ Breaking Changes\"]=\"\"
184
+ [\"โœจ Features\"]=\"\"
185
+ [\"๐Ÿ› Bug Fixes\"]=\"\"
186
+ [\"๐Ÿ“š Documentation\"]=\"\"
187
+ [\"๐Ÿ”ง Maintenance\"]=\"\"
188
+ [\"โšก Performance\"]=\"\"
189
+ [\"๐ŸŽจ Style\"]=\"\"
190
+ [\"โ™ป๏ธ Refactor\"]=\"\"
191
+ [\"๐Ÿงช Tests\"]=\"\"
192
+ [\"Other\"]=\"\"
193
+ )
194
+
195
+ while IFS='|' read -r message author hash; do
196
+ # Categorize based on conventional commit format
197
+ case \"$message\" in
198
+ BREAKING*|breaking*|*!:*)
199
+ categories[\"๐Ÿ’ฅ Breaking Changes\"]+=\"- $message ([$hash](commit/$hash)) - $author\\n\"
200
+ ;;
201
+ feat*|feature*|add*|new*)
202
+ categories[\"โœจ Features\"]+=\"- $message ([$hash](commit/$hash)) - $author\\n\"
203
+ ;;
204
+ fix*|bugfix*|patch*)
205
+ categories[\"๐Ÿ› Bug Fixes\"]+=\"- $message ([$hash](commit/$hash)) - $author\\n\"
206
+ ;;
207
+ docs*|doc*)
208
+ categories[\"๐Ÿ“š Documentation\"]+=\"- $message ([$hash](commit/$hash)) - $author\\n\"
209
+ ;;
210
+ chore*|deps*|build*)
211
+ categories[\"๐Ÿ”ง Maintenance\"]+=\"- $message ([$hash](commit/$hash)) - $author\\n\"
212
+ ;;
213
+ perf*|performance*)
214
+ categories[\"โšก Performance\"]+=\"- $message ([$hash](commit/$hash)) - $author\\n\"
215
+ ;;
216
+ style*|format*)
217
+ categories[\"๐ŸŽจ Style\"]+=\"- $message ([$hash](commit/$hash)) - $author\\n\"
218
+ ;;
219
+ refactor*)
220
+ categories[\"โ™ป๏ธ Refactor\"]+=\"- $message ([$hash](commit/$hash)) - $author\\n\"
221
+ ;;
222
+ test*)
223
+ categories[\"๐Ÿงช Tests\"]+=\"- $message ([$hash](commit/$hash)) - $author\\n\"
224
+ ;;
225
+ *)
226
+ categories[\"Other\"]+=\"- $message ([$hash](commit/$hash)) - $author\\n\"
227
+ ;;
228
+ esac
229
+ done <<< \"$commits\"
230
+
231
+ # Write categories to changelog
232
+ for category in \"${!categories[@]}\"; do
233
+ if [ -n \"${categories[$category]}\" ]; then
234
+ echo -e \"\\n### $category\\n\" >> \"$changelog_file\"
235
+ echo -e \"${categories[$category]}\" >> \"$changelog_file\"
236
+ fi
237
+ done
238
+
239
+ # Add contributors
240
+ echo -e \"\\n## Contributors\\n\" >> \"$changelog_file\"
241
+ git log $previous_tag..HEAD --format='%aN' 2>/dev/null | sort -u | while read author; do
242
+ echo \"- $author\" >> \"$changelog_file\"
243
+ done
244
+
245
+ # Add statistics
246
+ echo -e \"\\n## Statistics\\n\" >> \"$changelog_file\"
247
+ commit_count=$(git rev-list $previous_tag..HEAD --count 2>/dev/null || git rev-list --count HEAD)
248
+ files_changed=$(git diff --stat $previous_tag..HEAD 2>/dev/null | tail -1 || echo \"N/A\")
249
+
250
+ echo \"- **Commits:** $commit_count\" >> \"$changelog_file\"
251
+ echo \"- **Files Changed:** $files_changed\" >> \"$changelog_file\"
252
+
253
+ echo \"โœ… Changelog generated: $changelog_file\"
254
+ echo \"$changelog_file\"
255
+ }
256
+
257
+ # Generate changelog
258
+ changelog_file=$(generate_changelog \"$new_version\")
259
+
260
+ # Show changelog for review
261
+ echo \"\"
262
+ echo \"โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\"
263
+ cat \"$changelog_file\"
264
+ echo \"โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•\"
265
+ echo \"\"
266
+
267
+ read -p \"Accept changelog? (yes/edit/cancel): \" changelog_choice
268
+
269
+ case $changelog_choice in
270
+ edit)
271
+ ${EDITOR:-nano} \"$changelog_file\"
272
+ ;;
273
+ cancel)
274
+ echo \"Release cancelled\"
275
+ rm \"$changelog_file\"
276
+ exit 1
277
+ ;;
278
+ esac
279
+ ```
280
+
281
+ ### 4. Update Version in Files
282
+
283
+ ```bash
284
+ update_version_files() {
285
+ local version=$1
286
+
287
+ echo \"๐Ÿ“ Updating version in project files...\"
288
+
289
+ # Update package.json
290
+ if [ -f \"package.json\" ]; then
291
+ echo \"Updating package.json...\"
292
+ jq \".version = \\\"$version\\\"\" package.json > package.json.tmp
293
+ mv package.json.tmp package.json
294
+ echo \"โœ… package.json updated\"
295
+ fi
296
+
297
+ # Update package-lock.json
298
+ if [ -f \"package-lock.json\" ]; then
299
+ echo \"Updating package-lock.json...\"
300
+ jq \".version = \\\"$version\\\"\" package-lock.json > package-lock.json.tmp
301
+ mv package-lock.json.tmp package-lock.json
302
+ echo \"โœ… package-lock.json updated\"
303
+ fi
304
+
305
+ # Update version.txt if exists
306
+ if [ -f \"version.txt\" ]; then
307
+ echo \"$version\" > version.txt
308
+ echo \"โœ… version.txt updated\"
309
+ fi
310
+
311
+ # Update Cargo.toml if Rust project
312
+ if [ -f \"Cargo.toml\" ]; then
313
+ sed -i \"s/^version = .*/version = \\\"$version\\\"/\" Cargo.toml
314
+ echo \"โœ… Cargo.toml updated\"
315
+ fi
316
+
317
+ # Update pyproject.toml if Python project
318
+ if [ -f \"pyproject.toml\" ]; then
319
+ sed -i \"s/^version = .*/version = \\\"$version\\\"/\" pyproject.toml
320
+ echo \"โœ… pyproject.toml updated\"
321
+ fi
322
+
323
+ # Update setup.py if Python project
324
+ if [ -f \"setup.py\" ]; then
325
+ sed -i \"s/version=['\\\"].*['\\\"]/version='$version'/\" setup.py
326
+ echo \"โœ… setup.py updated\"
327
+ fi
328
+
329
+ # Stage all version changes
330
+ git add -A
331
+
332
+ echo \"โœ… Version files updated\"
333
+ }
334
+
335
+ # Update version
336
+ update_version_files \"$new_version\"
337
+ ```
338
+
339
+ ### 5. Commit and Tag Release
340
+
341
+ ```bash
342
+ create_release_commit() {
343
+ local version=$1
344
+ local changelog_file=$2
345
+
346
+ echo \"๐Ÿท๏ธ Creating release commit and tag...\"
347
+
348
+ # Create release commit
349
+ git commit -m \"chore(release): v$version
350
+
351
+ $(cat $changelog_file)
352
+
353
+ ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code)
354
+
355
+ Co-Authored-By: Claude <noreply@anthropic.com>\"
356
+
357
+ # Create annotated tag
358
+ git tag -a \"v$version\" -m \"Release v$version
359
+
360
+ $(head -20 $changelog_file)
361
+
362
+ Full changelog: See CHANGELOG.md\"
363
+
364
+ echo \"โœ… Release commit and tag created\"
365
+ }
366
+
367
+ # Create commit and tag
368
+ create_release_commit \"$new_version\" \"$changelog_file\"
369
+ ```
370
+
371
+ ### 6. Update CHANGELOG.md
372
+
373
+ ```bash
374
+ update_main_changelog() {
375
+ local version=$1
376
+ local changelog_file=$2
377
+
378
+ echo \"๐Ÿ“ Updating CHANGELOG.md...\"
379
+
380
+ # Create CHANGELOG.md if it doesn't exist
381
+ if [ ! -f \"CHANGELOG.md\" ]; then
382
+ cat > CHANGELOG.md << EOF
383
+ # Changelog
384
+
385
+ All notable changes to this project will be documented in this file.
386
+
387
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
388
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
389
+
390
+ EOF
391
+ fi
392
+
393
+ # Insert new version at the top (after header)
394
+ temp_file=$(mktemp)
395
+
396
+ # Read header
397
+ sed '/^## /q' CHANGELOG.md > \"$temp_file\"
398
+
399
+ # Add new version
400
+ echo \"\" >> \"$temp_file\"
401
+ cat \"$changelog_file\" >> \"$temp_file\"
402
+ echo \"\" >> \"$temp_file\"
403
+
404
+ # Add rest of changelog
405
+ sed -n '/^## /,$p' CHANGELOG.md >> \"$temp_file\"
406
+
407
+ # Replace old changelog
408
+ mv \"$temp_file\" CHANGELOG.md
409
+
410
+ # Stage changelog
411
+ git add CHANGELOG.md
412
+
413
+ # Amend the release commit to include updated CHANGELOG
414
+ git commit --amend --no-edit
415
+
416
+ # Update the tag
417
+ git tag -d \"v$version\"
418
+ git tag -a \"v$version\" -m \"Release v$version
419
+
420
+ $(head -20 $changelog_file)
421
+
422
+ Full changelog: See CHANGELOG.md\"
423
+
424
+ # Clean up temporary changelog
425
+ rm \"$changelog_file\"
426
+
427
+ echo \"โœ… CHANGELOG.md updated\"
428
+ }
429
+
430
+ # Update main changelog
431
+ update_main_changelog \"$new_version\" \"$changelog_file\"
432
+ ```
433
+
434
+ ### 7. Push Release
435
+
436
+ ```bash
437
+ push_release() {
438
+ local version=$1
439
+
440
+ echo \"๐Ÿš€ Pushing release to remote...\"
441
+
442
+ read -p \"Push release v$version to origin? (yes/no): \" push_confirm
443
+
444
+ if [ \"$push_confirm\" != \"yes\" ]; then
445
+ echo \"โš ๏ธ Release created locally but not pushed\"
446
+ echo \"To push later: git push origin $current_branch && git push origin v$version\"
447
+ return
448
+ fi
449
+
450
+ # Push commit
451
+ git push origin \"$current_branch\" || {
452
+ echo \"โŒ Failed to push commit\"
453
+ exit 1
454
+ }
455
+
456
+ # Push tag
457
+ git push origin \"v$version\" || {
458
+ echo \"โŒ Failed to push tag\"
459
+ exit 1
460
+ }
461
+
462
+ echo \"โœ… Release pushed to origin\"
463
+ }
464
+
465
+ # Push release
466
+ push_release \"$new_version\"
467
+ ```
468
+
469
+ ### 8. Create GitHub Release
470
+
471
+ ```bash
472
+ create_github_release() {
473
+ local version=$1
474
+
475
+ echo \"๐Ÿ“ฆ Creating GitHub release...\"
476
+
477
+ # Check if gh CLI is installed
478
+ if ! command -v gh &> /dev/null; then
479
+ echo \"โš ๏ธ GitHub CLI not installed. Install with: brew install gh\"
480
+ echo \"Manual release creation: https://github.com/$(git config remote.origin.url | sed 's/.*://;s/.git$//')/releases/new\"
481
+ return
482
+ fi
483
+
484
+ # Check if authenticated
485
+ if ! gh auth status &> /dev/null; then
486
+ echo \"๐Ÿ” Authenticating with GitHub...\"
487
+ gh auth login
488
+ fi
489
+
490
+ # Extract changelog content for this version
491
+ changelog_content=$(sed -n '/^# Release/,/^# Release/p' CHANGELOG.md | head -n -1)
492
+
493
+ # Create release
494
+ echo \"Creating GitHub release...\"
495
+
496
+ gh release create \"v$version\" \\
497
+ --title \"Release v$version\" \\
498
+ --notes \"$changelog_content\" \\
499
+ || {
500
+ echo \"โŒ Failed to create GitHub release\"
501
+ exit 1
502
+ }
503
+
504
+ echo \"โœ… GitHub release created\"
505
+ echo \"๐ŸŒ View at: https://github.com/$(git remote get-url origin | sed 's/.*://;s/.git$//')/releases/tag/v$version\"
506
+ }
507
+
508
+ # Create GitHub release if available
509
+ create_github_release \"$new_version\"
510
+ ```
511
+
512
+ ### 9. Upload Release Assets
513
+
514
+ ```bash
515
+ upload_release_assets() {
516
+ local version=$1
517
+
518
+ echo \"๐Ÿ“Ž Uploading release assets...\"
519
+
520
+ # Build release artifacts
521
+ if [ -f \"package.json\" ] && grep -q \"\\\"build\\\"\" package.json; then
522
+ echo \"Building release artifacts...\"
523
+ npm run build || echo \"โš ๏ธ Build failed\"
524
+
525
+ # Create distribution archive
526
+ if [ -d \"dist\" ]; then
527
+ echo \"Creating distribution archive...\"
528
+ tar -czf \"dist-v$version.tar.gz\" dist/
529
+ asset_files+=(\"dist-v$version.tar.gz\")
530
+ fi
531
+ fi
532
+
533
+ # Upload checksums
534
+ if [ ${#asset_files[@]} -gt 0 ]; then
535
+ echo \"Generating checksums...\"
536
+ sha256sum \"${asset_files[@]}\" > \"checksums-v$version.txt\"
537
+ asset_files+=(\"checksums-v$version.txt\")
538
+ fi
539
+
540
+ # Upload to GitHub release
541
+ if command -v gh &> /dev/null; then
542
+ for asset in \"${asset_files[@]}\"; do
543
+ echo \"Uploading $asset...\"
544
+ gh release upload \"v$version\" \"$asset\" || echo \"โš ๏ธ Failed to upload $asset\"
545
+ done
546
+
547
+ echo \"โœ… Assets uploaded\"
548
+ else
549
+ echo \"โš ๏ธ GitHub CLI not available, upload assets manually\"
550
+ echo \"Assets: ${asset_files[*]}\"
551
+ fi
552
+
553
+ # Clean up
554
+ rm -f \"${asset_files[@]}\"
555
+ }
556
+
557
+ # Upload assets
558
+ declare -a asset_files=()
559
+ upload_release_assets \"$new_version\"
560
+ ```
561
+
562
+ ### 10. Publish to NPM (Optional)
563
+
564
+ ```bash
565
+ publish_to_npm() {
566
+ local version=$1
567
+
568
+ if [ ! -f \"package.json\" ]; then
569
+ return
570
+ fi
571
+
572
+ echo \"๐Ÿ“ฆ NPM Publishing...\"
573
+
574
+ read -p \"Publish v$version to NPM? (yes/no): \" npm_confirm
575
+
576
+ if [ \"$npm_confirm\" != \"yes\" ]; then
577
+ echo \"โš ๏ธ Skipping NPM publish\"
578
+ return
579
+ fi
580
+
581
+ # Check if logged in
582
+ if ! npm whoami &> /dev/null; then
583
+ echo \"๐Ÿ” Logging into NPM...\"
584
+ npm login
585
+ fi
586
+
587
+ # Run pre-publish checks
588
+ echo \"Running pre-publish checks...\"
589
+ npm run prepublishOnly || echo \"โš ๏ธ Pre-publish hook failed\"
590
+
591
+ # Publish
592
+ echo \"Publishing to NPM...\"
593
+ npm publish --access public || {
594
+ echo \"โŒ NPM publish failed\"
595
+ return 1
596
+ }
597
+
598
+ echo \"โœ… Published to NPM\"
599
+ echo \"๐ŸŒ View at: https://www.npmjs.com/package/$(jq -r '.name' package.json)\"
600
+ }
601
+
602
+ # Publish to NPM
603
+ publish_to_npm \"$new_version\"
604
+ ```
605
+
606
+ ### 11. Post-Release Actions
607
+
608
+ ```bash
609
+ post_release_actions() {
610
+ local version=$1
611
+
612
+ echo \"๐ŸŽ‰ Post-release actions...\"
613
+
614
+ # Trigger release deployment
615
+ if [ -f \".github/workflows/release.yml\" ]; then
616
+ echo \"๐Ÿ“ข GitHub Actions will handle deployment\"
617
+ fi
618
+
619
+ # Create next development version
620
+ read -p \"Create next dev version? (yes/no): \" dev_version
621
+
622
+ if [ \"$dev_version\" == \"yes\" ]; then
623
+ IFS='.' read -r major minor patch <<< \"$version\"
624
+ next_patch=$((patch + 1))
625
+ dev_version=\"$major.$minor.$next_patch-dev\"
626
+
627
+ # Update version files
628
+ if [ -f \"package.json\" ]; then
629
+ jq \".version = \\\"$dev_version\\\"\" package.json > package.json.tmp
630
+ mv package.json.tmp package.json
631
+ fi
632
+
633
+ git add -A
634
+ git commit -m \"chore: bump to v$dev_version\"
635
+ git push origin \"$current_branch\"
636
+
637
+ echo \"โœ… Development version set to v$dev_version\"
638
+ fi
639
+
640
+ # Notify team
641
+ send_release_notification \"$version\"
642
+
643
+ echo \"โœ… Post-release actions complete\"
644
+ }
645
+
646
+ # Post-release actions
647
+ post_release_actions \"$new_version\"
648
+ ```
649
+
650
+ ### 12. Release Notification
651
+
652
+ ```bash
653
+ send_release_notification() {
654
+ local version=$1
655
+ local repo_url=$(git config remote.origin.url | sed 's/git@github.com:/https:\\/\\/github.com\\//' | sed 's/.git$//')
656
+ local release_url=\"$repo_url/releases/tag/v$version\"
657
+ local changelog=$(sed -n '/^# Release/,/^# Release/p' CHANGELOG.md | head -n -1)
658
+
659
+ # Slack notification
660
+ if [ -n \"$SLACK_WEBHOOK_URL\" ]; then
661
+ curl -X POST \"$SLACK_WEBHOOK_URL\" \\
662
+ -H 'Content-Type: application/json' \\
663
+ -d \"{
664
+ \\\"text\\\": \\\"๐ŸŽ‰ New Release: v$version\\\",
665
+ \\\"blocks\\\": [
666
+ {
667
+ \\\"type\\\": \\\"header\\\",
668
+ \\\"text\\\": {
669
+ \\\"type\\\": \\\"plain_text\\\",
670
+ \\\"text\\\": \\\"๐ŸŽ‰ New Release: v$version\\\"
671
+ }
672
+ },
673
+ {
674
+ \\\"type\\\": \\\"section\\\",
675
+ \\\"text\\\": {
676
+ \\\"type\\\": \\\"mrkdwn\\\",
677
+ \\\"text\\\": \\\"$changelog\\\"
678
+ }
679
+ },
680
+ {
681
+ \\\"type\\\": \\\"actions\\\",
682
+ \\\"elements\\\": [
683
+ {
684
+ \\\"type\\\": \\\"button\\\",
685
+ \\\"text\\\": {\\\"type\\\": \\\"plain_text\\\", \\\"text\\\": \\\"View Release\\\"},
686
+ \\\"url\\\": \\\"$release_url\\\"
687
+ }
688
+ ]
689
+ }
690
+ ]
691
+ }\"
692
+ fi
693
+
694
+ # Discord notification
695
+ if [ -n \"$DISCORD_WEBHOOK_URL\" ]; then
696
+ curl -X POST \"$DISCORD_WEBHOOK_URL\" \\
697
+ -H 'Content-Type: application/json' \\
698
+ -d \"{
699
+ \\\"content\\\": \\\"๐ŸŽ‰ **New Release: v$version**\\\",
700
+ \\\"embeds\\\": [{
701
+ \\\"title\\\": \\\"Release v$version\\\",
702
+ \\\"url\\\": \\\"$release_url\\\",
703
+ \\\"description\\\": \\\"$(echo \"$changelog\" | head -500)\\\",
704
+ \\\"color\\\": 5763719,
705
+ \\\"timestamp\\\": \\\"$(date -u +%Y-%m-%dT%H:%M:%SZ)\\\"
706
+ }]
707
+ }\"
708
+ fi
709
+
710
+ echo \"โœ… Release notification sent\"
711
+ }
712
+ ```
713
+
714
+ ## Complete Release Script
715
+
716
+ ```bash
717
+ #!/bin/bash
718
+ set -e
719
+
720
+ echo \"๐ŸŽ‰ Starting release process...\"
721
+
722
+ # 1. Validate
723
+ git diff-index --quiet HEAD -- || { echo \"โŒ Uncommitted changes\"; exit 1; }
724
+ npm test || { echo \"โŒ Tests failed\"; exit 1; }
725
+
726
+ # 2. Determine version
727
+ new_version=$(determine_version_bump)
728
+
729
+ # 3. Generate changelog
730
+ changelog_file=$(generate_changelog \"$new_version\")
731
+
732
+ # 4. Update files
733
+ update_version_files \"$new_version\"
734
+
735
+ # 5. Commit and tag
736
+ create_release_commit \"$new_version\" \"$changelog_file\"
737
+ update_main_changelog \"$new_version\" \"$changelog_file\"
738
+
739
+ # 6. Push
740
+ push_release \"$new_version\"
741
+
742
+ # 7. Create GitHub release
743
+ create_github_release \"$new_version\"
744
+
745
+ # 8. Upload assets
746
+ upload_release_assets \"$new_version\"
747
+
748
+ # 9. Publish to NPM
749
+ publish_to_npm \"$new_version\"
750
+
751
+ # 10. Post-release
752
+ post_release_actions \"$new_version\"
753
+
754
+ echo \"โœ… Release v$new_version complete!\"
755
+ echo \"๐ŸŒ Release: https://github.com/$(git remote get-url origin | sed 's/.*://;s/.git$//')/releases/tag/v$new_version\"
756
+ ```
757
+
758
+ ## Quick Release Commands
759
+
760
+ **Patch release (bug fixes):**
761
+ ```bash
762
+ npm run release:patch
763
+ # or
764
+ /myai-git-release --patch
765
+ ```
766
+
767
+ **Minor release (new features):**
768
+ ```bash
769
+ npm run release:minor
770
+ # or
771
+ /myai-git-release --minor
772
+ ```
773
+
774
+ **Major release (breaking changes):**
775
+ ```bash
776
+ npm run release:major
777
+ # or
778
+ /myai-git-release --major
779
+ ```
780
+
781
+ ## Environment Configuration
782
+
783
+ ```bash
784
+ # GitHub (for releases)
785
+ GH_TOKEN=your_github_token
786
+
787
+ # NPM (for publishing)
788
+ NPM_TOKEN=your_npm_token
789
+
790
+ # Notifications
791
+ SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK
792
+ DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/YOUR/WEBHOOK
793
+
794
+ # Release settings
795
+ AUTO_PUBLISH_NPM=false
796
+ CREATE_DEV_VERSION=true
797
+ UPLOAD_ASSETS=true
798
+ ```
799
+
800
+ Execute the release workflow with semantic versioning and complete automation.
801
+
802
+ """