@atlashub/smartstack-cli 4.75.0 → 4.79.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 (81) hide show
  1. package/dist/index.js +87 -41
  2. package/dist/index.js.map +1 -1
  3. package/package.json +1 -1
  4. package/templates/project/claude-md/root.CLAUDE.md.template +1 -1
  5. package/templates/skills/ai-prompt/SKILL.md +64 -0
  6. package/templates/skills/ai-prompt/references/ai-agent-modes.md +89 -0
  7. package/templates/skills/ai-prompt/references/eval-framework.md +129 -0
  8. package/templates/skills/apex/SKILL.md +2 -2
  9. package/templates/skills/apex/references/checks/frontend-checks.sh +123 -11
  10. package/templates/skills/apex/references/checks/seed-checks.sh +81 -7
  11. package/templates/skills/apex/references/core-seed-data.md +27 -22
  12. package/templates/skills/apex/references/domain-events-pattern.md +45 -0
  13. package/templates/skills/apex/references/entity-hooks-pattern.md +68 -0
  14. package/templates/skills/apex/references/licensing-enforcement.md +52 -0
  15. package/templates/skills/apex/references/post-checks.md +18 -1
  16. package/templates/skills/apex/references/smartstack-api.md +116 -5
  17. package/templates/skills/apex/references/smartstack-frontend.md +1 -1
  18. package/templates/skills/apex/references/smartstack-layers.md +6 -6
  19. package/templates/skills/apex/steps/step-00-init.md +1 -1
  20. package/templates/skills/apex/steps/step-03b-layer1-seed.md +26 -0
  21. package/templates/skills/apex/steps/step-03d-layer3-frontend.md +124 -2
  22. package/templates/skills/apex/steps/step-04-examine.md +163 -0
  23. package/templates/skills/apex-verify/SKILL.md +110 -0
  24. package/templates/skills/apex-verify/references/audit-rules.md +50 -0
  25. package/templates/skills/apex-verify/steps/step-00-init.md +119 -0
  26. package/templates/skills/apex-verify/steps/step-01-nav-audit.md +96 -0
  27. package/templates/skills/apex-verify/steps/step-02-crud-audit.md +127 -0
  28. package/templates/skills/apex-verify/steps/step-03-perm-audit.md +119 -0
  29. package/templates/skills/apex-verify/steps/step-04-route-audit.md +98 -0
  30. package/templates/skills/apex-verify/steps/step-05-report.md +110 -0
  31. package/templates/skills/application/references/contexts-cheatsheet.md +86 -0
  32. package/templates/skills/application/references/extensions-system.md +158 -0
  33. package/templates/skills/application/references/frontend-route-naming.md +7 -5
  34. package/templates/skills/application/references/frontend-verification.md +7 -5
  35. package/templates/skills/application/references/provider-template.md +4 -2
  36. package/templates/skills/application/references/smartstack-provider.md +118 -0
  37. package/templates/skills/application/references/themes-db-driven.md +484 -0
  38. package/templates/skills/application/templates-frontend.md +2 -2
  39. package/templates/skills/application/templates-seed.md +4 -2
  40. package/templates/skills/audit-route/references/routing-pattern.md +3 -1
  41. package/templates/skills/business-analyse/SKILL.md +3 -3
  42. package/templates/skills/business-analyse/_shared.md +37 -0
  43. package/templates/skills/business-analyse/react/components.md +30 -28
  44. package/templates/skills/business-analyse/references/03-json-schemas.md +11 -3
  45. package/templates/skills/business-analyse/references/03-post-check-validation.md +64 -0
  46. package/templates/skills/business-analyse/references/canonical-json-formats.md +7 -3
  47. package/templates/skills/business-analyse/references/robustness-checks.md +1 -1
  48. package/templates/skills/business-analyse/references/validation-checklist.md +5 -5
  49. package/templates/skills/business-analyse/schemas/sections/analysis-schema.json +15 -4
  50. package/templates/skills/business-analyse/steps/step-03-specify.md +162 -4
  51. package/templates/skills/business-analyse/steps/step-04-consolidate.md +211 -1
  52. package/templates/skills/business-analyse/templates-react.md +15 -15
  53. package/templates/skills/business-analyse-handoff/references/agent-handoff-transform-prompt.md +3 -0
  54. package/templates/skills/business-analyse-html/html/ba-interactive.html +198 -16
  55. package/templates/skills/business-analyse-html/html/src/scripts/01-data-init.js +64 -0
  56. package/templates/skills/business-analyse-html/html/src/scripts/05-render-specs.js +80 -11
  57. package/templates/skills/business-analyse-html/html/src/scripts/06-render-consolidation.js +2 -2
  58. package/templates/skills/business-analyse-html/html/src/scripts/06-render-mockups.js +6 -3
  59. package/templates/skills/business-analyse-html/html/src/scripts/12-render-diagrams.js +46 -0
  60. package/templates/skills/business-analyse-html/references/02-feature-data-building.md +4 -2
  61. package/templates/skills/business-analyse-html/references/data-build.md +2 -0
  62. package/templates/skills/business-analyse-html/references/data-mapping.md +88 -21
  63. package/templates/skills/business-analyse-html/steps/step-02-build-data.md +6 -0
  64. package/templates/skills/business-analyse-html/steps/step-04-verify.md +92 -3
  65. package/templates/skills/business-analyse-quick/SKILL.md +807 -0
  66. package/templates/skills/{sketch → business-analyse-quick}/references/domain-heuristics.md +59 -3
  67. package/templates/skills/business-analyse-quick/references/prd-schema.md +268 -0
  68. package/templates/skills/business-analyse-review/references/review-data-mapping.md +6 -0
  69. package/templates/skills/cli-app-sync/SKILL.md +105 -4
  70. package/templates/skills/cli-app-sync/references/comparison-map.md +13 -0
  71. package/templates/skills/cli-app-sync/references/diff-entities.md +162 -0
  72. package/templates/skills/dev-start/SKILL.md +7 -7
  73. package/templates/skills/documentation/templates.md +16 -16
  74. package/templates/skills/migrate/SKILL.md +312 -0
  75. package/templates/skills/migrate/references/v3.34-to-v3.46.md +289 -0
  76. package/templates/skills/sketch/SKILL.md +15 -153
  77. package/templates/skills/smoke-generation/SKILL.md +313 -0
  78. package/templates/skills/ui-components/SKILL.md +11 -1
  79. package/templates/skills/ui-components/patterns/data-table.md +1 -1
  80. package/templates/skills/ui-components/references/component-catalog.md +82 -0
  81. package/templates/skills/workflow/SKILL.md +70 -1
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: step-01-nav-audit
3
+ description: Audit navigation seed data for reserved section codes appearing as menu items
4
+ next_step: steps/step-02-crud-audit.md
5
+ ---
6
+
7
+ # Step 1: Navigation Audit
8
+
9
+ ## YOUR TASK:
10
+ Scan all navigation seed data files for sections with reserved codes that should NOT appear as sidebar menu items.
11
+
12
+ ## RESERVED SECTION CODES:
13
+ ```
14
+ RESERVED = ["detail", "create", "edit"]
15
+ ```
16
+ These are internal route targets (/:id, /create, /:id/edit), NOT sidebar menu items.
17
+ Any section with one of these codes — or containing "detail" (e.g., "department-detail") — must NOT be a visible menu entry.
18
+
19
+ ---
20
+
21
+ ## EXECUTION SEQUENCE:
22
+
23
+ ### 1. Scan Navigation Seed Data
24
+
25
+ For each file in {seed_files}:
26
+
27
+ **1a. Extract all section entries**
28
+
29
+ Use Grep to find section definitions. Two patterns to check:
30
+
31
+ Pattern A — SectionData record array:
32
+ ```csharp
33
+ new("detail", "/path/:id", "icon", 4, (...))
34
+ ```
35
+ → Grep for `new\s*\("([^"]+)"` in SectionData arrays
36
+
37
+ Pattern B — NavigationSectionSeedEntry objects:
38
+ ```csharp
39
+ Code = "detail",
40
+ ```
41
+ → Grep for `Code\s*=\s*"([^"]+)"`
42
+
43
+ **1b. Check each section code against RESERVED list**
44
+
45
+ For each extracted section code:
46
+ - If code == "detail" OR code == "create" OR code == "edit" → **BLOCKING finding**
47
+ - If code contains "-detail" (e.g., "department-detail") → **BLOCKING finding**
48
+ - Check if `IsActive = false` is set nearby (within 10 lines) — if so, downgrade to WARNING (it's hidden but still seeded, which is acceptable)
49
+
50
+ ### 2. Check Route Patterns
51
+
52
+ For each section route in seed data:
53
+ - Route ending with `/:id` that is NOT the "list" section's detail route → WARNING (may be a separate detail section that should be merged)
54
+ - Route containing `/detail/` or `/create/` or `/edit/` as segments → **BLOCKING** (forbidden patterns per SmartStack convention)
55
+
56
+ ### 3. Record Findings
57
+
58
+ For each issue found, create a finding:
59
+
60
+ ```
61
+ {
62
+ id: "NAV-001", // Sequential per category
63
+ severity: "BLOCKING",
64
+ category: "Navigation",
65
+ file: "EmployeesNavigationSeedData.cs",
66
+ line: 25,
67
+ message: "Reserved section code 'detail' is seeded as a visible menu item",
68
+ fix: "Remove this section entry from the Sections[] array. Detail routes are resolved by DynamicRouter convention (/:id under list section)."
69
+ }
70
+ ```
71
+
72
+ ### Finding IDs:
73
+
74
+ | ID | Severity | Rule |
75
+ |----|----------|------|
76
+ | NAV-001 | BLOCKING | Reserved section code (detail/create/edit) seeded as menu item |
77
+ | NAV-002 | BLOCKING | Section code contains "-detail" (e.g., department-detail) seeded as menu item |
78
+ | NAV-003 | BLOCKING | Route contains forbidden segment (/detail/, /create/, /edit/) |
79
+ | NAV-004 | WARNING | Reserved section code with IsActive = false (acceptable but unnecessary) |
80
+ | NAV-005 | WARNING | Section code not in kebab-case |
81
+ | NAV-006 | WARNING (v3.46) | `ApplicationZone` enum referenced in seed data — must use `IsPersonal`/`IsOpen` flags (cf. seed-checks.sh check **C66**, will become BLOCKING in v3.47) |
82
+ | NAV-007 | WARNING (v3.46) | Legacy layouts `AdminLayout`/`BusinessLayout`/`UserLayout`/`HRLayout`/`SalesLayout` referenced — must use `AppLayout` (cf. seed-checks.sh check **C67**, will become BLOCKING in v3.47) |
83
+
84
+ **Note** : NAV-006 and NAV-007 mirror the bash post-checks **C66**/**C67** in `apex/references/checks/seed-checks.sh`. The bash checks emit `WARNING` (no FAIL) during the v3.46 grace period — apex-verify should align with the same severity.
85
+
86
+ ---
87
+
88
+ ## SUCCESS METRICS:
89
+ - All NavigationSeedData files scanned
90
+ - Every section code checked against reserved list
91
+ - Every route checked for forbidden patterns
92
+ - Findings recorded with file:line evidence
93
+
94
+ ## NEXT STEP:
95
+ If {scope} is `all` or `crud` → proceed to `./step-02-crud-audit.md`
96
+ If {scope} is `nav` → skip to `./step-05-report.md`
@@ -0,0 +1,127 @@
1
+ ---
2
+ name: step-02-crud-audit
3
+ description: Audit CRUD completeness - 4 page types per section, create buttons, componentRegistry
4
+ next_step: steps/step-03-perm-audit.md
5
+ ---
6
+
7
+ # Step 2: CRUD Audit
8
+
9
+ ## YOUR TASK:
10
+ Verify that every section in the application has complete CRUD support: 4 page types, create button on list pages, and proper componentRegistry registration.
11
+
12
+ ---
13
+
14
+ ## EXECUTION SEQUENCE:
15
+
16
+ ### 1. Identify Sections to Audit
17
+
18
+ From {seed_files}, extract all section codes that represent CRUD entities.
19
+
20
+ **Exclude from audit:**
21
+ - Sections with code: "dashboard", "calendar", "import-export", "approve", "balances" (these are specialized views, not CRUD entities)
22
+ - Sections with reserved codes: "detail", "create", "edit" (these shouldn't exist as sections)
23
+
24
+ **Include in audit:**
25
+ - "list" sections → audit as the main entity section
26
+ - "departments", "absence-types", or any other entity section → audit for CRUD completeness
27
+
28
+ For each auditable section, determine the entity name:
29
+ - Section code → PascalCase entity name (e.g., "departments" → "Department", "absence-types" → "AbsenceType")
30
+
31
+ ### 2. Check 4 Page Types per Section
32
+
33
+ For each entity, search in {page_files} for:
34
+
35
+ ```
36
+ Required page types (at least 3 naming conventions per type):
37
+ ListPage: {Entity}ListPage.tsx OR {Entity}sPage.tsx OR {Entities}Page.tsx
38
+ DetailPage: {Entity}DetailPage.tsx OR {Entity}Page.tsx
39
+ CreatePage: Create{Entity}Page.tsx OR {Entity}CreatePage.tsx OR {Entity}FormPage.tsx
40
+ EditPage: Edit{Entity}Page.tsx OR {Entity}EditPage.tsx OR {Entity}FormPage.tsx (shared)
41
+ ```
42
+
43
+ Note: Create and Edit may share a single `{Entity}FormPage.tsx` — this is acceptable.
44
+
45
+ **Findings:**
46
+
47
+ | ID | Severity | Rule |
48
+ |----|----------|------|
49
+ | CRUD-001 | BLOCKING | ListPage missing for entity |
50
+ | CRUD-002 | BLOCKING | DetailPage missing for entity |
51
+ | CRUD-003 | BLOCKING | Create/Edit page missing for entity (no CreatePage, EditPage, or FormPage) |
52
+
53
+ ### 3. Check Create Button on List Pages
54
+
55
+ For each ListPage found:
56
+
57
+ Grep for navigate patterns:
58
+ ```
59
+ navigate('create')
60
+ navigate(`create`)
61
+ navigate('new')
62
+ navigate(`${basePath}/create`)
63
+ navigate(`create`)
64
+ ```
65
+
66
+ Also check for link patterns:
67
+ ```
68
+ <Link to="create"
69
+ to={`create`}
70
+ to="new"
71
+ ```
72
+
73
+ If NONE found → **BLOCKING finding** (users cannot access create form)
74
+
75
+ | ID | Severity | Rule |
76
+ |----|----------|------|
77
+ | CRUD-004 | BLOCKING | ListPage has no Create/New button (no navigate to create route) |
78
+
79
+ ### 4. Check componentRegistry Registration
80
+
81
+ Read {registry_file} and extract all `PageRegistry.register()` calls.
82
+
83
+ For each entity section:
84
+ - Check for list page registration: key matching `*.{section}` or `*.{module}.{section}`
85
+ - Check for detail page registration: key matching `*.{section}.detail` or the `:id` route
86
+ - Check for create page registration: key matching `*.{section}.create`
87
+ - Check for edit page registration: key matching `*.{section}.edit`
88
+
89
+ | ID | Severity | Rule |
90
+ |----|----------|------|
91
+ | CRUD-005 | BLOCKING | Page exists on disk but NOT registered in componentRegistry |
92
+ | CRUD-006 | WARNING | componentRegistry entry has no matching page file on disk |
93
+
94
+ ### 5. Check Form Submit Handlers
95
+
96
+ For each Create/Edit/Form page:
97
+
98
+ Grep for submit patterns:
99
+ ```
100
+ onSubmit
101
+ handleSubmit
102
+ api.create(
103
+ api.post(
104
+ api.update(
105
+ api.put(
106
+ apiClient.post(
107
+ apiClient.put(
108
+ ```
109
+
110
+ If NONE found → WARNING (form exists but may not submit data)
111
+
112
+ | ID | Severity | Rule |
113
+ |----|----------|------|
114
+ | CRUD-007 | WARNING | Form page has no visible submit handler |
115
+
116
+ ---
117
+
118
+ ## SUCCESS METRICS:
119
+ - All entity sections identified from seed data
120
+ - 4 page types checked per entity
121
+ - Create button presence verified on all list pages
122
+ - componentRegistry cross-referenced with page files
123
+ - Form submit handlers checked
124
+
125
+ ## NEXT STEP:
126
+ If {scope} is `all` or `perm` → proceed to `./step-03-perm-audit.md`
127
+ If {scope} is `crud` → skip to `./step-05-report.md`
@@ -0,0 +1,119 @@
1
+ ---
2
+ name: step-03-perm-audit
3
+ description: Cross-reference permissions between controllers, Permissions.cs, seed data, and roles
4
+ next_step: steps/step-04-route-audit.md
5
+ ---
6
+
7
+ # Step 3: Permission Audit
8
+
9
+ ## YOUR TASK:
10
+ Cross-reference permissions across 4 sources to ensure complete coverage:
11
+ 1. Controller `[RequirePermission]` attributes → what the API enforces
12
+ 2. `Permissions.cs` static constants → what the code defines
13
+ 3. `PermissionsSeedData` → what gets seeded to the database
14
+ 4. `RolesSeedData` → what roles have which permissions
15
+
16
+ ---
17
+
18
+ ## EXECUTION SEQUENCE:
19
+
20
+ ### 1. Extract Controller Permissions
21
+
22
+ For each file in {controller_files}:
23
+
24
+ Grep for `[RequirePermission(` and extract the permission string:
25
+ ```csharp
26
+ [RequirePermission(Permissions.Employees.Read)]
27
+ [RequirePermission(Permissions.AbsenceManagement.Create)]
28
+ ```
29
+
30
+ Build a set: `{controller_permissions}` = all unique permission references.
31
+
32
+ Also note which controller and HTTP method uses each permission (for context in findings).
33
+
34
+ ### 2. Extract Permissions.cs Constants
35
+
36
+ Read {permissions_file} and extract all `public const string` values:
37
+ ```csharp
38
+ public const string Read = "human-resources.employees.read";
39
+ public const string Wildcard = "human-resources.employees.*";
40
+ ```
41
+
42
+ Build a set: `{defined_permissions}` = all permission path strings.
43
+ Also track the constant name → path mapping.
44
+
45
+ ### 3. Extract Seed Data Permissions
46
+
47
+ For each file in {perm_seed_files}:
48
+
49
+ Grep for permission path patterns:
50
+ ```csharp
51
+ Path = "human-resources.employees.read"
52
+ new PermissionSeedEntry { ... Path = "..." }
53
+ "human-resources.employees.read" // in HasData() or SeedPermissionsAsync
54
+ ```
55
+
56
+ Build a set: `{seeded_permissions}` = all permission paths in seed data.
57
+
58
+ ### 4. Extract Role Mappings
59
+
60
+ For each file in {role_seed_files}:
61
+
62
+ Grep for role-permission associations. Look for patterns:
63
+ ```csharp
64
+ // Role assignment patterns
65
+ new { RoleId = ..., PermissionId = ... }
66
+ SeedRolePermissionsAsync
67
+ rolePermissions.Add(...)
68
+ ```
69
+
70
+ Build a map: `{role_mappings}` = { permission_path: [role_names] }
71
+
72
+ ### 5. Cross-Reference Matrix
73
+
74
+ **Check A: Controllers → Permissions.cs**
75
+ For each permission in {controller_permissions}:
76
+ - Verify it resolves to a constant in {defined_permissions}
77
+ - If missing → BLOCKING (controller references undefined permission)
78
+
79
+ **Check B: Permissions.cs → Seed Data**
80
+ For each permission in {defined_permissions} (excluding wildcards):
81
+ - Verify it exists in {seeded_permissions}
82
+ - If missing → BLOCKING (permission defined but never seeded = always 403)
83
+
84
+ **Check C: Seed Data → Roles**
85
+ For each permission in {seeded_permissions}:
86
+ - Verify it has at least one role mapping in {role_mappings}
87
+ - If missing → CRITICAL (permission seeded but no role has it = always 403)
88
+
89
+ **Check D: Admin Role Wildcard**
90
+ - Verify admin role has wildcard (`*`) permissions for each module
91
+ - If missing → CRITICAL (admin cannot access module)
92
+
93
+ **Check E: Role Matrix Sanity**
94
+ - Viewer role must NOT have write permissions (create, update, delete)
95
+ - Admin must have wildcard or all individual permissions
96
+
97
+ ### 6. Record Findings
98
+
99
+ | ID | Severity | Rule |
100
+ |----|----------|------|
101
+ | PERM-001 | BLOCKING | Controller uses permission not defined in Permissions.cs |
102
+ | PERM-002 | BLOCKING | Permissions.cs constant not seeded in PermissionsSeedData |
103
+ | PERM-003 | CRITICAL | Seeded permission has no role mapping (always 403 for all users) |
104
+ | PERM-004 | CRITICAL | Admin role missing wildcard for module |
105
+ | PERM-005 | WARNING | Permission path segments not in kebab-case |
106
+ | PERM-006 | WARNING | Viewer role has write permission (create/update/delete) |
107
+ | PERM-007 | WARNING | Permission defined in Permissions.cs but unused by any controller (dead code) |
108
+
109
+ ---
110
+
111
+ ## SUCCESS METRICS:
112
+ - All 4 sources extracted completely
113
+ - Cross-reference matrix fully evaluated
114
+ - Role matrix sanity checked
115
+ - Findings recorded with file:line evidence
116
+
117
+ ## NEXT STEP:
118
+ If {scope} is `all` or `route` → proceed to `./step-04-route-audit.md`
119
+ If {scope} is `perm` → skip to `./step-05-report.md`
@@ -0,0 +1,98 @@
1
+ ---
2
+ name: step-04-route-audit
3
+ description: Verify route alignment between navigation seed data, componentRegistry, and controllers
4
+ next_step: steps/step-05-report.md
5
+ ---
6
+
7
+ # Step 4: Route Audit
8
+
9
+ ## YOUR TASK:
10
+ Verify that routes are consistent across 3 sources: navigation seed data, componentRegistry (PageRegistry), and backend controllers (NavRoute attributes).
11
+
12
+ ---
13
+
14
+ ## EXECUTION SEQUENCE:
15
+
16
+ ### 1. Extract Seed Data Routes
17
+
18
+ From {seed_files}, extract all section routes:
19
+ ```
20
+ {seed_routes} = [
21
+ { code: "departments", route: "/human-resources/employees/departments", file: "...", line: N },
22
+ { code: "list", route: "/human-resources/employees", file: "...", line: N },
23
+ ...
24
+ ]
25
+ ```
26
+
27
+ ### 2. Extract PageRegistry Keys
28
+
29
+ From {registry_file}, extract all `PageRegistry.register()` calls:
30
+ ```typescript
31
+ PageRegistry.register('human-resources.employees.departments', ...)
32
+ PageRegistry.register('human-resources.employees', ...)
33
+ ```
34
+
35
+ Build: `{registry_keys}` = all registered page keys.
36
+
37
+ ### 3. Extract Controller NavRoutes
38
+
39
+ From {controller_files}, extract `[NavRoute("...")]` attributes:
40
+ ```csharp
41
+ [NavRoute("human-resources.employees")]
42
+ [NavRoute("human-resources.employees.departments")]
43
+ ```
44
+
45
+ Build: `{controller_navroutes}` = all NavRoute values.
46
+
47
+ ### 4. Cross-Reference
48
+
49
+ **Check A: Seed Routes → PageRegistry**
50
+ For each seed route (excluding reserved sections and /:id routes):
51
+ - Convert route to PageRegistry key: `/human-resources/employees/departments` → `human-resources.employees.departments`
52
+ - Verify key exists in {registry_keys}
53
+ - If missing → BLOCKING (seed route has no frontend page)
54
+
55
+ **Check B: Controller NavRoutes → Seed Data**
56
+ For each NavRoute:
57
+ - Convert to route path: `human-resources.employees` → `/human-resources/employees`
58
+ - Verify exists in seed data routes
59
+ - If missing → WARNING (controller exists but no navigation entry)
60
+
61
+ **Check C: PageRegistry → Page Files**
62
+ For each registry entry:
63
+ - Verify the imported component file exists on disk
64
+ - If missing → BLOCKING (registry references non-existent page)
65
+
66
+ **Check D: Orphan Pages**
67
+ For each page file in {page_files}:
68
+ - Check if it's registered in componentRegistry
69
+ - If NOT registered → WARNING (page exists but has no route — unreachable)
70
+
71
+ **Check E: DynamicRouter Convention Routes**
72
+ For each section with a list page:
73
+ - Verify these implicit routes are handled (either by registry or DynamicRouter convention):
74
+ - `{section}/:id` → detail page
75
+ - `{section}/create` → create page
76
+ - `{section}/:id/edit` → edit page
77
+ - Note: DynamicRouter may resolve these by convention without explicit registry entries. Only flag if BOTH registry AND convention are missing.
78
+
79
+ ### 5. Record Findings
80
+
81
+ | ID | Severity | Rule |
82
+ |----|----------|------|
83
+ | ROUTE-001 | BLOCKING | Seed data route has no matching PageRegistry entry |
84
+ | ROUTE-002 | WARNING | Controller NavRoute has no matching seed data entry |
85
+ | ROUTE-003 | BLOCKING | PageRegistry references non-existent page file |
86
+ | ROUTE-004 | WARNING | Orphan page — exists on disk but not registered (unreachable) |
87
+ | ROUTE-005 | WARNING | Implicit route (detail/create/edit) not resolvable |
88
+
89
+ ---
90
+
91
+ ## SUCCESS METRICS:
92
+ - All 3 sources extracted completely
93
+ - Cross-reference completed for all combinations
94
+ - Orphan detection completed
95
+ - DynamicRouter conventions accounted for
96
+
97
+ ## NEXT STEP:
98
+ Proceed to `./step-05-report.md`
@@ -0,0 +1,110 @@
1
+ ---
2
+ name: step-05-report
3
+ description: Generate consolidated audit report with all findings
4
+ ---
5
+
6
+ # Step 5: Consolidated Report
7
+
8
+ ## YOUR TASK:
9
+ Compile all findings from previous steps into a structured, actionable report.
10
+
11
+ ---
12
+
13
+ ## REPORT FORMAT:
14
+
15
+ Display the following report to the user:
16
+
17
+ ```
18
+ ============================================================
19
+ APEX VERIFICATION REPORT
20
+ ============================================================
21
+
22
+ Project: {project_name}
23
+ Scope: {scope}
24
+ Date: {current_date}
25
+
26
+ ------------------------------------------------------------
27
+ SUMMARY
28
+ ------------------------------------------------------------
29
+
30
+ | Category | BLOCKING | CRITICAL | WARNING | PASS |
31
+ |-------------|----------|----------|---------|------|
32
+ | Navigation | {count} | {count} | {count} | {Y/N}|
33
+ | CRUD | {count} | {count} | {count} | {Y/N}|
34
+ | Permissions | {count} | {count} | {count} | {Y/N}|
35
+ | Routes | {count} | {count} | {count} | {Y/N}|
36
+ | **TOTAL** | {total} | {total} | {total} | |
37
+
38
+ Result: {PASS / FAIL (N blocking issues)}
39
+
40
+ ------------------------------------------------------------
41
+ BLOCKING FINDINGS (must fix)
42
+ ------------------------------------------------------------
43
+
44
+ [{ID}] {message}
45
+ File: {file_path}:{line}
46
+ Fix: {fix_description}
47
+
48
+ ... (repeat for each blocking finding)
49
+
50
+ ------------------------------------------------------------
51
+ CRITICAL FINDINGS (should fix)
52
+ ------------------------------------------------------------
53
+
54
+ [{ID}] {message}
55
+ File: {file_path}:{line}
56
+ Fix: {fix_description}
57
+
58
+ ... (repeat for each critical finding)
59
+
60
+ ------------------------------------------------------------
61
+ WARNINGS (nice to fix)
62
+ ------------------------------------------------------------
63
+
64
+ [{ID}] {message}
65
+ File: {file_path}:{line}
66
+ Fix: {fix_description}
67
+
68
+ ... (repeat for each warning)
69
+
70
+ ============================================================
71
+ ```
72
+
73
+ ## ADDITIONAL SECTIONS (if --fix):
74
+
75
+ When {fix_mode} is true, add a "FIX COMMANDS" section after the findings:
76
+
77
+ ```
78
+ ------------------------------------------------------------
79
+ FIX COMMANDS
80
+ ------------------------------------------------------------
81
+
82
+ # NAV-001: Remove reserved section 'detail' from menu
83
+ # File: src/.../EmployeesNavigationSeedData.cs
84
+ # Action: Remove the section entry with code "detail" from Sections[] array
85
+
86
+ # CRUD-004: Add Create button to EmployeeListPage
87
+ # File: web/.../EmployeeListPage.tsx
88
+ # Action: Add in the page header:
89
+ # <button onClick={() => navigate('create')} className="...">
90
+ # New Employee
91
+ # </button>
92
+
93
+ ... (repeat for each finding with specific fix instructions)
94
+ ```
95
+
96
+ ## RULES FOR REPORT GENERATION:
97
+
98
+ 1. **Sort by severity**: BLOCKING first, then CRITICAL, then WARNING
99
+ 2. **Within same severity**: Sort by category (NAV, CRUD, PERM, ROUTE)
100
+ 3. **No false positives**: Only include findings with concrete evidence (file:line)
101
+ 4. **No duplicates**: Merge findings that point to the same root cause
102
+ 5. **Actionable fixes**: Every finding must have a clear, specific fix instruction
103
+ 6. **If no findings in a category**: Display "PASS — No issues found" for that category
104
+
105
+ ## SUCCESS CRITERIA:
106
+ - Report is complete and properly formatted
107
+ - All findings from steps 1-4 are included
108
+ - Pass/fail status is correct
109
+ - Fix commands are included if --fix was specified
110
+ - Report is immediately actionable by the developer
@@ -0,0 +1,86 @@
1
+ # SmartStack Contexts — Cheatsheet
2
+
3
+ > **Reference for `application` skill** — quick lookup of the 10 system contexts exposed by `<SmartStackProvider>`.
4
+
5
+ ## When This Reference Applies
6
+
7
+ - You generate a component that needs to read auth/tenant/theme state
8
+ - You audit a page that re-implements existing context state
9
+ - The user asks "how do I read the current tenant", "how do I check a permission", "where is the SignalR connection"
10
+
11
+ ---
12
+
13
+ ## The 10 contexts (state map)
14
+
15
+ | # | Context | Hook | State exposed | Example use case |
16
+ |---|---|---|---|---|
17
+ | 1 | AuthContext | `useAuth()` | `user`, `roles`, `permissions`, `isAuthenticated`, `login()`, `logout()`, `refresh()`, `hasPermission(path)` | Read current user, check permission gate |
18
+ | 2 | TenantContext | `useTenant()` | `currentTenant`, `userTenants`, `isGlobalView`, `switchTenant(id)` | Display tenant switcher, scope a query |
19
+ | 3 | NavigationContext | `useNavigation()` | `menu` (MenuDto), `reload()`, `currentApp`, `currentModule`, `currentSection`, `isLoading`, `getApplicationsByZone()` (back-compat alias) | Render sidebar, breadcrumb, route resolution |
20
+ | 4 | ThemeContext | `useTheme()` | `mode`, `selectedTheme`, `selectedPreset`, `setMode()`, `setTheme(id)`, `setPreset(id)` | Toggle dark mode, switch theme |
21
+ | 5 | LicenseContext | `useLicense()` | `license`, `isFeatureEnabled(code)`, `hasModule(code)` | Gate a feature behind license |
22
+ | 6 | SignalRContext | `useSignalR()` | `isConnected`, `on(event, handler)`, `off(event, handler)`, `emit(event, payload)` | Real-time notifications |
23
+ | 7 | FavoritesContext | `useFavorites()` | `favorites`, `toggleFavorite(item)`, `isFavorite(id)` | Bookmark a page/entity |
24
+ | 8 | SidebarContext | `useSidebar()` | `isCollapsed`, `toggle()`, `setCollapsed(value)` | Sidebar collapse button |
25
+ | 9 | FeatureConfigContext | `useFeatureConfig()` | `features` (record from `/api/config/public`) | Feature flag, A/B test |
26
+ | 10 | DocPanelContext | `useDocPanel()` | `isOpen`, `toggle()`, `openDoc(slug)` | Contextual help panel |
27
+
28
+ ---
29
+
30
+ ## Common patterns
31
+
32
+ ### Permission check — render guard
33
+
34
+ ```tsx
35
+ const { hasPermission } = useAuth();
36
+ if (!hasPermission('administration.users.create')) return <Forbidden />;
37
+ ```
38
+
39
+ ### Tenant-scoped query
40
+
41
+ ```tsx
42
+ const { currentTenant } = useTenant();
43
+ const { data } = useQuery(
44
+ ['orders', currentTenant?.id],
45
+ () => orderApi.list({ tenantId: currentTenant?.id })
46
+ );
47
+ ```
48
+
49
+ ### Real-time updates
50
+
51
+ ```tsx
52
+ const { on, off } = useSignalR();
53
+ useEffect(() => {
54
+ const handler = (notif) => toast(notif.message);
55
+ on('NotificationReceived', handler);
56
+ return () => off('NotificationReceived', handler);
57
+ }, []);
58
+ ```
59
+
60
+ ### Feature flag
61
+
62
+ ```tsx
63
+ const { isFeatureEnabled } = useLicense();
64
+ if (isFeatureEnabled('ai-assistant')) return <AiAssistant />;
65
+ ```
66
+
67
+ ---
68
+
69
+ ## DO / DON'T
70
+
71
+ | ✅ DO | ❌ DON'T |
72
+ |---|---|
73
+ | Consume contexts via the provided hooks | `useContext(SmartStackContext)` directly |
74
+ | Memoize derived values from context | Re-compute on every render |
75
+ | Subscribe/unsubscribe SignalR handlers in `useEffect` cleanup | Forget to `off()` (memory leak) |
76
+ | Treat `permissions` as opaque strings | Parse permissions client-side |
77
+ | Read tenant from `currentTenant`, not URL | Trust the URL slug as a source of truth |
78
+
79
+ ---
80
+
81
+ ## Reference source files (read-only)
82
+
83
+ - `D:\01 - projets\SmartStack.app\features\IA-Workflow\web\smartstack-web\src\contexts\` (all 10 files)
84
+ - `D:\01 - projets\SmartStack.app\features\IA-Workflow\web\smartstack-web\src\provider\SmartStackProvider.tsx` (wrapping order)
85
+
86
+ See [smartstack-provider.md](smartstack-provider.md) for the wrapping order.