@atlashub/smartstack-cli 3.8.0 → 3.9.0

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 (120) hide show
  1. package/dist/index.js +365 -2
  2. package/dist/index.js.map +1 -1
  3. package/package.json +2 -1
  4. package/templates/agents/action.md +1 -0
  5. package/templates/agents/ba-writer.md +33 -0
  6. package/templates/agents/explore-codebase.md +1 -0
  7. package/templates/agents/explore-docs.md +1 -0
  8. package/templates/agents/fix-grammar.md +1 -0
  9. package/templates/agents/snipper.md +1 -0
  10. package/templates/skills/admin/SKILL.md +6 -0
  11. package/templates/skills/ai-prompt/SKILL.md +32 -136
  12. package/templates/skills/ai-prompt/steps/step-01-implementation.md +122 -0
  13. package/templates/skills/apex/SKILL.md +120 -0
  14. package/templates/skills/apex/_shared.md +86 -0
  15. package/templates/skills/apex/references/agent-teams-protocol.md +164 -0
  16. package/templates/skills/apex/references/smartstack-layers.md +173 -0
  17. package/templates/skills/apex/steps/step-00-init.md +156 -0
  18. package/templates/skills/apex/steps/step-01-analyze.md +169 -0
  19. package/templates/skills/apex/steps/step-02-plan.md +160 -0
  20. package/templates/skills/apex/steps/step-03-execute.md +166 -0
  21. package/templates/skills/apex/steps/step-04-validate.md +138 -0
  22. package/templates/skills/apex/steps/step-05-examine.md +124 -0
  23. package/templates/skills/apex/steps/step-06-resolve.md +105 -0
  24. package/templates/skills/apex/steps/step-07-tests.md +130 -0
  25. package/templates/skills/apex/steps/step-08-run-tests.md +115 -0
  26. package/templates/skills/application/SKILL.md +10 -0
  27. package/templates/skills/application/references/backend-controller-hierarchy.md +58 -0
  28. package/templates/skills/application/references/backend-entity-seeding.md +72 -0
  29. package/templates/skills/application/references/backend-verification.md +88 -0
  30. package/templates/skills/application/references/frontend-verification.md +111 -0
  31. package/templates/skills/application/references/nav-fallback-procedure.md +200 -0
  32. package/templates/skills/application/references/provider-template.md +134 -0
  33. package/templates/skills/application/references/test-frontend.md +73 -0
  34. package/templates/skills/application/references/test-prerequisites.md +72 -0
  35. package/templates/skills/application/steps/step-01-navigation.md +7 -198
  36. package/templates/skills/application/steps/step-03b-provider.md +4 -128
  37. package/templates/skills/application/steps/step-04-backend.md +20 -350
  38. package/templates/skills/application/steps/step-05-frontend.md +12 -101
  39. package/templates/skills/application/steps/step-07-tests.md +12 -132
  40. package/templates/skills/business-analyse/SKILL.md +11 -2
  41. package/templates/skills/business-analyse/html/ba-interactive.html +176 -14
  42. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +1 -0
  43. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +16 -4
  44. package/templates/skills/business-analyse/html/src/scripts/06-render-consolidation.js +7 -2
  45. package/templates/skills/business-analyse/html/src/scripts/09-export.js +103 -0
  46. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +12 -6
  47. package/templates/skills/business-analyse/html/src/scripts/11-review-panel.js +24 -2
  48. package/templates/skills/business-analyse/html/src/styles/08-review-panel.css +12 -0
  49. package/templates/skills/business-analyse/html/src/template.html +1 -0
  50. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +78 -0
  51. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +97 -0
  52. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +92 -0
  53. package/templates/skills/business-analyse/references/deploy-data-build.md +121 -0
  54. package/templates/skills/business-analyse/references/deploy-modes.md +49 -0
  55. package/templates/skills/business-analyse/references/handoff-file-templates.md +119 -0
  56. package/templates/skills/business-analyse/references/handoff-mappings.md +81 -0
  57. package/templates/skills/business-analyse/references/html-data-mapping.md +10 -2
  58. package/templates/skills/business-analyse/references/init-schema-deployment.md +65 -0
  59. package/templates/skills/business-analyse/references/review-data-mapping.md +363 -0
  60. package/templates/skills/business-analyse/references/spec-auto-inference.md +57 -0
  61. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +85 -0
  62. package/templates/skills/business-analyse/references/ui-resource-cards.md +110 -0
  63. package/templates/skills/business-analyse/references/validate-incremental-html.md +55 -0
  64. package/templates/skills/business-analyse/steps/step-00-init.md +35 -68
  65. package/templates/skills/business-analyse/steps/step-01-cadrage.md +5 -194
  66. package/templates/skills/business-analyse/steps/step-03a-data.md +6 -49
  67. package/templates/skills/business-analyse/steps/step-03b-ui.md +12 -178
  68. package/templates/skills/business-analyse/steps/step-03d-validate.md +3 -48
  69. package/templates/skills/business-analyse/steps/step-04-consolidation.md +9 -104
  70. package/templates/skills/business-analyse/steps/step-05a-handoff.md +25 -441
  71. package/templates/skills/business-analyse/steps/step-05b-deploy.md +19 -187
  72. package/templates/skills/business-analyse/steps/step-06-review.md +277 -0
  73. package/templates/skills/cc-agent/references/agent-behavior-patterns.md +95 -0
  74. package/templates/skills/cc-agent/steps/step-02-generate.md +5 -78
  75. package/templates/skills/check-version/SKILL.md +7 -0
  76. package/templates/skills/controller/references/controller-code-templates.md +159 -0
  77. package/templates/skills/controller/references/permission-sync-templates.md +152 -0
  78. package/templates/skills/controller/steps/step-03-generate.md +6 -158
  79. package/templates/skills/controller/steps/step-04-perms.md +5 -144
  80. package/templates/skills/debug/SKILL.md +7 -0
  81. package/templates/skills/explore/SKILL.md +6 -0
  82. package/templates/skills/feature-full/SKILL.md +39 -142
  83. package/templates/skills/feature-full/steps/step-01-implementation.md +120 -0
  84. package/templates/skills/gitflow/references/init-config-template.md +135 -0
  85. package/templates/skills/gitflow/references/init-name-normalization.md +103 -0
  86. package/templates/skills/gitflow/references/plan-template.md +69 -0
  87. package/templates/skills/gitflow/references/start-efcore-preflight.md +70 -0
  88. package/templates/skills/gitflow/references/start-local-config.md +110 -0
  89. package/templates/skills/gitflow/steps/step-init.md +18 -289
  90. package/templates/skills/gitflow/steps/step-plan.md +6 -63
  91. package/templates/skills/gitflow/steps/step-start.md +16 -126
  92. package/templates/skills/mcp/SKILL.md +9 -213
  93. package/templates/skills/mcp/steps/step-01-healthcheck.md +108 -0
  94. package/templates/skills/mcp/steps/step-02-tools.md +73 -0
  95. package/templates/skills/notification/SKILL.md +7 -0
  96. package/templates/skills/quick-search/SKILL.md +5 -0
  97. package/templates/skills/ralph-loop/SKILL.md +99 -381
  98. package/templates/skills/ralph-loop/references/category-rules.md +259 -0
  99. package/templates/skills/ralph-loop/references/compact-loop.md +182 -0
  100. package/templates/skills/ralph-loop/references/task-transform-legacy.md +259 -0
  101. package/templates/skills/ralph-loop/references/team-orchestration.md +189 -0
  102. package/templates/skills/ralph-loop/steps/step-00-init.md +111 -383
  103. package/templates/skills/ralph-loop/steps/step-01-task.md +79 -896
  104. package/templates/skills/ralph-loop/steps/step-02-execute.md +68 -680
  105. package/templates/skills/ralph-loop/steps/step-03-commit.md +47 -277
  106. package/templates/skills/ralph-loop/steps/step-04-check.md +124 -607
  107. package/templates/skills/ralph-loop/steps/step-05-report.md +68 -367
  108. package/templates/skills/refactor/SKILL.md +12 -176
  109. package/templates/skills/refactor/steps/step-01-discover.md +60 -0
  110. package/templates/skills/refactor/steps/step-02-execute.md +67 -0
  111. package/templates/skills/review-code/SKILL.md +19 -257
  112. package/templates/skills/review-code/steps/step-01-smartstack.md +96 -0
  113. package/templates/skills/review-code/steps/step-02-detailed-review.md +80 -0
  114. package/templates/skills/review-code/steps/step-03-react.md +44 -0
  115. package/templates/skills/ui-components/SKILL.md +7 -0
  116. package/templates/skills/utils/SKILL.md +6 -0
  117. package/templates/skills/validate/SKILL.md +6 -0
  118. package/templates/skills/validate-feature/SKILL.md +8 -0
  119. package/templates/skills/workflow/SKILL.md +40 -118
  120. package/templates/skills/workflow/steps/step-01-implementation.md +84 -0
@@ -6,119 +6,44 @@ next_step: steps/step-04-check.md
6
6
 
7
7
  # Step 3: Commit Changes
8
8
 
9
- > **CONTEXT OPTIMIZATION:** This file is only read ONCE (first iteration).
10
- > After the first full iteration, ALL subsequent iterations use the COMPACT LOOP
11
- > in step-04-check.md section 5 which includes inline commit logic.
12
- > **DO NOT re-read this file for iterations > 1.**
9
+ > **CONTEXT OPTIMIZATION:** Read ONCE (first iteration). Subsequent iterations use compact-loop.md.
13
10
 
14
11
  ## YOUR TASK:
15
12
 
16
- Commit the changes from the executed task, finalize task tracking in prd.json, and append to history.
13
+ Commit changes, finalize task tracking in prd.json, append to history.
17
14
 
18
15
  ---
19
16
 
20
17
  ## EXECUTION SEQUENCE:
21
18
 
22
- ### 0. PRE-COMMIT VALIDATION (BLOCKING)
23
-
24
- **CRITICAL: Before ANY commit, verify all tests pass.**
19
+ ### 0. Pre-Commit Validation (BLOCKING)
25
20
 
26
21
  ```bash
27
- # Check if test project exists
28
- PROJECT_NAME=$(basename $(pwd))
29
- TEST_PROJECT="tests/${PROJECT_NAME}.Tests.Unit"
22
+ # Backend: build must pass
23
+ if [ "{current_task_category}" != "frontend" ] && [ "{current_task_category}" != "i18n" ]; then
24
+ dotnet build --no-restore --verbosity quiet
25
+ fi
30
26
 
31
- if [ -d "$TEST_PROJECT" ]; then
32
- echo "Running full test suite before commit..."
27
+ # Frontend: typecheck must pass
28
+ if [ "{current_task_category}" = "frontend" ]; then
29
+ npm run typecheck
30
+ fi
33
31
 
34
- # Run ALL tests (not just current task's tests)
32
+ # Tests: full suite if test project exists
33
+ TEST_PROJECT="tests/$(basename $(pwd)).Tests.Unit"
34
+ if [ -d "$TEST_PROJECT" ]; then
35
35
  dotnet test "$TEST_PROJECT" --no-build --verbosity minimal
36
-
37
- TEST_EXIT_CODE=$?
38
-
39
- if [ $TEST_EXIT_CODE -ne 0 ]; then
40
- echo "╔════════════════════════════════════════════════════════════╗"
41
- echo "║ ❌ COMMIT BLOCKED: TESTS FAILED ║"
42
- echo "╠════════════════════════════════════════════════════════════╣"
43
- echo "║ Cannot commit code when tests are failing. ║"
44
- echo "║ This prevents broken code from entering the repository. ║"
45
- echo "╠════════════════════════════════════════════════════════════╣"
46
- echo "║ ACTION REQUIRED: ║"
47
- echo "║ 1. Review test failures above ║"
48
- echo "║ 2. Fix the failing code ║"
49
- echo "║ 3. Re-run: dotnet test ║"
50
- echo "║ 4. Once tests pass, Ralph will commit automatically ║"
51
- echo "╚════════════════════════════════════════════════════════════╝"
52
-
53
- # Mark task as failed (do not complete)
54
- # Update prd.json
55
- const prd = readJSON('.ralph/prd.json');
56
- const task = prd.tasks.find(t => t.id === {current_task_id});
57
- task.status = 'failed';
58
- task.error = 'Pre-commit test suite failed. Cannot commit broken code.';
59
- writeJSON('.ralph/prd.json', prd);
60
-
61
- # STOP - return to step-02 to fix
62
- exit 1;
36
+ if [ $? -ne 0 ]; then
37
+ echo "COMMIT BLOCKED: tests failing. Fix before committing."
38
+ STOP — return to step-02
63
39
  fi
64
-
65
- echo "✅ All tests passed. Proceeding with commit..."
66
40
  fi
67
41
  ```
68
42
 
69
- **Additional validation for specific categories:**
70
-
71
- ```javascript
72
- const task = prd.tasks.find(t => t.id === {current_task_id});
73
-
74
- // For backend changes: ensure build succeeds
75
- if (['domain', 'application', 'infrastructure', 'api'].includes(task.category)) {
76
- dotnet build --no-restore --verbosity quiet
77
- if ($? !== 0) {
78
- echo "❌ Build failed. Cannot commit broken code.";
79
- task.status = 'failed';
80
- task.error = 'Build failed';
81
- exit 1;
82
- }
83
- }
84
-
85
- // For frontend changes: ensure typecheck passes
86
- if (task.category === 'frontend') {
87
- npm run typecheck
88
- if ($? !== 0) {
89
- echo "❌ TypeScript errors. Cannot commit broken code.";
90
- task.status = 'failed';
91
- task.error = 'TypeScript compilation failed';
92
- exit 1;
93
- }
94
- }
95
- ```
96
-
97
- **If ALL validations pass, proceed to staging.**
98
-
99
- ### 1. Stage Changes
100
-
101
- **Add modified files:**
102
-
103
- ```bash
104
- git add {files_created} {files_modified}
105
-
106
- # Also stage prd.json (already updated in step-02)
107
- git add .ralph/prd.json
108
- ```
109
-
110
- **Verify staged changes:**
111
-
112
- ```bash
113
- git status
114
- git diff --cached --stat
115
- ```
116
-
117
- ### 2. Create Commit
118
-
119
- **Commit with descriptive message:**
43
+ ### 1. Stage and Commit
120
44
 
121
45
  ```bash
46
+ git add {files_created} {files_modified} .ralph/prd.json
122
47
  git commit -m "$(cat <<'EOF'
123
48
  {PREFIX}({scope}): {current_task_description}
124
49
 
@@ -129,235 +54,80 @@ Category: {current_task_category}
129
54
  Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
130
55
  EOF
131
56
  )"
132
- ```
133
-
134
- **Determine commit prefix and scope:**
135
57
 
136
- | Category | Prefix | Scope |
137
- |----------|--------|-------|
138
- | `domain` | `feat` | entity name or module |
139
- | `application` | `feat` | module name |
140
- | `infrastructure` | `db` | migrations / config |
141
- | `api` | `feat` | controller name |
142
- | `frontend` | `feat` | component/page name |
143
- | `i18n` | `chore` | i18n |
144
- | `test` | `test` | module name |
145
- | `validation` | `chore` | validation |
146
- | `other` | `chore` | ralph |
147
-
148
- **Multi-module scope:** When `{current_module}` is set (from modules-queue.json), prefix the scope with the module code: `{PREFIX}({module}/{scope})`. Example: `feat(orders/OrderController): Create REST endpoints`.
149
-
150
- **Get commit hash:**
151
- ```bash
152
58
  COMMIT_HASH=$(git rev-parse --short HEAD)
153
59
  ```
154
60
 
155
- ### 3. Finalize Task in prd.json
61
+ **Prefix mapping:**
156
62
 
157
- **Mark task as completed with all tracking data:**
63
+ | Category | Prefix |
64
+ |----------|--------|
65
+ | domain, application, api, frontend | `feat` |
66
+ | infrastructure | `db` |
67
+ | i18n | `chore` |
68
+ | test | `test` |
69
+ | validation, other | `chore` |
70
+
71
+ ### 2. Finalize Task in prd.json
158
72
 
159
73
  ```javascript
160
74
  const prd = readJSON('.ralph/prd.json');
161
75
  const task = prd.tasks.find(t => t.id === {current_task_id});
162
76
  const now = new Date().toISOString();
163
77
 
164
- // Only mark completed if not already failed in step-02
165
- if (task.status !== 'failed') {
166
- task.status = 'completed';
167
- }
78
+ if (task.status !== 'failed') task.status = 'completed';
168
79
  task.completed_at = now;
169
80
  task.iteration = prd.config.current_iteration;
170
81
  task.commit_hash = COMMIT_HASH;
171
82
 
172
- // files_changed already set in step-02, but verify
173
- if (!task.files_changed || (!task.files_changed.created.length && !task.files_changed.modified.length)) {
174
- // Fallback: extract from git diff
175
- task.files_changed = {
176
- created: getGitNewFiles(), // git diff --cached --name-only --diff-filter=A
177
- modified: getGitModifiedFiles() // git diff --cached --name-only --diff-filter=M
178
- };
179
- }
180
- ```
181
-
182
- ### 4. Append to History
183
-
184
- **Add structured iteration entry:**
185
-
186
- ```javascript
187
83
  prd.history.push({
188
- iteration: prd.config.current_iteration,
189
- task_id: task.id,
190
- action: task.status, // "completed" or "failed"
191
- timestamp: now,
192
- commit_hash: COMMIT_HASH,
193
- duration_seconds: Math.round(
194
- (new Date(now) - new Date(task.started_at)) / 1000
195
- ),
196
- notes: "{What was learned or accomplished during this task}"
84
+ iteration: prd.config.current_iteration, task_id: task.id,
85
+ action: task.status, timestamp: now, commit_hash: COMMIT_HASH,
86
+ duration_seconds: Math.round((new Date(now) - new Date(task.started_at)) / 1000),
87
+ notes: "{What was accomplished}"
197
88
  });
198
- ```
199
89
 
200
- ### 5. Increment Iteration and Update Timestamps
201
-
202
- **IMPORTANT: Increment AFTER recording the current iteration in task and history.**
203
-
204
- ```javascript
205
90
  prd.config.current_iteration++;
206
91
  prd.updated_at = now;
207
92
 
208
- // Update top-level status
209
- const allCompleted = prd.tasks.every(t =>
210
- t.status === 'completed' || t.status === 'skipped'
211
- );
212
- const anyFailed = prd.tasks.some(t => t.status === 'failed');
213
- const anyBlocked = prd.tasks.some(t => t.status === 'blocked');
214
-
215
- if (allCompleted) {
216
- prd.status = 'completed';
217
- } else if (anyFailed || anyBlocked) {
218
- prd.status = 'partial';
219
- } else {
220
- prd.status = 'in_progress';
221
- }
93
+ const allDone = prd.tasks.every(t => t.status === 'completed' || t.status === 'skipped');
94
+ prd.status = allDone ? 'completed' : prd.tasks.some(t => t.status === 'failed' || t.status === 'blocked') ? 'partial' : 'in_progress';
222
95
 
223
96
  writeJSON('.ralph/prd.json', prd);
224
97
  ```
225
98
 
226
- ### 6. Update progress.txt
227
-
228
- **Append learnings to progress.txt:**
99
+ ### 3. Update progress.txt
229
100
 
101
+ Append iteration learnings (compact):
230
102
  ```markdown
231
- ---
232
-
233
- ## Iteration {current_iteration}
234
-
235
- ### Task Completed
236
- [{current_task_id}] {current_task_description}
237
- Category: {current_task_category}
238
- Status: {task.status}
239
- Commit: {COMMIT_HASH}
240
-
241
- ### Files Changed
242
- - Created: {task.files_changed.created}
243
- - Modified: {task.files_changed.modified}
244
-
245
- ### Acceptance Criteria
246
- {current_task_criteria}
247
- Result: ✅ Met / ❌ Not met
248
-
249
- ### Learnings
250
- {What was learned during this task}
251
- {Any issues encountered and how they were resolved}
252
- {Patterns discovered that might help future tasks}
253
-
254
- ### Context for Next Task
255
- {What the next iteration should know}
103
+ ## Iteration {iteration} — [{id}] {description}
104
+ Status: {status} | Commit: {hash} | Files: {count}
105
+ Learnings: {what was learned}
256
106
  ```
257
107
 
258
- ### 7. Commit prd.json and progress.txt Updates
259
-
260
- **Stage and commit the tracking files separately:**
108
+ ### 4. Commit Progress Files
261
109
 
262
110
  ```bash
263
111
  git add .ralph/prd.json .ralph/progress.txt
264
- # Also stage modules-queue.json if it exists (multi-module tracking)
265
112
  [ -f .ralph/modules-queue.json ] && git add .ralph/modules-queue.json
266
-
267
- git commit -m "$(cat <<'EOF'
268
- chore(ralph): update progress - task {current_task_id}/{tasks_total}
269
-
270
- Iteration {current_iteration} complete
271
- Status: {task.status}
272
- {current_module ? "Module: " + current_module : ""}
273
-
274
- Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
275
- EOF
276
- )"
113
+ git commit -m "chore(ralph): progress — task {id}/{total}"
277
114
  ```
278
115
 
279
- ### 8. Verify Commit
280
-
281
- **Check commit was created:**
116
+ ### 5. Verify
282
117
 
283
118
  ```bash
284
119
  git log -2 --oneline
285
120
  ```
286
121
 
287
- **Expected output:**
288
- ```
289
- def5678 chore(ralph): update progress - task {id}/{total}
290
- abc1234 feat(scope): {current_task_description}
291
- ```
292
-
293
- ### 9. Log Activity (if verbose)
294
-
295
- **If {verbose_mode} = true:**
296
-
297
- Append to `.ralph/logs/{date}.log`:
298
- ```
299
- [{timestamp}] TASK COMPLETED
300
- Task: [{current_task_id}] {current_task_description}
301
- Category: {current_task_category}
302
- Status: {task.status}
303
- Commit: {COMMIT_HASH}
304
- Files: {file_count} changed ({created_count} created, {modified_count} modified)
305
- Duration: {duration_seconds}s
306
- Iteration: {current_iteration}
307
- Validation: {validation_result}
308
- ```
309
-
310
- ---
311
-
312
- ## OUTPUT FORMAT:
313
-
314
- ```
315
- Changes Committed:
316
-
317
- | Field | Value |
318
- |-------|-------|
319
- | Commit | {COMMIT_HASH} |
320
- | Task | [{current_task_id}] {current_task_description} |
321
- | Category | {current_task_category} |
322
- | Status | {task.status} |
323
- | Iteration | {current_iteration} |
324
- | Files | {file_count} changed |
325
- | Duration | {duration_seconds}s |
326
- | Validation | {validation_result} |
327
-
328
- prd.json: Task {current_task_id} → {task.status}, history entry added
329
- progress.txt: Iteration {current_iteration} learnings appended
330
-
331
- -> Checking completion...
332
- ```
333
-
334
122
  ---
335
123
 
336
124
  ## ERROR HANDLING:
337
125
 
338
- **If commit fails (pre-commit hook):**
339
-
340
- 1. Read hook error message
341
- 2. Fix the issue (lint, format, etc.)
342
- 3. Stage fixes
343
- 4. Create NEW commit (don't amend)
344
- 5. Proceed to step-04
345
-
346
- **If prd.json write fails:**
347
-
348
- 1. Log error
349
- 2. Retry write
350
- 3. If still fails, output error and stop
351
-
352
- **If task was failed in step-02:**
353
-
354
- 1. Still commit whatever was done (partial progress)
355
- 2. task.status remains "failed"
356
- 3. history entry records action: "failed"
357
- 4. step-04 will handle downstream blocking
126
+ - **Commit fails (pre-commit hook):** Fix issue, stage, create NEW commit (don't amend)
127
+ - **Task failed in step-02:** Still commit partial progress, status stays "failed"
358
128
 
359
129
  ---
360
130
 
361
131
  ## NEXT STEP:
362
132
 
363
- After commit and updates complete, proceed to `./step-04-check.md`
133
+ After commit, proceed to `./step-04-check.md`