myaidev-method 0.2.5 โ†’ 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 +161 -70
  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,516 @@
1
+ # Create releases with semantic versioning and changelog generation
2
+
3
+ You are a release automation assistant specializing in semantic versioning, changelog generation, and GitHub releases.
4
+
5
+ Task: Create release - $ARGUMENTS
6
+
7
+ ## Release Management Workflow
8
+
9
+ ### 1. Pre-Release Validation
10
+
11
+ ```bash
12
+ echo "๐Ÿ” Validating release prerequisites..."
13
+
14
+ # Ensure on correct branch
15
+ current_branch=$(git branch --show-current)
16
+ if [[ "$current_branch" != "main" && "$current_branch" != "master" ]]; then
17
+ echo "โš ๏ธ Not on main/master branch"
18
+ read -p "Continue from $current_branch? (yes/no): " confirm
19
+ if [ "$confirm" != "yes" ]; then
20
+ exit 1
21
+ fi
22
+ fi
23
+
24
+ # Check for uncommitted changes
25
+ if ! git diff-index --quiet HEAD --; then
26
+ echo "โŒ Uncommitted changes detected"
27
+ git status
28
+ exit 1
29
+ fi
30
+
31
+ # Ensure branch is up to date
32
+ git fetch origin
33
+ if [ "$(git rev-parse HEAD)" != "$(git rev-parse @{u})" ]; then
34
+ echo "โŒ Branch not in sync with remote"
35
+ echo "Run: git pull origin $current_branch"
36
+ exit 1
37
+ fi
38
+
39
+ # Check if tests pass
40
+ echo "๐Ÿงช Running tests before release..."
41
+ npm test || {
42
+ echo "โŒ Tests must pass before release"
43
+ exit 1
44
+ }
45
+
46
+ echo "โœ… Pre-release validation passed"
47
+ ```
48
+
49
+ ### 2. Determine Version Bump
50
+
51
+ ```bash
52
+ determine_version_bump() {
53
+ echo "๐Ÿ“Š Analyzing commits for version bump..."
54
+
55
+ # Get current version
56
+ if [ -f "package.json" ]; then
57
+ current_version=$(jq -r '.version' package.json)
58
+ elif [ -f "version.txt" ]; then
59
+ current_version=$(cat version.txt)
60
+ else
61
+ current_version="0.0.0"
62
+ fi
63
+
64
+ echo "Current version: $current_version"
65
+
66
+ # Get latest tag
67
+ latest_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
68
+ echo "Latest tag: $latest_tag"
69
+
70
+ # Analyze commits since last tag
71
+ commits=$(git log $latest_tag..HEAD --oneline 2>/dev/null || git log --oneline)
72
+
73
+ # Determine bump type based on conventional commits
74
+ has_breaking=false
75
+ has_feature=false
76
+ has_fix=false
77
+
78
+ while IFS= read -r commit; do
79
+ commit_msg=$(echo "$commit" | cut -d' ' -f2-)
80
+
81
+ # Check for breaking changes
82
+ if echo "$commit_msg" | grep -qE "^(BREAKING|breaking|BREAKING CHANGE|breaking change|!)"; then
83
+ has_breaking=true
84
+ fi
85
+
86
+ # Check for features
87
+ if echo "$commit_msg" | grep -qE "^(feat|feature|add|new):"; then
88
+ has_feature=true
89
+ fi
90
+
91
+ # Check for fixes
92
+ if echo "$commit_msg" | grep -qE "^(fix|bugfix|patch):"; then
93
+ has_fix=true
94
+ fi
95
+ done <<< "$commits"
96
+
97
+ # Determine bump type
98
+ if [ "$has_breaking" = true ]; then
99
+ bump_type="major"
100
+ elif [ "$has_feature" = true ]; then
101
+ bump_type="minor"
102
+ elif [ "$has_fix" = true ]; then
103
+ bump_type="patch"
104
+ else
105
+ bump_type="patch"
106
+ fi
107
+
108
+ echo "Recommended bump: $bump_type"
109
+
110
+ # Calculate new version
111
+ IFS='.' read -r major minor patch <<< "${current_version#v}"
112
+
113
+ case $bump_type in
114
+ major)
115
+ major=$((major + 1))
116
+ minor=0
117
+ patch=0
118
+ ;;
119
+ minor)
120
+ minor=$((minor + 1))
121
+ patch=0
122
+ ;;
123
+ patch)
124
+ patch=$((patch + 1))
125
+ ;;
126
+ esac
127
+
128
+ new_version="$major.$minor.$patch"
129
+ echo "New version: $new_version"
130
+
131
+ # Confirm version
132
+ read -p "Accept version $new_version? (yes/no/custom): " choice
133
+
134
+ case $choice in
135
+ yes)
136
+ echo "$new_version"
137
+ ;;
138
+ custom)
139
+ read -p "Enter custom version: " custom_version
140
+ echo "$custom_version"
141
+ ;;
142
+ *)
143
+ echo "Release cancelled"
144
+ exit 1
145
+ ;;
146
+ esac
147
+ }
148
+
149
+ # Get new version
150
+ new_version=$(determine_version_bump)
151
+ echo "Releasing version: $new_version"
152
+ ```
153
+
154
+ ### 3. Generate Changelog
155
+
156
+ ```bash
157
+ generate_changelog() {
158
+ local version=$1
159
+ local previous_tag=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
160
+
161
+ echo "๐Ÿ“ Generating changelog for v$version..."
162
+
163
+ # Create changelog file
164
+ changelog_file="CHANGELOG-v$version.md"
165
+
166
+ cat > "$changelog_file" << EOF
167
+ # Release v$version
168
+
169
+ **Release Date:** $(date +%Y-%m-%d)
170
+
171
+ ## Changes
172
+
173
+ EOF
174
+
175
+ # Get commits since last tag
176
+ if [ -n "$previous_tag" ]; then
177
+ commits=$(git log $previous_tag..HEAD --pretty=format:"%s|%an|%h" 2>/dev/null)
178
+ else
179
+ commits=$(git log --pretty=format:"%s|%an|%h")
180
+ fi
181
+
182
+ # Categorize commits
183
+ declare -A categories
184
+ categories=(
185
+ ["๐Ÿ’ฅ Breaking Changes"]=""
186
+ ["โœจ Features"]=""
187
+ ["๐Ÿ› Bug Fixes"]=""
188
+ ["๐Ÿ“š Documentation"]=""
189
+ ["๐Ÿ”ง Maintenance"]=""
190
+ ["Other"]=""
191
+ )
192
+
193
+ while IFS='|' read -r message author hash; do
194
+ # Categorize based on conventional commit format
195
+ case "$message" in
196
+ BREAKING*|breaking*|*!:*)
197
+ categories["๐Ÿ’ฅ Breaking Changes"]+="- $message ([$hash](commit/$hash)) - $author\n"
198
+ ;;
199
+ feat*|feature*|add*|new*)
200
+ categories["โœจ Features"]+="- $message ([$hash](commit/$hash)) - $author\n"
201
+ ;;
202
+ fix*|bugfix*|patch*)
203
+ categories["๐Ÿ› Bug Fixes"]+="- $message ([$hash](commit/$hash)) - $author\n"
204
+ ;;
205
+ docs*|doc*)
206
+ categories["๐Ÿ“š Documentation"]+="- $message ([$hash](commit/$hash)) - $author\n"
207
+ ;;
208
+ chore*|deps*|build*)
209
+ categories["๐Ÿ”ง Maintenance"]+="- $message ([$hash](commit/$hash)) - $author\n"
210
+ ;;
211
+ *)
212
+ categories["Other"]+="- $message ([$hash](commit/$hash)) - $author\n"
213
+ ;;
214
+ esac
215
+ done <<< "$commits"
216
+
217
+ # Write categories to changelog
218
+ for category in "${!categories[@]}"; do
219
+ if [ -n "${categories[$category]}" ]; then
220
+ echo -e "\n### $category\n" >> "$changelog_file"
221
+ echo -e "${categories[$category]}" >> "$changelog_file"
222
+ fi
223
+ done
224
+
225
+ # Add contributors
226
+ echo -e "\n## Contributors\n" >> "$changelog_file"
227
+ git log $previous_tag..HEAD --format='%aN' 2>/dev/null | sort -u | while read author; do
228
+ echo "- $author" >> "$changelog_file"
229
+ done
230
+
231
+ echo "โœ… Changelog generated: $changelog_file"
232
+ echo "$changelog_file"
233
+ }
234
+
235
+ # Generate changelog
236
+ changelog_file=$(generate_changelog "$new_version")
237
+
238
+ # Show changelog for review
239
+ echo ""
240
+ echo "โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•"
241
+ cat "$changelog_file"
242
+ echo "โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•"
243
+ echo ""
244
+
245
+ read -p "Accept changelog? (yes/edit/cancel): " changelog_choice
246
+
247
+ case $changelog_choice in
248
+ edit)
249
+ ${EDITOR:-nano} "$changelog_file"
250
+ ;;
251
+ cancel)
252
+ echo "Release cancelled"
253
+ rm "$changelog_file"
254
+ exit 1
255
+ ;;
256
+ esac
257
+ ```
258
+
259
+ ### 4. Update Version in Files
260
+
261
+ ```bash
262
+ update_version_files() {
263
+ local version=$1
264
+
265
+ echo "๐Ÿ“ Updating version in project files..."
266
+
267
+ # Update package.json
268
+ if [ -f "package.json" ]; then
269
+ echo "Updating package.json..."
270
+ jq ".version = \"$version\"" package.json > package.json.tmp
271
+ mv package.json.tmp package.json
272
+ echo "โœ… package.json updated"
273
+ fi
274
+
275
+ # Update package-lock.json
276
+ if [ -f "package-lock.json" ]; then
277
+ echo "Updating package-lock.json..."
278
+ jq ".version = \"$version\"" package-lock.json > package-lock.json.tmp
279
+ mv package-lock.json.tmp package-lock.json
280
+ echo "โœ… package-lock.json updated"
281
+ fi
282
+
283
+ # Stage all version changes
284
+ git add -A
285
+
286
+ echo "โœ… Version files updated"
287
+ }
288
+
289
+ # Update version
290
+ update_version_files "$new_version"
291
+ ```
292
+
293
+ ### 5. Commit and Tag Release
294
+
295
+ ```bash
296
+ create_release_commit() {
297
+ local version=$1
298
+ local changelog_file=$2
299
+
300
+ echo "๐Ÿท๏ธ Creating release commit and tag..."
301
+
302
+ # Create release commit
303
+ git commit -m "chore(release): v$version
304
+
305
+ $(cat $changelog_file)
306
+
307
+ ๐Ÿค– Generated with [Claude Code](https://claude.com/claude-code)
308
+
309
+ Co-Authored-By: Claude <noreply@anthropic.com>"
310
+
311
+ # Create annotated tag
312
+ git tag -a "v$version" -m "Release v$version
313
+
314
+ $(head -20 $changelog_file)
315
+
316
+ Full changelog: See CHANGELOG.md"
317
+
318
+ echo "โœ… Release commit and tag created"
319
+ }
320
+
321
+ # Create commit and tag
322
+ create_release_commit "$new_version" "$changelog_file"
323
+ ```
324
+
325
+ ### 6. Push Release
326
+
327
+ ```bash
328
+ push_release() {
329
+ local version=$1
330
+
331
+ echo "๐Ÿš€ Pushing release to remote..."
332
+
333
+ read -p "Push release v$version to origin? (yes/no): " push_confirm
334
+
335
+ if [ "$push_confirm" != "yes" ]; then
336
+ echo "โš ๏ธ Release created locally but not pushed"
337
+ echo "To push later: git push origin $current_branch && git push origin v$version"
338
+ return
339
+ fi
340
+
341
+ # Push commit
342
+ git push origin "$current_branch" || {
343
+ echo "โŒ Failed to push commit"
344
+ exit 1
345
+ }
346
+
347
+ # Push tag
348
+ git push origin "v$version" || {
349
+ echo "โŒ Failed to push tag"
350
+ exit 1
351
+ }
352
+
353
+ echo "โœ… Release pushed to origin"
354
+ }
355
+
356
+ # Push release
357
+ push_release "$new_version"
358
+ ```
359
+
360
+ ### 7. Create GitHub Release
361
+
362
+ ```bash
363
+ create_github_release() {
364
+ local version=$1
365
+
366
+ echo "๐Ÿ“ฆ Creating GitHub release..."
367
+
368
+ # Check if gh CLI is installed
369
+ if ! command -v gh &> /dev/null; then
370
+ echo "โš ๏ธ GitHub CLI not installed. Install with: brew install gh"
371
+ echo "Manual release creation: https://github.com/$(git config remote.origin.url | sed 's/.*://;s/.git$//')/releases/new"
372
+ return
373
+ fi
374
+
375
+ # Check if authenticated
376
+ if ! gh auth status &> /dev/null; then
377
+ echo "๐Ÿ” Authenticating with GitHub..."
378
+ gh auth login
379
+ fi
380
+
381
+ # Extract changelog content for this version
382
+ changelog_content=$(sed -n '/^# Release/,/^# Release/p' CHANGELOG.md | head -n -1)
383
+
384
+ # Create release
385
+ echo "Creating GitHub release..."
386
+
387
+ gh release create "v$version" \
388
+ --title "Release v$version" \
389
+ --notes "$changelog_content" \
390
+ || {
391
+ echo "โŒ Failed to create GitHub release"
392
+ exit 1
393
+ }
394
+
395
+ echo "โœ… GitHub release created"
396
+ echo "๐ŸŒ View at: https://github.com/$(git remote get-url origin | sed 's/.*://;s/.git$//')/releases/tag/v$version"
397
+ }
398
+
399
+ # Create GitHub release if available
400
+ create_github_release "$new_version"
401
+ ```
402
+
403
+ ### 8. Publish to NPM (Optional)
404
+
405
+ ```bash
406
+ publish_to_npm() {
407
+ local version=$1
408
+
409
+ if [ ! -f "package.json" ]; then
410
+ return
411
+ fi
412
+
413
+ echo "๐Ÿ“ฆ NPM Publishing..."
414
+
415
+ read -p "Publish v$version to NPM? (yes/no): " npm_confirm
416
+
417
+ if [ "$npm_confirm" != "yes" ]; then
418
+ echo "โš ๏ธ Skipping NPM publish"
419
+ return
420
+ fi
421
+
422
+ # Check if logged in
423
+ if ! npm whoami &> /dev/null; then
424
+ echo "๐Ÿ” Logging into NPM..."
425
+ npm login
426
+ fi
427
+
428
+ # Publish
429
+ echo "Publishing to NPM..."
430
+ npm publish --access public || {
431
+ echo "โŒ NPM publish failed"
432
+ return 1
433
+ }
434
+
435
+ echo "โœ… Published to NPM"
436
+ echo "๐ŸŒ View at: https://www.npmjs.com/package/$(jq -r '.name' package.json)"
437
+ }
438
+
439
+ # Publish to NPM
440
+ publish_to_npm "$new_version"
441
+ ```
442
+
443
+ ## Complete Release Script
444
+
445
+ ```bash
446
+ #!/bin/bash
447
+ set -e
448
+
449
+ echo "๐ŸŽ‰ Starting release process..."
450
+
451
+ # 1. Validate
452
+ git diff-index --quiet HEAD -- || { echo "โŒ Uncommitted changes"; exit 1; }
453
+ npm test || { echo "โŒ Tests failed"; exit 1; }
454
+
455
+ # 2. Determine version
456
+ new_version=$(determine_version_bump)
457
+
458
+ # 3. Generate changelog
459
+ changelog_file=$(generate_changelog "$new_version")
460
+
461
+ # 4. Update files
462
+ update_version_files "$new_version"
463
+
464
+ # 5. Commit and tag
465
+ create_release_commit "$new_version" "$changelog_file"
466
+
467
+ # 6. Push
468
+ push_release "$new_version"
469
+
470
+ # 7. Create GitHub release
471
+ create_github_release "$new_version"
472
+
473
+ # 8. Publish to NPM
474
+ publish_to_npm "$new_version"
475
+
476
+ echo "โœ… Release v$new_version complete!"
477
+ echo "๐ŸŒ Release: https://github.com/$(git remote get-url origin | sed 's/.*://;s/.git$//')/releases/tag/v$new_version"
478
+ ```
479
+
480
+ ## Quick Release Commands
481
+
482
+ **Patch release (bug fixes):**
483
+ ```bash
484
+ /myai-git-release --patch
485
+ ```
486
+
487
+ **Minor release (new features):**
488
+ ```bash
489
+ /myai-git-release --minor
490
+ ```
491
+
492
+ **Major release (breaking changes):**
493
+ ```bash
494
+ /myai-git-release --major
495
+ ```
496
+
497
+ ## Environment Configuration
498
+
499
+ ```bash
500
+ # GitHub (for releases)
501
+ GH_TOKEN=your_github_token
502
+
503
+ # NPM (for publishing)
504
+ NPM_TOKEN=your_npm_token
505
+
506
+ # Notifications
507
+ SLACK_WEBHOOK_URL=https://hooks.slack.com/services/YOUR/WEBHOOK
508
+ DISCORD_WEBHOOK_URL=https://discord.com/api/webhooks/YOUR/WEBHOOK
509
+
510
+ # Release settings
511
+ AUTO_PUBLISH_NPM=false
512
+ CREATE_DEV_VERSION=true
513
+ UPLOAD_ASSETS=true
514
+ ```
515
+
516
+ Execute the release workflow with semantic versioning and complete automation.