@trentapps/manager-protocol 1.1.3 → 1.2.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.
Files changed (142) hide show
  1. package/README.md +164 -17
  2. package/dist/analyzers/CSSAnalyzer.d.ts +180 -8
  3. package/dist/analyzers/CSSAnalyzer.d.ts.map +1 -1
  4. package/dist/analyzers/CSSAnalyzer.js +561 -105
  5. package/dist/analyzers/CSSAnalyzer.js.map +1 -1
  6. package/dist/config/dashboard.d.ts +55 -0
  7. package/dist/config/dashboard.d.ts.map +1 -0
  8. package/dist/config/dashboard.js +103 -0
  9. package/dist/config/dashboard.js.map +1 -0
  10. package/dist/config/index.d.ts +7 -0
  11. package/dist/config/index.d.ts.map +1 -0
  12. package/dist/config/index.js +7 -0
  13. package/dist/config/index.js.map +1 -0
  14. package/dist/dashboard/httpDashboard.d.ts +100 -0
  15. package/dist/dashboard/httpDashboard.d.ts.map +1 -0
  16. package/dist/dashboard/httpDashboard.js +1276 -0
  17. package/dist/dashboard/httpDashboard.js.map +1 -0
  18. package/dist/dashboard/index.d.ts +6 -0
  19. package/dist/dashboard/index.d.ts.map +1 -0
  20. package/dist/dashboard/index.js +7 -0
  21. package/dist/dashboard/index.js.map +1 -0
  22. package/dist/engine/AuditLogger.d.ts +370 -2
  23. package/dist/engine/AuditLogger.d.ts.map +1 -1
  24. package/dist/engine/AuditLogger.js +1064 -24
  25. package/dist/engine/AuditLogger.js.map +1 -1
  26. package/dist/engine/GitHubClient.d.ts +183 -0
  27. package/dist/engine/GitHubClient.d.ts.map +1 -0
  28. package/dist/engine/GitHubClient.js +411 -0
  29. package/dist/engine/GitHubClient.js.map +1 -0
  30. package/dist/engine/RateLimiter.d.ts +5 -3
  31. package/dist/engine/RateLimiter.d.ts.map +1 -1
  32. package/dist/engine/RateLimiter.js +49 -72
  33. package/dist/engine/RateLimiter.js.map +1 -1
  34. package/dist/engine/RuleDependencyAnalyzer.d.ts +73 -0
  35. package/dist/engine/RuleDependencyAnalyzer.d.ts.map +1 -0
  36. package/dist/engine/RuleDependencyAnalyzer.js +475 -0
  37. package/dist/engine/RuleDependencyAnalyzer.js.map +1 -0
  38. package/dist/engine/RulesEngine.d.ts +102 -3
  39. package/dist/engine/RulesEngine.d.ts.map +1 -1
  40. package/dist/engine/RulesEngine.js +326 -21
  41. package/dist/engine/RulesEngine.js.map +1 -1
  42. package/dist/engine/TaskManager.d.ts +10 -14
  43. package/dist/engine/TaskManager.d.ts.map +1 -1
  44. package/dist/engine/TaskManager.js +169 -197
  45. package/dist/engine/TaskManager.js.map +1 -1
  46. package/dist/engine/index.d.ts +3 -0
  47. package/dist/engine/index.d.ts.map +1 -1
  48. package/dist/engine/index.js +5 -0
  49. package/dist/engine/index.js.map +1 -1
  50. package/dist/rules/azure.d.ts.map +1 -1
  51. package/dist/rules/azure.js +12 -14
  52. package/dist/rules/azure.js.map +1 -1
  53. package/dist/rules/compliance.d.ts.map +1 -1
  54. package/dist/rules/compliance.js +23 -41
  55. package/dist/rules/compliance.js.map +1 -1
  56. package/dist/rules/condition-optimizer.d.ts +151 -0
  57. package/dist/rules/condition-optimizer.d.ts.map +1 -0
  58. package/dist/rules/condition-optimizer.js +479 -0
  59. package/dist/rules/condition-optimizer.js.map +1 -0
  60. package/dist/rules/css.d.ts.map +1 -1
  61. package/dist/rules/css.js +538 -0
  62. package/dist/rules/css.js.map +1 -1
  63. package/dist/rules/field-standards.d.ts +1172 -0
  64. package/dist/rules/field-standards.d.ts.map +1 -0
  65. package/dist/rules/field-standards.js +908 -0
  66. package/dist/rules/field-standards.js.map +1 -0
  67. package/dist/rules/flask.d.ts.map +1 -1
  68. package/dist/rules/flask.js +18 -31
  69. package/dist/rules/flask.js.map +1 -1
  70. package/dist/rules/index.d.ts +220 -0
  71. package/dist/rules/index.d.ts.map +1 -1
  72. package/dist/rules/index.js +155 -0
  73. package/dist/rules/index.js.map +1 -1
  74. package/dist/rules/ml-ai.d.ts.map +1 -1
  75. package/dist/rules/ml-ai.js +11 -13
  76. package/dist/rules/ml-ai.js.map +1 -1
  77. package/dist/rules/patterns.d.ts +568 -0
  78. package/dist/rules/patterns.d.ts.map +1 -0
  79. package/dist/rules/patterns.js +1359 -0
  80. package/dist/rules/patterns.js.map +1 -0
  81. package/dist/rules/security.d.ts.map +1 -1
  82. package/dist/rules/security.js +580 -19
  83. package/dist/rules/security.js.map +1 -1
  84. package/dist/rules/shared-patterns.d.ts +268 -0
  85. package/dist/rules/shared-patterns.d.ts.map +1 -0
  86. package/dist/rules/shared-patterns.js +556 -0
  87. package/dist/rules/shared-patterns.js.map +1 -0
  88. package/dist/rules/storage.d.ts +8 -2
  89. package/dist/rules/storage.d.ts.map +1 -1
  90. package/dist/rules/storage.js +541 -3
  91. package/dist/rules/storage.js.map +1 -1
  92. package/dist/rules/stripe.d.ts.map +1 -1
  93. package/dist/rules/stripe.js +19 -26
  94. package/dist/rules/stripe.js.map +1 -1
  95. package/dist/rules/websocket.d.ts.map +1 -1
  96. package/dist/rules/websocket.js +32 -40
  97. package/dist/rules/websocket.js.map +1 -1
  98. package/dist/supervisor/AgentSupervisor.d.ts +52 -0
  99. package/dist/supervisor/AgentSupervisor.d.ts.map +1 -1
  100. package/dist/supervisor/AgentSupervisor.js +120 -1
  101. package/dist/supervisor/AgentSupervisor.js.map +1 -1
  102. package/dist/supervisor/ManagedServerRegistry.d.ts +139 -2
  103. package/dist/supervisor/ManagedServerRegistry.d.ts.map +1 -1
  104. package/dist/supervisor/ManagedServerRegistry.js +590 -6
  105. package/dist/supervisor/ManagedServerRegistry.js.map +1 -1
  106. package/dist/supervisor/ProjectTracker.d.ts +2 -1
  107. package/dist/supervisor/ProjectTracker.d.ts.map +1 -1
  108. package/dist/supervisor/ProjectTracker.js +5 -9
  109. package/dist/supervisor/ProjectTracker.js.map +1 -1
  110. package/dist/testing/index.d.ts +11 -0
  111. package/dist/testing/index.d.ts.map +1 -0
  112. package/dist/testing/index.js +12 -0
  113. package/dist/testing/index.js.map +1 -0
  114. package/dist/testing/rule-tester.d.ts +217 -0
  115. package/dist/testing/rule-tester.d.ts.map +1 -0
  116. package/dist/testing/rule-tester.examples.d.ts +57 -0
  117. package/dist/testing/rule-tester.examples.d.ts.map +1 -0
  118. package/dist/testing/rule-tester.examples.js +375 -0
  119. package/dist/testing/rule-tester.examples.js.map +1 -0
  120. package/dist/testing/rule-tester.js +381 -0
  121. package/dist/testing/rule-tester.js.map +1 -0
  122. package/dist/testing/rule-validator.d.ts +141 -0
  123. package/dist/testing/rule-validator.d.ts.map +1 -0
  124. package/dist/testing/rule-validator.js +640 -0
  125. package/dist/testing/rule-validator.js.map +1 -0
  126. package/dist/types/index.d.ts +265 -4
  127. package/dist/types/index.d.ts.map +1 -1
  128. package/dist/types/index.js +57 -2
  129. package/dist/types/index.js.map +1 -1
  130. package/dist/utils/index.d.ts +2 -0
  131. package/dist/utils/index.d.ts.map +1 -1
  132. package/dist/utils/index.js +2 -0
  133. package/dist/utils/index.js.map +1 -1
  134. package/dist/utils/rate-limiting.d.ts +268 -0
  135. package/dist/utils/rate-limiting.d.ts.map +1 -0
  136. package/dist/utils/rate-limiting.js +403 -0
  137. package/dist/utils/rate-limiting.js.map +1 -0
  138. package/dist/utils/shared.d.ts +306 -0
  139. package/dist/utils/shared.d.ts.map +1 -0
  140. package/dist/utils/shared.js +464 -0
  141. package/dist/utils/shared.js.map +1 -0
  142. package/package.json +3 -2
package/dist/rules/css.js CHANGED
@@ -1233,6 +1233,544 @@ export const cssRules = [
1233
1233
  ],
1234
1234
  riskWeight: 3,
1235
1235
  tags: ['css', 'selectors', 'is', 'modern']
1236
+ },
1237
+ // ============================================================================
1238
+ // CSS CONSISTENCY RULES (css-130 to css-149)
1239
+ // ============================================================================
1240
+ // --- Naming Convention Consistency ---
1241
+ {
1242
+ id: 'css-130',
1243
+ name: 'Enforce BEM Naming Convention',
1244
+ description: 'Ensure consistent BEM naming (block__element--modifier)',
1245
+ type: 'architecture',
1246
+ enabled: true,
1247
+ priority: 720,
1248
+ conditions: [
1249
+ { field: 'projectUsesBEM', operator: 'equals', value: true },
1250
+ { field: 'followsBEMPattern', operator: 'not_equals', value: true }
1251
+ ],
1252
+ conditionLogic: 'all',
1253
+ actions: [
1254
+ { type: 'warn', message: 'Class name does not follow BEM convention (block__element--modifier). Use .block, .block__element, or .block--modifier pattern.' }
1255
+ ],
1256
+ riskWeight: 8,
1257
+ tags: ['css', 'naming', 'bem', 'consistency']
1258
+ },
1259
+ {
1260
+ id: 'css-131',
1261
+ name: 'Enforce SMACSS Naming Convention',
1262
+ description: 'Ensure consistent SMACSS naming (l-, is-, js-, etc.)',
1263
+ type: 'architecture',
1264
+ enabled: true,
1265
+ priority: 720,
1266
+ conditions: [
1267
+ { field: 'projectUsesSMACSS', operator: 'equals', value: true },
1268
+ { field: 'followsSMACSPattern', operator: 'not_equals', value: true }
1269
+ ],
1270
+ conditionLogic: 'all',
1271
+ actions: [
1272
+ { type: 'warn', message: 'Class name does not follow SMACSS convention. Use prefixes: l- (layout), is- (state), js- (JavaScript hooks).' }
1273
+ ],
1274
+ riskWeight: 8,
1275
+ tags: ['css', 'naming', 'smacss', 'consistency']
1276
+ },
1277
+ {
1278
+ id: 'css-132',
1279
+ name: 'Enforce OOCSS Naming Convention',
1280
+ description: 'Ensure consistent OOCSS naming (object-oriented CSS)',
1281
+ type: 'architecture',
1282
+ enabled: true,
1283
+ priority: 720,
1284
+ conditions: [
1285
+ { field: 'projectUsesOOCSS', operator: 'equals', value: true },
1286
+ { field: 'followsOOCSSPattern', operator: 'not_equals', value: true }
1287
+ ],
1288
+ conditionLogic: 'all',
1289
+ actions: [
1290
+ { type: 'warn', message: 'Class name does not follow OOCSS convention. Separate structure from skin, container from content.' }
1291
+ ],
1292
+ riskWeight: 7,
1293
+ tags: ['css', 'naming', 'oocss', 'consistency']
1294
+ },
1295
+ {
1296
+ id: 'css-133',
1297
+ name: 'Enforce kebab-case for Class Names',
1298
+ description: 'Class names should use kebab-case (lowercase with hyphens)',
1299
+ type: 'architecture',
1300
+ enabled: true,
1301
+ priority: 700,
1302
+ conditions: [
1303
+ { field: 'hasNonKebabCaseName', operator: 'equals', value: true }
1304
+ ],
1305
+ conditionLogic: 'all',
1306
+ actions: [
1307
+ { type: 'warn', message: 'Class names should use kebab-case (e.g., .my-component not .myComponent or .my_component).' }
1308
+ ],
1309
+ riskWeight: 6,
1310
+ tags: ['css', 'naming', 'kebab-case', 'consistency']
1311
+ },
1312
+ {
1313
+ id: 'css-134',
1314
+ name: 'Consistent Selector Naming Pattern',
1315
+ description: 'Detect mixed naming conventions in the same stylesheet',
1316
+ type: 'architecture',
1317
+ enabled: true,
1318
+ priority: 750,
1319
+ conditions: [
1320
+ { field: 'hasMixedNamingPatterns', operator: 'equals', value: true }
1321
+ ],
1322
+ conditionLogic: 'all',
1323
+ actions: [
1324
+ { type: 'deny', message: 'Mixed naming conventions detected. Standardize on one convention (BEM, SMACSS, kebab-case) throughout the stylesheet.' }
1325
+ ],
1326
+ riskWeight: 15,
1327
+ tags: ['css', 'naming', 'consistency', 'architecture']
1328
+ },
1329
+ // --- Property Ordering Consistency ---
1330
+ {
1331
+ id: 'css-135',
1332
+ name: 'Enforce Property Ordering (Grouped)',
1333
+ description: 'Properties should be ordered by group: positioning, display, box model, typography, visual, misc',
1334
+ type: 'architecture',
1335
+ enabled: true,
1336
+ priority: 680,
1337
+ conditions: [
1338
+ { field: 'propertyOrderStyle', operator: 'equals', value: 'grouped' },
1339
+ { field: 'followsGroupedPropertyOrder', operator: 'not_equals', value: true }
1340
+ ],
1341
+ conditionLogic: 'all',
1342
+ actions: [
1343
+ { type: 'warn', message: 'Properties should be ordered by group: 1) Positioning (position, top, z-index), 2) Display (display, flex, grid), 3) Box Model (width, margin, padding), 4) Typography (font, color), 5) Visual (background, border), 6) Misc (cursor, overflow).' }
1344
+ ],
1345
+ riskWeight: 5,
1346
+ tags: ['css', 'property-order', 'consistency', 'grouped']
1347
+ },
1348
+ {
1349
+ id: 'css-136',
1350
+ name: 'Enforce Property Ordering (Alphabetical)',
1351
+ description: 'Properties should be ordered alphabetically',
1352
+ type: 'architecture',
1353
+ enabled: true,
1354
+ priority: 680,
1355
+ conditions: [
1356
+ { field: 'propertyOrderStyle', operator: 'equals', value: 'alphabetical' },
1357
+ { field: 'followsAlphabeticalPropertyOrder', operator: 'not_equals', value: true }
1358
+ ],
1359
+ conditionLogic: 'all',
1360
+ actions: [
1361
+ { type: 'warn', message: 'Properties should be ordered alphabetically for consistency.' }
1362
+ ],
1363
+ riskWeight: 5,
1364
+ tags: ['css', 'property-order', 'consistency', 'alphabetical']
1365
+ },
1366
+ {
1367
+ id: 'css-137',
1368
+ name: 'Inconsistent Property Ordering Pattern',
1369
+ description: 'Detect mixed property ordering styles in the same stylesheet',
1370
+ type: 'architecture',
1371
+ enabled: true,
1372
+ priority: 700,
1373
+ conditions: [
1374
+ { field: 'hasMixedPropertyOrdering', operator: 'equals', value: true }
1375
+ ],
1376
+ conditionLogic: 'all',
1377
+ actions: [
1378
+ { type: 'warn', message: 'Mixed property ordering detected. Choose one style (grouped or alphabetical) and apply consistently.' }
1379
+ ],
1380
+ riskWeight: 8,
1381
+ tags: ['css', 'property-order', 'consistency']
1382
+ },
1383
+ // --- Unit Consistency ---
1384
+ {
1385
+ id: 'css-138',
1386
+ name: 'Consistent Font Size Units',
1387
+ description: 'Font sizes should use consistent units (rem preferred)',
1388
+ type: 'ux',
1389
+ enabled: true,
1390
+ priority: 780,
1391
+ conditions: [
1392
+ { field: 'hasMixedFontSizeUnits', operator: 'equals', value: true }
1393
+ ],
1394
+ conditionLogic: 'all',
1395
+ actions: [
1396
+ { type: 'warn', message: 'Mixed font-size units detected. Use rem consistently for accessibility (allows user font scaling).' }
1397
+ ],
1398
+ riskWeight: 10,
1399
+ tags: ['css', 'units', 'consistency', 'font-size', 'accessibility']
1400
+ },
1401
+ {
1402
+ id: 'css-139',
1403
+ name: 'Consistent Spacing Units',
1404
+ description: 'Spacing (margin, padding, gap) should use consistent units',
1405
+ type: 'architecture',
1406
+ enabled: true,
1407
+ priority: 740,
1408
+ conditions: [
1409
+ { field: 'hasMixedSpacingUnits', operator: 'equals', value: true }
1410
+ ],
1411
+ conditionLogic: 'all',
1412
+ actions: [
1413
+ { type: 'warn', message: 'Mixed spacing units detected (px, rem, em). Standardize on rem or design system tokens for consistent spacing scale.' }
1414
+ ],
1415
+ riskWeight: 8,
1416
+ tags: ['css', 'units', 'consistency', 'spacing']
1417
+ },
1418
+ {
1419
+ id: 'css-140',
1420
+ name: 'Consistent Line Height Units',
1421
+ description: 'Line heights should use unitless values or consistent units',
1422
+ type: 'ux',
1423
+ enabled: true,
1424
+ priority: 720,
1425
+ conditions: [
1426
+ { field: 'hasMixedLineHeightUnits', operator: 'equals', value: true }
1427
+ ],
1428
+ conditionLogic: 'all',
1429
+ actions: [
1430
+ { type: 'warn', message: 'Mixed line-height units detected. Use unitless values (e.g., 1.5) for predictable scaling with font-size changes.' }
1431
+ ],
1432
+ riskWeight: 7,
1433
+ tags: ['css', 'units', 'consistency', 'line-height', 'typography']
1434
+ },
1435
+ {
1436
+ id: 'css-141',
1437
+ name: 'Consistent Border Width Units',
1438
+ description: 'Border widths should use consistent units',
1439
+ type: 'architecture',
1440
+ enabled: true,
1441
+ priority: 660,
1442
+ conditions: [
1443
+ { field: 'hasMixedBorderWidthUnits', operator: 'equals', value: true }
1444
+ ],
1445
+ conditionLogic: 'all',
1446
+ actions: [
1447
+ { type: 'warn', message: 'Mixed border-width units detected. Use px for thin borders or design tokens for consistency.' }
1448
+ ],
1449
+ riskWeight: 5,
1450
+ tags: ['css', 'units', 'consistency', 'border']
1451
+ },
1452
+ {
1453
+ id: 'css-142',
1454
+ name: 'Use Zero Without Units',
1455
+ description: 'Zero values should not have units (0 not 0px)',
1456
+ type: 'architecture',
1457
+ enabled: true,
1458
+ priority: 650,
1459
+ conditions: [
1460
+ { field: 'hasZeroWithUnits', operator: 'equals', value: true }
1461
+ ],
1462
+ conditionLogic: 'all',
1463
+ actions: [
1464
+ { type: 'warn', message: 'Zero values should be unitless (0 not 0px, 0rem). This reduces file size and is the recommended practice.' }
1465
+ ],
1466
+ riskWeight: 3,
1467
+ tags: ['css', 'units', 'consistency', 'zero']
1468
+ },
1469
+ // --- Color Format Consistency ---
1470
+ {
1471
+ id: 'css-143',
1472
+ name: 'Consistent Color Format (Hex)',
1473
+ description: 'Colors should use consistent format (hex preferred)',
1474
+ type: 'architecture',
1475
+ enabled: true,
1476
+ priority: 720,
1477
+ conditions: [
1478
+ { field: 'projectColorFormat', operator: 'equals', value: 'hex' },
1479
+ { field: 'usesNonHexColor', operator: 'equals', value: true }
1480
+ ],
1481
+ conditionLogic: 'all',
1482
+ actions: [
1483
+ { type: 'warn', message: 'Non-hex color format detected. Use hex format (#rgb or #rrggbb) consistently for this project.' }
1484
+ ],
1485
+ riskWeight: 6,
1486
+ tags: ['css', 'colors', 'consistency', 'hex']
1487
+ },
1488
+ {
1489
+ id: 'css-144',
1490
+ name: 'Consistent Color Format (RGB/RGBA)',
1491
+ description: 'Colors should use consistent format (rgb/rgba preferred)',
1492
+ type: 'architecture',
1493
+ enabled: true,
1494
+ priority: 720,
1495
+ conditions: [
1496
+ { field: 'projectColorFormat', operator: 'equals', value: 'rgb' },
1497
+ { field: 'usesNonRgbColor', operator: 'equals', value: true }
1498
+ ],
1499
+ conditionLogic: 'all',
1500
+ actions: [
1501
+ { type: 'warn', message: 'Non-rgb color format detected. Use rgb()/rgba() format consistently for this project.' }
1502
+ ],
1503
+ riskWeight: 6,
1504
+ tags: ['css', 'colors', 'consistency', 'rgb']
1505
+ },
1506
+ {
1507
+ id: 'css-145',
1508
+ name: 'Consistent Color Format (HSL/HSLA)',
1509
+ description: 'Colors should use consistent format (hsl/hsla preferred)',
1510
+ type: 'architecture',
1511
+ enabled: true,
1512
+ priority: 720,
1513
+ conditions: [
1514
+ { field: 'projectColorFormat', operator: 'equals', value: 'hsl' },
1515
+ { field: 'usesNonHslColor', operator: 'equals', value: true }
1516
+ ],
1517
+ conditionLogic: 'all',
1518
+ actions: [
1519
+ { type: 'warn', message: 'Non-hsl color format detected. Use hsl()/hsla() format consistently for this project.' }
1520
+ ],
1521
+ riskWeight: 6,
1522
+ tags: ['css', 'colors', 'consistency', 'hsl']
1523
+ },
1524
+ {
1525
+ id: 'css-146',
1526
+ name: 'Mixed Color Formats Detected',
1527
+ description: 'Detect inconsistent color formats in the same stylesheet',
1528
+ type: 'architecture',
1529
+ enabled: true,
1530
+ priority: 750,
1531
+ conditions: [
1532
+ { field: 'hasMixedColorFormats', operator: 'equals', value: true }
1533
+ ],
1534
+ conditionLogic: 'all',
1535
+ actions: [
1536
+ { type: 'warn', message: 'Mixed color formats detected (hex, rgb, hsl). Standardize on one format for maintainability. Consider HSL for easier color manipulation.' }
1537
+ ],
1538
+ riskWeight: 10,
1539
+ tags: ['css', 'colors', 'consistency', 'format']
1540
+ },
1541
+ {
1542
+ id: 'css-147',
1543
+ name: 'Use Modern Color Syntax',
1544
+ description: 'Use modern color syntax (rgb/hsl without commas)',
1545
+ type: 'architecture',
1546
+ enabled: true,
1547
+ priority: 650,
1548
+ conditions: [
1549
+ { field: 'usesLegacyColorSyntax', operator: 'equals', value: true }
1550
+ ],
1551
+ conditionLogic: 'all',
1552
+ actions: [
1553
+ { type: 'warn', message: 'Consider modern color syntax: rgb(255 0 0 / 50%) instead of rgba(255, 0, 0, 0.5) for cleaner code.' }
1554
+ ],
1555
+ riskWeight: 3,
1556
+ tags: ['css', 'colors', 'consistency', 'modern']
1557
+ },
1558
+ {
1559
+ id: 'css-148',
1560
+ name: 'Use Hex Shorthand When Possible',
1561
+ description: 'Use 3-character hex when possible (#fff not #ffffff)',
1562
+ type: 'architecture',
1563
+ enabled: true,
1564
+ priority: 620,
1565
+ conditions: [
1566
+ { field: 'hasExpandableHex', operator: 'equals', value: true }
1567
+ ],
1568
+ conditionLogic: 'all',
1569
+ actions: [
1570
+ { type: 'warn', message: 'Use shorthand hex when possible (#fff instead of #ffffff) for conciseness.' }
1571
+ ],
1572
+ riskWeight: 2,
1573
+ tags: ['css', 'colors', 'consistency', 'hex', 'shorthand']
1574
+ },
1575
+ // --- Vendor Prefix Consistency ---
1576
+ {
1577
+ id: 'css-149',
1578
+ name: 'Consistent Vendor Prefix Ordering',
1579
+ description: 'Vendor prefixes should be ordered consistently (-webkit, -moz, -ms, unprefixed)',
1580
+ type: 'architecture',
1581
+ enabled: true,
1582
+ priority: 700,
1583
+ conditions: [
1584
+ { field: 'hasVendorPrefix', operator: 'equals', value: true },
1585
+ { field: 'hasInconsistentPrefixOrder', operator: 'equals', value: true }
1586
+ ],
1587
+ conditionLogic: 'all',
1588
+ actions: [
1589
+ { type: 'warn', message: 'Vendor prefixes should be ordered: -webkit-, -moz-, -ms-, then unprefixed standard property last.' }
1590
+ ],
1591
+ riskWeight: 6,
1592
+ tags: ['css', 'vendor-prefix', 'consistency', 'order']
1593
+ },
1594
+ {
1595
+ id: 'css-150',
1596
+ name: 'Missing Standard Property After Vendor Prefix',
1597
+ description: 'Vendor-prefixed properties must include the unprefixed version',
1598
+ type: 'architecture',
1599
+ enabled: true,
1600
+ priority: 780,
1601
+ conditions: [
1602
+ { field: 'hasVendorPrefix', operator: 'equals', value: true },
1603
+ { field: 'hasMissingUnprefixedProperty', operator: 'equals', value: true }
1604
+ ],
1605
+ conditionLogic: 'all',
1606
+ actions: [
1607
+ { type: 'deny', message: 'Vendor-prefixed property missing unprefixed fallback. Always include the standard property for future compatibility.' }
1608
+ ],
1609
+ riskWeight: 15,
1610
+ tags: ['css', 'vendor-prefix', 'consistency', 'fallback']
1611
+ },
1612
+ {
1613
+ id: 'css-151',
1614
+ name: 'Incomplete Vendor Prefix Set',
1615
+ description: 'When using vendor prefixes, include all relevant prefixes',
1616
+ type: 'architecture',
1617
+ enabled: true,
1618
+ priority: 720,
1619
+ conditions: [
1620
+ { field: 'hasVendorPrefix', operator: 'equals', value: true },
1621
+ { field: 'hasIncompletePrefixSet', operator: 'equals', value: true }
1622
+ ],
1623
+ conditionLogic: 'all',
1624
+ actions: [
1625
+ { type: 'warn', message: 'Incomplete vendor prefix set. Consider using autoprefixer or include all necessary prefixes (-webkit-, -moz-, -ms-).' }
1626
+ ],
1627
+ riskWeight: 8,
1628
+ tags: ['css', 'vendor-prefix', 'consistency', 'complete']
1629
+ },
1630
+ {
1631
+ id: 'css-152',
1632
+ name: 'Deprecated Vendor Prefix',
1633
+ description: 'Avoid vendor prefixes that are no longer needed',
1634
+ type: 'architecture',
1635
+ enabled: true,
1636
+ priority: 700,
1637
+ conditions: [
1638
+ { field: 'hasDeprecatedVendorPrefix', operator: 'equals', value: true }
1639
+ ],
1640
+ conditionLogic: 'all',
1641
+ actions: [
1642
+ { type: 'warn', message: 'Deprecated vendor prefix detected. This prefix is no longer needed for modern browsers (flexbox, border-radius, box-shadow, etc.).' }
1643
+ ],
1644
+ riskWeight: 5,
1645
+ tags: ['css', 'vendor-prefix', 'deprecated', 'cleanup']
1646
+ },
1647
+ // --- Design Token Validation ---
1648
+ {
1649
+ id: 'css-153',
1650
+ name: 'Validate Against Design Tokens',
1651
+ description: 'Property values should match design system tokens',
1652
+ type: 'ux',
1653
+ enabled: true,
1654
+ priority: 800,
1655
+ conditions: [
1656
+ { field: 'hasDesignTokens', operator: 'equals', value: true },
1657
+ { field: 'valueMatchesDesignToken', operator: 'not_equals', value: true }
1658
+ ],
1659
+ conditionLogic: 'all',
1660
+ actions: [
1661
+ { type: 'warn', message: 'Value does not match design tokens. Use design system values for consistency (colors, spacing, typography).' }
1662
+ ],
1663
+ riskWeight: 12,
1664
+ tags: ['css', 'design-tokens', 'consistency', 'design-system']
1665
+ },
1666
+ {
1667
+ id: 'css-154',
1668
+ name: 'Non-Standard Spacing Value',
1669
+ description: 'Spacing values should match the spacing scale',
1670
+ type: 'architecture',
1671
+ enabled: true,
1672
+ priority: 750,
1673
+ conditions: [
1674
+ { field: 'hasSpacingScale', operator: 'equals', value: true },
1675
+ { field: 'spacingMatchesScale', operator: 'not_equals', value: true }
1676
+ ],
1677
+ conditionLogic: 'all',
1678
+ actions: [
1679
+ { type: 'warn', message: 'Spacing value does not match the spacing scale. Use standard increments (4px, 8px, 16px, 24px, 32px, etc.) or design tokens.' }
1680
+ ],
1681
+ riskWeight: 8,
1682
+ tags: ['css', 'spacing', 'consistency', 'design-tokens']
1683
+ },
1684
+ {
1685
+ id: 'css-155',
1686
+ name: 'Non-Standard Font Size',
1687
+ description: 'Font sizes should match the type scale',
1688
+ type: 'ux',
1689
+ enabled: true,
1690
+ priority: 760,
1691
+ conditions: [
1692
+ { field: 'hasTypeScale', operator: 'equals', value: true },
1693
+ { field: 'fontSizeMatchesScale', operator: 'not_equals', value: true }
1694
+ ],
1695
+ conditionLogic: 'all',
1696
+ actions: [
1697
+ { type: 'warn', message: 'Font size does not match the type scale. Use standard sizes (12px, 14px, 16px, 18px, 20px, 24px, etc.) or design tokens.' }
1698
+ ],
1699
+ riskWeight: 8,
1700
+ tags: ['css', 'typography', 'consistency', 'design-tokens']
1701
+ },
1702
+ // --- CSS Linting Integration Suggestions ---
1703
+ {
1704
+ id: 'css-156',
1705
+ name: 'Suggest Stylelint Integration',
1706
+ description: 'Recommend Stylelint for automated CSS linting',
1707
+ type: 'architecture',
1708
+ enabled: true,
1709
+ priority: 650,
1710
+ conditions: [
1711
+ { field: 'hasStylelintConfig', operator: 'not_equals', value: true },
1712
+ { field: 'cssFileCount', operator: 'greater_than', value: 5 }
1713
+ ],
1714
+ conditionLogic: 'all',
1715
+ actions: [
1716
+ { type: 'warn', message: 'Consider adding Stylelint for automated CSS linting. Create .stylelintrc.json with rules for naming, ordering, and format consistency.' }
1717
+ ],
1718
+ riskWeight: 5,
1719
+ tags: ['css', 'linting', 'stylelint', 'tooling']
1720
+ },
1721
+ {
1722
+ id: 'css-157',
1723
+ name: 'Suggest CSS Modules or Scoped Styles',
1724
+ description: 'Recommend scoped CSS for component isolation',
1725
+ type: 'architecture',
1726
+ enabled: true,
1727
+ priority: 680,
1728
+ conditions: [
1729
+ { field: 'hasComponentArchitecture', operator: 'equals', value: true },
1730
+ { field: 'usesScopedStyles', operator: 'not_equals', value: true }
1731
+ ],
1732
+ conditionLogic: 'all',
1733
+ actions: [
1734
+ { type: 'warn', message: 'Consider CSS Modules or scoped styles for component isolation. This prevents naming conflicts and improves maintainability.' }
1735
+ ],
1736
+ riskWeight: 6,
1737
+ tags: ['css', 'architecture', 'css-modules', 'scoped']
1738
+ },
1739
+ {
1740
+ id: 'css-158',
1741
+ name: 'Suggest PostCSS for Processing',
1742
+ description: 'Recommend PostCSS for CSS processing and transformation',
1743
+ type: 'architecture',
1744
+ enabled: true,
1745
+ priority: 640,
1746
+ conditions: [
1747
+ { field: 'hasPostCSSConfig', operator: 'not_equals', value: true },
1748
+ { field: 'hasVendorPrefix', operator: 'equals', value: true }
1749
+ ],
1750
+ conditionLogic: 'all',
1751
+ actions: [
1752
+ { type: 'warn', message: 'Consider using PostCSS with autoprefixer to automatically handle vendor prefixes. This ensures consistent prefix handling.' }
1753
+ ],
1754
+ riskWeight: 4,
1755
+ tags: ['css', 'tooling', 'postcss', 'autoprefixer']
1756
+ },
1757
+ {
1758
+ id: 'css-159',
1759
+ name: 'Suggest Prettier for CSS Formatting',
1760
+ description: 'Recommend Prettier for consistent CSS formatting',
1761
+ type: 'architecture',
1762
+ enabled: true,
1763
+ priority: 620,
1764
+ conditions: [
1765
+ { field: 'hasPrettierConfig', operator: 'not_equals', value: true },
1766
+ { field: 'hasInconsistentFormatting', operator: 'equals', value: true }
1767
+ ],
1768
+ conditionLogic: 'all',
1769
+ actions: [
1770
+ { type: 'warn', message: 'Consider using Prettier for consistent CSS formatting. This enforces property ordering, spacing, and formatting automatically.' }
1771
+ ],
1772
+ riskWeight: 3,
1773
+ tags: ['css', 'tooling', 'prettier', 'formatting']
1236
1774
  }
1237
1775
  ];
1238
1776
  export default cssRules;