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,517 @@
1
+ # Sync and manage branches across development workflow
2
+
3
+ You are a git workflow automation assistant specializing in branch synchronization and management.
4
+
5
+ Task: Sync branches and manage git workflow - $ARGUMENTS
6
+
7
+ ## Branch Synchronization Workflow
8
+
9
+ ### 1. Branch Status Overview
10
+
11
+ ```bash
12
+ check_branch_status() {
13
+ echo "🔍 Checking branch status..."
14
+
15
+ # Current branch
16
+ current_branch=$(git branch --show-current)
17
+ echo "Current branch: $current_branch"
18
+
19
+ # Fetch latest from remote
20
+ git fetch --all --prune
21
+
22
+ # List all branches with status
23
+ echo ""
24
+ echo "╔══════════════════════════════════════════════════════════╗"
25
+ echo "║ BRANCH STATUS ║"
26
+ echo "╚══════════════════════════════════════════════════════════╝"
27
+
28
+ # Local branches
29
+ echo ""
30
+ echo "📍 Local Branches:"
31
+ git branch -vv
32
+
33
+ # Remote branches
34
+ echo ""
35
+ echo "☁️ Remote Branches:"
36
+ git branch -r
37
+
38
+ # Check for branches ahead/behind
39
+ echo ""
40
+ echo "📊 Sync Status:"
41
+
42
+ for branch in $(git branch --format='%(refname:short)'); do
43
+ if git rev-parse --verify "origin/$branch" &>/dev/null; then
44
+ ahead=$(git rev-list --count "origin/$branch..$branch" 2>/dev/null || echo "0")
45
+ behind=$(git rev-list --count "$branch..origin/$branch" 2>/dev/null || echo "0")
46
+
47
+ if [ "$ahead" -gt 0 ] || [ "$behind" -gt 0 ]; then
48
+ echo " $branch: ↑$ahead ↓$behind"
49
+ else
50
+ echo " $branch: ✅ synced"
51
+ fi
52
+ else
53
+ echo " $branch: ⚠️ not on remote"
54
+ fi
55
+ done
56
+
57
+ echo ""
58
+ }
59
+
60
+ # Show status
61
+ check_branch_status
62
+ ```
63
+
64
+ ### 2. Sync Main/Master Branch
65
+
66
+ ```bash
67
+ sync_main_branch() {
68
+ echo "🔄 Syncing main/master branch..."
69
+
70
+ # Determine main branch name
71
+ if git show-ref --verify --quiet refs/heads/main; then
72
+ main_branch="main"
73
+ elif git show-ref --verify --quiet refs/heads/master; then
74
+ main_branch="master"
75
+ else
76
+ echo "❌ No main/master branch found"
77
+ return 1
78
+ fi
79
+
80
+ echo "Main branch: $main_branch"
81
+
82
+ # Save current branch
83
+ current_branch=$(git branch --show-current)
84
+
85
+ # Stash changes if any
86
+ if ! git diff-index --quiet HEAD --; then
87
+ echo "💾 Stashing local changes..."
88
+ git stash save "Auto-stash before sync $(date)"
89
+ stashed=true
90
+ else
91
+ stashed=false
92
+ fi
93
+
94
+ # Switch to main branch
95
+ git checkout "$main_branch" || {
96
+ echo "❌ Failed to checkout $main_branch"
97
+ return 1
98
+ }
99
+
100
+ # Pull latest changes
101
+ echo "⬇️ Pulling latest changes..."
102
+ git pull origin "$main_branch" --rebase || {
103
+ echo "❌ Failed to pull changes"
104
+ git checkout "$current_branch"
105
+ return 1
106
+ }
107
+
108
+ # Switch back to original branch
109
+ if [ "$current_branch" != "$main_branch" ]; then
110
+ git checkout "$current_branch"
111
+ fi
112
+
113
+ # Restore stashed changes
114
+ if [ "$stashed" = true ]; then
115
+ echo "📂 Restoring stashed changes..."
116
+ git stash pop
117
+ fi
118
+
119
+ echo "✅ Main branch synced"
120
+ }
121
+
122
+ # Sync main
123
+ sync_main_branch
124
+ ```
125
+
126
+ ### 3. Sync Development Branch
127
+
128
+ ```bash
129
+ sync_dev_branch() {
130
+ echo "🔄 Syncing development branch..."
131
+
132
+ # Determine dev branch name
133
+ if git show-ref --verify --quiet refs/heads/dev; then
134
+ dev_branch="dev"
135
+ elif git show-ref --verify --quiet refs/heads/develop; then
136
+ dev_branch="develop"
137
+ else
138
+ echo "⚠️ No dev/develop branch found"
139
+ return 0
140
+ fi
141
+
142
+ echo "Dev branch: $dev_branch"
143
+
144
+ # Save current branch
145
+ current_branch=$(git branch --show-current)
146
+
147
+ # Switch to dev branch
148
+ git checkout "$dev_branch"
149
+
150
+ # Pull latest changes
151
+ echo "⬇️ Pulling latest changes..."
152
+ git pull origin "$dev_branch" --rebase || {
153
+ echo "❌ Failed to pull changes"
154
+ git checkout "$current_branch"
155
+ return 1
156
+ }
157
+
158
+ # Merge main into dev (keep dev updated with main)
159
+ main_branch=$(git show-ref --verify --quiet refs/heads/main && echo "main" || echo "master")
160
+
161
+ echo "🔀 Merging $main_branch into $dev_branch..."
162
+ git merge "origin/$main_branch" --no-edit || {
163
+ echo "⚠️ Merge conflicts detected"
164
+ echo "Resolve conflicts and run: git merge --continue"
165
+ return 1
166
+ }
167
+
168
+ # Push updated dev branch
169
+ echo "⬆️ Pushing updated dev branch..."
170
+ git push origin "$dev_branch"
171
+
172
+ # Switch back to original branch
173
+ if [ "$current_branch" != "$dev_branch" ]; then
174
+ git checkout "$current_branch"
175
+ fi
176
+
177
+ echo "✅ Dev branch synced"
178
+ }
179
+
180
+ # Sync dev
181
+ sync_dev_branch
182
+ ```
183
+
184
+ ### 4. Merge Main into Feature Branch
185
+
186
+ ```bash
187
+ merge_main_into_feature() {
188
+ local feature_branch=${1:-$(git branch --show-current)}
189
+
190
+ echo "🔀 Merging main into feature branch: $feature_branch..."
191
+
192
+ # Ensure we're on the feature branch
193
+ if [ "$(git branch --show-current)" != "$feature_branch" ]; then
194
+ git checkout "$feature_branch" || {
195
+ echo "❌ Failed to checkout $feature_branch"
196
+ return 1
197
+ }
198
+ fi
199
+
200
+ # Determine main branch
201
+ main_branch=$(git show-ref --verify --quiet refs/heads/main && echo "main" || echo "master")
202
+
203
+ # Fetch latest
204
+ git fetch origin "$main_branch"
205
+
206
+ # Check if feature branch is behind main
207
+ behind=$(git rev-list --count "$feature_branch..origin/$main_branch")
208
+
209
+ if [ "$behind" -eq 0 ]; then
210
+ echo "✅ Feature branch is up to date with $main_branch"
211
+ return 0
212
+ fi
213
+
214
+ echo "📊 Feature branch is $behind commits behind $main_branch"
215
+
216
+ # Stash changes if any
217
+ if ! git diff-index --quiet HEAD --; then
218
+ echo "💾 Stashing local changes..."
219
+ git stash save "Auto-stash before merge $(date)"
220
+ stashed=true
221
+ else
222
+ stashed=false
223
+ fi
224
+
225
+ # Merge main into feature
226
+ echo "🔀 Merging $main_branch..."
227
+ git merge "origin/$main_branch" --no-edit || {
228
+ echo "⚠️ Merge conflicts detected"
229
+ echo ""
230
+ echo "Conflicted files:"
231
+ git diff --name-only --diff-filter=U
232
+ echo ""
233
+ echo "Resolve conflicts then run:"
234
+ echo " git add <resolved-files>"
235
+ echo " git merge --continue"
236
+
237
+ if [ "$stashed" = true ]; then
238
+ echo " git stash pop"
239
+ fi
240
+
241
+ return 1
242
+ }
243
+
244
+ # Restore stashed changes
245
+ if [ "$stashed" = true ]; then
246
+ echo "📂 Restoring stashed changes..."
247
+ git stash pop
248
+ fi
249
+
250
+ # Push updated feature branch
251
+ read -p "Push updated feature branch? (yes/no): " push_confirm
252
+
253
+ if [ "$push_confirm" == "yes" ]; then
254
+ git push origin "$feature_branch"
255
+ echo "✅ Feature branch pushed"
256
+ fi
257
+
258
+ echo "✅ Main merged into feature branch"
259
+ }
260
+
261
+ # Merge main into current branch
262
+ merge_main_into_feature
263
+ ```
264
+
265
+ ### 5. Sync All Branches
266
+
267
+ ```bash
268
+ sync_all_branches() {
269
+ echo "🔄 Syncing all branches..."
270
+
271
+ # Save current branch
272
+ current_branch=$(git branch --show-current)
273
+
274
+ # Fetch all
275
+ git fetch --all --prune
276
+
277
+ # Define branch hierarchy
278
+ main_branch=$(git show-ref --verify --quiet refs/heads/main && echo "main" || echo "master")
279
+ dev_branch=$(git show-ref --verify --quiet refs/heads/dev && echo "dev" || echo "develop")
280
+
281
+ # Sync main
282
+ echo ""
283
+ echo "═══════════════════════════════════════"
284
+ echo "Syncing $main_branch..."
285
+ echo "═══════════════════════════════════════"
286
+ git checkout "$main_branch"
287
+ git pull origin "$main_branch" --rebase
288
+
289
+ # Sync dev
290
+ if git show-ref --verify --quiet "refs/heads/$dev_branch"; then
291
+ echo ""
292
+ echo "═══════════════════════════════════════"
293
+ echo "Syncing $dev_branch..."
294
+ echo "═══════════════════════════════════════"
295
+ git checkout "$dev_branch"
296
+ git pull origin "$dev_branch" --rebase
297
+ git merge "origin/$main_branch" --no-edit
298
+ git push origin "$dev_branch"
299
+ fi
300
+
301
+ # Sync staging
302
+ if git show-ref --verify --quiet refs/heads/staging; then
303
+ echo ""
304
+ echo "═══════════════════════════════════════"
305
+ echo "Syncing staging..."
306
+ echo "═══════════════════════════════════════"
307
+ git checkout staging
308
+ git pull origin staging --rebase
309
+ if git show-ref --verify --quiet "refs/heads/$dev_branch"; then
310
+ git merge "origin/$dev_branch" --no-edit
311
+ else
312
+ git merge "origin/$main_branch" --no-edit
313
+ fi
314
+ git push origin staging
315
+ fi
316
+
317
+ # Return to original branch
318
+ git checkout "$current_branch"
319
+
320
+ echo ""
321
+ echo "✅ All branches synced"
322
+ }
323
+
324
+ # Uncomment to sync all branches
325
+ # sync_all_branches
326
+ ```
327
+
328
+ ### 6. Clean Up Merged Branches
329
+
330
+ ```bash
331
+ cleanup_merged_branches() {
332
+ echo "🧹 Cleaning up merged branches..."
333
+
334
+ # Determine main branch
335
+ main_branch=$(git show-ref --verify --quiet refs/heads/main && echo "main" || echo "master")
336
+
337
+ # Fetch and prune
338
+ git fetch --all --prune
339
+
340
+ # Find merged branches
341
+ echo "🔍 Finding merged branches..."
342
+
343
+ merged_branches=$(git branch --merged "$main_branch" | \
344
+ grep -v "^\*" | \
345
+ grep -v "$main_branch" | \
346
+ grep -v "develop" | \
347
+ grep -v "dev" | \
348
+ grep -v "staging" | \
349
+ grep -v "production")
350
+
351
+ if [ -z "$merged_branches" ]; then
352
+ echo "✅ No merged branches to clean up"
353
+ return 0
354
+ fi
355
+
356
+ echo "Branches merged into $main_branch:"
357
+ echo "$merged_branches"
358
+ echo ""
359
+
360
+ read -p "Delete these local branches? (yes/no): " delete_confirm
361
+
362
+ if [ "$delete_confirm" == "yes" ]; then
363
+ echo "$merged_branches" | xargs git branch -d
364
+ echo "✅ Local branches deleted"
365
+ fi
366
+
367
+ echo "✅ Branch cleanup complete"
368
+ }
369
+
370
+ # Cleanup merged branches
371
+ cleanup_merged_branches
372
+ ```
373
+
374
+ ### 7. Pull Request Ready Check
375
+
376
+ ```bash
377
+ pr_ready_check() {
378
+ local feature_branch=${1:-$(git branch --show-current)}
379
+
380
+ echo "✅ PR Ready Check: $feature_branch"
381
+
382
+ # Determine main branch
383
+ main_branch=$(git show-ref --verify --quiet refs/heads/main && echo "main" || echo "master")
384
+
385
+ # Fetch latest
386
+ git fetch origin
387
+
388
+ # Check 1: Branch is pushed
389
+ if ! git rev-parse --verify "origin/$feature_branch" &>/dev/null; then
390
+ echo "❌ Branch not pushed to remote"
391
+ echo " Run: git push origin $feature_branch"
392
+ return 1
393
+ fi
394
+
395
+ # Check 2: No uncommitted changes
396
+ if ! git diff-index --quiet HEAD --; then
397
+ echo "❌ Uncommitted changes detected"
398
+ git status --short
399
+ return 1
400
+ fi
401
+
402
+ # Check 3: Up to date with main
403
+ behind=$(git rev-list --count "$feature_branch..origin/$main_branch")
404
+ if [ "$behind" -gt 0 ]; then
405
+ echo "⚠️ Branch is $behind commits behind $main_branch"
406
+ echo " Consider merging main: /myai-git-sync merge-main"
407
+ fi
408
+
409
+ # Check 4: Tests pass
410
+ echo "🧪 Running tests..."
411
+ if npm test &>/dev/null; then
412
+ echo "✅ Tests passing"
413
+ else
414
+ echo "❌ Tests failing"
415
+ return 1
416
+ fi
417
+
418
+ # Summary
419
+ echo ""
420
+ echo "═══════════════════════════════════════"
421
+ echo "✅ Ready to create Pull Request!"
422
+ echo "═══════════════════════════════════════"
423
+
424
+ # Generate PR creation command
425
+ if command -v gh &>/dev/null; then
426
+ echo ""
427
+ echo "Create PR with:"
428
+ echo " gh pr create --base $main_branch --head $feature_branch"
429
+ fi
430
+ }
431
+
432
+ # Check if ready for PR
433
+ pr_ready_check
434
+ ```
435
+
436
+ ## Complete Sync Script
437
+
438
+ ```bash
439
+ #!/bin/bash
440
+ set -e
441
+
442
+ echo "🔄 Git Branch Synchronization"
443
+ echo "═══════════════════════════════════════"
444
+
445
+ # Parse arguments
446
+ action=${1:-status}
447
+
448
+ case $action in
449
+ status)
450
+ check_branch_status
451
+ ;;
452
+
453
+ main)
454
+ sync_main_branch
455
+ ;;
456
+
457
+ dev)
458
+ sync_dev_branch
459
+ ;;
460
+
461
+ all)
462
+ sync_all_branches
463
+ ;;
464
+
465
+ merge-main)
466
+ merge_main_into_feature
467
+ ;;
468
+
469
+ cleanup)
470
+ cleanup_merged_branches
471
+ ;;
472
+
473
+ pr-check)
474
+ pr_ready_check "$2"
475
+ ;;
476
+
477
+ *)
478
+ echo "Usage: /myai-git-sync [command]"
479
+ echo ""
480
+ echo "Commands:"
481
+ echo " status - Show branch status overview"
482
+ echo " main - Sync main/master branch"
483
+ echo " dev - Sync dev/develop branch"
484
+ echo " all - Sync all branches"
485
+ echo " merge-main - Merge main into current feature branch"
486
+ echo " cleanup - Clean up merged branches"
487
+ echo " pr-check - Check if ready for pull request"
488
+ ;;
489
+ esac
490
+
491
+ echo ""
492
+ echo "✅ Sync operation complete"
493
+ ```
494
+
495
+ ## Quick Commands
496
+
497
+ ```bash
498
+ # Check status
499
+ /myai-git-sync status
500
+
501
+ # Sync main branch
502
+ /myai-git-sync main
503
+
504
+ # Sync all branches
505
+ /myai-git-sync all
506
+
507
+ # Merge main into feature
508
+ /myai-git-sync merge-main
509
+
510
+ # Clean up merged branches
511
+ /myai-git-sync cleanup
512
+
513
+ # Check PR readiness
514
+ /myai-git-sync pr-check
515
+ ```
516
+
517
+ Execute branch synchronization and management operations efficiently.
@@ -0,0 +1,42 @@
1
+ # Mintlify Documentation Publisher
2
+
3
+ Publish markdown/MDX content to Mintlify documentation site with automatic navigation updates: $ARGUMENTS
4
+
5
+ Invoke the Mintlify publishing agent to transform content, update mint.json, and deploy via git.
6
+
7
+ ## Usage Examples
8
+
9
+ ```bash
10
+ /myai-mintlify-publish "guide.mdx"
11
+ /myai-mintlify-publish "api-ref.md" --nav-section "API Reference"
12
+ /myai-mintlify-publish "tutorial.md" --project ./docs --branch main
13
+ ```
14
+
15
+ ## Options
16
+
17
+ - `--nav-section <name>` - Add to navigation section
18
+ - `--project <path>` - Mintlify project path
19
+ - `--branch <name>` - Git branch (default: main)
20
+ - `--no-push` - Commit but don't push
21
+ - `--dry-run` - Validate without publishing
22
+
23
+ ## Prerequisites
24
+
25
+ Mintlify project with mint.json and git repository.
26
+
27
+ ## Examples
28
+
29
+ ### Basic publish
30
+ ```
31
+ /myai-mintlify-publish "getting-started.mdx"
32
+ ```
33
+
34
+ ### With navigation
35
+ ```
36
+ /myai-mintlify-publish "api-users.md" --nav-section "API Reference"
37
+ ```
38
+
39
+ ### Custom project
40
+ ```
41
+ /myai-mintlify-publish "guide.md" --project ~/docs --branch develop
42
+ ```
@@ -0,0 +1,42 @@
1
+ # PayloadCMS Content Publisher
2
+
3
+ Publish markdown content to PayloadCMS headless CMS: $ARGUMENTS
4
+
5
+ Invoke the PayloadCMS publishing agent to convert markdown to Lexical format and publish to your PayloadCMS instance.
6
+
7
+ ## Usage Examples
8
+
9
+ ```bash
10
+ /myai-payloadcms-publish "article.md"
11
+ /myai-payloadcms-publish "article.md" --status published
12
+ /myai-payloadcms-publish "article.md" --collection articles --id 12345
13
+ ```
14
+
15
+ ## Options
16
+
17
+ - `--status draft|published` - Set publish status (default: draft)
18
+ - `--collection <name>` - Target collection (default: posts)
19
+ - `--id <doc-id>` - Update existing document
20
+ - `--dry-run` - Validate without publishing
21
+ - `--verbose` - Show detailed progress
22
+
23
+ ## Prerequisites
24
+
25
+ Configure PayloadCMS credentials: `/myai-configure`
26
+
27
+ ## Examples
28
+
29
+ ### Publish as draft
30
+ ```
31
+ /myai-payloadcms-publish "my-article.md"
32
+ ```
33
+
34
+ ### Publish to production
35
+ ```
36
+ /myai-payloadcms-publish "article.md" --status published --collection blog-posts
37
+ ```
38
+
39
+ ### Update existing
40
+ ```
41
+ /myai-payloadcms-publish "updated.md" --id 67890
42
+ ```