@triedotdev/mcp 1.0.7 → 1.0.8

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.
@@ -1203,10 +1203,10 @@ var ComprehensionAgent = class extends BaseAgent {
1203
1203
  }
1204
1204
  };
1205
1205
 
1206
- // src/agents/design-engineer.ts
1207
- var DesignEngineerAgent = class extends BaseAgent {
1208
- name = "design-engineer";
1209
- description = "WCAG 2.1 accessibility compliance, visual polish, and UX best practices";
1206
+ // src/agents/accessibility.ts
1207
+ var AccessibilityAgent = class extends BaseAgent {
1208
+ name = "accessibility";
1209
+ description = "WCAG 2.1 accessibility compliance, keyboard nav, screen readers, color contrast";
1210
1210
  version = "1.0.0";
1211
1211
  shouldActivate(context) {
1212
1212
  return context.touchesUI;
@@ -1219,7 +1219,7 @@ var DesignEngineerAgent = class extends BaseAgent {
1219
1219
  issues.push(...this.analyzeAccessibility(content, file));
1220
1220
  issues.push(...this.analyzeUXPatterns(content, file));
1221
1221
  } catch (error) {
1222
- console.error(`Design Engineer Agent: Error reading file ${file}:`, error);
1222
+ console.error(`Accessibility Agent: Error reading file ${file}:`, error);
1223
1223
  }
1224
1224
  }
1225
1225
  return issues;
@@ -1350,6 +1350,408 @@ var DesignEngineerAgent = class extends BaseAgent {
1350
1350
  }
1351
1351
  };
1352
1352
 
1353
+ // src/agents/design-engineer.ts
1354
+ var DesignEngineerAgent = class extends BaseAgent {
1355
+ name = "design-engineer";
1356
+ description = "Award-winning frontend craft: design systems, motion design, creative CSS, Awwwards-level polish";
1357
+ version = "1.0.0";
1358
+ shouldActivate(context) {
1359
+ return context.touchesUI;
1360
+ }
1361
+ async analyzeFiles(files, _context) {
1362
+ const issues = [];
1363
+ for (const file of files) {
1364
+ try {
1365
+ const content = await this.readFile(file);
1366
+ if (this.isFrontendFile(file)) {
1367
+ issues.push(...this.analyzeDesignSystem(content, file));
1368
+ issues.push(...this.analyzeMotionDesign(content, file));
1369
+ issues.push(...this.analyzeVisualCraft(content, file));
1370
+ issues.push(...this.analyzeModernCSS(content, file));
1371
+ issues.push(...this.analyzePerformance(content, file));
1372
+ }
1373
+ } catch (error) {
1374
+ console.error(`Design Engineer Agent: Error reading file ${file}:`, error);
1375
+ }
1376
+ }
1377
+ return issues;
1378
+ }
1379
+ isFrontendFile(file) {
1380
+ return /\.(tsx|jsx|vue|svelte|astro|css|scss|sass|less|styled\.(ts|js))$/.test(file);
1381
+ }
1382
+ /**
1383
+ * Analyze design system patterns
1384
+ */
1385
+ analyzeDesignSystem(content, file) {
1386
+ const issues = [];
1387
+ const lines = content.split("\n");
1388
+ for (let i = 0; i < lines.length; i++) {
1389
+ const line = lines[i];
1390
+ const lineNumber = i + 1;
1391
+ if (/margin|padding|gap|top|left|right|bottom/i.test(line)) {
1392
+ const magicPx = line.match(/:\s*(\d+)px/);
1393
+ if (magicPx && !["0", "1", "2"].includes(magicPx[1])) {
1394
+ const value = parseInt(magicPx[1]);
1395
+ const scale = [4, 8, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128];
1396
+ if (!scale.includes(value)) {
1397
+ issues.push(this.createIssue(
1398
+ this.generateIssueId(),
1399
+ "low",
1400
+ `Magic number ${value}px \u2014 consider using a spacing token`,
1401
+ `Use a design token like --space-${Math.round(value / 4)} or spacing scale (4, 8, 12, 16, 24, 32...)`,
1402
+ file,
1403
+ lineNumber,
1404
+ 0.6,
1405
+ void 0,
1406
+ false
1407
+ ));
1408
+ }
1409
+ }
1410
+ }
1411
+ if (/color|background|border|fill|stroke/i.test(line)) {
1412
+ const hardcodedHex = line.match(/#[0-9a-fA-F]{3,8}(?![0-9a-fA-F])/);
1413
+ const hardcodedRgb = line.match(/rgba?\s*\(\s*\d+/);
1414
+ if ((hardcodedHex || hardcodedRgb) && !line.includes("var(--")) {
1415
+ issues.push(this.createIssue(
1416
+ this.generateIssueId(),
1417
+ "low",
1418
+ "Hardcoded color value \u2014 use a design token",
1419
+ "Define colors in CSS custom properties: var(--color-primary), var(--color-surface), etc.",
1420
+ file,
1421
+ lineNumber,
1422
+ 0.7,
1423
+ void 0,
1424
+ false
1425
+ ));
1426
+ }
1427
+ }
1428
+ if (/font-size/i.test(line)) {
1429
+ const pxSize = line.match(/font-size:\s*(\d+)px/);
1430
+ if (pxSize) {
1431
+ issues.push(this.createIssue(
1432
+ this.generateIssueId(),
1433
+ "low",
1434
+ "Fixed font-size in px \u2014 consider fluid typography",
1435
+ "Use clamp() for responsive text: font-size: clamp(1rem, 2vw + 0.5rem, 1.5rem)",
1436
+ file,
1437
+ lineNumber,
1438
+ 0.65,
1439
+ void 0,
1440
+ false
1441
+ ));
1442
+ }
1443
+ }
1444
+ if (/z-index:\s*(\d+)/.test(line)) {
1445
+ const zValue = parseInt(line.match(/z-index:\s*(\d+)/)?.[1] || "0");
1446
+ if (zValue > 100 && zValue !== 9999) {
1447
+ issues.push(this.createIssue(
1448
+ this.generateIssueId(),
1449
+ "moderate",
1450
+ `High z-index (${zValue}) \u2014 establish a z-index scale`,
1451
+ "Create z-index tokens: --z-dropdown: 100, --z-modal: 200, --z-toast: 300, --z-tooltip: 400",
1452
+ file,
1453
+ lineNumber,
1454
+ 0.75,
1455
+ void 0,
1456
+ false
1457
+ ));
1458
+ }
1459
+ }
1460
+ }
1461
+ return issues;
1462
+ }
1463
+ /**
1464
+ * Analyze motion design patterns
1465
+ */
1466
+ analyzeMotionDesign(content, file) {
1467
+ const issues = [];
1468
+ const lines = content.split("\n");
1469
+ for (let i = 0; i < lines.length; i++) {
1470
+ const line = lines[i];
1471
+ const lineNumber = i + 1;
1472
+ if (/transition/i.test(line) && !line.includes("cubic-bezier") && !line.includes("ease")) {
1473
+ if (line.includes("linear") || !/ease|cubic|spring/.test(line)) {
1474
+ issues.push(this.createIssue(
1475
+ this.generateIssueId(),
1476
+ "low",
1477
+ "Transition using linear timing \u2014 add easing for polish",
1478
+ "Use custom easing: cubic-bezier(0.22, 1, 0.36, 1) for smooth deceleration, or ease-out for exits",
1479
+ file,
1480
+ lineNumber,
1481
+ 0.7,
1482
+ void 0,
1483
+ false
1484
+ ));
1485
+ }
1486
+ }
1487
+ if (/transition.*(\d+)ms/.test(line)) {
1488
+ const duration = parseInt(line.match(/(\d+)ms/)?.[1] || "0");
1489
+ if (duration > 0 && duration < 100) {
1490
+ issues.push(this.createIssue(
1491
+ this.generateIssueId(),
1492
+ "low",
1493
+ `Very short transition (${duration}ms) \u2014 may feel jarring`,
1494
+ "Micro-interactions work best at 150-300ms. Use 100ms minimum for perceivable motion.",
1495
+ file,
1496
+ lineNumber,
1497
+ 0.6,
1498
+ void 0,
1499
+ false
1500
+ ));
1501
+ }
1502
+ }
1503
+ if (/@keyframes|animation:/i.test(line)) {
1504
+ if (!content.includes("prefers-reduced-motion")) {
1505
+ issues.push(this.createIssue(
1506
+ this.generateIssueId(),
1507
+ "moderate",
1508
+ "Animation without reduced-motion fallback",
1509
+ "Add @media (prefers-reduced-motion: reduce) { animation: none } for motion-sensitive users",
1510
+ file,
1511
+ lineNumber,
1512
+ 0.8,
1513
+ void 0,
1514
+ false
1515
+ ));
1516
+ }
1517
+ }
1518
+ if (/\.map\s*\(|v-for|ngFor|\*ngFor|{#each/.test(line)) {
1519
+ const nextLines = lines.slice(i, i + 10).join("\n");
1520
+ if (nextLines.includes("animation") && !nextLines.includes("delay") && !nextLines.includes("stagger")) {
1521
+ issues.push(this.createIssue(
1522
+ this.generateIssueId(),
1523
+ "low",
1524
+ "List items animate without stagger \u2014 add animation delay",
1525
+ "Stagger reveals with animation-delay: calc(var(--index) * 50ms) for Awwwards-level polish",
1526
+ file,
1527
+ lineNumber,
1528
+ 0.65,
1529
+ void 0,
1530
+ false
1531
+ ));
1532
+ }
1533
+ }
1534
+ }
1535
+ return issues;
1536
+ }
1537
+ /**
1538
+ * Analyze visual craft and creative techniques
1539
+ */
1540
+ analyzeVisualCraft(content, file) {
1541
+ const issues = [];
1542
+ const lines = content.split("\n");
1543
+ for (let i = 0; i < lines.length; i++) {
1544
+ const line = lines[i];
1545
+ const lineNumber = i + 1;
1546
+ if (/box-shadow:/i.test(line) && !line.includes(",")) {
1547
+ issues.push(this.createIssue(
1548
+ this.generateIssueId(),
1549
+ "low",
1550
+ "Single-layer box-shadow \u2014 layer shadows for depth",
1551
+ "Use layered shadows: box-shadow: 0 1px 2px rgba(0,0,0,.1), 0 4px 12px rgba(0,0,0,.1)",
1552
+ file,
1553
+ lineNumber,
1554
+ 0.55,
1555
+ void 0,
1556
+ false
1557
+ ));
1558
+ }
1559
+ if (/border-radius:\s*(\d+)px/.test(line)) {
1560
+ const radius = parseInt(line.match(/border-radius:\s*(\d+)px/)?.[1] || "0");
1561
+ if (radius > 0 && ![2, 4, 6, 8, 12, 16, 24, 9999].includes(radius)) {
1562
+ issues.push(this.createIssue(
1563
+ this.generateIssueId(),
1564
+ "low",
1565
+ `Border-radius ${radius}px \u2014 use a radius scale`,
1566
+ "Establish a radius scale: --radius-sm: 4px, --radius-md: 8px, --radius-lg: 16px, --radius-full: 9999px",
1567
+ file,
1568
+ lineNumber,
1569
+ 0.5,
1570
+ void 0,
1571
+ false
1572
+ ));
1573
+ }
1574
+ }
1575
+ if (/hero|banner|header|jumbotron/i.test(file) || /Hero|Banner|Header/i.test(content.slice(0, 500))) {
1576
+ if (/background:\s*#|background-color:/i.test(line) && !line.includes("gradient")) {
1577
+ issues.push(this.createIssue(
1578
+ this.generateIssueId(),
1579
+ "low",
1580
+ "Solid background in hero section \u2014 consider a subtle gradient",
1581
+ "Add depth with gradients: background: linear-gradient(135deg, var(--color-bg) 0%, var(--color-surface) 100%)",
1582
+ file,
1583
+ lineNumber,
1584
+ 0.5,
1585
+ void 0,
1586
+ false
1587
+ ));
1588
+ }
1589
+ }
1590
+ if (/overlay|modal|dialog|drawer/i.test(line) || /position:\s*fixed/.test(line)) {
1591
+ const context = lines.slice(Math.max(0, i - 5), i + 10).join("\n");
1592
+ if (!context.includes("backdrop") && context.includes("background")) {
1593
+ issues.push(this.createIssue(
1594
+ this.generateIssueId(),
1595
+ "low",
1596
+ "Overlay without backdrop blur \u2014 add glassmorphism effect",
1597
+ "Use backdrop-filter: blur(12px) with semi-transparent background for modern glass effect",
1598
+ file,
1599
+ lineNumber,
1600
+ 0.55,
1601
+ void 0,
1602
+ false
1603
+ ));
1604
+ }
1605
+ }
1606
+ }
1607
+ return issues;
1608
+ }
1609
+ /**
1610
+ * Analyze modern CSS feature usage
1611
+ */
1612
+ analyzeModernCSS(content, file) {
1613
+ const issues = [];
1614
+ if (/@media.*width/.test(content) && !content.includes("container-type")) {
1615
+ issues.push(this.createIssue(
1616
+ this.generateIssueId(),
1617
+ "low",
1618
+ "Using media queries \u2014 consider container queries for component isolation",
1619
+ "Use container queries for truly reusable components: container-type: inline-size; @container (min-width: 400px) {...}",
1620
+ file,
1621
+ void 0,
1622
+ 0.5,
1623
+ void 0,
1624
+ false
1625
+ ));
1626
+ }
1627
+ if (content.includes("padding") && content.includes("max-width") && !content.includes("clamp(")) {
1628
+ issues.push(this.createIssue(
1629
+ this.generateIssueId(),
1630
+ "low",
1631
+ "Consider fluid spacing with clamp()",
1632
+ "Use clamp() for responsive spacing: padding: clamp(1rem, 5vw, 3rem)",
1633
+ file,
1634
+ void 0,
1635
+ 0.45,
1636
+ void 0,
1637
+ false
1638
+ ));
1639
+ }
1640
+ if (/\.parent.*\.child|parentElement|closest\(/i.test(content)) {
1641
+ issues.push(this.createIssue(
1642
+ this.generateIssueId(),
1643
+ "low",
1644
+ "JavaScript parent selection \u2014 consider CSS :has()",
1645
+ "Use CSS :has() for parent styling: .card:has(.featured) { border: 2px solid gold }",
1646
+ file,
1647
+ void 0,
1648
+ 0.55,
1649
+ void 0,
1650
+ false
1651
+ ));
1652
+ }
1653
+ if (/grid-template-columns:\s*repeat\(\d+,/.test(content) && !content.includes("auto-fit") && !content.includes("auto-fill")) {
1654
+ issues.push(this.createIssue(
1655
+ this.generateIssueId(),
1656
+ "low",
1657
+ "Fixed grid columns \u2014 use auto-fit for responsive grids",
1658
+ "Use intrinsic sizing: grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr))",
1659
+ file,
1660
+ void 0,
1661
+ 0.6,
1662
+ void 0,
1663
+ false
1664
+ ));
1665
+ }
1666
+ if (/padding-top:\s*\d+%|padding-bottom:\s*\d+%/.test(content) && !content.includes("aspect-ratio")) {
1667
+ issues.push(this.createIssue(
1668
+ this.generateIssueId(),
1669
+ "moderate",
1670
+ "Padding-based aspect ratio hack \u2014 use aspect-ratio property",
1671
+ "Use native aspect-ratio: aspect-ratio: 16 / 9 instead of padding hacks",
1672
+ file,
1673
+ void 0,
1674
+ 0.8,
1675
+ void 0,
1676
+ true
1677
+ ));
1678
+ }
1679
+ return issues;
1680
+ }
1681
+ /**
1682
+ * Analyze animation performance
1683
+ */
1684
+ analyzePerformance(content, file) {
1685
+ const issues = [];
1686
+ const lines = content.split("\n");
1687
+ for (let i = 0; i < lines.length; i++) {
1688
+ const line = lines[i];
1689
+ const lineNumber = i + 1;
1690
+ if (/transition|animation/i.test(line)) {
1691
+ if (/width|height|top|left|right|bottom|margin|padding/i.test(line) && !line.includes("transform") && !line.includes("opacity")) {
1692
+ issues.push(this.createIssue(
1693
+ this.generateIssueId(),
1694
+ "moderate",
1695
+ "Animating layout properties \u2014 use transform instead",
1696
+ "Animate transform/opacity for 60fps. Replace top/left with translate, width/height with scale",
1697
+ file,
1698
+ lineNumber,
1699
+ 0.85,
1700
+ void 0,
1701
+ false
1702
+ ));
1703
+ }
1704
+ }
1705
+ if (/will-change:\s*transform|will-change:\s*opacity/.test(line)) {
1706
+ issues.push(this.createIssue(
1707
+ this.generateIssueId(),
1708
+ "low",
1709
+ "Static will-change \u2014 apply dynamically",
1710
+ "Add will-change on hover/focus, remove after animation. Permanent will-change wastes GPU memory.",
1711
+ file,
1712
+ lineNumber,
1713
+ 0.7,
1714
+ void 0,
1715
+ false
1716
+ ));
1717
+ }
1718
+ if (/transition.*filter|animation.*filter|filter.*transition/i.test(line)) {
1719
+ issues.push(this.createIssue(
1720
+ this.generateIssueId(),
1721
+ "moderate",
1722
+ "Animating filter is expensive \u2014 use sparingly",
1723
+ "Filter animations trigger repaint. Consider opacity/transform alternatives or accept lower framerates.",
1724
+ file,
1725
+ lineNumber,
1726
+ 0.75,
1727
+ void 0,
1728
+ false
1729
+ ));
1730
+ }
1731
+ if (/transition.*box-shadow|animation.*box-shadow|box-shadow.*transition/i.test(line)) {
1732
+ const context = lines.slice(Math.max(0, i - 3), i + 3).join("\n");
1733
+ if (/blur\s*\(\s*(\d+)/.test(context)) {
1734
+ const blur = parseInt(context.match(/blur\s*\(\s*(\d+)/)?.[1] || "0");
1735
+ if (blur > 20) {
1736
+ issues.push(this.createIssue(
1737
+ this.generateIssueId(),
1738
+ "moderate",
1739
+ `Large shadow blur (${blur}px) in animation \u2014 may drop frames`,
1740
+ "Use pseudo-element for shadow animation: animate opacity of ::after with the shadow instead",
1741
+ file,
1742
+ lineNumber,
1743
+ 0.7,
1744
+ void 0,
1745
+ false
1746
+ ));
1747
+ }
1748
+ }
1749
+ }
1750
+ }
1751
+ return issues;
1752
+ }
1753
+ };
1754
+
1353
1755
  // src/agents/legal.ts
1354
1756
  var LegalAgent = class extends BaseAgent {
1355
1757
  name = "legal";
@@ -2187,7 +2589,7 @@ var UserTestingAgent = class extends BaseAgent {
2187
2589
  name: this.name,
2188
2590
  tier: 2,
2189
2591
  estimatedTimeMs: 150,
2190
- dependencies: ["design-engineer"]
2592
+ dependencies: ["accessibility"]
2191
2593
  // accessibility before UX
2192
2594
  };
2193
2595
  }
@@ -2907,6 +3309,157 @@ var SOC2Agent = class extends BaseAgent {
2907
3309
  }
2908
3310
  };
2909
3311
 
3312
+ // src/agents/super-reviewer.ts
3313
+ var SuperReviewerAgent = class extends BaseAgent {
3314
+ name = "super-reviewer";
3315
+ description = "Interactive PR review: walks through changes file-by-file, explains each chunk, waits for cross-examination";
3316
+ version = "1.0.0";
3317
+ shouldActivate(context) {
3318
+ return context.linesChanged > 50 || context.isNewFeature || context.touchesAuth || context.touchesPayment || context.touchesDatabase || context.touchesAPI;
3319
+ }
3320
+ /**
3321
+ * The Super Reviewer doesn't do static pattern matching like other agents.
3322
+ * Instead, it generates a structured review workflow for the AI to execute.
3323
+ */
3324
+ async analyzeFiles(files, context) {
3325
+ return [];
3326
+ }
3327
+ /**
3328
+ * Get the structured review workflow for a set of files/changes
3329
+ */
3330
+ async buildReviewWorkflow(changedFiles, options) {
3331
+ const orderedFiles = this.orderFilesForReview(changedFiles);
3332
+ return {
3333
+ metadata: {
3334
+ prNumber: options.prNumber,
3335
+ prTitle: options.prTitle,
3336
+ prAuthor: options.prAuthor,
3337
+ baseBranch: options.baseBranch,
3338
+ headBranch: options.headBranch,
3339
+ mode: options.mode || "own",
3340
+ totalFiles: changedFiles.length,
3341
+ totalAdditions: changedFiles.reduce((sum, f) => sum + f.additions, 0),
3342
+ totalDeletions: changedFiles.reduce((sum, f) => sum + f.deletions, 0)
3343
+ },
3344
+ fileOrder: orderedFiles.map((f, idx) => ({
3345
+ index: idx + 1,
3346
+ path: f.path,
3347
+ reason: f.orderReason,
3348
+ additions: f.additions,
3349
+ deletions: f.deletions
3350
+ })),
3351
+ designDocs: options.designDocs || [],
3352
+ reviewInstructions: this.getReviewInstructions(options.mode || "own")
3353
+ };
3354
+ }
3355
+ /**
3356
+ * Order files for understanding, not alphabetically
3357
+ *
3358
+ * Strategy:
3359
+ * 1. Protos/schemas first — define data structures
3360
+ * 2. Constants/configs early — context for magic values
3361
+ * 3. Core logic before utilities — understand main change before helpers
3362
+ * 4. Implementation before tests — know what's being tested
3363
+ * 5. Docs/comments last — reference during review
3364
+ */
3365
+ orderFilesForReview(files) {
3366
+ const scored = files.map((file) => {
3367
+ let priority = 50;
3368
+ let reason = "General implementation";
3369
+ const path = file.path.toLowerCase();
3370
+ const filename = path.split("/").pop() || "";
3371
+ if (/\.(proto|graphql|prisma)$/.test(path) || /schema\.(ts|js|json)$/.test(path) || /types?\.(ts|d\.ts)$/.test(path) || path.includes("/types/") || path.includes("/schema/")) {
3372
+ priority = 10;
3373
+ reason = "Defines data structures everything else uses";
3374
+ } else if (/constants?\.(ts|js)$/.test(path) || /config\.(ts|js|json)$/.test(path) || path.includes("/config/") || /\.env/.test(path)) {
3375
+ priority = 20;
3376
+ reason = "Gives context for values used throughout";
3377
+ } else if (path.includes("/core/") || path.includes("/services/") || path.includes("/domain/") || path.includes("/lib/")) {
3378
+ priority = 30;
3379
+ reason = "Core logic \u2014 understand this first";
3380
+ } else if (path.includes("/api/") || path.includes("/routes/") || path.includes("/handlers/") || path.includes("/controllers/")) {
3381
+ priority = 40;
3382
+ reason = "API layer \u2014 connects core logic to consumers";
3383
+ } else if (path.includes("/components/") || path.includes("/pages/") || path.includes("/views/") || /\.(tsx|jsx|vue|svelte)$/.test(path)) {
3384
+ priority = 50;
3385
+ reason = "UI layer \u2014 uses core logic and types";
3386
+ } else if (path.includes("/utils/") || path.includes("/helpers/") || /utils?\.(ts|js)$/.test(path)) {
3387
+ priority = 60;
3388
+ reason = "Helper utilities";
3389
+ } else if (/\.(test|spec)\.(ts|js|tsx|jsx)$/.test(path) || path.includes("__tests__") || path.includes("/test/")) {
3390
+ priority = 70;
3391
+ reason = "Tests \u2014 review after understanding the implementation";
3392
+ } else if (/\.(md|mdx|txt)$/.test(path) || /readme/i.test(path) || path.includes("/docs/")) {
3393
+ priority = 80;
3394
+ reason = "Documentation \u2014 reference during review as needed";
3395
+ } else if (/package\.json$/.test(path) || /tsconfig/.test(path) || /\.config\.(ts|js|json)$/.test(path)) {
3396
+ priority = 90;
3397
+ reason = "Project config \u2014 review last";
3398
+ }
3399
+ return { ...file, priority, orderReason: reason };
3400
+ });
3401
+ return scored.sort((a, b) => a.priority - b.priority);
3402
+ }
3403
+ /**
3404
+ * Get the review mode instructions
3405
+ */
3406
+ getReviewInstructions(mode) {
3407
+ if (mode === "own") {
3408
+ return {
3409
+ mode: "own",
3410
+ description: "Your own PR \u2014 I explain, you learn/verify/fix",
3411
+ approach: [
3412
+ "Walk through each file explaining what changed and why",
3413
+ "Help you understand your own code better",
3414
+ "Identify potential issues before reviewers do",
3415
+ "Suggest improvements you can make before requesting review"
3416
+ ],
3417
+ afterEachFile: [
3418
+ "Pause for your questions",
3419
+ "Discuss any concerns you have",
3420
+ "Note any self-review fixes to make"
3421
+ ]
3422
+ };
3423
+ } else {
3424
+ return {
3425
+ mode: "others",
3426
+ description: "Someone else's PR \u2014 I flag issues, you add comments",
3427
+ approach: [
3428
+ "Analyze each file for correctness and completeness",
3429
+ "Flag potential issues with suggested comment text",
3430
+ "Look for missing pieces (cleanup handlers, tests, edge cases)",
3431
+ "Check state/lifecycle consistency"
3432
+ ],
3433
+ afterEachFile: [
3434
+ "Present draft comments for your approval",
3435
+ "Let you modify or skip each comment",
3436
+ "Post approved comments to PR"
3437
+ ]
3438
+ };
3439
+ }
3440
+ }
3441
+ };
3442
+ var CRITICAL_REVIEW_CHECKLIST = {
3443
+ stateAndLifecycle: [
3444
+ "Cleanup symmetry: If state is set, is it reset? Check cleanup paths.",
3445
+ "Lifecycle consistency: Does state survive scenarios it shouldn't?",
3446
+ "Guard completeness: Are there missing guards (already active, re-entrancy)?"
3447
+ ],
3448
+ edgeCasesAndRaces: [
3449
+ "Concurrent calls: What if called twice rapidly? Orphaned promises?",
3450
+ "Ordering assumptions: Does code assume events arrive in order?",
3451
+ "Partial failures: If step 3 of 5 fails, is state left consistent?"
3452
+ ],
3453
+ missingPieces: [
3454
+ "What's NOT in the diff that should be? (cleanup handlers, tests)",
3455
+ "Defensive gaps: Missing timeouts, size limits, null checks?"
3456
+ ],
3457
+ designQuestions: [
3458
+ "Is this the right approach? Is there a simpler/more robust design?",
3459
+ "Hidden assumptions: What does this assume about its environment?"
3460
+ ]
3461
+ };
3462
+
2910
3463
  // src/agents/custom-agent.ts
2911
3464
  var CustomAgent = class extends BaseAgent {
2912
3465
  name;
@@ -3134,6 +3687,7 @@ var AgentRegistryImpl = class {
3134
3687
  new TypeCheckAgent(),
3135
3688
  new ComprehensionAgent(),
3136
3689
  // Specialized agents
3690
+ new AccessibilityAgent(),
3137
3691
  new DesignEngineerAgent(),
3138
3692
  new LegalAgent(),
3139
3693
  new TestAgent(),
@@ -3142,7 +3696,8 @@ var AgentRegistryImpl = class {
3142
3696
  new BugFindingAgent(),
3143
3697
  new UserTestingAgent(),
3144
3698
  new TrieCleanAgent(),
3145
- new SOC2Agent()
3699
+ new SOC2Agent(),
3700
+ new SuperReviewerAgent()
3146
3701
  ];
3147
3702
  console.error(`Loaded config for ${builtinAgents.length} built-in agents`);
3148
3703
  for (const agent of builtinAgents) {
@@ -4068,7 +4623,7 @@ var Triager = class {
4068
4623
  reasons.push("CAN-SPAM");
4069
4624
  }
4070
4625
  }
4071
- if (agent.name === "design-engineer") {
4626
+ if (agent.name === "accessibility") {
4072
4627
  tier = 2;
4073
4628
  if (context.touchesUI) {
4074
4629
  confidence += 0.6;
@@ -4272,7 +4827,7 @@ var Triager = class {
4272
4827
  // legal should see privacy issues first
4273
4828
  "test": ["bug-finding"],
4274
4829
  // find bugs before writing tests
4275
- "user-testing": ["design-engineer"]
4830
+ "user-testing": ["accessibility"]
4276
4831
  // accessibility before UX
4277
4832
  };
4278
4833
  for (const agent of agents) {
@@ -6712,7 +7267,7 @@ var TrieScanTool = class {
6712
7267
  "typecheck": "always runs - type safety is fundamental",
6713
7268
  "comprehension": "always runs - explains changes to stakeholders",
6714
7269
  "legal": context.touchesHealthData ? "HIPAA compliance required" : context.touchesPayments ? "payment regulations apply" : context.touchesUserData ? "data protection laws apply" : "legal patterns detected",
6715
- "design-engineer": context.touchesUI ? "UI components detected" : "UI patterns detected",
7270
+ "accessibility": context.touchesUI ? "UI components detected" : "UI patterns detected",
6716
7271
  "test": context.isNewFeature ? "new feature needs tests" : context.touchesAuth ? "auth code needs tests" : "test coverage needed",
6717
7272
  "software-architect": context.isNewFeature ? "architecture review for new feature" : context.touchesDatabase ? "database schema review" : "architecture patterns detected",
6718
7273
  "devops": context.touchesSecurityConfig ? "security config detected" : context.touchesDatabase ? "infrastructure changes" : "deployment patterns detected",
@@ -7105,6 +7660,72 @@ Identify:
7105
7660
  4. Risk assessment (litigation, fines, etc.)
7106
7661
  5. Remediation recommendations
7107
7662
  6. Required documentation/policies`
7663
+ },
7664
+ "design-engineer": {
7665
+ system: `You are an elite design engineer \u2014 the kind who builds award-winning interfaces featured on Awwwards and Codrops.
7666
+
7667
+ You think in design systems, breathe motion design, and obsess over the details that make interfaces feel magical.
7668
+
7669
+ Your expertise:
7670
+ - **Design Systems**: Spacing scales, type scales, color tokens, radius tokens, shadow tokens
7671
+ - **Motion Design**: Micro-interactions, page transitions, scroll-triggered animations, FLIP technique
7672
+ - **Creative CSS**: Gradients, blend modes, clip-paths, masks, backdrop-filter, mix-blend-mode
7673
+ - **Modern CSS**: Container queries, :has(), subgrid, anchor positioning, cascade layers, @scope
7674
+ - **Fluid Design**: clamp(), min(), max(), fluid typography, intrinsic sizing
7675
+ - **Performance**: GPU-accelerated animations, will-change strategy, avoiding layout thrashing
7676
+ - **Visual Polish**: Layered shadows, subtle gradients, glass effects, smooth easing curves
7677
+
7678
+ You review code with the eye of someone who's shipped Stripe-level interfaces.
7679
+ Small details matter: the easing curve, the stagger timing, the shadow layering.`,
7680
+ analysis: `## Design Engineering Review
7681
+
7682
+ Analyze this frontend code for Awwwards-level craft:
7683
+
7684
+ \`\`\`{{language}}
7685
+ {{code}}
7686
+ \`\`\`
7687
+
7688
+ **File:** {{filePath}}
7689
+
7690
+ Review for:
7691
+
7692
+ ### 1. Design System Consistency
7693
+ - Are spacing values on a scale (4, 8, 12, 16, 24, 32...)?
7694
+ - Are colors defined as tokens?
7695
+ - Is typography systematic?
7696
+ - Are radii consistent?
7697
+ - Is z-index controlled?
7698
+
7699
+ ### 2. Motion Design
7700
+ - Are transitions using custom easing (cubic-bezier)?
7701
+ - Are durations appropriate (150-300ms for micro, 300-500ms for page)?
7702
+ - Are list items staggered?
7703
+ - Is there reduced-motion support?
7704
+ - Are entrance animations choreographed?
7705
+
7706
+ ### 3. Visual Craft
7707
+ - Are shadows layered for depth?
7708
+ - Are gradients subtle and purposeful?
7709
+ - Is there backdrop-blur on overlays?
7710
+ - Are hover states polished?
7711
+ - Is there visual hierarchy?
7712
+
7713
+ ### 4. Modern CSS Opportunities
7714
+ - Could container queries improve component isolation?
7715
+ - Could clamp() create fluid spacing?
7716
+ - Could :has() simplify parent styling?
7717
+ - Could aspect-ratio replace padding hacks?
7718
+
7719
+ ### 5. Performance
7720
+ - Are expensive properties (width, height, top, left) being animated?
7721
+ - Is will-change used appropriately (not statically)?
7722
+ - Are large blurs avoided in animations?
7723
+
7724
+ For each issue, provide:
7725
+ - What's wrong (with specific line if applicable)
7726
+ - Why it matters for premium feel
7727
+ - Exact code to fix it
7728
+ - Before/after comparison`
7108
7729
  },
7109
7730
  accessibility: {
7110
7731
  system: `You are an accessibility expert and WCAG 2.1 specialist.
@@ -7402,6 +8023,130 @@ Provide:
7402
8023
  2. Brief explanation of the change
7403
8024
  3. Any related changes needed elsewhere
7404
8025
  4. Test to verify the fix works`
8026
+ },
8027
+ pr_review: {
8028
+ system: `You are an expert code reviewer performing detailed, interactive PR reviews.
8029
+ Your goal: Make reviewing a large PR a delight, not a chore. The user learns about the change while you shepherd them through \u2014 maintaining momentum, explaining each piece, and making what could be an overwhelming task feel painless and even enjoyable.
8030
+
8031
+ You drive; they cross-examine.
8032
+
8033
+ ## Critical Review Mindset
8034
+
8035
+ Don't just explain \u2014 actively look for problems:
8036
+
8037
+ ### State & Lifecycle
8038
+ - Cleanup symmetry: If state is set, is it reset? Check cleanup paths, disconnect handlers.
8039
+ - Lifecycle consistency: Does state survive scenarios it shouldn't?
8040
+ - Guard completeness: Missing "already active" checks, re-entrancy protection?
8041
+
8042
+ ### Edge Cases & Races
8043
+ - Concurrent calls: What if called twice rapidly? Orphaned promises?
8044
+ - Ordering assumptions: Does code assume events arrive in order?
8045
+ - Partial failures: If step 3 of 5 fails, is state left consistent?
8046
+
8047
+ ### Missing Pieces
8048
+ - What's NOT in the diff that should be? (cleanup handlers, tests, related state)
8049
+ - Defensive gaps: Missing timeouts, size limits, null checks?
8050
+
8051
+ ### Design Questions
8052
+ - Is this the right approach? Is there a simpler or more robust design?
8053
+ - Hidden assumptions: What does this assume about its environment?
8054
+
8055
+ Be critical, not just descriptive. Your job is to find problems, not just narrate.`,
8056
+ analysis: `## Interactive PR Review
8057
+
8058
+ I'll walk you through this PR file by file, explaining each change and pausing for your questions.
8059
+
8060
+ **PR:** {{prTitle}}
8061
+ **Author:** {{prAuthor}}
8062
+ **Scope:** {{totalFiles}} files, +{{additions}}/-{{deletions}} lines
8063
+
8064
+ ### File Order (sequenced for understanding)
8065
+
8066
+ {{fileOrder}}
8067
+
8068
+ ---
8069
+
8070
+ ## Review Mode
8071
+
8072
+ {{reviewMode}}
8073
+
8074
+ ---
8075
+
8076
+ For each file, I will:
8077
+ 1. **Show the change** \u2014 Display the diff for each logical chunk
8078
+ 2. **Explain what changed** \u2014 What it does and why it matters
8079
+ 3. **Walk through examples** \u2014 Concrete scenarios for non-obvious logic
8080
+ 4. **Call out nuances** \u2014 Alternatives, edge cases, subtle points
8081
+ 5. **Summarize** \u2014 Core change + correctness assessment
8082
+ 6. **Pause** \u2014 Wait for your questions before proceeding
8083
+
8084
+ **Ready for File 1?** (yes / skip to [file] / reorder / done)`,
8085
+ file: `## File Review: {{filePath}}
8086
+
8087
+ ### The Change
8088
+
8089
+ \`\`\`{{language}}
8090
+ {{diff}}
8091
+ \`\`\`
8092
+
8093
+ **What Changed:** {{summary}}
8094
+
8095
+ **Why This Matters:** {{impact}}
8096
+
8097
+ {{#if hasExampleScenario}}
8098
+ ### Example Scenario
8099
+
8100
+ {{exampleScenario}}
8101
+ {{/if}}
8102
+
8103
+ {{#if nuances}}
8104
+ ### Nuances to Note
8105
+
8106
+ {{nuances}}
8107
+ {{/if}}
8108
+
8109
+ {{#if potentialIssue}}
8110
+ ### \u26A0\uFE0F Potential Issue
8111
+
8112
+ **Issue:** {{issueDescription}}
8113
+ **Scenario:** {{issueScenario}}
8114
+ **Suggested fix:** {{suggestedFix}}
8115
+ {{/if}}
8116
+
8117
+ ---
8118
+
8119
+ ### Summary for \`{{fileName}}\`
8120
+
8121
+ | Aspect | Assessment |
8122
+ |--------|------------|
8123
+ | Core change | {{coreChange}} |
8124
+ | Correctness | {{correctnessAssessment}} |
8125
+
8126
+ **Ready for the next file?** (yes / questions? / done)`,
8127
+ comment: `**Issue:** {{issueDescription}}
8128
+ **Draft comment:** {{draftComment}}
8129
+
8130
+ Post this comment? (yes / modify / skip)`,
8131
+ final: `## Review Complete
8132
+
8133
+ | File | Key Change | Status |
8134
+ |------|------------|--------|
8135
+ {{fileSummaries}}
8136
+
8137
+ **Overall:** {{overallAssessment}}
8138
+
8139
+ {{#if comments}}
8140
+ ### Comments Posted
8141
+
8142
+ {{postedComments}}
8143
+ {{/if}}
8144
+
8145
+ {{#if followUps}}
8146
+ ### Follow-up Actions
8147
+
8148
+ {{followUps}}
8149
+ {{/if}}`
7405
8150
  },
7406
8151
  vibe: {
7407
8152
  system: `You are a friendly coding mentor helping someone who's learning to code with AI.
@@ -7797,10 +8542,12 @@ The AI will analyze each issue, generate the fix, and you can review before appl
7797
8542
  };
7798
8543
 
7799
8544
  export {
8545
+ SuperReviewerAgent,
8546
+ CRITICAL_REVIEW_CHECKLIST,
7800
8547
  getAgentRegistry,
7801
8548
  TrieScanTool,
7802
8549
  getPrompt,
7803
8550
  getSystemPrompt,
7804
8551
  TrieFixTool
7805
8552
  };
7806
- //# sourceMappingURL=chunk-EDWYG3KK.js.map
8553
+ //# sourceMappingURL=chunk-Z3GM6UVW.js.map