@atlashub/smartstack-cli 3.7.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 (133) hide show
  1. package/dist/index.js +365 -2
  2. package/dist/index.js.map +1 -1
  3. package/package.json +4 -2
  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 +3214 -2246
  42. package/templates/skills/business-analyse/html/build-html.js +77 -0
  43. package/templates/skills/business-analyse/html/src/scripts/01-data-init.js +130 -0
  44. package/templates/skills/business-analyse/html/src/scripts/02-navigation.js +22 -0
  45. package/templates/skills/business-analyse/html/src/scripts/03-render-cadrage.js +208 -0
  46. package/templates/skills/business-analyse/html/src/scripts/04-render-modules.js +211 -0
  47. package/templates/skills/business-analyse/html/src/scripts/05-render-specs.js +554 -0
  48. package/templates/skills/business-analyse/html/src/scripts/06-render-consolidation.js +110 -0
  49. package/templates/skills/business-analyse/html/src/scripts/07-render-handoff.js +90 -0
  50. package/templates/skills/business-analyse/html/src/scripts/08-editing.js +45 -0
  51. package/templates/skills/business-analyse/html/src/scripts/09-export.js +168 -0
  52. package/templates/skills/business-analyse/html/src/scripts/10-comments.js +171 -0
  53. package/templates/skills/business-analyse/html/src/scripts/11-review-panel.js +161 -0
  54. package/templates/skills/business-analyse/html/src/styles/01-variables.css +38 -0
  55. package/templates/skills/business-analyse/html/src/styles/02-layout.css +101 -0
  56. package/templates/skills/business-analyse/html/src/styles/03-navigation.css +62 -0
  57. package/templates/skills/business-analyse/html/src/styles/04-cards.css +196 -0
  58. package/templates/skills/business-analyse/html/src/styles/05-modules.css +325 -0
  59. package/templates/skills/business-analyse/html/src/styles/06-wireframes.css +230 -0
  60. package/templates/skills/business-analyse/html/src/styles/07-comments.css +184 -0
  61. package/templates/skills/business-analyse/html/src/styles/08-review-panel.css +241 -0
  62. package/templates/skills/business-analyse/html/src/template.html +623 -0
  63. package/templates/skills/business-analyse/references/cadrage-structure-cards.md +78 -0
  64. package/templates/skills/business-analyse/references/cadrage-vibe-coding.md +97 -0
  65. package/templates/skills/business-analyse/references/consolidation-structural-checks.md +92 -0
  66. package/templates/skills/business-analyse/references/deploy-data-build.md +121 -0
  67. package/templates/skills/business-analyse/references/deploy-modes.md +49 -0
  68. package/templates/skills/business-analyse/references/handoff-file-templates.md +119 -0
  69. package/templates/skills/business-analyse/references/handoff-mappings.md +81 -0
  70. package/templates/skills/business-analyse/references/html-data-mapping.md +10 -2
  71. package/templates/skills/business-analyse/references/init-schema-deployment.md +65 -0
  72. package/templates/skills/business-analyse/references/review-data-mapping.md +363 -0
  73. package/templates/skills/business-analyse/references/spec-auto-inference.md +57 -0
  74. package/templates/skills/business-analyse/references/ui-dashboard-spec.md +85 -0
  75. package/templates/skills/business-analyse/references/ui-resource-cards.md +110 -0
  76. package/templates/skills/business-analyse/references/validate-incremental-html.md +55 -0
  77. package/templates/skills/business-analyse/steps/step-00-init.md +35 -68
  78. package/templates/skills/business-analyse/steps/step-01-cadrage.md +5 -194
  79. package/templates/skills/business-analyse/steps/step-03a-data.md +6 -49
  80. package/templates/skills/business-analyse/steps/step-03b-ui.md +12 -178
  81. package/templates/skills/business-analyse/steps/step-03d-validate.md +3 -48
  82. package/templates/skills/business-analyse/steps/step-04-consolidation.md +9 -104
  83. package/templates/skills/business-analyse/steps/step-05a-handoff.md +25 -441
  84. package/templates/skills/business-analyse/steps/step-05b-deploy.md +19 -187
  85. package/templates/skills/business-analyse/steps/step-06-review.md +277 -0
  86. package/templates/skills/cc-agent/references/agent-behavior-patterns.md +95 -0
  87. package/templates/skills/cc-agent/steps/step-02-generate.md +5 -78
  88. package/templates/skills/check-version/SKILL.md +7 -0
  89. package/templates/skills/controller/references/controller-code-templates.md +159 -0
  90. package/templates/skills/controller/references/permission-sync-templates.md +152 -0
  91. package/templates/skills/controller/steps/step-03-generate.md +6 -158
  92. package/templates/skills/controller/steps/step-04-perms.md +5 -144
  93. package/templates/skills/debug/SKILL.md +7 -0
  94. package/templates/skills/explore/SKILL.md +6 -0
  95. package/templates/skills/feature-full/SKILL.md +39 -142
  96. package/templates/skills/feature-full/steps/step-01-implementation.md +120 -0
  97. package/templates/skills/gitflow/references/init-config-template.md +135 -0
  98. package/templates/skills/gitflow/references/init-name-normalization.md +103 -0
  99. package/templates/skills/gitflow/references/plan-template.md +69 -0
  100. package/templates/skills/gitflow/references/start-efcore-preflight.md +70 -0
  101. package/templates/skills/gitflow/references/start-local-config.md +110 -0
  102. package/templates/skills/gitflow/steps/step-init.md +18 -289
  103. package/templates/skills/gitflow/steps/step-plan.md +6 -63
  104. package/templates/skills/gitflow/steps/step-start.md +16 -126
  105. package/templates/skills/mcp/SKILL.md +9 -213
  106. package/templates/skills/mcp/steps/step-01-healthcheck.md +108 -0
  107. package/templates/skills/mcp/steps/step-02-tools.md +73 -0
  108. package/templates/skills/notification/SKILL.md +7 -0
  109. package/templates/skills/quick-search/SKILL.md +5 -0
  110. package/templates/skills/ralph-loop/SKILL.md +99 -381
  111. package/templates/skills/ralph-loop/references/category-rules.md +259 -0
  112. package/templates/skills/ralph-loop/references/compact-loop.md +182 -0
  113. package/templates/skills/ralph-loop/references/task-transform-legacy.md +259 -0
  114. package/templates/skills/ralph-loop/references/team-orchestration.md +189 -0
  115. package/templates/skills/ralph-loop/steps/step-00-init.md +111 -383
  116. package/templates/skills/ralph-loop/steps/step-01-task.md +79 -896
  117. package/templates/skills/ralph-loop/steps/step-02-execute.md +68 -680
  118. package/templates/skills/ralph-loop/steps/step-03-commit.md +47 -277
  119. package/templates/skills/ralph-loop/steps/step-04-check.md +124 -607
  120. package/templates/skills/ralph-loop/steps/step-05-report.md +68 -367
  121. package/templates/skills/refactor/SKILL.md +12 -176
  122. package/templates/skills/refactor/steps/step-01-discover.md +60 -0
  123. package/templates/skills/refactor/steps/step-02-execute.md +67 -0
  124. package/templates/skills/review-code/SKILL.md +19 -257
  125. package/templates/skills/review-code/steps/step-01-smartstack.md +96 -0
  126. package/templates/skills/review-code/steps/step-02-detailed-review.md +80 -0
  127. package/templates/skills/review-code/steps/step-03-react.md +44 -0
  128. package/templates/skills/ui-components/SKILL.md +7 -0
  129. package/templates/skills/utils/SKILL.md +6 -0
  130. package/templates/skills/validate/SKILL.md +6 -0
  131. package/templates/skills/validate-feature/SKILL.md +8 -0
  132. package/templates/skills/workflow/SKILL.md +40 -118
  133. package/templates/skills/workflow/steps/step-01-implementation.md +84 -0
@@ -47,78 +47,11 @@ From previous steps:
47
47
 
48
48
  ## PRE-REQUISITES
49
49
 
50
- ### 1. Verify Test Project Exists
51
-
52
- Check that the solution contains a test project:
53
-
54
- ```bash
55
- # Look for existing test project
56
- ls *Tests*/*.csproj 2>/dev/null || ls tests/*/*.csproj 2>/dev/null
57
- ```
58
-
59
- If NO test project exists, create one:
60
-
61
- ```bash
62
- dotnet new xunit -n {SolutionName}.Tests -o tests/{SolutionName}.Tests
63
- dotnet sln add tests/{SolutionName}.Tests/{SolutionName}.Tests.csproj
64
- ```
65
-
66
- ### 2. Verify Required NuGet Packages
67
-
68
- The test project MUST have these packages:
69
-
70
- | Package | Purpose |
71
- |---------|---------|
72
- | `xunit` | Test framework |
73
- | `FluentAssertions` | Assertion library |
74
- | `Moq` | Mocking framework |
75
- | `Microsoft.AspNetCore.Mvc.Testing` | Integration test support |
76
- | `Microsoft.EntityFrameworkCore.Sqlite` | SQLite in-memory for REAL integration tests |
77
- | `Microsoft.Data.Sqlite` | SQLite connection support |
78
- | `Microsoft.EntityFrameworkCore.InMemory` | In-memory DB for repository tests |
79
- | `FluentValidation.TestHelper` | Validator testing support |
80
-
81
- ```bash
82
- cd tests/{SolutionName}.Tests
83
- dotnet add package FluentAssertions
84
- dotnet add package Moq
85
- dotnet add package Microsoft.AspNetCore.Mvc.Testing
86
- dotnet add package Microsoft.EntityFrameworkCore.Sqlite
87
- dotnet add package Microsoft.Data.Sqlite
88
- dotnet add package Microsoft.EntityFrameworkCore.InMemory
89
- dotnet add package FluentValidation.TestHelper
90
- ```
91
-
92
- ### 3. Add Project References
93
-
94
- The test project MUST reference the API project (for WebApplicationFactory):
95
-
96
- ```bash
97
- cd tests/{SolutionName}.Tests
98
- dotnet add reference ../../src/{SolutionName}.Api/{SolutionName}.Api.csproj
99
- dotnet add reference ../../src/{SolutionName}.Application/{SolutionName}.Application.csproj
100
- dotnet add reference ../../src/{SolutionName}.Domain/{SolutionName}.Domain.csproj
101
- dotnet add reference ../../src/{SolutionName}.Infrastructure/{SolutionName}.Infrastructure.csproj
102
- ```
103
-
104
- ### 4. Ensure Program.cs is Accessible (BLOCKING)
105
-
106
- The API project's `Program` class must be accessible for `WebApplicationFactory<Program>`.
107
-
108
- Check if `Program.cs` ends with `public partial class Program { }`. If not, add it:
109
-
110
- ```csharp
111
- // At the very end of Program.cs
112
- public partial class Program { }
113
- ```
114
-
115
- **Alternatively**, add to the API `.csproj`:
116
-
117
- ```xml
118
- <ItemGroup>
119
- <InternalsVisibleTo Include="{SolutionName}.Tests" />
120
- </ItemGroup>
121
- ```
50
+ See [references/test-prerequisites.md](../references/test-prerequisites.md) for the complete setup:
51
+ 1. Verify test project exists (create xunit project if missing)
52
+ 2. Install required NuGet packages (xunit, FluentAssertions, Moq, Mvc.Testing, EF Sqlite, etc.)
53
+ 3. Add project references (API, Application, Domain, Infrastructure)
54
+ 4. Ensure Program.cs is accessible for WebApplicationFactory (BLOCKING)
122
55
 
123
56
  ---
124
57
 
@@ -343,62 +276,13 @@ dotnet test tests/{SolutionName}.Tests/{SolutionName}.Tests.csproj --no-build --
343
276
 
344
277
  ## FRONTEND TESTS (React Components)
345
278
 
346
- ### 7. Check Frontend Test Infrastructure
279
+ See [references/test-frontend.md](../references/test-frontend.md) for the complete frontend test setup:
347
280
 
348
- Verify that the frontend project has Vitest + Testing Library configured:
349
-
350
- ```bash
351
- # Check if vitest.config.ts exists in the web/frontend project
352
- ls {WebProjectPath}/vitest.config.ts 2>/dev/null
353
- ```
354
-
355
- If NOT found, deploy the test infrastructure:
356
-
357
- 1. **Install packages:**
358
-
359
- ```bash
360
- cd {WebProjectPath}
361
- npm install -D vitest @testing-library/react @testing-library/jest-dom @testing-library/user-event jsdom msw
362
- ```
363
-
364
- 2. **Copy infrastructure files** from SmartStack templates:
365
-
366
- | Template Source | Destination |
367
- |----------------|-------------|
368
- | `templates/project/test-frontend/vitest.config.ts` | `{WebProjectPath}/vitest.config.ts` |
369
- | `templates/project/test-frontend/setup.ts` | `{WebProjectPath}/src/test/setup.ts` |
370
- | `templates/project/test-frontend/test-utils.tsx` | `{WebProjectPath}/src/test/test-utils.tsx` |
371
- | `templates/project/test-frontend/msw/server.ts` | `{WebProjectPath}/src/test/msw/server.ts` |
372
- | `templates/project/test-frontend/msw/handlers.ts` | `{WebProjectPath}/src/test/msw/handlers.ts` |
373
-
374
- 3. **Add test script** to `package.json` (if missing):
375
-
376
- ```json
377
- {
378
- "scripts": {
379
- "test": "vitest run",
380
- "test:watch": "vitest",
381
- "test:coverage": "vitest run --coverage"
382
- }
383
- }
384
- ```
385
-
386
- ### 8. Generate Frontend Tests
387
-
388
- ```
389
- Tool: mcp__smartstack__scaffold_frontend_tests
390
- Args:
391
- name: "{entity_name}"
392
- components: ["all"]
393
- apiRoute: "/api/{entity_code}"
394
- ```
395
-
396
- This generates:
397
- - `src/pages/{context}/{application}/__tests__/{EntityName}Page.test.tsx` - Page rendering, loading, error states
398
- - `src/pages/{context}/{application}/__tests__/{EntityName}ListView.test.tsx` - List display, pagination, view toggle
399
- - `src/pages/{context}/{application}/__tests__/{EntityName}DetailPage.test.tsx` - Detail view, tabs, back navigation
400
- - `src/hooks/__tests__/use{EntityName}Preferences.test.ts` - Preference get/set
401
- - `src/services/api/__tests__/{entityName}Api.test.ts` - API client calls with MSW
281
+ ### 7-8. Infrastructure & Test Generation
282
+ - Check Vitest + Testing Library + MSW configuration
283
+ - Install packages if missing (`vitest`, `@testing-library/react`, `msw`, etc.)
284
+ - Copy infrastructure templates (vitest.config.ts, setup.ts, test-utils.tsx, MSW handlers)
285
+ - Generate tests via `mcp__smartstack__scaffold_frontend_tests` (Page, ListView, DetailPage, Hooks, API)
402
286
 
403
287
  ### 9. Run Frontend Tests (BLOCKING)
404
288
 
@@ -407,11 +291,7 @@ cd {WebProjectPath}
407
291
  npx vitest run --reporter=default
408
292
  ```
409
293
 
410
- **ALL frontend tests MUST pass.** If tests fail:
411
- 1. Read the failure output carefully
412
- 2. Fix the failing tests or the components they test
413
- 3. Re-run until all tests pass
414
- 4. Do NOT proceed to the next step until all tests are green
294
+ **ALL frontend tests MUST pass.** Fix failures before proceeding.
415
295
 
416
296
  ---
417
297
 
@@ -35,12 +35,16 @@ The skill auto-detects which use case applies by scanning existing features in `
35
35
 
36
36
  <parameters>
37
37
 
38
- No flags. The entire input is the `{feature_description}`.
38
+ | Flag | Description |
39
+ |------|-------------|
40
+ | (aucun) | Mode standard — analyse complete ou mise a jour |
41
+ | `-review` | Mode review — lit `ba-review.json`, cree une nouvelle version avec les corrections appliquees |
39
42
 
40
- Step-00 handles all detection automatically:
43
+ Step-00 handles detection automatically:
41
44
  - **New vs Update**: scans `docs/business/` for existing applications
42
45
  - **Single vs Multi-module**: determined during step-02 decomposition
43
46
  - **Language**: detected from config or asked once
47
+ - **Review mode**: if `-review` flag, routes directly to step-06
44
48
 
45
49
  </parameters>
46
50
 
@@ -108,6 +112,10 @@ When step-00 detects that the description matches an existing application:
108
112
  - **Step 00:** Detection, locate existing feature, create version N+1
109
113
  - **Step 01:** Cadrage delta: what changes, impact on existing
110
114
  - **Step 02-05:** Same flow as new, with existing context loaded
115
+
116
+ **Review workflow (`-review` flag):**
117
+ - **Step 00:** Detection, scan for latest application, locate `ba-review.json`
118
+ - **Step 06:** Apply corrections, create new version, reverse-map data, regenerate all artifacts
111
119
  </workflow>
112
120
 
113
121
  <state_variables>
@@ -149,6 +157,7 @@ When step-00 detects that the description matches an existing application:
149
157
  | 04 | `steps/step-04-consolidation.md` | Opus | Cross-module validation, E2E flows, permissions coherence |
150
158
  | 05a | `steps/step-05a-handoff.md` | Sonnet | Handoff: file mapping (7 categories), BR-to-code mapping, API summary, write handoff |
151
159
  | 05b | `steps/step-05b-deploy.md` | Sonnet | Deploy: prd.json, progress.txt, manifest, ba-interactive.html, auto-launch ralph-loop |
160
+ | 06 | `steps/step-06-review.md` | Opus | Apply review corrections, create new version, regenerate all artifacts |
152
161
 
153
162
  </step_files>
154
163