@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
@@ -0,0 +1,113 @@
1
+ # Ralph Weegund Configuration
2
+ # Auto-generated by SmartStack CLI
3
+ # Documentation: https://atlashub.ch/docs/ralph
4
+
5
+ version: "1.0.0"
6
+
7
+ # MCP Servers - REQUIRED for Ralph to function
8
+ mcp:
9
+ required:
10
+ - name: context7
11
+ description: "Library documentation and code examples"
12
+ install_command: "claude mcp add context7"
13
+ health_check: true
14
+
15
+ - name: smartstack
16
+ description: "SmartStack validation and scaffolding"
17
+ install_command: "claude mcp add smartstack"
18
+ health_check: true
19
+
20
+ # Behavior when MCP is unavailable
21
+ on_unavailable: "abort" # abort | warn | ignore
22
+
23
+ # Health check interval (seconds) - 0 to disable
24
+ health_check_interval: 300
25
+
26
+ # Logging configuration
27
+ logging:
28
+ enabled: true
29
+ level: "info" # debug | info | warn | error
30
+
31
+ # Log directory (relative to project root)
32
+ directory: ".ralph/logs"
33
+
34
+ # Log file naming pattern
35
+ file_pattern: "ralph-{date}.log"
36
+
37
+ # Retention in days (0 = unlimited)
38
+ retention_days: 30
39
+
40
+ # What to log
41
+ log_mcp_calls: true
42
+ log_tool_usage: true
43
+ log_iterations: true
44
+ log_file_changes: true
45
+
46
+ # Feature reports
47
+ reports:
48
+ enabled: true
49
+
50
+ # Reports directory (relative to project root)
51
+ directory: ".ralph/reports"
52
+
53
+ # Auto-generate report on feature completion
54
+ auto_generate: true
55
+
56
+ # Report format
57
+ format: "markdown" # markdown | json | html
58
+
59
+ # Include in report
60
+ include:
61
+ mcp_usage_stats: true
62
+ files_created: true
63
+ files_modified: true
64
+ duration: true
65
+ iterations_count: true
66
+ validations_performed: true
67
+
68
+ # Iteration settings
69
+ iteration:
70
+ # Maximum iterations before forced stop (0 = unlimited)
71
+ max_iterations: 0
72
+
73
+ # Pause between iterations (milliseconds)
74
+ pause_ms: 1000
75
+
76
+ # Completion detection
77
+ completion:
78
+ # Require explicit completion promise
79
+ require_promise: true
80
+
81
+ # Keywords that indicate completion
82
+ keywords:
83
+ - "TASK_COMPLETE"
84
+ - "FEATURE_DONE"
85
+
86
+ # Metrics and counters
87
+ metrics:
88
+ enabled: true
89
+
90
+ # Track MCP tool usage
91
+ track_mcp_tools: true
92
+
93
+ # Track file operations
94
+ track_file_ops: true
95
+
96
+ # Export metrics on completion
97
+ export_on_complete: true
98
+
99
+ # Alerting (future feature)
100
+ alerts:
101
+ enabled: false
102
+
103
+ # Alert on MCP failure
104
+ on_mcp_failure: true
105
+
106
+ # Alert on max iterations reached
107
+ on_max_iterations: true
108
+
109
+ # Alert destinations (future)
110
+ # destinations:
111
+ # - type: "console"
112
+ # - type: "file"
113
+ # - type: "webhook"
@@ -0,0 +1,173 @@
1
+ #!/bin/bash
2
+ # Ralph Loop Setup Script
3
+ # SmartStack CLI - https://atlashub.ch
4
+ #
5
+ # This script initializes the Ralph loop with MCP validation
6
+ # Usage: setup-ralph-loop.sh "PROMPT" [--max-iterations N] [--completion-promise TEXT]
7
+
8
+ set -e
9
+
10
+ # Colors
11
+ RED='\033[0;31m'
12
+ GREEN='\033[0;32m'
13
+ YELLOW='\033[1;33m'
14
+ BLUE='\033[0;34m'
15
+ NC='\033[0m' # No Color
16
+
17
+ # Configuration
18
+ RALPH_CONFIG_FILE=".ralph/ralph.config.yaml"
19
+ RALPH_LOG_DIR=".ralph/logs"
20
+ REQUIRED_MCP_SERVERS=("context7" "smartstack")
21
+
22
+ # Parse arguments
23
+ PROMPT=""
24
+ MAX_ITERATIONS=0
25
+ COMPLETION_PROMISE=""
26
+
27
+ while [[ $# -gt 0 ]]; do
28
+ case $1 in
29
+ --max-iterations)
30
+ MAX_ITERATIONS="$2"
31
+ shift 2
32
+ ;;
33
+ --completion-promise)
34
+ COMPLETION_PROMISE="$2"
35
+ shift 2
36
+ ;;
37
+ *)
38
+ if [[ -z "$PROMPT" ]]; then
39
+ PROMPT="$1"
40
+ fi
41
+ shift
42
+ ;;
43
+ esac
44
+ done
45
+
46
+ # Functions
47
+ log_info() {
48
+ echo -e "${BLUE}[Ralph]${NC} $1"
49
+ }
50
+
51
+ log_success() {
52
+ echo -e "${GREEN}[Ralph]${NC} $1"
53
+ }
54
+
55
+ log_warning() {
56
+ echo -e "${YELLOW}[Ralph]${NC} $1"
57
+ }
58
+
59
+ log_error() {
60
+ echo -e "${RED}[Ralph]${NC} $1"
61
+ }
62
+
63
+ check_mcp_server() {
64
+ local server_name="$1"
65
+ # Check if MCP server is available via claude mcp list
66
+ if claude mcp list 2>/dev/null | grep -q "$server_name"; then
67
+ return 0
68
+ else
69
+ return 1
70
+ fi
71
+ }
72
+
73
+ validate_mcp_servers() {
74
+ log_info "Validating required MCP servers..."
75
+ local all_ok=true
76
+
77
+ for server in "${REQUIRED_MCP_SERVERS[@]}"; do
78
+ if check_mcp_server "$server"; then
79
+ log_success " ✓ $server available"
80
+ else
81
+ log_error " ✗ $server NOT FOUND"
82
+ log_warning " Install with: claude mcp add $server"
83
+ all_ok=false
84
+ fi
85
+ done
86
+
87
+ if [[ "$all_ok" == "false" ]]; then
88
+ log_error ""
89
+ log_error "Ralph requires ALL MCP servers to be available."
90
+ log_error "Please install missing servers and try again."
91
+ log_error ""
92
+ log_error "Quick fix: smartstack check-mcp"
93
+ exit 1
94
+ fi
95
+
96
+ log_success "All MCP servers validated ✓"
97
+ }
98
+
99
+ ensure_ralph_structure() {
100
+ # Create .ralph directory structure if not exists
101
+ if [[ ! -d ".ralph" ]]; then
102
+ log_info "Creating .ralph directory structure..."
103
+ mkdir -p ".ralph/logs"
104
+ mkdir -p ".ralph/reports"
105
+
106
+ # Copy default config if available
107
+ if [[ -f "${CLAUDE_PLUGIN_ROOT}/templates/ralph/ralph.config.yaml" ]]; then
108
+ cp "${CLAUDE_PLUGIN_ROOT}/templates/ralph/ralph.config.yaml" ".ralph/"
109
+ fi
110
+
111
+ log_success ".ralph structure created"
112
+ fi
113
+
114
+ # Ensure log directory exists
115
+ mkdir -p "$RALPH_LOG_DIR"
116
+ }
117
+
118
+ init_session_log() {
119
+ local session_id=$(date +%Y%m%d_%H%M%S)
120
+ local log_file="$RALPH_LOG_DIR/ralph-session-$session_id.log"
121
+
122
+ echo "# Ralph Session Log" > "$log_file"
123
+ echo "# Started: $(date -Iseconds)" >> "$log_file"
124
+ echo "# Prompt: $PROMPT" >> "$log_file"
125
+ echo "# Max Iterations: $MAX_ITERATIONS" >> "$log_file"
126
+ echo "# Completion Promise: $COMPLETION_PROMISE" >> "$log_file"
127
+ echo "" >> "$log_file"
128
+
129
+ export RALPH_SESSION_LOG="$log_file"
130
+ export RALPH_SESSION_ID="$session_id"
131
+
132
+ log_info "Session log: $log_file"
133
+ }
134
+
135
+ # Main execution
136
+ echo ""
137
+ echo -e "${BLUE}╔══════════════════════════════════════════╗${NC}"
138
+ echo -e "${BLUE}║${NC} ${GREEN}Ralph Weegund${NC} - SmartStack ${BLUE}║${NC}"
139
+ echo -e "${BLUE}╚══════════════════════════════════════════╝${NC}"
140
+ echo ""
141
+
142
+ # Validate prompt
143
+ if [[ -z "$PROMPT" ]]; then
144
+ log_error "No prompt provided!"
145
+ log_info "Usage: /ralph-loop \"Your feature description\""
146
+ exit 1
147
+ fi
148
+
149
+ # Run validations
150
+ validate_mcp_servers
151
+ ensure_ralph_structure
152
+ init_session_log
153
+
154
+ # Display configuration
155
+ echo ""
156
+ log_info "Configuration:"
157
+ echo " • Prompt: $PROMPT"
158
+ [[ $MAX_ITERATIONS -gt 0 ]] && echo " • Max iterations: $MAX_ITERATIONS"
159
+ [[ -n "$COMPLETION_PROMISE" ]] && echo " • Completion promise: $COMPLETION_PROMISE"
160
+ echo ""
161
+
162
+ log_success "Ralph is ready. Starting iteration loop..."
163
+ echo ""
164
+
165
+ # Export for Claude to use
166
+ export RALPH_PROMPT="$PROMPT"
167
+ export RALPH_MAX_ITERATIONS="$MAX_ITERATIONS"
168
+ export RALPH_COMPLETION_PROMISE="$COMPLETION_PROMISE"
169
+ export RALPH_STARTED="true"
170
+
171
+ # The actual loop behavior is handled by Claude Code
172
+ # This script just sets up the environment
173
+ exit 0
@@ -0,0 +1,117 @@
1
+ # Skills SmartStack - Fonctions Partagées
2
+
3
+ ## Stratégie Modèles
4
+
5
+ | Tâche | Modèle | Raison |
6
+ |-------|--------|--------|
7
+ | Génération code | **Sonnet** | Rapport qualité/coût optimal |
8
+ | Audit sécurité | **Opus** | Analyse critique requise |
9
+ | Validation finale | **Opus** | Décisions architecturales |
10
+
11
+ ## Architecture SmartStack
12
+
13
+ ```
14
+ Domain → Application → Infrastructure → API → Web
15
+ ```
16
+
17
+ ### Layers
18
+ | Layer | Responsabilité | Namespace |
19
+ |-------|---------------|-----------|
20
+ | Domain | Entités, ValueObjects | `SmartStack.Domain.{Context}` |
21
+ | Application | Services, DTOs, Interfaces | `SmartStack.Application.{Context}` |
22
+ | Infrastructure | Implémentations, EF Core | `SmartStack.Infrastructure.{Context}` |
23
+ | API | Controllers, Middleware | `SmartStack.Api.Controllers.{Area}` |
24
+ | Web | React components, pages | `src/pages/{context}/{app}/{module}` |
25
+
26
+ ## Permissions (2 fichiers obligatoires)
27
+
28
+ ### 1. Permissions.cs (Application layer)
29
+ ```csharp
30
+ public static class {Module}
31
+ {
32
+ public const string View = "{context}.{app}.{module}.view";
33
+ public const string Create = "{context}.{app}.{module}.create";
34
+ public const string Update = "{context}.{app}.{module}.update";
35
+ public const string Delete = "{context}.{app}.{module}.delete";
36
+ }
37
+ ```
38
+
39
+ ### 2. PermissionConfiguration.cs (Infrastructure layer)
40
+ ```csharp
41
+ builder.HasData(
42
+ new { Id = nextId++, Path = Permissions.{Module}.View, ... },
43
+ new { Id = nextId++, Path = Permissions.{Module}.Create, ... },
44
+ ...
45
+ );
46
+ ```
47
+
48
+ ## i18n (4 langues obligatoires)
49
+
50
+ | Langue | Fichier | Code |
51
+ |--------|---------|------|
52
+ | Français | `fr.json` | `fr` |
53
+ | English | `en.json` | `en` |
54
+ | Italiano | `it.json` | `it` |
55
+ | Deutsch | `de.json` | `de` |
56
+
57
+ ### Structure i18n
58
+ ```json
59
+ {
60
+ "{context}": {
61
+ "{application}": {
62
+ "{module}": {
63
+ "title": "...",
64
+ "fields": { ... },
65
+ "actions": { ... },
66
+ "messages": { ... }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ ```
72
+
73
+ ## Services Communs à Injecter
74
+
75
+ | Service | Usage |
76
+ |---------|-------|
77
+ | `IApplicationDbContext` | Accès DB |
78
+ | `ICurrentUserService` | User courant |
79
+ | `ILogger<T>` | Logging |
80
+ | `IMapper` | AutoMapper |
81
+ | `IPermissionService` | Cache permissions |
82
+
83
+ ## Validation Sécurité
84
+
85
+ ### Logs Critiques
86
+ | Événement | Niveau |
87
+ |-----------|--------|
88
+ | Login échoué | `Critical` |
89
+ | Permission refusée | `Critical` |
90
+ | Compte verrouillé | `Critical` |
91
+ | Password change | `Warning` |
92
+ | Suppression | `Warning` |
93
+
94
+ ### Protection Comptes Système
95
+ ```csharp
96
+ if (entity.UserType == UserType.System || entity.UserType == UserType.LocalAdmin)
97
+ return BadRequest(new { message = "Cannot modify system accounts" });
98
+ ```
99
+
100
+ ## Checklist Validation Commune
101
+
102
+ ```
103
+ □ Permissions créées (Permissions.cs + PermissionConfiguration.cs)
104
+ □ Migration EF Core créée
105
+ □ i18n 4 langues (fr, en, it, de)
106
+ □ Tests unitaires
107
+ □ Documentation API (ProducesResponseType)
108
+ ```
109
+
110
+ ## Références MCP Tools
111
+
112
+ | Tool | Usage |
113
+ |------|-------|
114
+ | `mcp__smartstack__validate_conventions` | Validation conventions |
115
+ | `mcp__smartstack__scaffold_extension` | Génération code |
116
+ | `mcp__smartstack__check_migrations` | Vérification migrations |
117
+ | `mcp__smartstack__scaffold_tests` | Génération tests |