@atlashub/smartstack-cli 1.11.0 → 1.13.1

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 (74) hide show
  1. package/.documentation/agents.html +7 -2
  2. package/.documentation/apex.html +7 -2
  3. package/.documentation/business-analyse.html +7 -2
  4. package/.documentation/cli-commands.html +871 -0
  5. package/.documentation/commands.html +7 -2
  6. package/.documentation/efcore.html +7 -2
  7. package/.documentation/gitflow.html +7 -2
  8. package/.documentation/hooks.html +7 -2
  9. package/.documentation/index.html +7 -2
  10. package/.documentation/init.html +7 -2
  11. package/.documentation/installation.html +7 -2
  12. package/.documentation/ralph-loop.html +7 -2
  13. package/.documentation/test-web.html +7 -2
  14. package/dist/index.js +1932 -336
  15. package/dist/index.js.map +1 -1
  16. package/package.json +8 -2
  17. package/templates/agents/efcore/squash.md +67 -31
  18. package/templates/agents/gitflow/finish.md +68 -56
  19. package/templates/commands/business-analyse/0-orchestrate.md +72 -556
  20. package/templates/commands/business-analyse/1-init.md +23 -193
  21. package/templates/commands/business-analyse/2-discover.md +85 -462
  22. package/templates/commands/business-analyse/3-analyse.md +40 -342
  23. package/templates/commands/business-analyse/4-specify.md +72 -537
  24. package/templates/commands/business-analyse/5-validate.md +43 -237
  25. package/templates/commands/business-analyse/6-handoff.md +93 -682
  26. package/templates/commands/business-analyse/7-doc-html.md +45 -544
  27. package/templates/commands/business-analyse/_shared.md +176 -0
  28. package/templates/commands/business-analyse/bug.md +50 -257
  29. package/templates/commands/business-analyse/change-request.md +59 -283
  30. package/templates/commands/business-analyse/hotfix.md +36 -120
  31. package/templates/commands/business-analyse.md +55 -574
  32. package/templates/commands/efcore/_shared.md +206 -0
  33. package/templates/commands/efcore/conflicts.md +39 -201
  34. package/templates/commands/efcore/db-deploy.md +28 -237
  35. package/templates/commands/efcore/db-reset.md +41 -390
  36. package/templates/commands/efcore/db-seed.md +44 -323
  37. package/templates/commands/efcore/db-status.md +31 -210
  38. package/templates/commands/efcore/migration.md +45 -368
  39. package/templates/commands/efcore/rebase-snapshot.md +38 -241
  40. package/templates/commands/efcore/scan.md +35 -204
  41. package/templates/commands/efcore/squash.md +158 -251
  42. package/templates/commands/efcore.md +49 -177
  43. package/templates/commands/gitflow/1-init.md +94 -1318
  44. package/templates/commands/gitflow/10-start.md +86 -990
  45. package/templates/commands/gitflow/11-finish.md +264 -454
  46. package/templates/commands/gitflow/12-cleanup.md +40 -213
  47. package/templates/commands/gitflow/2-status.md +51 -386
  48. package/templates/commands/gitflow/3-commit.md +108 -801
  49. package/templates/commands/gitflow/4-plan.md +42 -13
  50. package/templates/commands/gitflow/5-exec.md +60 -5
  51. package/templates/commands/gitflow/6-abort.md +54 -277
  52. package/templates/commands/gitflow/7-pull-request.md +74 -717
  53. package/templates/commands/gitflow/8-review.md +51 -178
  54. package/templates/commands/gitflow/9-merge.md +74 -404
  55. package/templates/commands/gitflow/_shared.md +196 -0
  56. package/templates/commands/quickstart.md +154 -0
  57. package/templates/commands/ralph-loop/ralph-loop.md +104 -2
  58. package/templates/hooks/hooks.json +13 -0
  59. package/templates/hooks/ralph-mcp-logger.sh +46 -0
  60. package/templates/hooks/ralph-session-end.sh +69 -0
  61. package/templates/ralph/README.md +91 -0
  62. package/templates/ralph/ralph.config.yaml +113 -0
  63. package/templates/scripts/setup-ralph-loop.sh +173 -0
  64. package/templates/skills/_shared.md +117 -0
  65. package/templates/skills/ai-prompt/SKILL.md +87 -654
  66. package/templates/skills/application/SKILL.md +76 -499
  67. package/templates/skills/controller/SKILL.md +38 -165
  68. package/templates/skills/documentation/SKILL.md +2 -1
  69. package/templates/skills/feature-full/SKILL.md +107 -732
  70. package/templates/skills/notification/SKILL.md +85 -474
  71. package/templates/skills/ui-components/SKILL.md +62 -762
  72. package/templates/skills/workflow/SKILL.md +85 -489
  73. package/templates/commands/gitflow/rescue.md +0 -867
  74. package/templates/skills/business-analyse/SKILL.md +0 -191
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlashub/smartstack-cli",
3
- "version": "1.11.0",
3
+ "version": "1.13.1",
4
4
  "description": "SmartStack Claude Code automation toolkit - GitFlow, APEX, EF Core migrations, prompts and more",
5
5
  "author": {
6
6
  "name": "SmartStack",
@@ -61,7 +61,13 @@
61
61
  "install:local": "npm run build && node dist/index.js install --local --force",
62
62
  "install:global": "npm run build && node dist/index.js install --force",
63
63
  "status:local": "node dist/index.js status --local --verbose",
64
- "status:global": "node dist/index.js status --verbose"
64
+ "status:global": "node dist/index.js status --verbose",
65
+ "doctor": "node dist/index.js doctor",
66
+ "check-mcp": "node dist/index.js check-mcp",
67
+ "ralph:start": "node dist/index.js ralph start",
68
+ "ralph:status": "node dist/index.js ralph status",
69
+ "ralph:logs": "node dist/index.js ralph logs",
70
+ "health": "node dist/index.js doctor --json"
65
71
  },
66
72
  "dependencies": {
67
73
  "chalk": "^5.3.0",
@@ -8,60 +8,96 @@ tools: Bash, Glob, Read
8
8
 
9
9
  # EF Core Squash Agent
10
10
 
11
- Merges multiple migrations into one. For releases.
11
+ Consolide plusieurs migrations en une seule, en récupérant le ModelSnapshot de la branche parente.
12
+
13
+ ## Principe Fondamental
14
+
15
+ ```
16
+ RÈGLE D'OR: Toujours récupérer le snapshot de la branche PARENTE
17
+
18
+ feature/* → snapshot de develop
19
+ develop → snapshot de main
20
+ release/* → snapshot de main
21
+ hotfix/* → snapshot de main
22
+ main → BLOQUÉ (jamais squash)
23
+ ```
12
24
 
13
25
  ## Workflow
14
26
 
15
- 1. **List**: All migrations
16
- 2. **Confirm**: Request user validation
17
- 3. **Backup**: Save all files
18
- 4. **Delete**: Old migrations
19
- 5. **Create**: Consolidated migration
20
- 6. **Script**: Generate idempotent SQL
21
- 7. **Validate**: Build OK
27
+ 1. **Determine**: Identifier branche parente (`determine_base_branch`)
28
+ 2. **List**: Migrations propres à cette branche (pas héritées)
29
+ 3. **Confirm**: Demander validation utilisateur
30
+ 4. **Backup**: Sauvegarder tous les fichiers
31
+ 5. **Fetch**: Récupérer ModelSnapshot de branche parente
32
+ 6. **Delete**: Supprimer migrations de la branche
33
+ 7. **Create**: Créer migration consolidée
34
+ 8. **Validate**: Build + script OK
22
35
 
23
- ## Key Commands
36
+ ## Commandes Clés
24
37
 
25
38
  ```bash
39
+ # Déterminer branche parente
40
+ determine_base_branch # → BASE_BRANCH, BRANCH_TYPE
41
+
42
+ # Identifier migrations propres à la branche
43
+ BASE_MIGS=$(git ls-tree -r --name-only "origin/$BASE_BRANCH" -- Migrations/)
44
+ LOCAL_MIGS=$(find Migrations -name "*.cs" | grep -v Designer | grep -v Snapshot)
45
+
26
46
  # Backup
27
47
  BACKUP_DIR=".claude/gitflow/backup/migrations/squash_$(date +%Y%m%d_%H%M%S)"
28
- mkdir -p "$BACKUP_DIR"
29
- cp Migrations/*.cs "$BACKUP_DIR/"
48
+ mkdir -p "$BACKUP_DIR" && cp Migrations/*.cs "$BACKUP_DIR/"
30
49
 
31
- # Delete (except snapshot)
32
- find Migrations -name "*.cs" -not -name "*Snapshot*" -delete
50
+ # CRUCIAL: Récupérer snapshot parent
51
+ git fetch origin "$BASE_BRANCH"
52
+ git checkout "origin/$BASE_BRANCH" -- Migrations/*ModelSnapshot.cs
33
53
 
34
- # Create consolidated
35
- dotnet ef migrations add Release_${VERSION}_Initial
54
+ # Supprimer migrations de la branche uniquement
55
+ for mig in $BRANCH_ONLY_MIGRATIONS; do
56
+ rm -f "Migrations/${mig}"*
57
+ done
36
58
 
37
- # SQL Script
38
- dotnet ef migrations script --idempotent -o scripts/migrations/release.sql
59
+ # Créer migration consolidée
60
+ dotnet ef migrations add "${BRANCH_TYPE}_${NAME}_Consolidated"
61
+
62
+ # Valider
63
+ dotnet build && dotnet ef migrations script --idempotent > /dev/null
39
64
  ```
40
65
 
41
66
  ## Safety Checks
42
67
 
43
- - [ ] User confirmation
44
- - [ ] Backup created
45
- - [ ] Build OK after squash
46
- - [ ] SQL script generated
68
+ - [ ] Branche parente identifiée
69
+ - [ ] main/master = BLOQUÉ
70
+ - [ ] User confirmation obtenue
71
+ - [ ] Backup créé
72
+ - [ ] Snapshot parent récupéré
73
+ - [ ] Build OK après squash
74
+ - [ ] Script générable
47
75
 
48
76
  ## Output Format
49
77
 
50
78
  ```
51
- SQUASH
52
- Before: 12 migrations
53
- After: 1 migration
54
- Backup: .claude/gitflow/backup/migrations/squash_20250102/
55
- Script: scripts/migrations/Release_1_7_0_Initial.sql
79
+ SQUASH - {current_branch}
80
+ Base: {BASE_BRANCH} (snapshot récupéré)
81
+ Avant: {N} migrations (propres à cette branche)
82
+ Apres: 1 migration consolidée
83
+ Backup: .claude/gitflow/backup/migrations/squash_{timestamp}/
56
84
 
57
- WARNING: Production DB - use SQL script
85
+ Prochains: /efcore:db-reset, /efcore:db-deploy
58
86
  ```
59
87
 
60
- ## Production Warning
88
+ ## Cas Particuliers
61
89
 
62
- Never apply directly to a DB that already has migrations.
63
- Use idempotent SQL script or `--skip-apply`.
90
+ | Situation | Action |
91
+ |-----------|--------|
92
+ | 0 migrations propres | "Rien à squash" - exit |
93
+ | Snapshot identique | Migration vide créée - warning |
94
+ | Build fail | Restaurer backup automatiquement |
95
+ | Sur main/master | BLOQUÉ - exit code 1 |
64
96
 
65
97
  ## Priority
66
98
 
67
- Safety > Correctness > Speed. Backup mandatory.
99
+ Safety > Correctness > Speed.
100
+
101
+ 1. Backup OBLIGATOIRE (sauf --no-backup)
102
+ 2. Snapshot parent OBLIGATOIRE (jamais optionnel)
103
+ 3. Restauration auto si échec
@@ -10,81 +10,93 @@ tools: Bash, Read, Glob, Grep, Edit, Write
10
10
 
11
11
  Finalisation complete de branche GitFlow.
12
12
 
13
+ ## MODE D'EXÉCUTION
14
+
15
+ **CRITIQUE:** Tu dois EXECUTER chaque commande git avec l'outil Bash.
16
+
17
+ - **NE PAS** afficher les commandes a l'utilisateur
18
+ - **EXECUTER** directement via l'outil Bash
19
+ - **AFFICHER** uniquement le resume final
20
+
13
21
  ## Workflow
14
22
 
15
- 1. **Verifier**: Branche valide, PR merged, build OK
16
- 2. **Version**: Auto-increment selon type (PATCH pour hotfix)
17
- 3. **Tag**: Creer tag annote avec nouvelle version
18
- 4. **Merge**: Double merge si release/hotfix (main + develop)
19
- 5. **Cleanup**: Supprimer branche + worktree
20
- 6. **Push**: Tags + branches
23
+ 1. **Detecter contexte**: Aller au repo principal si dans un worktree
24
+ 2. **Verifier PR**: Confirmer que la PR est mergee (via GitHub ou `gh pr list --state merged`)
25
+ 3. **Executer selon type**: Feature/Release/Hotfix ont des workflows differents
26
+ 4. **Cleanup**: Supprimer branche + worktree
27
+ 5. **Resume**: Afficher le resultat final
28
+
29
+ ## Detection PR Mergee
30
+
31
+ ```bash
32
+ # Verifier si PR mergee
33
+ PR_INFO=$(gh pr list --head "$BRANCH" --state merged --json number --jq '.[0]')
34
+
35
+ # Si pas trouve, verifier si main a ete mis a jour (merge manuel via GitHub)
36
+ if [ -z "$PR_INFO" ]; then
37
+ git checkout main && git pull origin main
38
+ # Continuer si les commits sont presents
39
+ fi
40
+ ```
21
41
 
22
42
  ## Actions par Type
23
43
 
24
- | Type | Version | Tag | Merge to |
25
- |------|---------|-----|----------|
26
- | Feature | - | - | develop |
27
- | Release | bump (manual) | vX.Y.Z | main + develop |
28
- | Hotfix | **AUTO patch** | vX.Y.Z | main + develop |
44
+ | Type | Version | Tag | Merge to | Cleanup |
45
+ |------|---------|-----|----------|---------|
46
+ | Feature | - | - | develop (via PR) | branche + worktree |
47
+ | Release | bump MINOR sur develop | vX.Y.Z | main + develop | branche + worktree |
48
+ | Hotfix | AUTO PATCH | vX.Y.Z | main + develop | branche + worktree |
29
49
 
30
- ### Hotfix Versioning (IMPORTANT)
50
+ ### Feature Workflow
31
51
 
32
- Pour les hotfixes, le versioning est **AUTOMATIQUE**:
33
- - Lecture de la version actuelle depuis `package.json`
34
- - Increment du PATCH: `1.7.1` → `1.7.2`
35
- - Mise a jour de `package.json`
36
- - Commit du bump
37
- - Creation du tag avec la nouvelle version
38
- - Push main + tag
39
- - Merge back vers develop
52
+ ```bash
53
+ git checkout develop && git pull origin develop
54
+ git branch -d feature/xxx
55
+ git push origin --delete feature/xxx
56
+ git worktree remove ../features/xxx --force
57
+ ```
40
58
 
41
- ## Commandes
59
+ ### Release Workflow
42
60
 
43
61
  ```bash
44
- # IMPORTANT: Detecter et revenir au repo principal si dans un worktree
45
- MAIN_WORKTREE=$(git worktree list --porcelain | grep -m1 "^worktree " | sed 's/worktree //')
46
- cd "$MAIN_WORKTREE"
47
-
48
- # Tag annote
49
- git tag -a v{version} -m "Release {version}
50
-
51
- Changes:
52
- - {liste commits}"
53
-
54
- # Double merge release
55
- git checkout main && git merge --no-ff release/{version}
56
- git checkout develop && git merge --no-ff release/{version}
57
-
58
- # Cleanup worktree (nouvelle structure organisee)
59
- WORKTREE_BASE="../worktrees"
60
- # Feature: ../worktrees/features/{name}
61
- # Release: ../worktrees/releases/v{version}
62
- # Hotfix: ../worktrees/hotfixes/{name}
63
- git worktree remove "${WORKTREE_BASE}/{type}s/{name}" --force
64
- git branch -d {branch}
62
+ git checkout main && git pull origin main
63
+ git tag -a "v$VERSION" -m "Release v$VERSION"
64
+ git push origin "v$VERSION"
65
+ git checkout develop && git pull origin develop
66
+ git merge main --no-ff -m "chore: merge release back to develop"
67
+ # Bump MINOR version
68
+ npm version X.Y+1.0 --no-git-tag-version
69
+ git commit -m "chore: bump develop to vX.Y+1.0"
70
+ git push origin develop
71
+ # Cleanup
65
72
  ```
66
73
 
67
- ## Generation Script SQL (Release/Hotfix)
74
+ ### Hotfix Workflow
68
75
 
69
76
  ```bash
70
- dotnet ef migrations script --idempotent -o ./scripts/migrations/{type}_{version}.sql
77
+ git checkout main && git pull origin main
78
+ # Auto-increment PATCH
79
+ npm version X.Y.Z+1 --no-git-tag-version
80
+ git commit -m "chore: bump version"
81
+ git tag -a "v$NEW_VERSION" -m "Hotfix v$NEW_VERSION"
82
+ git push origin main "v$NEW_VERSION"
83
+ git checkout develop && git merge main --no-ff
84
+ git push origin develop
85
+ # Cleanup
71
86
  ```
72
87
 
73
88
  ## Output Format
74
89
 
90
+ A la fin, afficher UNIQUEMENT:
91
+
75
92
  ```
76
- BRANCH FINISHED
77
- Type: {type}
78
- Version: {version}
79
- Tag: v{version}
80
- Script: ./scripts/migrations/{file}.sql
81
- Merged: main, develop
82
- Deleted: {branch}
83
- Worktree: ../worktrees/{type}s/{name} (supprime)
84
-
85
- DEPLOYED TO: (manual steps)
86
- 1. Push tags: git push --tags
87
- 2. Deploy script to production
93
+ {TYPE} FINALISÉ ✓
94
+ - Branche: {branch}
95
+ - Tag: v{version} (ou N/A)
96
+ - Merge back: develop ✓ (ou N/A)
97
+ - Worktree: nettoyé ✓
98
+
99
+ → Prochain: /gitflow:10-start feature {name}
88
100
  ```
89
101
 
90
102
  ## Priority