@atlashub/smartstack-cli 2.5.3 → 2.6.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.
- package/.documentation/business-analyse.html +4 -4
- package/.documentation/commands.html +2 -2
- package/.documentation/index.html +2 -2
- package/.documentation/js/app.js +2 -2
- package/dist/index.js +163 -56
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/mcp-scaffolding/component.tsx.hbs +14 -14
- package/templates/mcp-scaffolding/controller.cs.hbs +6 -5
- package/templates/skills/_resources/docs-manifest-schema.md +3 -3
- package/templates/skills/_resources/mcp-validate-documentation-spec.md +6 -6
- package/templates/skills/apex/steps/step-04b-doc-sync.md +4 -4
- package/templates/skills/apex/steps/step-05-examine.md +1 -1
- package/templates/skills/apex/templates/04b-doc-sync.md +1 -1
- package/templates/skills/application/SKILL.md +33 -16
- package/templates/skills/application/steps/step-00-init.md +86 -3
- package/templates/skills/application/steps/step-01-navigation.md +34 -0
- package/templates/skills/application/steps/step-02-permissions.md +37 -0
- package/templates/skills/application/steps/step-03-roles.md +23 -2
- package/templates/skills/application/steps/step-03b-provider.md +251 -0
- package/templates/skills/application/steps/step-04-backend.md +75 -0
- package/templates/skills/application/steps/step-05-frontend.md +149 -10
- package/templates/skills/application/steps/step-06-migration.md +27 -15
- package/templates/skills/application/steps/step-07-tests.md +404 -0
- package/templates/skills/application/steps/step-08-documentation.md +137 -0
- package/templates/skills/application/templates-frontend.md +133 -26
- package/templates/skills/application/templates-seed.md +116 -0
- package/templates/skills/business-analyse/SKILL.md +1 -1
- package/templates/skills/business-analyse/questionnaire/07-ui.md +15 -0
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +2 -2
- package/templates/skills/business-analyse/schemas/feature-schema.json +96 -7
- package/templates/skills/business-analyse/steps/step-03-specify.md +134 -5
- package/templates/skills/business-analyse/steps/step-05-handoff.md +61 -8
- package/templates/skills/business-analyse/templates/tpl-frd.md +1 -1
- package/templates/skills/business-analyse/templates-frd.md +8 -8
- package/templates/skills/business-analyse/templates-react.md +26 -26
- package/templates/skills/documentation/SKILL.md +6 -6
- package/templates/skills/documentation/data-schema.md +70 -44
- package/templates/skills/documentation/templates.md +6 -6
- package/templates/skills/ralph-loop/SKILL.md +1 -2
- package/templates/skills/ralph-loop/steps/step-01-task.md +1 -1
- package/templates/skills/ui-components/SKILL.md +33 -2
- package/templates/skills/ui-components/patterns/dashboard-chart.md +327 -0
- package/templates/skills/ui-components/style-guide.md +27 -0
package/package.json
CHANGED
|
@@ -134,8 +134,8 @@ export const {{name}}: React.FC<{{name}}Props> = ({
|
|
|
134
134
|
if (isLoading && !data.id) {
|
|
135
135
|
return (
|
|
136
136
|
<div className="flex items-center justify-center p-8">
|
|
137
|
-
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-
|
|
138
|
-
<span className="ml-2 text-
|
|
137
|
+
<div className="animate-spin rounded-full h-8 w-8 border-b-2 border-[var(--color-accent-500)]" />
|
|
138
|
+
<span className="ml-2 text-[var(--text-secondary)]">Loading...</span>
|
|
139
139
|
</div>
|
|
140
140
|
);
|
|
141
141
|
}
|
|
@@ -143,16 +143,16 @@ export const {{name}}: React.FC<{{name}}Props> = ({
|
|
|
143
143
|
// Render error state
|
|
144
144
|
if (error) {
|
|
145
145
|
return (
|
|
146
|
-
<div className="p-4 bg-
|
|
146
|
+
<div className="p-4 bg-[var(--error-bg)] border border-[var(--error-border)] rounded-[var(--radius-card)]">
|
|
147
147
|
<div className="flex items-center">
|
|
148
|
-
<svg className="h-5 w-5 text-
|
|
148
|
+
<svg className="h-5 w-5 text-[var(--error-text)]" viewBox="0 0 20 20" fill="currentColor">
|
|
149
149
|
<path fillRule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z" clipRule="evenodd" />
|
|
150
150
|
</svg>
|
|
151
|
-
<span className="ml-2 text-
|
|
151
|
+
<span className="ml-2 text-[var(--error-text)]">{error}</span>
|
|
152
152
|
</div>
|
|
153
153
|
<button
|
|
154
154
|
onClick={() => id && fetchData(id)}
|
|
155
|
-
className="mt-2 text-sm text-
|
|
155
|
+
className="mt-2 text-sm text-[var(--error-text)] hover:opacity-80 underline"
|
|
156
156
|
>
|
|
157
157
|
Try again
|
|
158
158
|
</button>
|
|
@@ -161,33 +161,33 @@ export const {{name}}: React.FC<{{name}}Props> = ({
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
return (
|
|
164
|
-
<div className="bg-
|
|
164
|
+
<div className="bg-[var(--bg-card)] rounded-[var(--radius-card)] shadow-sm border border-[var(--border-color)]">
|
|
165
165
|
{/* Header */}
|
|
166
|
-
<div className="px-6 py-4 border-b border-
|
|
167
|
-
<h2 className="text-xl font-semibold text-
|
|
166
|
+
<div className="px-6 py-4 border-b border-[var(--border-color)]">
|
|
167
|
+
<h2 className="text-xl font-semibold text-[var(--text-primary)]">
|
|
168
168
|
{id ? 'Edit' : 'Create'} {{name}}
|
|
169
169
|
</h2>
|
|
170
170
|
{isDirty && (
|
|
171
|
-
<span className="text-sm text-
|
|
171
|
+
<span className="text-sm text-[var(--warning-text)]">Unsaved changes</span>
|
|
172
172
|
)}
|
|
173
173
|
</div>
|
|
174
174
|
|
|
175
175
|
{/* Form */}
|
|
176
176
|
<form onSubmit={handleSubmit} className="p-6 space-y-6">
|
|
177
177
|
{/* TODO: Add form fields */}
|
|
178
|
-
<div className="text-
|
|
178
|
+
<div className="text-[var(--text-secondary)] text-center py-8">
|
|
179
179
|
Add your form fields here
|
|
180
180
|
</div>
|
|
181
181
|
|
|
182
182
|
{/* Actions */}
|
|
183
183
|
{!readOnly && (
|
|
184
|
-
<div className="flex items-center justify-end gap-3 pt-4 border-t border-
|
|
184
|
+
<div className="flex items-center justify-end gap-3 pt-4 border-t border-[var(--border-color)]">
|
|
185
185
|
{onCancel && (
|
|
186
186
|
<button
|
|
187
187
|
type="button"
|
|
188
188
|
onClick={handleCancel}
|
|
189
189
|
disabled={isLoading}
|
|
190
|
-
className="px-4 py-2 text-
|
|
190
|
+
className="px-4 py-2 text-[var(--text-secondary)] bg-[var(--bg-secondary)] border border-[var(--border-color)] rounded-[var(--radius-button)] hover:bg-[var(--bg-hover)] disabled:opacity-50"
|
|
191
191
|
>
|
|
192
192
|
Cancel
|
|
193
193
|
</button>
|
|
@@ -195,7 +195,7 @@ export const {{name}}: React.FC<{{name}}Props> = ({
|
|
|
195
195
|
<button
|
|
196
196
|
type="submit"
|
|
197
197
|
disabled={isLoading || !isDirty}
|
|
198
|
-
className="px-4 py-2 text-white bg-
|
|
198
|
+
className="px-4 py-2 text-white bg-[var(--color-accent-600)] rounded-[var(--radius-button)] hover:bg-[var(--color-accent-700)] disabled:opacity-50 disabled:cursor-not-allowed"
|
|
199
199
|
>
|
|
200
200
|
{isLoading ? 'Saving...' : 'Save'}
|
|
201
201
|
</button>
|
|
@@ -5,6 +5,7 @@ using System.Threading.Tasks;
|
|
|
5
5
|
using Microsoft.AspNetCore.Authorization;
|
|
6
6
|
using Microsoft.AspNetCore.Mvc;
|
|
7
7
|
using Microsoft.Extensions.Logging;
|
|
8
|
+
using SmartStack.Api.Authorization;
|
|
8
9
|
|
|
9
10
|
namespace {{namespace}}.Controllers;
|
|
10
11
|
|
|
@@ -39,7 +40,7 @@ public class {{name}}Controller : ControllerBase
|
|
|
39
40
|
/// <returns>List of {{namePlural}}</returns>
|
|
40
41
|
[HttpGet]
|
|
41
42
|
{{#if navRoute}}
|
|
42
|
-
[
|
|
43
|
+
[RequirePermission("{{navRoute}}.read")]
|
|
43
44
|
{{/if}}
|
|
44
45
|
[ProducesResponseType(typeof(IEnumerable<{{name}}Dto>), 200)]
|
|
45
46
|
public async Task<ActionResult<IEnumerable<{{name}}Dto>>> GetAll(CancellationToken cancellationToken = default)
|
|
@@ -61,7 +62,7 @@ public class {{name}}Controller : ControllerBase
|
|
|
61
62
|
/// <returns>{{name}} details</returns>
|
|
62
63
|
[HttpGet("{id:guid}")]
|
|
63
64
|
{{#if navRoute}}
|
|
64
|
-
[
|
|
65
|
+
[RequirePermission("{{navRoute}}.read")]
|
|
65
66
|
{{/if}}
|
|
66
67
|
[ProducesResponseType(typeof({{name}}Dto), 200)]
|
|
67
68
|
[ProducesResponseType(404)]
|
|
@@ -87,7 +88,7 @@ public class {{name}}Controller : ControllerBase
|
|
|
87
88
|
/// <returns>Created {{nameCamel}}</returns>
|
|
88
89
|
[HttpPost]
|
|
89
90
|
{{#if navRoute}}
|
|
90
|
-
[
|
|
91
|
+
[RequirePermission("{{navRoute}}.create")]
|
|
91
92
|
{{/if}}
|
|
92
93
|
[ProducesResponseType(typeof({{name}}Dto), 201)]
|
|
93
94
|
[ProducesResponseType(400)]
|
|
@@ -113,7 +114,7 @@ public class {{name}}Controller : ControllerBase
|
|
|
113
114
|
/// <param name="cancellationToken">Cancellation token</param>
|
|
114
115
|
[HttpPut("{id:guid}")]
|
|
115
116
|
{{#if navRoute}}
|
|
116
|
-
[
|
|
117
|
+
[RequirePermission("{{navRoute}}.update")]
|
|
117
118
|
{{/if}}
|
|
118
119
|
[ProducesResponseType(204)]
|
|
119
120
|
[ProducesResponseType(404)]
|
|
@@ -138,7 +139,7 @@ public class {{name}}Controller : ControllerBase
|
|
|
138
139
|
/// <param name="cancellationToken">Cancellation token</param>
|
|
139
140
|
[HttpDelete("{id:guid}")]
|
|
140
141
|
{{#if navRoute}}
|
|
141
|
-
[
|
|
142
|
+
[RequirePermission("{{navRoute}}.delete")]
|
|
142
143
|
{{/if}}
|
|
143
144
|
[ProducesResponseType(204)]
|
|
144
145
|
[ProducesResponseType(404)]
|
|
@@ -23,7 +23,7 @@ The `docs-manifest.json` file maps code modules to their documentation artifacts
|
|
|
23
23
|
"src/SmartStack.Api/Controllers/Business/{Module}Controller.cs"
|
|
24
24
|
],
|
|
25
25
|
"docFiles": [
|
|
26
|
-
"web/smartstack-web/src/pages/docs/business/{app}/{module}/
|
|
26
|
+
"web/smartstack-web/src/pages/docs/business/{app}/{module}/doc-data.ts",
|
|
27
27
|
"web/smartstack-web/src/i18n/locales/fr/docs-{app}-{module}.json"
|
|
28
28
|
],
|
|
29
29
|
"baOutputs": [
|
|
@@ -58,7 +58,7 @@ The `docs-manifest.json` file maps code modules to their documentation artifacts
|
|
|
58
58
|
| `featureId` | string | Yes | BA feature ID (FEAT-NNN) |
|
|
59
59
|
| `displayName` | string | Yes | Human-readable module name |
|
|
60
60
|
| `codeFiles` | string[] | Yes | Source code files for this module |
|
|
61
|
-
| `docFiles` | string[] | Yes | Documentation files (
|
|
61
|
+
| `docFiles` | string[] | Yes | Documentation files (doc-data.ts, i18n) |
|
|
62
62
|
| `baOutputs` | string[] | No | Business Analysis output directory |
|
|
63
63
|
| `screenshots` | object | No | Map of stepKey → image path |
|
|
64
64
|
| `lastCodeChange` | ISO date | Yes | Last code modification timestamp |
|
|
@@ -119,7 +119,7 @@ ELSE:
|
|
|
119
119
|
"src/SmartStack.Api/Controllers/Business/SlaController.cs"
|
|
120
120
|
],
|
|
121
121
|
"docFiles": [
|
|
122
|
-
"web/smartstack-web/src/pages/docs/business/support/sla/
|
|
122
|
+
"web/smartstack-web/src/pages/docs/business/support/sla/doc-data.ts",
|
|
123
123
|
"web/smartstack-web/src/i18n/locales/fr/docs-support-sla.json"
|
|
124
124
|
],
|
|
125
125
|
"baOutputs": [
|
|
@@ -65,11 +65,11 @@ FOR each module in manifest:
|
|
|
65
65
|
### completeness
|
|
66
66
|
Verify that documented modules have all 8 business-first sections.
|
|
67
67
|
|
|
68
|
-
**Input:**
|
|
68
|
+
**Input:** doc-data.ts files, i18n JSON files
|
|
69
69
|
**Logic:**
|
|
70
70
|
```
|
|
71
71
|
FOR each module with documentation:
|
|
72
|
-
Read
|
|
72
|
+
Read doc-data.ts
|
|
73
73
|
Check presence of:
|
|
74
74
|
1. overview (valeur métier)
|
|
75
75
|
2. useCases (cas d'usage)
|
|
@@ -99,21 +99,21 @@ FOR each module with documentation:
|
|
|
99
99
|
### accuracy
|
|
100
100
|
Compare documented permissions, endpoints, and entities against actual code.
|
|
101
101
|
|
|
102
|
-
**Input:**
|
|
102
|
+
**Input:** doc-data.ts, controllers, PermissionConfiguration.cs, entities
|
|
103
103
|
**Logic:**
|
|
104
104
|
```
|
|
105
105
|
FOR each module:
|
|
106
|
-
documentedPermissions =
|
|
106
|
+
documentedPermissions = docData.permissions
|
|
107
107
|
actualPermissions = scan PermissionConfiguration.cs for module path
|
|
108
108
|
IF documentedPermissions != actualPermissions:
|
|
109
109
|
issues.push("permission mismatch")
|
|
110
110
|
|
|
111
|
-
documentedEndpoints =
|
|
111
|
+
documentedEndpoints = docData.apiEndpoints
|
|
112
112
|
actualEndpoints = scan Controller for [Http*] attributes
|
|
113
113
|
IF documentedEndpoints != actualEndpoints:
|
|
114
114
|
issues.push("endpoint mismatch")
|
|
115
115
|
|
|
116
|
-
documentedEntities =
|
|
116
|
+
documentedEntities = docData (entity references)
|
|
117
117
|
actualEntities = scan Domain/Entities for module
|
|
118
118
|
IF documentedEntities != actualEntities:
|
|
119
119
|
issues.push("entity mismatch")
|
|
@@ -92,14 +92,14 @@ For each affected module:
|
|
|
92
92
|
- Agent returns structured summary of current doc state
|
|
93
93
|
|
|
94
94
|
**If {economy_mode} = true:**
|
|
95
|
-
- Read `
|
|
95
|
+
- Read `doc-data.ts` directly
|
|
96
96
|
- Read i18n FR file directly
|
|
97
97
|
|
|
98
98
|
### 5. Update Documentation Data
|
|
99
99
|
|
|
100
100
|
For each affected module and impacted section:
|
|
101
101
|
|
|
102
|
-
1. Read current `
|
|
102
|
+
1. Read current `doc-data.ts`
|
|
103
103
|
2. Compare with actual code state
|
|
104
104
|
3. Update affected fields:
|
|
105
105
|
- **apiEndpoints**: Scan controller for `[Http*]` attributes
|
|
@@ -107,7 +107,7 @@ For each affected module and impacted section:
|
|
|
107
107
|
- **businessRules**: Scan validators and entity methods
|
|
108
108
|
- **useCases**: Update if commands/queries changed
|
|
109
109
|
- **features**: Update if new functionality added
|
|
110
|
-
4. Write updated `
|
|
110
|
+
4. Write updated `doc-data.ts`
|
|
111
111
|
5. Update i18n FR file if label keys changed
|
|
112
112
|
|
|
113
113
|
### 6. Update Documentation Manifest
|
|
@@ -144,7 +144,7 @@ Write `{output_dir}/04b-doc-sync.md` with:
|
|
|
144
144
|
## FAILURE MODES:
|
|
145
145
|
|
|
146
146
|
- docs-manifest.json absent → skip gracefully (not a failure)
|
|
147
|
-
-
|
|
147
|
+
- doc-data.ts has unexpected format → report warning, skip module
|
|
148
148
|
- No modules affected → display "No documented modules affected by changes"
|
|
149
149
|
|
|
150
150
|
---
|
|
@@ -77,7 +77,7 @@ Self-review with checklist:
|
|
|
77
77
|
- [ ] Clear naming
|
|
78
78
|
|
|
79
79
|
## Documentation Checklist
|
|
80
|
-
- [ ] Documented modules updated (
|
|
80
|
+
- [ ] Documented modules updated (doc-data.ts reflects code changes)
|
|
81
81
|
- [ ] API endpoints reflected in documentation
|
|
82
82
|
- [ ] Documented permissions match code
|
|
83
83
|
- [ ] i18n keys added for new labels
|
|
@@ -21,15 +21,18 @@ This skill uses progressive step loading. Each step calls MCP tools for generati
|
|
|
21
21
|
|
|
22
22
|
## STEP FILES
|
|
23
23
|
|
|
24
|
-
| Step | File | MCP Tool Called |
|
|
25
|
-
|
|
26
|
-
| 00 | `steps/step-00-init.md` | `validate_conventions` (MCP check) |
|
|
27
|
-
| 01 | `steps/step-01-navigation.md` | `scaffold_navigation` |
|
|
28
|
-
| 02 | `steps/step-02-permissions.md` | `generate_permissions` |
|
|
29
|
-
| 03 | `steps/step-03-roles.md` | `scaffold_role_permissions` |
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
24
|
+
| Step | File | MCP Tool Called | Condition |
|
|
25
|
+
|------|------|-----------------|-----------|
|
|
26
|
+
| 00 | `steps/step-00-init.md` | `validate_conventions` (MCP check) | Always |
|
|
27
|
+
| 01 | `steps/step-01-navigation.md` | `scaffold_navigation` | Always |
|
|
28
|
+
| 02 | `steps/step-02-permissions.md` | `generate_permissions` | Always |
|
|
29
|
+
| 03 | `steps/step-03-roles.md` | `scaffold_role_permissions` | Always |
|
|
30
|
+
| 03b | `steps/step-03b-provider.md` | (none - direct generation) | Client projects only |
|
|
31
|
+
| 04 | `steps/step-04-backend.md` | `scaffold_extension` | Always |
|
|
32
|
+
| 05 | `steps/step-05-frontend.md` | `scaffold_api_client`, `scaffold_routes` | Always |
|
|
33
|
+
| 06 | `steps/step-06-migration.md` | `suggest_migration` | Always |
|
|
34
|
+
| 07 | `steps/step-07-tests.md` | `scaffold_tests` | Always |
|
|
35
|
+
| 08 | `steps/step-08-documentation.md` | `/documentation` skill | If userDocRequired |
|
|
33
36
|
|
|
34
37
|
## MCP INTEGRATION
|
|
35
38
|
|
|
@@ -45,6 +48,7 @@ This skill uses progressive step loading. Each step calls MCP tools for generati
|
|
|
45
48
|
| `mcp__smartstack__scaffold_api_client` | TypeScript API client |
|
|
46
49
|
| `mcp__smartstack__scaffold_routes` | React Router configuration |
|
|
47
50
|
| `mcp__smartstack__suggest_migration` | Migration name suggestion |
|
|
51
|
+
| `mcp__smartstack__scaffold_tests` | Test suite generation |
|
|
48
52
|
|
|
49
53
|
## WHEN THIS SKILL ACTIVATES
|
|
50
54
|
|
|
@@ -81,15 +85,24 @@ WEB (React) → API (.NET) → Application → Infrastructure → Database
|
|
|
81
85
|
```
|
|
82
86
|
1. DB SEED (Navigation + Translations 4 languages)
|
|
83
87
|
2. PERMISSIONS (Permissions.cs + PermissionConfiguration.cs) ← 2 files!
|
|
84
|
-
3.
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
88
|
+
3. ROLES (RolePermission mappings)
|
|
89
|
+
3b. CLIENT SEED PROVIDER (client projects only - IClientSeedDataProvider)
|
|
90
|
+
4. API (Controller + DTOs via /controller:create)
|
|
91
|
+
5. SERVICES (Interface + Implementation)
|
|
92
|
+
6. FRONTEND (Page + Components + Hooks)
|
|
93
|
+
7. I18N (fr, en, it, de)
|
|
94
|
+
8. ROUTES (nested routes mandatory)
|
|
95
|
+
9. PREFERENCES (Hook pattern)
|
|
96
|
+
10. MIGRATION (/efcore:migration)
|
|
97
|
+
11. TESTS (scaffold_tests - 6 categories)
|
|
98
|
+
12. DOCUMENTATION (in-app user doc via /documentation - if userDocRequired)
|
|
91
99
|
```
|
|
92
100
|
|
|
101
|
+
### 3b. Client Seed Provider (client projects only)
|
|
102
|
+
Generates `IClientSeedDataProvider` implementation that wires navigation + permissions + roles
|
|
103
|
+
into the SmartStack Core seeding pipeline. Only runs when `{seeding_strategy}` = "provider".
|
|
104
|
+
Core projects skip this step entirely.
|
|
105
|
+
|
|
93
106
|
### 4. Automatic Chaining
|
|
94
107
|
- `/controller:create` → API Controllers
|
|
95
108
|
- `/efcore:migration` → DB Migrations
|
|
@@ -138,6 +151,7 @@ export function use{Module}Preferences() {
|
|
|
138
151
|
| `/workflow` | Automated emails | IWorkflowService.TriggerAsync |
|
|
139
152
|
| `/ai-prompt` | AI assistance | IAiCompletionService |
|
|
140
153
|
| `/feature-full` | Complete feature | Orchestration all skills |
|
|
154
|
+
| `/documentation` | In-app user doc | Documentation page via doc-data.ts + DocRenderer |
|
|
141
155
|
|
|
142
156
|
### Notification Integration Pattern
|
|
143
157
|
```csharp
|
|
@@ -172,9 +186,12 @@ await _workflowService.TriggerAsync("{entity}.created", new Dictionary<string, o
|
|
|
172
186
|
- [steps/step-01-navigation.md](steps/step-01-navigation.md) - Generate navigation
|
|
173
187
|
- [steps/step-02-permissions.md](steps/step-02-permissions.md) - Generate permissions
|
|
174
188
|
- [steps/step-03-roles.md](steps/step-03-roles.md) - Assign roles
|
|
189
|
+
- [steps/step-03b-provider.md](steps/step-03b-provider.md) - Client seed provider (client projects only)
|
|
175
190
|
- [steps/step-04-backend.md](steps/step-04-backend.md) - Generate backend
|
|
176
191
|
- [steps/step-05-frontend.md](steps/step-05-frontend.md) - Generate frontend
|
|
177
192
|
- [steps/step-06-migration.md](steps/step-06-migration.md) - Create migration
|
|
193
|
+
- [steps/step-07-tests.md](steps/step-07-tests.md) - Generate test suite
|
|
194
|
+
- [steps/step-08-documentation.md](steps/step-08-documentation.md) - Generate in-app documentation
|
|
178
195
|
|
|
179
196
|
### Templates (REFERENCE ONLY - Do Not Use Directly)
|
|
180
197
|
> These templates are kept for documentation purposes.
|
|
@@ -89,7 +89,79 @@ Args: { checks: ["tables"] }
|
|
|
89
89
|
**DO NOT** proceed with step files.
|
|
90
90
|
**STOP the skill immediately.**
|
|
91
91
|
|
|
92
|
-
### 4.
|
|
92
|
+
### 4. Detect Project Type
|
|
93
|
+
|
|
94
|
+
Read `.smartstack/config.json` at the project root to determine the seeding strategy:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
Read: .smartstack/config.json
|
|
98
|
+
Extract: projectType, dbContext
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
| projectType | dbContext | Seeding Strategy |
|
|
102
|
+
|-------------|----------|-----------------|
|
|
103
|
+
| `core` | `core` | HasData() in Configuration files (existing pattern) |
|
|
104
|
+
| `client` | `extensions` | IClientSeedDataProvider (runtime seeding) |
|
|
105
|
+
|
|
106
|
+
**If file not found or projectType missing:** Default to `core` / `hasdata`.
|
|
107
|
+
|
|
108
|
+
Store:
|
|
109
|
+
```
|
|
110
|
+
{project_type} = "core" or "client"
|
|
111
|
+
{db_context} = "core" or "extensions"
|
|
112
|
+
{seeding_strategy} = "hasdata" or "provider"
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### 4b. Detect Feature.json Context (Optional Enrichment)
|
|
116
|
+
|
|
117
|
+
Search for a Business Analysis feature.json for the target module:
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
Glob: docs/business/*/{code}/business-analyse/v*/feature.json
|
|
121
|
+
.business-analyse/business/*/modules/{code}/features/*/feature.json
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**If found (status = "handed-off" or "consolidated"):**
|
|
125
|
+
|
|
126
|
+
Read the feature.json and extract context for subsequent steps:
|
|
127
|
+
|
|
128
|
+
| feature.json Section | Used In Step | Extracted Data |
|
|
129
|
+
|----------------------|-------------|----------------|
|
|
130
|
+
| `analysis.entities[]` | step-04 (backend) | Entity names, attributes, relationships, validations |
|
|
131
|
+
| `specification.useCases[]` | step-04 (backend) | API endpoint definitions beyond basic CRUD |
|
|
132
|
+
| `specification.permissionMatrix` | step-02 (permissions) | Custom permission paths and role assignments |
|
|
133
|
+
| `specification.apiEndpoints[]` | step-04 (backend) | Exact HTTP methods, routes, DTOs |
|
|
134
|
+
| `specification.navigation` | step-01 (navigation) | Navigation hierarchy with labels and icons |
|
|
135
|
+
| `specification.i18nKeys` | step-05 (frontend) | Pre-defined translation keys |
|
|
136
|
+
| `specification.validations[]` | step-04 (backend) | Field-level validation rules |
|
|
137
|
+
| `specification.uiWireframes[]` | step-05 (frontend) | UI layout guidance |
|
|
138
|
+
| `specification.seedDataCore` | step-01, step-02, step-03 | Pre-computed seeds |
|
|
139
|
+
| `analysis.businessRules[]` | step-04, step-07 | Business rules for service logic and tests |
|
|
140
|
+
| `specification.lifeCycles[]` | step-04 (backend) | Entity state machines |
|
|
141
|
+
| `specification.dashboards` | step-05 (frontend) | Dashboard KPIs and chart specs |
|
|
142
|
+
| `documentation` | step-08 | userDocRequired / techDocRequired flags |
|
|
143
|
+
|
|
144
|
+
Store:
|
|
145
|
+
```
|
|
146
|
+
{feature_json_path} = "path/to/feature.json" or null
|
|
147
|
+
{has_feature_context} = true or false
|
|
148
|
+
{feature_data} = parsed feature.json object (if found)
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
**If NOT found or status not in ["handed-off", "consolidated"]:**
|
|
152
|
+
|
|
153
|
+
```
|
|
154
|
+
{has_feature_context} = false
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Continue normally. All subsequent steps use their standard generation logic (generic CRUD).
|
|
158
|
+
|
|
159
|
+
> **When `{has_feature_context} = true`**, subsequent steps SHOULD use the feature.json data
|
|
160
|
+
> to generate more accurate code: entities with correct attributes and relationships, custom
|
|
161
|
+
> permissions beyond basic CRUD, specific API routes, validation rules, and business logic
|
|
162
|
+
> in services. This reduces post-generation manual corrections significantly.
|
|
163
|
+
|
|
164
|
+
### 5. Build Full Path
|
|
93
165
|
|
|
94
166
|
```
|
|
95
167
|
{full_path} = {parentPath}.{code} (if parentPath exists)
|
|
@@ -102,7 +174,7 @@ Example:
|
|
|
102
174
|
→ full_path: erp.sales.products
|
|
103
175
|
```
|
|
104
176
|
|
|
105
|
-
###
|
|
177
|
+
### 6. Infer Descriptions (if not provided)
|
|
106
178
|
|
|
107
179
|
```yaml
|
|
108
180
|
descriptions:
|
|
@@ -112,7 +184,7 @@ descriptions:
|
|
|
112
184
|
de: "Verwaltung von {labels.de}"
|
|
113
185
|
```
|
|
114
186
|
|
|
115
|
-
###
|
|
187
|
+
### 7. Show Summary
|
|
116
188
|
|
|
117
189
|
```
|
|
118
190
|
## Application Skill: {level} - {code}
|
|
@@ -125,6 +197,9 @@ descriptions:
|
|
|
125
197
|
| Parent | {parentPath} |
|
|
126
198
|
| Icon | {icon} |
|
|
127
199
|
| Display Order | {displayOrder} |
|
|
200
|
+
| Project Type | {project_type} |
|
|
201
|
+
| Seeding Strategy | {seeding_strategy} |
|
|
202
|
+
| Feature.json | {has_feature_context ? feature_json_path : "Not found (standard generation)"} |
|
|
128
203
|
|
|
129
204
|
### Labels
|
|
130
205
|
| Language | Label |
|
|
@@ -152,6 +227,12 @@ descriptions:
|
|
|
152
227
|
| `{icon}` | Lucide icon name |
|
|
153
228
|
| `{display_order}` | Numeric display order |
|
|
154
229
|
| `{mcp_available}` | Boolean - MCP connectivity status |
|
|
230
|
+
| `{project_type}` | "core" or "client" (from .smartstack/config.json) |
|
|
231
|
+
| `{db_context}` | "core" or "extensions" (from .smartstack/config.json) |
|
|
232
|
+
| `{seeding_strategy}` | "hasdata" (core) or "provider" (client) |
|
|
233
|
+
| `{feature_json_path}` | Path to feature.json (null if not found) |
|
|
234
|
+
| `{has_feature_context}` | Boolean - whether BA context is available |
|
|
235
|
+
| `{feature_data}` | Parsed feature.json object (null if not found) |
|
|
155
236
|
|
|
156
237
|
---
|
|
157
238
|
|
|
@@ -160,6 +241,8 @@ descriptions:
|
|
|
160
241
|
- Level correctly detected
|
|
161
242
|
- All required parameters extracted
|
|
162
243
|
- MCP availability verified
|
|
244
|
+
- Project type and seeding strategy detected
|
|
245
|
+
- Feature.json detected if available (enrichment context loaded)
|
|
163
246
|
- Full path computed correctly
|
|
164
247
|
- Summary displayed
|
|
165
248
|
- Proceeded to step-01-navigation.md
|
|
@@ -38,11 +38,16 @@ From step-00-init:
|
|
|
38
38
|
| `{icon}` | Lucide icon name |
|
|
39
39
|
| `{display_order}` | Numeric display order |
|
|
40
40
|
| `{mcp_available}` | Boolean - MCP connectivity status |
|
|
41
|
+
| `{project_type}` | "core" or "client" |
|
|
42
|
+
| `{seeding_strategy}` | "hasdata" or "provider" |
|
|
41
43
|
|
|
42
44
|
---
|
|
43
45
|
|
|
44
46
|
## EXECUTION SEQUENCE (MCP Primary)
|
|
45
47
|
|
|
48
|
+
> **Branch:** If `{seeding_strategy}` = "provider", jump to **CLIENT PROJECT HANDLING** section below.
|
|
49
|
+
> The MCP and FALLBACK sections apply only when `{seeding_strategy}` = "hasdata" (core projects).
|
|
50
|
+
|
|
46
51
|
### 1. Call MCP scaffold_navigation
|
|
47
52
|
|
|
48
53
|
```
|
|
@@ -106,10 +111,39 @@ If MCP call fails or `{mcp_available}` = false:
|
|
|
106
111
|
|
|
107
112
|
---
|
|
108
113
|
|
|
114
|
+
## CLIENT PROJECT HANDLING
|
|
115
|
+
|
|
116
|
+
> **Condition:** `{seeding_strategy}` = "provider"
|
|
117
|
+
|
|
118
|
+
For client projects, navigation is NOT seeded via HasData() in Configuration files.
|
|
119
|
+
It will be seeded at runtime via `IClientSeedDataProvider` generated at step 03b.
|
|
120
|
+
|
|
121
|
+
### Actions for a client project:
|
|
122
|
+
|
|
123
|
+
1. **Generate the navigation GUID** (deterministic, same method as core)
|
|
124
|
+
2. **Create the SeedData file** (same pattern as existing)
|
|
125
|
+
- `Infrastructure/Persistence/Seeding/Data/{Domain}/{Module}NavigationSeedData.cs`
|
|
126
|
+
- Contains static GUIDs and `GetNavigationEntries()`
|
|
127
|
+
3. **Create the translations file**
|
|
128
|
+
- `Infrastructure/Persistence/Seeding/Data/{Domain}/{Module}NavigationTranslationSeedData.cs`
|
|
129
|
+
4. **DO NOT search for** `NavigationModuleConfiguration.cs` (does not exist in client projects)
|
|
130
|
+
5. **DO NOT write** HasData() in Configuration files
|
|
131
|
+
6. **Store** `{navigation_guid}` for subsequent steps
|
|
132
|
+
|
|
133
|
+
The SeedData files will be consumed by the `IClientSeedDataProvider` generated at step 03b.
|
|
134
|
+
|
|
135
|
+
**After creating SeedData files:** Store `{navigation_guid}` and proceed to step-02-permissions.md.
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
109
139
|
## FALLBACK PROCEDURE (When MCP Unavailable)
|
|
110
140
|
|
|
111
141
|
> This procedure generates navigation seeds following SmartStack.app patterns.
|
|
112
142
|
> Reference: `templates-seed.md` for code templates.
|
|
143
|
+
>
|
|
144
|
+
> **Branch by Project Type:**
|
|
145
|
+
> - If `{seeding_strategy}` = "hasdata" (core project): Follow F1-F8 below (existing pattern)
|
|
146
|
+
> - If `{seeding_strategy}` = "provider" (client project): Follow **CLIENT PROJECT HANDLING** above (create SeedData classes only, no HasData)
|
|
113
147
|
|
|
114
148
|
### F1. Read Existing Configuration Files
|
|
115
149
|
|
|
@@ -32,6 +32,8 @@ From previous steps:
|
|
|
32
32
|
| `{full_path}` | Complete navigation path (navRoute) |
|
|
33
33
|
| `{navigation_guid}` | GUID of the navigation entity |
|
|
34
34
|
| `{labels}` | Object with fr, en, it, de |
|
|
35
|
+
| `{project_type}` | "core" or "client" |
|
|
36
|
+
| `{seeding_strategy}` | "hasdata" or "provider" |
|
|
35
37
|
|
|
36
38
|
---
|
|
37
39
|
|
|
@@ -105,6 +107,38 @@ Store the permission GUIDs for use in step-03-roles:
|
|
|
105
107
|
|
|
106
108
|
---
|
|
107
109
|
|
|
110
|
+
## CLIENT PROJECT HANDLING
|
|
111
|
+
|
|
112
|
+
> **Condition:** `{seeding_strategy}` = "provider"
|
|
113
|
+
|
|
114
|
+
### 1. Call MCP generate_permissions normally
|
|
115
|
+
|
|
116
|
+
The tool always returns:
|
|
117
|
+
- Permissions.cs constants (Application layer) - **ALWAYS generated** (identical for core and client)
|
|
118
|
+
- PermissionConfiguration.cs HasData - **REDIRECT for client projects**
|
|
119
|
+
|
|
120
|
+
### 2. Permissions.cs: IDENTICAL
|
|
121
|
+
|
|
122
|
+
The `Permissions.cs` file in the Application layer is generated identically regardless of project type.
|
|
123
|
+
Write it as usual.
|
|
124
|
+
|
|
125
|
+
### 3. PermissionConfiguration.cs: REDIRECT
|
|
126
|
+
|
|
127
|
+
**For core (`{seeding_strategy}` = "hasdata"):** Write HasData() in `PermissionConfiguration.cs` (existing pattern)
|
|
128
|
+
|
|
129
|
+
**For client (`{seeding_strategy}` = "provider"):** DO NOT write in PermissionConfiguration.cs (does not exist in client projects).
|
|
130
|
+
Instead, create:
|
|
131
|
+
- `Infrastructure/Persistence/Seeding/Data/{Domain}/{Module}PermissionSeedData.cs`
|
|
132
|
+
|
|
133
|
+
Content: static class with deterministic GUIDs and method `GetPermissionEntries()`.
|
|
134
|
+
These entries will be consumed by the `IClientSeedDataProvider` at step 03b.
|
|
135
|
+
|
|
136
|
+
### 4. Store Permission GUIDs
|
|
137
|
+
|
|
138
|
+
Identical to the existing pattern - store `{permission_guids}` for step-03.
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
108
142
|
## TWO-FILE REQUIREMENT
|
|
109
143
|
|
|
110
144
|
**CRITICAL:** SmartStack requires permissions in TWO files:
|
|
@@ -116,6 +150,9 @@ Store the permission GUIDs for use in step-03-roles:
|
|
|
116
150
|
|
|
117
151
|
Both MUST be kept in sync. Missing one = runtime 403 errors.
|
|
118
152
|
|
|
153
|
+
> **Client project exception:** For `{seeding_strategy}` = "provider", `PermissionConfiguration.cs` is replaced by
|
|
154
|
+
> `{Module}PermissionSeedData.cs` + `IClientSeedDataProvider`. The `Permissions.cs` constants file is still required.
|
|
155
|
+
|
|
119
156
|
---
|
|
120
157
|
|
|
121
158
|
## MCP RESPONSE HANDLING
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
name: step-03-roles
|
|
3
3
|
description: Generate role-permission mappings using MCP scaffold_role_permissions (with fallback)
|
|
4
4
|
prev_step: steps/step-02-permissions.md
|
|
5
|
-
next_step: steps/step-
|
|
5
|
+
next_step: steps/step-03b-provider.md
|
|
6
6
|
---
|
|
7
7
|
|
|
8
8
|
# Step 3: Role-Permission Mapping
|
|
@@ -34,6 +34,8 @@ From previous steps:
|
|
|
34
34
|
| `{level}` | context, application, module, or section |
|
|
35
35
|
| `{permission_guids}` | GUIDs for generated permissions |
|
|
36
36
|
| `{mcp_available}` | Boolean - MCP connectivity status |
|
|
37
|
+
| `{project_type}` | "core" or "client" |
|
|
38
|
+
| `{seeding_strategy}` | "hasdata" or "provider" |
|
|
37
39
|
|
|
38
40
|
---
|
|
39
41
|
|
|
@@ -122,6 +124,23 @@ If MCP call fails or `{mcp_available}` = false:
|
|
|
122
124
|
|
|
123
125
|
---
|
|
124
126
|
|
|
127
|
+
## CLIENT PROJECT HANDLING
|
|
128
|
+
|
|
129
|
+
> **Condition:** `{seeding_strategy}` = "provider"
|
|
130
|
+
|
|
131
|
+
**For core (`{seeding_strategy}` = "hasdata"):** Write in RolePermissionConfiguration.cs (existing pattern)
|
|
132
|
+
|
|
133
|
+
**For client (`{seeding_strategy}` = "provider"):** DO NOT write in RolePermissionConfiguration.cs (does not exist in client projects).
|
|
134
|
+
Instead, create:
|
|
135
|
+
- `Infrastructure/Persistence/Seeding/Data/{Domain}/{Module}RolePermissionSeedData.cs`
|
|
136
|
+
|
|
137
|
+
Content: static class with method `GetRolePermissionEntries()` that returns the role-permission mapping data.
|
|
138
|
+
These entries will be consumed by the `IClientSeedDataProvider` at step 03b.
|
|
139
|
+
|
|
140
|
+
**After creating RolePermission SeedData:** Proceed to step-03b-provider.md (which will skip for core projects).
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
125
144
|
## FALLBACK PROCEDURE (When MCP Unavailable)
|
|
126
145
|
|
|
127
146
|
> This procedure generates role-permission HasData entries following SmartStack.app patterns.
|
|
@@ -277,4 +296,6 @@ If user selects "Custom adjustments", ask which roles/permissions to change and
|
|
|
277
296
|
## NEXT STEP
|
|
278
297
|
|
|
279
298
|
After role-permission mappings are generated (via MCP or fallback) and written to files,
|
|
280
|
-
proceed to `./step-
|
|
299
|
+
proceed to `./step-03b-provider.md`
|
|
300
|
+
|
|
301
|
+
> **Note:** step-03b will automatically skip if `{seeding_strategy}` = "hasdata" and proceed directly to step-04-backend.
|