@atlashub/smartstack-cli 1.13.2 → 1.14.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.
- package/.documentation/agents.html +1 -1
- package/.documentation/apex.html +1 -1
- package/.documentation/business-analyse.html +1 -1
- package/.documentation/cli-commands.html +3 -3
- package/.documentation/commands.html +1 -1
- package/.documentation/efcore.html +1 -1
- package/.documentation/gitflow.html +1 -1
- package/.documentation/hooks.html +1 -1
- package/.documentation/index.html +1 -1
- package/.documentation/init.html +3 -3
- package/.documentation/installation.html +1001 -352
- package/.documentation/ralph-loop.html +1 -1
- package/.documentation/test-web.html +1 -1
- package/README.md +88 -20
- package/dist/index.js +276 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/agents/code-reviewer.md +163 -0
- package/templates/agents/efcore/db-deploy.md +25 -7
- package/templates/agents/efcore/db-reset.md +31 -10
- package/templates/agents/efcore/db-status.md +22 -5
- package/templates/agents/efcore/migration.md +69 -19
- package/templates/agents/gitflow/cleanup.md +8 -1
- package/templates/agents/gitflow/commit.md +7 -5
- package/templates/agents/gitflow/finish.md +6 -4
- package/templates/agents/gitflow/pr.md +8 -1
- package/templates/agents/gitflow/start.md +1 -1
- package/templates/commands/check-version.md +267 -0
- package/templates/commands/efcore/_shared.md +30 -1
- package/templates/commands/efcore/db-reset.md +18 -6
- package/templates/commands/gitflow/OPTIMIZATIONS.md +206 -0
- package/templates/commands/refactor.md +164 -0
- package/templates/project/DependencyInjection.Application.cs.template +25 -0
- package/templates/project/DependencyInjection.Infrastructure.cs.template +61 -0
- package/templates/project/DesignTimeExtensionsDbContextFactory.cs.template +70 -0
- package/templates/project/ExampleEntity.cs.template +116 -0
- package/templates/project/ExampleEntityConfiguration.cs.template +64 -0
- package/templates/project/ExampleService.cs.template +146 -0
- package/templates/project/ExtensionsDbContext.cs.template +41 -0
- package/templates/project/IExtensionsDbContext.cs.template +22 -0
- package/templates/project/Program.cs.template +47 -0
- package/templates/project/README.md +79 -0
- package/templates/ralph/README.md +10 -8
- package/templates/ralph/ralph.config.yaml +2 -2
- package/templates/skills/_shared.md +44 -44
- package/templates/skills/ai-prompt/SKILL.md +55 -55
- package/templates/skills/apex/SKILL.md +235 -0
- package/templates/skills/apex/steps/step-00-init.md +203 -0
- package/templates/skills/apex/steps/step-01-analyze.md +210 -0
- package/templates/skills/apex/steps/step-02-plan.md +217 -0
- package/templates/skills/apex/steps/step-03-execute.md +178 -0
- package/templates/skills/apex/steps/step-04-validate.md +217 -0
- package/templates/skills/apex/steps/step-05-examine.md +207 -0
- package/templates/skills/apex/steps/step-06-resolve.md +181 -0
- package/templates/skills/apex/steps/step-07-tests.md +206 -0
- package/templates/skills/apex/steps/step-08-run-tests.md +207 -0
- package/templates/skills/apex/templates/00-context.md +46 -0
- package/templates/skills/apex/templates/01-analyze.md +63 -0
- package/templates/skills/apex/templates/02-plan.md +63 -0
- package/templates/skills/apex/templates/03-execute.md +34 -0
- package/templates/skills/apex/templates/04-validate.md +61 -0
- package/templates/skills/apex/templates/05-examine.md +58 -0
- package/templates/skills/apex/templates/06-resolve.md +39 -0
- package/templates/skills/apex/templates/07-tests.md +56 -0
- package/templates/skills/apex/templates/08-run-tests.md +41 -0
- package/templates/skills/apex/templates/README.md +69 -0
- package/templates/skills/application/SKILL.md +50 -50
- package/templates/skills/application/templates-backend.md +25 -25
- package/templates/skills/application/templates-frontend.md +43 -43
- package/templates/skills/application/templates-i18n.md +29 -29
- package/templates/skills/application/templates-seed.md +77 -77
- package/templates/skills/business-analyse/SKILL.md +223 -0
- package/templates/skills/business-analyse/_shared.md +258 -0
- package/templates/skills/business-analyse/questionnaire/01-context.md +33 -0
- package/templates/skills/business-analyse/questionnaire/02-stakeholders.md +35 -0
- package/templates/skills/business-analyse/questionnaire/03-scope.md +35 -0
- package/templates/skills/business-analyse/questionnaire/04-data.md +36 -0
- package/templates/skills/business-analyse/questionnaire/05-integrations.md +36 -0
- package/templates/skills/business-analyse/questionnaire/06-security.md +40 -0
- package/templates/skills/business-analyse/questionnaire/07-ui.md +36 -0
- package/templates/skills/business-analyse/questionnaire/08-performance.md +35 -0
- package/templates/skills/business-analyse/questionnaire/09-constraints.md +35 -0
- package/templates/skills/business-analyse/questionnaire/10-documentation.md +35 -0
- package/templates/skills/business-analyse/questionnaire.md +177 -177
- package/templates/skills/business-analyse/react/components.md +340 -0
- package/templates/skills/business-analyse/react/i18n-template.md +245 -0
- package/templates/skills/business-analyse/react/schema.md +151 -0
- package/templates/skills/business-analyse/steps/step-00-init.md +293 -0
- package/templates/skills/business-analyse/steps/step-01-discover.md +267 -0
- package/templates/skills/business-analyse/steps/step-02-analyse.md +243 -0
- package/templates/skills/business-analyse/steps/step-03-specify.md +317 -0
- package/templates/skills/business-analyse/steps/step-04-validate.md +239 -0
- package/templates/skills/business-analyse/steps/step-05-handoff.md +336 -0
- package/templates/skills/business-analyse/steps/step-06-doc-html.md +261 -0
- package/templates/skills/business-analyse/templates/00-context.md +105 -0
- package/templates/skills/business-analyse/templates/frd-brd.md +97 -0
- package/templates/skills/business-analyse/templates/frd-discovery.md +78 -0
- package/templates/skills/business-analyse/templates/frd-handoff.md +118 -0
- package/templates/skills/business-analyse/templates/frd-spec.md +168 -0
- package/templates/skills/business-analyse/templates-frd.md +217 -217
- package/templates/skills/business-analyse/templates-react.md +26 -26
- package/templates/skills/controller/SKILL.md +141 -92
- package/templates/skills/controller/postman-templates.md +15 -15
- package/templates/skills/controller/steps/step-00-init.md +191 -0
- package/templates/skills/controller/steps/step-01-analyze.md +146 -0
- package/templates/skills/controller/steps/step-02-plan.md +176 -0
- package/templates/skills/controller/steps/step-03-generate.md +219 -0
- package/templates/skills/controller/steps/step-04-perms.md +219 -0
- package/templates/skills/controller/steps/step-05-validate.md +107 -0
- package/templates/skills/controller/templates.md +77 -77
- package/templates/skills/documentation/SKILL.md +79 -79
- package/templates/skills/feature-full/SKILL.md +38 -38
- package/templates/skills/gitflow/SKILL.md +277 -0
- package/templates/{commands → skills}/gitflow/_shared.md +20 -20
- package/templates/skills/gitflow/phases/abort.md +173 -0
- package/templates/skills/gitflow/phases/cleanup.md +226 -0
- package/templates/skills/gitflow/phases/status.md +178 -0
- package/templates/skills/gitflow/steps/step-commit.md +255 -0
- package/templates/skills/gitflow/steps/step-finish.md +255 -0
- package/templates/skills/gitflow/steps/step-init.md +209 -0
- package/templates/skills/gitflow/steps/step-merge.md +225 -0
- package/templates/skills/gitflow/steps/step-plan.md +208 -0
- package/templates/skills/gitflow/steps/step-pr.md +235 -0
- package/templates/skills/gitflow/steps/step-start.md +234 -0
- package/templates/skills/gitflow/steps/step-sync.md +200 -0
- package/templates/skills/gitflow/templates/config.json +53 -0
- package/templates/skills/notification/SKILL.md +51 -51
- package/templates/skills/ralph-loop/SKILL.md +228 -0
- package/templates/skills/ralph-loop/steps/step-00-init.md +201 -0
- package/templates/skills/ralph-loop/steps/step-01-task.md +169 -0
- package/templates/skills/ralph-loop/steps/step-02-execute.md +173 -0
- package/templates/skills/ralph-loop/steps/step-03-commit.md +170 -0
- package/templates/skills/ralph-loop/steps/step-04-check.md +162 -0
- package/templates/skills/ralph-loop/steps/step-05-report.md +181 -0
- package/templates/skills/review-code/SKILL.md +219 -0
- package/templates/skills/review-code/references/clean-code-principles.md +140 -0
- package/templates/skills/review-code/references/code-quality-metrics.md +174 -0
- package/templates/skills/review-code/references/feedback-patterns.md +149 -0
- package/templates/skills/review-code/references/security-checklist.md +127 -0
- package/templates/skills/ui-components/SKILL.md +54 -54
- package/templates/skills/workflow/SKILL.md +46 -46
- package/templates/commands/ai-prompt.md +0 -315
- package/templates/commands/apex/1-analyze.md +0 -100
- package/templates/commands/apex/2-plan.md +0 -145
- package/templates/commands/apex/3-execute.md +0 -171
- package/templates/commands/apex/4-examine.md +0 -116
- package/templates/commands/apex/5-tasks.md +0 -209
- package/templates/commands/apex.md +0 -76
- package/templates/commands/application/create.md +0 -362
- package/templates/commands/application/templates-backend.md +0 -463
- package/templates/commands/application/templates-frontend.md +0 -517
- package/templates/commands/application/templates-i18n.md +0 -478
- package/templates/commands/application/templates-seed.md +0 -362
- package/templates/commands/application.md +0 -303
- package/templates/commands/business-analyse/0-orchestrate.md +0 -156
- package/templates/commands/business-analyse/1-init.md +0 -99
- package/templates/commands/business-analyse/2-discover.md +0 -143
- package/templates/commands/business-analyse/3-analyse.md +0 -106
- package/templates/commands/business-analyse/4-specify.md +0 -133
- package/templates/commands/business-analyse/5-validate.md +0 -132
- package/templates/commands/business-analyse/6-handoff.md +0 -157
- package/templates/commands/business-analyse/7-doc-html.md +0 -103
- package/templates/commands/business-analyse/_shared.md +0 -176
- package/templates/commands/business-analyse/bug.md +0 -118
- package/templates/commands/business-analyse/change-request.md +0 -144
- package/templates/commands/business-analyse/hotfix.md +0 -116
- package/templates/commands/business-analyse.md +0 -121
- package/templates/commands/controller/create.md +0 -216
- package/templates/commands/controller/postman-templates.md +0 -528
- package/templates/commands/controller/templates.md +0 -600
- package/templates/commands/controller.md +0 -337
- package/templates/commands/create/agent.md +0 -138
- package/templates/commands/create/command.md +0 -166
- package/templates/commands/create/hook.md +0 -234
- package/templates/commands/create/plugin.md +0 -329
- package/templates/commands/create/project.md +0 -508
- package/templates/commands/create/skill.md +0 -199
- package/templates/commands/create.md +0 -220
- package/templates/commands/documentation/module.md +0 -202
- package/templates/commands/documentation/templates.md +0 -432
- package/templates/commands/documentation.md +0 -190
- package/templates/commands/epct.md +0 -69
- package/templates/commands/explain.md +0 -186
- package/templates/commands/feature-full.md +0 -267
- package/templates/commands/gitflow/1-init.md +0 -188
- package/templates/commands/gitflow/10-start.md +0 -190
- package/templates/commands/gitflow/11-finish.md +0 -382
- package/templates/commands/gitflow/12-cleanup.md +0 -103
- package/templates/commands/gitflow/13-sync.md +0 -216
- package/templates/commands/gitflow/14-rebase.md +0 -251
- package/templates/commands/gitflow/2-status.md +0 -122
- package/templates/commands/gitflow/3-commit.md +0 -209
- package/templates/commands/gitflow/4-plan.md +0 -174
- package/templates/commands/gitflow/5-exec.md +0 -202
- package/templates/commands/gitflow/6-abort.md +0 -121
- package/templates/commands/gitflow/7-pull-request.md +0 -176
- package/templates/commands/gitflow/8-review.md +0 -113
- package/templates/commands/gitflow/9-merge.md +0 -157
- package/templates/commands/gitflow.md +0 -128
- package/templates/commands/implement.md +0 -663
- package/templates/commands/init.md +0 -567
- package/templates/commands/mcp-integration.md +0 -330
- package/templates/commands/notification.md +0 -129
- package/templates/commands/oneshot.md +0 -57
- package/templates/commands/quickstart.md +0 -154
- package/templates/commands/ralph-loop/cancel-ralph.md +0 -18
- package/templates/commands/ralph-loop/help.md +0 -126
- package/templates/commands/ralph-loop/ralph-loop.md +0 -120
- package/templates/commands/review.md +0 -106
- package/templates/commands/workflow.md +0 -193
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SmartStack Controller Templates
|
|
2
2
|
|
|
3
|
-
> **Note:**
|
|
4
|
-
>
|
|
3
|
+
> **Note:** These templates are used by the `controller` skill and `/controller:create` command.
|
|
4
|
+
> Adapt variables `{Area}`, `{Module}`, `{Entity}`, `{PermissionPath}` according to context.
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
@@ -341,7 +341,7 @@ public record PagedResult<T>(
|
|
|
341
341
|
|
|
342
342
|
```csharp
|
|
343
343
|
// src/SmartStack.Api/Controllers/AuthController.cs
|
|
344
|
-
// NOTE:
|
|
344
|
+
// NOTE: This controller already exists - use as reference for auth patterns
|
|
345
345
|
|
|
346
346
|
using Microsoft.AspNetCore.Authorization;
|
|
347
347
|
using Microsoft.AspNetCore.Mvc;
|
|
@@ -406,7 +406,7 @@ public class AuthController : ControllerBase
|
|
|
406
406
|
_logger.LogWarning(
|
|
407
407
|
"Login failed: Account disabled - {Email} from {IpAddress}",
|
|
408
408
|
request.Email, ipAddress);
|
|
409
|
-
return Unauthorized(new ErrorResponse("
|
|
409
|
+
return Unauthorized(new ErrorResponse("Account disabled", "ACCOUNT_DISABLED"));
|
|
410
410
|
}
|
|
411
411
|
|
|
412
412
|
if (user.IsLocked)
|
|
@@ -415,7 +415,7 @@ public class AuthController : ControllerBase
|
|
|
415
415
|
_logger.LogCritical(
|
|
416
416
|
"SECURITY: Login attempt on locked account - User: {Email} (ID: {UserId}) from {IpAddress}",
|
|
417
417
|
request.Email, user.Id, ipAddress);
|
|
418
|
-
return Unauthorized(new ErrorResponse("
|
|
418
|
+
return Unauthorized(new ErrorResponse("Account locked", "ACCOUNT_LOCKED_BY_ADMIN"));
|
|
419
419
|
}
|
|
420
420
|
|
|
421
421
|
// Check brute force protection
|
|
@@ -429,7 +429,7 @@ public class AuthController : ControllerBase
|
|
|
429
429
|
_logger.LogCritical(
|
|
430
430
|
"SECURITY: Account temporarily locked due to brute force - User: {Email} (ID: {UserId}) from {IpAddress}",
|
|
431
431
|
request.Email, user.Id, ipAddress);
|
|
432
|
-
return Unauthorized(new ErrorResponse("
|
|
432
|
+
return Unauthorized(new ErrorResponse("Account temporarily locked", "ACCOUNT_LOCKED"));
|
|
433
433
|
}
|
|
434
434
|
|
|
435
435
|
if (!_passwordService.VerifyPassword(request.Password, user.PasswordHash))
|
|
@@ -512,7 +512,7 @@ public class AuthController : ControllerBase
|
|
|
512
512
|
"Password changed for user {Email} - All sessions invalidated",
|
|
513
513
|
user.Email);
|
|
514
514
|
|
|
515
|
-
return Ok(new ChangePasswordResponse("
|
|
515
|
+
return Ok(new ChangePasswordResponse("Password changed", true));
|
|
516
516
|
}
|
|
517
517
|
|
|
518
518
|
#endregion
|
|
@@ -533,7 +533,7 @@ public class AuthController : ControllerBase
|
|
|
533
533
|
|
|
534
534
|
```csharp
|
|
535
535
|
// src/SmartStack.Application/Common/Authorization/Permissions.cs
|
|
536
|
-
//
|
|
536
|
+
// ADD to existing class
|
|
537
537
|
|
|
538
538
|
public static class Permissions
|
|
539
539
|
{
|
|
@@ -546,7 +546,7 @@ public static class Permissions
|
|
|
546
546
|
public const string Create = "{permission.path}.create";
|
|
547
547
|
public const string Update = "{permission.path}.update";
|
|
548
548
|
public const string Delete = "{permission.path}.delete";
|
|
549
|
-
//
|
|
549
|
+
// Optional depending on module
|
|
550
550
|
public const string Assign = "{permission.path}.assign";
|
|
551
551
|
public const string Execute = "{permission.path}.execute";
|
|
552
552
|
public const string Export = "{permission.path}.export";
|
|
@@ -558,31 +558,31 @@ public static class Permissions
|
|
|
558
558
|
|
|
559
559
|
## Template PermissionConfiguration Seed
|
|
560
560
|
|
|
561
|
-
> **
|
|
561
|
+
> **CRITICAL:** This template is MANDATORY. Without these entries, all API calls will return 403 Forbidden.
|
|
562
562
|
|
|
563
563
|
```csharp
|
|
564
564
|
// src/SmartStack.Infrastructure/Persistence/Configurations/Navigation/PermissionConfiguration.cs
|
|
565
|
-
//
|
|
565
|
+
// ADD in Configure() method, HasData section
|
|
566
566
|
|
|
567
567
|
// ============================================
|
|
568
|
-
//
|
|
568
|
+
// STEP 1: Declare ModuleId
|
|
569
569
|
// ============================================
|
|
570
|
-
//
|
|
571
|
-
//
|
|
570
|
+
// Check in ModuleConfiguration.cs if module already exists
|
|
571
|
+
// Otherwise, create the module first via /application skill
|
|
572
572
|
|
|
573
|
-
var {module}ModuleId = Guid.Parse("{GUID
|
|
573
|
+
var {module}ModuleId = Guid.Parse("{MODULE-GUID}"); // Get from ModuleConfiguration.cs
|
|
574
574
|
|
|
575
575
|
// ============================================
|
|
576
|
-
//
|
|
576
|
+
// STEP 2: Add permissions (HasData)
|
|
577
577
|
// ============================================
|
|
578
578
|
|
|
579
579
|
// Pattern: {context}.{application}.{module}.{action}
|
|
580
|
-
//
|
|
580
|
+
// Example: platform.administration.users.read
|
|
581
581
|
|
|
582
582
|
var seedDate = new DateTime(2024, 1, 1, 0, 0, 0, DateTimeKind.Utc);
|
|
583
583
|
|
|
584
584
|
builder.HasData(
|
|
585
|
-
// Wildcard permission (
|
|
585
|
+
// Wildcard permission (full module access)
|
|
586
586
|
new
|
|
587
587
|
{
|
|
588
588
|
Id = Guid.Parse("{NOUVEAU-GUID-1}"),
|
|
@@ -647,13 +647,13 @@ builder.HasData(
|
|
|
647
647
|
CreatedAt = seedDate
|
|
648
648
|
}
|
|
649
649
|
|
|
650
|
-
//
|
|
651
|
-
// - PermissionAction.Assign →
|
|
652
|
-
// - PermissionAction.Execute →
|
|
650
|
+
// Optional actions depending on module:
|
|
651
|
+
// - PermissionAction.Assign → To assign resources/roles
|
|
652
|
+
// - PermissionAction.Execute → To execute actions (export, etc.)
|
|
653
653
|
);
|
|
654
654
|
```
|
|
655
655
|
|
|
656
|
-
###
|
|
656
|
+
### GUID Generation
|
|
657
657
|
|
|
658
658
|
```bash
|
|
659
659
|
# PowerShell (Windows)
|
|
@@ -663,13 +663,13 @@ builder.HasData(
|
|
|
663
663
|
uuidgen | tr '[:upper:]' '[:lower:]'
|
|
664
664
|
```
|
|
665
665
|
|
|
666
|
-
### Validation
|
|
666
|
+
### Validation Consistency Permissions.cs ↔ PermissionConfiguration.cs
|
|
667
667
|
|
|
668
|
-
> **
|
|
668
|
+
> **RULE:** Each constant in `Permissions.cs` MUST have a corresponding entry in `PermissionConfiguration.cs`
|
|
669
669
|
|
|
670
670
|
```
|
|
671
671
|
┌─────────────────────────────────────────────────────────────────────────────┐
|
|
672
|
-
│ VALIDATION
|
|
672
|
+
│ CONSISTENCY VALIDATION │
|
|
673
673
|
├─────────────────────────────────────────────────────────────────────────────┤
|
|
674
674
|
│ │
|
|
675
675
|
│ Permissions.cs PermissionConfiguration.cs │
|
|
@@ -679,26 +679,26 @@ uuidgen | tr '[:upper:]' '[:lower:]'
|
|
|
679
679
|
│ Permissions.Support.Tickets.Update→ Path = "platform.support.tickets.update"│
|
|
680
680
|
│ Permissions.Support.Tickets.Delete→ Path = "platform.support.tickets.delete"│
|
|
681
681
|
│ │
|
|
682
|
-
│
|
|
682
|
+
│ WARNING: COMMON ERROR: │
|
|
683
683
|
│ - Permissions.cs: "platform.support.tickets.read" │
|
|
684
|
-
│ - PermissionConfiguration.cs:
|
|
685
|
-
│ →
|
|
684
|
+
│ - PermissionConfiguration.cs: MISSING │
|
|
685
|
+
│ → Result: 403 Forbidden for ALL users │
|
|
686
686
|
│ │
|
|
687
687
|
└─────────────────────────────────────────────────────────────────────────────┘
|
|
688
688
|
```
|
|
689
689
|
|
|
690
|
-
###
|
|
690
|
+
### Post-generation commands
|
|
691
691
|
|
|
692
|
-
|
|
692
|
+
After adding entries in both files:
|
|
693
693
|
|
|
694
694
|
```bash
|
|
695
|
-
# 1.
|
|
695
|
+
# 1. Create migration
|
|
696
696
|
/efcore:migration Add{Module}Permissions
|
|
697
697
|
|
|
698
|
-
# 2.
|
|
698
|
+
# 2. Apply migration
|
|
699
699
|
/efcore:db-deploy
|
|
700
700
|
|
|
701
|
-
# 3.
|
|
701
|
+
# 3. Verify (optional)
|
|
702
702
|
/efcore:db-status
|
|
703
703
|
```
|
|
704
704
|
|
|
@@ -707,7 +707,7 @@ Après avoir ajouté les entrées dans les deux fichiers:
|
|
|
707
707
|
## Template Controller avec Relations
|
|
708
708
|
|
|
709
709
|
```csharp
|
|
710
|
-
//
|
|
710
|
+
// For controllers with related entities (ex: Tickets with Comments)
|
|
711
711
|
|
|
712
712
|
#region GET with Includes
|
|
713
713
|
|
|
@@ -786,7 +786,7 @@ public async Task<ActionResult<ChildDto>> AddChild(
|
|
|
786
786
|
|
|
787
787
|
---
|
|
788
788
|
|
|
789
|
-
## Patterns
|
|
789
|
+
## Reusable Patterns
|
|
790
790
|
|
|
791
791
|
### Error Response Standard
|
|
792
792
|
|
|
@@ -824,7 +824,7 @@ public static class QueryableExtensions
|
|
|
824
824
|
### Log Context Pattern
|
|
825
825
|
|
|
826
826
|
```csharp
|
|
827
|
-
//
|
|
827
|
+
// Always include user context in logs
|
|
828
828
|
_logger.LogInformation(
|
|
829
829
|
"User {User} ({UserId}) performed {Action} on {Entity} {EntityId}",
|
|
830
830
|
_currentUser.Email,
|
|
@@ -838,7 +838,7 @@ _logger.LogInformation(
|
|
|
838
838
|
|
|
839
839
|
## Template Section-Level Permissions (Level 4)
|
|
840
840
|
|
|
841
|
-
> **Usage:**
|
|
841
|
+
> **Usage:** When a Module has multiple sub-pages/tabs with different permissions (ex: AI → Dashboard, Settings, Prompts)
|
|
842
842
|
|
|
843
843
|
### Permissions.cs - Section
|
|
844
844
|
|
|
@@ -866,24 +866,24 @@ public static class Admin
|
|
|
866
866
|
|
|
867
867
|
```csharp
|
|
868
868
|
// src/SmartStack.Infrastructure/Persistence/Configurations/Navigation/PermissionConfiguration.cs
|
|
869
|
-
//
|
|
869
|
+
// ADD in Configure() method, HasData section
|
|
870
870
|
|
|
871
871
|
// ============================================
|
|
872
|
-
//
|
|
872
|
+
// STEP 1: Declare SectionId
|
|
873
873
|
// ============================================
|
|
874
|
-
//
|
|
874
|
+
// Get from NavigationSectionConfiguration.cs
|
|
875
875
|
|
|
876
|
-
var {section}SectionId = Guid.Parse("{GUID
|
|
876
|
+
var {section}SectionId = Guid.Parse("{SECTION-GUID}");
|
|
877
877
|
|
|
878
878
|
// ============================================
|
|
879
|
-
//
|
|
879
|
+
// STEP 2: Add Section permissions (Level 4)
|
|
880
880
|
// ============================================
|
|
881
881
|
|
|
882
882
|
// Pattern: {context}.{application}.{module}.{section}.{action}
|
|
883
|
-
//
|
|
883
|
+
// Example: platform.administration.ai.settings.read
|
|
884
884
|
|
|
885
885
|
builder.HasData(
|
|
886
|
-
// Wildcard permission (
|
|
886
|
+
// Wildcard permission (full section access)
|
|
887
887
|
new
|
|
888
888
|
{
|
|
889
889
|
Id = Guid.Parse("{NOUVEAU-GUID-1}"),
|
|
@@ -948,7 +948,7 @@ builder.HasData(
|
|
|
948
948
|
CreatedAt = seedDate
|
|
949
949
|
},
|
|
950
950
|
|
|
951
|
-
// Execute permission (
|
|
951
|
+
// Execute permission (optional)
|
|
952
952
|
new
|
|
953
953
|
{
|
|
954
954
|
Id = Guid.Parse("{NOUVEAU-GUID-6}"),
|
|
@@ -967,8 +967,8 @@ builder.HasData(
|
|
|
967
967
|
|
|
968
968
|
## Template Resource-Level Permissions (Level 5)
|
|
969
969
|
|
|
970
|
-
> **Usage:**
|
|
971
|
-
> **
|
|
970
|
+
> **Usage:** For the finest granularity level (ex: Prompts → Blocks, Users → Profiles)
|
|
971
|
+
> **CRITICAL:** Used when a Section contains sub-resources with distinct permissions
|
|
972
972
|
|
|
973
973
|
### Permissions.cs - Resource
|
|
974
974
|
|
|
@@ -1000,24 +1000,24 @@ public static class Admin
|
|
|
1000
1000
|
|
|
1001
1001
|
```csharp
|
|
1002
1002
|
// src/SmartStack.Infrastructure/Persistence/Configurations/Navigation/PermissionConfiguration.cs
|
|
1003
|
-
//
|
|
1003
|
+
// ADD in Configure() method, HasData section
|
|
1004
1004
|
|
|
1005
1005
|
// ============================================
|
|
1006
|
-
//
|
|
1006
|
+
// STEP 1: Declare ResourceId
|
|
1007
1007
|
// ============================================
|
|
1008
|
-
//
|
|
1008
|
+
// Get from NavigationResourceConfiguration.cs
|
|
1009
1009
|
|
|
1010
|
-
var {resource}ResourceId = Guid.Parse("{GUID
|
|
1010
|
+
var {resource}ResourceId = Guid.Parse("{RESOURCE-GUID}");
|
|
1011
1011
|
|
|
1012
1012
|
// ============================================
|
|
1013
|
-
//
|
|
1013
|
+
// STEP 2: Add Resource permissions (Level 5)
|
|
1014
1014
|
// ============================================
|
|
1015
1015
|
|
|
1016
1016
|
// Pattern: {context}.{application}.{module}.{section}.{resource}.{action}
|
|
1017
|
-
//
|
|
1017
|
+
// Example: platform.administration.ai.prompts.blocks.read
|
|
1018
1018
|
|
|
1019
1019
|
builder.HasData(
|
|
1020
|
-
// Wildcard permission (
|
|
1020
|
+
// Wildcard permission (full resource access)
|
|
1021
1021
|
new
|
|
1022
1022
|
{
|
|
1023
1023
|
Id = Guid.Parse("{NOUVEAU-GUID-1}"),
|
|
@@ -1086,9 +1086,9 @@ builder.HasData(
|
|
|
1086
1086
|
|
|
1087
1087
|
---
|
|
1088
1088
|
|
|
1089
|
-
## Template Bulk Operations (Insertion
|
|
1089
|
+
## Template Bulk Operations (Batch Insertion)
|
|
1090
1090
|
|
|
1091
|
-
> **
|
|
1091
|
+
> **MANDATORY:** Always provide bulk endpoints when creating a CRUD controller
|
|
1092
1092
|
|
|
1093
1093
|
### Permissions.cs - Bulk Operations
|
|
1094
1094
|
|
|
@@ -1103,7 +1103,7 @@ public static class {Module}
|
|
|
1103
1103
|
public const string Update = "{path}.update";
|
|
1104
1104
|
public const string Delete = "{path}.delete";
|
|
1105
1105
|
|
|
1106
|
-
// Bulk operations (
|
|
1106
|
+
// Bulk operations (MANDATORY for all CRUD modules)
|
|
1107
1107
|
public const string BulkCreate = "{path}.bulk-create";
|
|
1108
1108
|
public const string BulkUpdate = "{path}.bulk-update";
|
|
1109
1109
|
public const string BulkDelete = "{path}.bulk-delete";
|
|
@@ -1115,7 +1115,7 @@ public static class {Module}
|
|
|
1115
1115
|
### PermissionConfiguration.cs - Bulk Permissions Seed
|
|
1116
1116
|
|
|
1117
1117
|
```csharp
|
|
1118
|
-
//
|
|
1118
|
+
// Add after standard CRUD permissions
|
|
1119
1119
|
|
|
1120
1120
|
// Bulk Create permission
|
|
1121
1121
|
new
|
|
@@ -1187,7 +1187,7 @@ new
|
|
|
1187
1187
|
|
|
1188
1188
|
```csharp
|
|
1189
1189
|
// src/SmartStack.Api/Controllers/{Area}/{Module}Controller.cs
|
|
1190
|
-
//
|
|
1190
|
+
// ADD after standard CRUD endpoints
|
|
1191
1191
|
|
|
1192
1192
|
#region BULK OPERATIONS
|
|
1193
1193
|
|
|
@@ -1403,40 +1403,40 @@ public record BulkUpdate{Entity}Request(
|
|
|
1403
1403
|
|
|
1404
1404
|
---
|
|
1405
1405
|
|
|
1406
|
-
##
|
|
1406
|
+
## Complete Permissions Hierarchy
|
|
1407
1407
|
|
|
1408
1408
|
```
|
|
1409
1409
|
┌─────────────────────────────────────────────────────────────────────────────────┐
|
|
1410
|
-
│
|
|
1410
|
+
│ COMPLETE PERMISSIONS HIERARCHY │
|
|
1411
1411
|
├─────────────────────────────────────────────────────────────────────────────────┤
|
|
1412
1412
|
│ │
|
|
1413
1413
|
│ Level 1: CONTEXT │
|
|
1414
1414
|
│ └─ Path: {context}.* │
|
|
1415
|
-
│ └─ Ex: platform.* →
|
|
1415
|
+
│ └─ Ex: platform.* → Full platform context access │
|
|
1416
1416
|
│ │
|
|
1417
1417
|
│ Level 2: APPLICATION │
|
|
1418
1418
|
│ └─ Path: {context}.{application}.* │
|
|
1419
|
-
│ └─ Ex: platform.administration.* →
|
|
1419
|
+
│ └─ Ex: platform.administration.* → Full administration access │
|
|
1420
1420
|
│ │
|
|
1421
1421
|
│ Level 3: MODULE │
|
|
1422
1422
|
│ └─ Path: {context}.{application}.{module}.{action} │
|
|
1423
|
-
│ └─ Ex: platform.administration.users.read →
|
|
1424
|
-
│ └─ BULK: platform.administration.users.bulk-create →
|
|
1423
|
+
│ └─ Ex: platform.administration.users.read → Read users │
|
|
1424
|
+
│ └─ BULK: platform.administration.users.bulk-create → Batch create │
|
|
1425
1425
|
│ │
|
|
1426
1426
|
│ Level 4: SECTION │
|
|
1427
1427
|
│ └─ Path: {context}.{application}.{module}.{section}.{action} │
|
|
1428
|
-
│ └─ Ex: platform.administration.ai.settings.update →
|
|
1428
|
+
│ └─ Ex: platform.administration.ai.settings.update → Update AI settings │
|
|
1429
1429
|
│ │
|
|
1430
1430
|
│ Level 5: RESOURCE (finest granularity) │
|
|
1431
1431
|
│ └─ Path: {context}.{application}.{module}.{section}.{resource}.{action} │
|
|
1432
|
-
│ └─ Ex: platform.administration.ai.prompts.blocks.delete →
|
|
1432
|
+
│ └─ Ex: platform.administration.ai.prompts.blocks.delete → Delete blocks │
|
|
1433
1433
|
│ │
|
|
1434
1434
|
└─────────────────────────────────────────────────────────────────────────────────┘
|
|
1435
1435
|
```
|
|
1436
1436
|
|
|
1437
1437
|
---
|
|
1438
1438
|
|
|
1439
|
-
## Checklist
|
|
1439
|
+
## Controller Checklist with Complete Permissions
|
|
1440
1440
|
|
|
1441
1441
|
```
|
|
1442
1442
|
□ CRUD Standard
|
|
@@ -1455,14 +1455,14 @@ public record BulkUpdate{Entity}Request(
|
|
|
1455
1455
|
□ GET /api/.../export → {path}.export
|
|
1456
1456
|
□ POST /api/.../import → {path}.import
|
|
1457
1457
|
|
|
1458
|
-
□ Permissions
|
|
1459
|
-
□ Permissions.cs -
|
|
1458
|
+
□ Permissions Configured
|
|
1459
|
+
□ Permissions.cs - Constants defined
|
|
1460
1460
|
□ PermissionConfiguration.cs - Seed HasData
|
|
1461
|
-
□
|
|
1462
|
-
□ Migration
|
|
1461
|
+
□ EF Core Migration created
|
|
1462
|
+
□ Migration applied
|
|
1463
1463
|
|
|
1464
|
-
□
|
|
1465
|
-
□ Module (Level 3) -
|
|
1466
|
-
□ Section (Level 4) -
|
|
1467
|
-
□ Resource (Level 5) -
|
|
1464
|
+
□ Correct Permission Level
|
|
1465
|
+
□ Module (Level 3) - For main CRUD
|
|
1466
|
+
□ Section (Level 4) - If sub-pages with different permissions
|
|
1467
|
+
□ Resource (Level 5) - If sub-resources with distinct permissions
|
|
1468
1468
|
```
|
|
@@ -1,134 +1,134 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: documentation
|
|
3
3
|
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
Types: user module, developer tools, database
|
|
4
|
+
Automatically generates technical documentation for SmartStack.
|
|
5
|
+
Use this skill when:
|
|
6
|
+
- User asks to create/generate documentation
|
|
7
|
+
- User mentions "document", "documentation", "doc", "ERD", "schema"
|
|
8
|
+
- User wants to document a module, table, tool, or test
|
|
9
|
+
- After implementing a feature to generate its documentation
|
|
10
|
+
Types: user module, developer tools, database ERD, testing tools
|
|
11
11
|
---
|
|
12
12
|
|
|
13
13
|
# Skill Documentation SmartStack
|
|
14
14
|
|
|
15
|
-
> **Note:**
|
|
15
|
+
> **Note:** This skill works in synergy with the `/documentation:module` command.
|
|
16
16
|
|
|
17
|
-
**
|
|
17
|
+
**Reference:** [_shared.md](../_shared.md) for architecture, i18n
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## WHEN THIS SKILL ACTIVATES
|
|
20
20
|
|
|
21
|
-
Claude
|
|
21
|
+
Claude automatically invokes this skill when it detects:
|
|
22
22
|
|
|
23
|
-
|
|
|
24
|
-
|
|
25
|
-
|
|
|
26
|
-
|
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
|
|
|
23
|
+
| Trigger | Example |
|
|
24
|
+
|---------|---------|
|
|
25
|
+
| Explicit request | "Document the SLA module" |
|
|
26
|
+
| Documentation mention | "We should create the doc for..." |
|
|
27
|
+
| After implementation | "The feature is done, generate the doc" |
|
|
28
|
+
| Structure question | "How is the documentation organized?" |
|
|
29
|
+
| Keywords | "ERD", "schema", "diagram", "document" |
|
|
30
30
|
|
|
31
31
|
---
|
|
32
32
|
|
|
33
|
-
## WORKFLOW
|
|
33
|
+
## AUTOMATIC WORKFLOW
|
|
34
34
|
|
|
35
|
-
###
|
|
35
|
+
### STEP 1: TYPE DETECTION
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
Analyze the request to identify:
|
|
38
38
|
|
|
39
|
-
|
|
|
40
|
-
|
|
41
|
-
|
|
|
42
|
-
|
|
|
43
|
-
| Tables,
|
|
44
|
-
| Tests (
|
|
39
|
+
| Clue | → Type |
|
|
40
|
+
|------|--------|
|
|
41
|
+
| Functional module (SLA, Tickets, Users) | `user` |
|
|
42
|
+
| Dev tool (Docker, Postman, VS Code) | `developer` |
|
|
43
|
+
| Tables, schema, database | `database` |
|
|
44
|
+
| Tests (security, load, E2E) | `testing` |
|
|
45
45
|
|
|
46
|
-
###
|
|
46
|
+
### STEP 2: TARGET EXTRACTION
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
Identify the specific name:
|
|
49
49
|
- Module: `sla`, `tickets`, `users`, `permissions`
|
|
50
|
-
-
|
|
51
|
-
-
|
|
50
|
+
- Tool: `docker`, `postman`, `playwright`, `maildev`
|
|
51
|
+
- Schema: `support`, `auth`, `nav`, `usr`
|
|
52
52
|
- Test: `security`, `load`, `e2e`
|
|
53
53
|
|
|
54
|
-
###
|
|
54
|
+
### STEP 3: EXECUTION
|
|
55
55
|
|
|
56
|
-
|
|
56
|
+
Follow the workflow of the `/documentation:module` command:
|
|
57
57
|
|
|
58
58
|
```
|
|
59
|
-
TYPE = type
|
|
60
|
-
TARGET =
|
|
59
|
+
TYPE = detected type (user|developer|database|testing)
|
|
60
|
+
TARGET = extracted target
|
|
61
61
|
|
|
62
|
-
→
|
|
62
|
+
→ Execute the complete /documentation:module workflow
|
|
63
63
|
```
|
|
64
64
|
|
|
65
65
|
---
|
|
66
66
|
|
|
67
|
-
##
|
|
67
|
+
## QUICK REFERENCE
|
|
68
68
|
|
|
69
|
-
###
|
|
69
|
+
### Documentation types
|
|
70
70
|
|
|
71
|
-
| Type | Description |
|
|
71
|
+
| Type | Description | Output |
|
|
72
72
|
|------|-------------|--------|
|
|
73
|
-
| `user` |
|
|
74
|
-
| `developer` |
|
|
75
|
-
| `database` |
|
|
76
|
-
| `testing` |
|
|
73
|
+
| `user` | User module with UI mockups | `docs/user/{context}/{Module}DocPage.tsx` |
|
|
74
|
+
| `developer` | Development tool guide | `docs/developer/tools/{Tool}Page.tsx` |
|
|
75
|
+
| `database` | Schema with ERD diagram | `docs/developer/database/{Schema}SchemaPage.tsx` |
|
|
76
|
+
| `testing` | Testing tool | `docs/developer/testing/{Tool}TestingPage.tsx` |
|
|
77
77
|
|
|
78
|
-
###
|
|
78
|
+
### Available Developer tools
|
|
79
79
|
|
|
80
|
-
|
|
|
81
|
-
|
|
82
|
-
|
|
|
83
|
-
|
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
|
80
|
+
| Category | Tools |
|
|
81
|
+
|----------|-------|
|
|
82
|
+
| Local Environment | Docker Compose, MailDev, VS Code, Environment variables |
|
|
83
|
+
| API Testing | Postman, REST Client, Swagger/OpenAPI |
|
|
84
|
+
| E2E Testing | Microsoft Playwright, Inspector, Trace Viewer |
|
|
85
|
+
| Load Testing | NBomber (.NET), k6, Azure Load Testing |
|
|
86
|
+
| Security Testing | OWASP ZAP, Security Code Scan, Snyk, OWASP ASVS |
|
|
87
87
|
|
|
88
88
|
---
|
|
89
89
|
|
|
90
|
-
##
|
|
90
|
+
## ABSOLUTE RULES
|
|
91
91
|
|
|
92
|
-
1. **
|
|
93
|
-
2. **
|
|
94
|
-
3. **
|
|
95
|
-
4. **
|
|
96
|
-
5. **
|
|
97
|
-
6. **
|
|
92
|
+
1. **NEVER** hardcoded text → `useTranslation('docs')`
|
|
93
|
+
2. **NEVER** ASCII art → React/HTML components for ERD
|
|
94
|
+
3. **ALWAYS** read sources before generating
|
|
95
|
+
4. **ALWAYS** confirm before creating
|
|
96
|
+
5. **ALWAYS** update App.tsx and parent indexes
|
|
97
|
+
6. **ALWAYS** add module in `UserIndexPage.tsx` (IF type == `user`)
|
|
98
98
|
|
|
99
99
|
---
|
|
100
100
|
|
|
101
|
-
##
|
|
101
|
+
## UserIndexPage Integration (TYPE: user)
|
|
102
102
|
|
|
103
|
-
**
|
|
103
|
+
**MANDATORY** for `user` modules: Add the module to the navigation hierarchy.
|
|
104
104
|
|
|
105
|
-
|
|
|
106
|
-
|
|
107
|
-
| `UserIndexPage.tsx` |
|
|
108
|
-
| `fr/docs.json` |
|
|
109
|
-
| `en/docs.json` |
|
|
105
|
+
| File | Modification |
|
|
106
|
+
|------|--------------|
|
|
107
|
+
| `UserIndexPage.tsx` | Add icon + entry in `modules[]` of parent application |
|
|
108
|
+
| `fr/docs.json` | Add `user.modules.{module}.name` and `.description` |
|
|
109
|
+
| `en/docs.json` | Add `user.modules.{module}.name` and `.description` |
|
|
110
110
|
|
|
111
|
-
**
|
|
112
|
-
- `Platform > Administration`: modules
|
|
113
|
-
- `Platform > Support`: modules
|
|
114
|
-
- `Personal > MySpace`: modules
|
|
111
|
+
**Parent applications:**
|
|
112
|
+
- `Platform > Administration`: admin modules (users, roles, ai, entra...)
|
|
113
|
+
- `Platform > Support`: support modules (tickets, sla, templates...)
|
|
114
|
+
- `Personal > MySpace`: personal modules (profile, preferences...)
|
|
115
115
|
|
|
116
|
-
**
|
|
116
|
+
**Verification:** The module should appear on `/docs/user` under its application.
|
|
117
117
|
|
|
118
118
|
---
|
|
119
119
|
|
|
120
|
-
## SOURCES
|
|
120
|
+
## DATA SOURCES
|
|
121
121
|
|
|
122
|
-
|
|
|
123
|
-
|
|
124
|
-
|
|
|
122
|
+
| Data | Source |
|
|
123
|
+
|------|--------|
|
|
124
|
+
| DB schemas | `src/SmartStack.Infrastructure/Persistence/Configurations/` |
|
|
125
125
|
| Tables | `ApplicationDbContextModelSnapshot.cs` |
|
|
126
|
-
|
|
|
127
|
-
|
|
|
126
|
+
| Existing documentation | `web/smartstack-web/src/pages/docs/` |
|
|
127
|
+
| Testing tools | WebSearch (current versions) |
|
|
128
128
|
|
|
129
129
|
---
|
|
130
130
|
|
|
131
|
-
##
|
|
131
|
+
## ASSOCIATED FILES
|
|
132
132
|
|
|
133
|
-
- **Templates
|
|
134
|
-
- **
|
|
133
|
+
- **React Templates:** [templates.md](templates.md)
|
|
134
|
+
- **Complete Command:** `.claude/commands/documentation-module.md`
|