@ryuenn3123/agentic-senior-core 3.0.50 → 4.0.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 (89) hide show
  1. package/.agent-context/prompts/bootstrap-design.md +3 -1
  2. package/.agent-context/prompts/research-design.md +165 -0
  3. package/.agent-context/review-checklists/pr-checklist.md +1 -0
  4. package/.agent-context/rules/api-docs.md +63 -47
  5. package/.agent-context/rules/architecture.md +133 -120
  6. package/.agent-context/rules/database-design.md +36 -18
  7. package/.agent-context/rules/docker-runtime.md +66 -43
  8. package/.agent-context/rules/efficiency-vs-hype.md +38 -17
  9. package/.agent-context/rules/error-handling.md +35 -16
  10. package/.agent-context/rules/event-driven.md +35 -18
  11. package/.agent-context/rules/frontend-architecture.md +103 -76
  12. package/.agent-context/rules/git-workflow.md +81 -197
  13. package/.agent-context/rules/microservices.md +42 -41
  14. package/.agent-context/rules/naming-conv.md +27 -8
  15. package/.agent-context/rules/performance.md +32 -12
  16. package/.agent-context/rules/realtime.md +26 -9
  17. package/.agent-context/rules/security.md +39 -20
  18. package/.agent-context/rules/testing.md +36 -16
  19. package/AGENTS.md +21 -20
  20. package/README.md +10 -1
  21. package/lib/cli/commands/init.mjs +12 -0
  22. package/lib/cli/commands/upgrade.mjs +11 -0
  23. package/lib/cli/compiler.mjs +1 -0
  24. package/lib/cli/detector/constants.mjs +135 -0
  25. package/lib/cli/detector/design-evidence/collector.mjs +256 -0
  26. package/lib/cli/detector/design-evidence/constants.mjs +39 -0
  27. package/lib/cli/detector/design-evidence/file-traversal.mjs +83 -0
  28. package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +117 -0
  29. package/lib/cli/detector/design-evidence/summary.mjs +109 -0
  30. package/lib/cli/detector/design-evidence/utility-helpers.mjs +122 -0
  31. package/lib/cli/detector/design-evidence.mjs +25 -610
  32. package/lib/cli/detector/stack-detection.mjs +243 -0
  33. package/lib/cli/detector/ui-signals.mjs +150 -0
  34. package/lib/cli/detector/workspace-scan.mjs +177 -0
  35. package/lib/cli/detector.mjs +20 -688
  36. package/lib/cli/memory-continuity.mjs +1 -0
  37. package/lib/cli/project-scaffolder/design-contract/research-dossier-migration.mjs +165 -0
  38. package/lib/cli/project-scaffolder/design-contract/sections/audits.mjs +96 -0
  39. package/lib/cli/project-scaffolder/design-contract/sections/conceptual-anchor.mjs +233 -0
  40. package/lib/cli/project-scaffolder/design-contract/sections/execution-handoff.mjs +211 -0
  41. package/lib/cli/project-scaffolder/design-contract/seed-signals.mjs +79 -0
  42. package/lib/cli/project-scaffolder/design-contract/signal-vocab.mjs +64 -0
  43. package/lib/cli/project-scaffolder/design-contract/validation/anchor-validators.mjs +456 -0
  44. package/lib/cli/project-scaffolder/design-contract/validation/audit-validators.mjs +117 -0
  45. package/lib/cli/project-scaffolder/design-contract/validation/completeness.mjs +83 -0
  46. package/lib/cli/project-scaffolder/design-contract/validation/execution-validators.mjs +328 -0
  47. package/lib/cli/project-scaffolder/design-contract/validation/helpers.mjs +8 -0
  48. package/lib/cli/project-scaffolder/design-contract/validation/research-dossier-validators.mjs +104 -0
  49. package/lib/cli/project-scaffolder/design-contract/validation/structural-validators.mjs +79 -0
  50. package/lib/cli/project-scaffolder/design-contract/validation/system-validators.mjs +256 -0
  51. package/lib/cli/project-scaffolder/design-contract/validation.mjs +61 -896
  52. package/lib/cli/project-scaffolder/design-contract.mjs +151 -556
  53. package/lib/cli/project-scaffolder/prompt-builders.mjs +9 -0
  54. package/mcp.json +30 -9
  55. package/package.json +17 -2
  56. package/scripts/audit-cache-layer-contract.mjs +258 -0
  57. package/scripts/audit-caching-scope-hygiene.mjs +263 -0
  58. package/scripts/audit-file-size.mjs +219 -0
  59. package/scripts/audit-reflection-citations.mjs +163 -0
  60. package/scripts/audit-release-bundle.mjs +170 -0
  61. package/scripts/audit-rule-id-uniqueness.mjs +313 -0
  62. package/scripts/benchmark-evidence-bundle.mjs +1 -0
  63. package/scripts/build-release-benchmark-bundle.mjs +204 -0
  64. package/scripts/context-triggered-audit.mjs +1 -0
  65. package/scripts/documentation-boundary-audit.mjs +1 -0
  66. package/scripts/explain-on-demand-audit.mjs +2 -1
  67. package/scripts/frontend-usability-audit.mjs +10 -10
  68. package/scripts/llm-judge/checklist-loader.mjs +45 -0
  69. package/scripts/llm-judge/constants.mjs +66 -0
  70. package/scripts/llm-judge/diff-collection.mjs +74 -0
  71. package/scripts/llm-judge/prompting.mjs +78 -0
  72. package/scripts/llm-judge/providers.mjs +111 -0
  73. package/scripts/llm-judge/verdict.mjs +134 -0
  74. package/scripts/llm-judge.mjs +21 -482
  75. package/scripts/mcp-server/tool-registry.mjs +55 -0
  76. package/scripts/mcp-server/tools.mjs +137 -1
  77. package/scripts/migrate-rule-format/id-prefix-table.mjs +37 -0
  78. package/scripts/migrate-rule-format/parse-legacy.mjs +180 -0
  79. package/scripts/migrate-rule-format/render-new.mjs +169 -0
  80. package/scripts/migrate-rule-format/roundtrip-validate.mjs +89 -0
  81. package/scripts/migrate-rule-format.mjs +192 -0
  82. package/scripts/release-gate/constants.mjs +1 -1
  83. package/scripts/release-gate/static-checks.mjs +1 -1
  84. package/scripts/rules-guardian-audit.mjs +5 -2
  85. package/scripts/single-source-lazy-loading-audit.mjs +2 -1
  86. package/scripts/ui-design-judge/git-input.mjs +3 -0
  87. package/scripts/validate/config.mjs +27 -2
  88. package/scripts/validate/coverage-checks.mjs +1 -1
  89. package/scripts/validate.mjs +94 -1
@@ -0,0 +1,109 @@
1
+ /**
2
+ * Default-shaped design evidence summary. Constructed once per scan and then
3
+ * mutated in place by the collector and inspection passes. Keeping the default
4
+ * shape in one place makes downstream consumers diff-stable when adding new
5
+ * counters: add the field here once, and every scan starts with it.
6
+ */
7
+
8
+ export function createDesignEvidenceSummary(scanRootRelativePaths) {
9
+ return {
10
+ summaryVersion: 'v1',
11
+ source: 'lightweight-static-scan',
12
+ scanRootRelativePaths,
13
+ scannedFileCount: 0,
14
+ cssVariables: {
15
+ definitionCount: 0,
16
+ referenceCount: 0,
17
+ sampleNames: [],
18
+ categoryCounts: {
19
+ color: 0,
20
+ spacing: 0,
21
+ radius: 0,
22
+ shadow: 0,
23
+ typography: 0,
24
+ motion: 0,
25
+ other: 0,
26
+ },
27
+ },
28
+ colors: {
29
+ hardcodedCount: 0,
30
+ kindCounts: {
31
+ hex: 0,
32
+ rgb: 0,
33
+ hsl: 0,
34
+ oklch: 0,
35
+ other: 0,
36
+ },
37
+ sampleValues: [],
38
+ },
39
+ spacing: {
40
+ rawValueCount: 0,
41
+ sampleValues: [],
42
+ },
43
+ radius: {
44
+ rawValueCount: 0,
45
+ sampleValues: [],
46
+ },
47
+ shadow: {
48
+ rawValueCount: 0,
49
+ sampleValues: [],
50
+ },
51
+ typography: {
52
+ fontFamilyCount: 0,
53
+ fontSizeCount: 0,
54
+ lineHeightCount: 0,
55
+ letterSpacingCount: 0,
56
+ fontFamilySamples: [],
57
+ fontSizeSamples: [],
58
+ lineHeightSamples: [],
59
+ letterSpacingSamples: [],
60
+ },
61
+ motion: {
62
+ transitionCount: 0,
63
+ animationCount: 0,
64
+ durationCount: 0,
65
+ durationSamples: [],
66
+ },
67
+ tailwind: {
68
+ breakpointUsageCount: 0,
69
+ arbitraryBreakpointCount: 0,
70
+ utilityFamilyCounts: {},
71
+ utilityFamilySamples: [],
72
+ },
73
+ componentInventory: {
74
+ componentFileCount: 0,
75
+ pageFileCount: 0,
76
+ layoutFileCount: 0,
77
+ surfaceFileSamples: [],
78
+ },
79
+ structuredInspection: {
80
+ mode: 'attribute-aware-static-scan',
81
+ classAttributeCount: 0,
82
+ boundClassExpressionCount: 0,
83
+ inlineStyleObjectCount: 0,
84
+ inlineStyleBindingCount: 0,
85
+ classAttributeSamples: [],
86
+ inlineStyleSamples: [],
87
+ utilityFamilyCounts: {},
88
+ utilityFamilySamples: [],
89
+ inlineTokenBypassSignals: {
90
+ hardcodedColorCount: 0,
91
+ rawSpacingCount: 0,
92
+ rawRadiusCount: 0,
93
+ rawShadowCount: 0,
94
+ cssVariableReferenceCount: 0,
95
+ },
96
+ },
97
+ tokenBypassSignals: {
98
+ hardcodedColorCount: 0,
99
+ rawSpacingCount: 0,
100
+ rawRadiusCount: 0,
101
+ rawShadowCount: 0,
102
+ inlineHardcodedColorCount: 0,
103
+ inlineRawSpacingCount: 0,
104
+ inlineRawRadiusCount: 0,
105
+ inlineRawShadowCount: 0,
106
+ inlineCssVariableReferenceCount: 0,
107
+ },
108
+ };
109
+ }
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Small pure helpers shared across the static design evidence scan modules.
3
+ * Kept side-effect free so each can be tested in isolation.
4
+ */
5
+
6
+ import { DESIGN_EVIDENCE_SAMPLE_LIMIT } from './constants.mjs';
7
+
8
+ export function countPatternMatches(sourceText, pattern) {
9
+ return Array.from(sourceText.matchAll(pattern)).length;
10
+ }
11
+
12
+ export function pushSampleValue(targetSamples, value, targetSet) {
13
+ const normalizedValue = String(value || '').trim();
14
+ if (!normalizedValue || targetSet.has(normalizedValue)) {
15
+ return;
16
+ }
17
+
18
+ targetSet.add(normalizedValue);
19
+ if (targetSamples.length < DESIGN_EVIDENCE_SAMPLE_LIMIT) {
20
+ targetSamples.push(normalizedValue);
21
+ }
22
+ }
23
+
24
+ export function incrementCountMap(countMap, key) {
25
+ countMap[key] = (countMap[key] || 0) + 1;
26
+ }
27
+
28
+ export function getFirstDefinedCapture(matchGroups) {
29
+ for (const capturedValue of matchGroups) {
30
+ if (typeof capturedValue === 'string' && capturedValue.trim().length > 0) {
31
+ return capturedValue;
32
+ }
33
+ }
34
+
35
+ return '';
36
+ }
37
+
38
+ export function normalizeEvidenceSample(rawValue) {
39
+ return String(rawValue || '').replace(/\s+/g, ' ').trim();
40
+ }
41
+
42
+ export function categorizeCssVariable(variableName) {
43
+ const normalizedVariableName = String(variableName || '').trim().toLowerCase();
44
+
45
+ if (/(color|surface|accent|bg|text|border|fill|stroke|ink|tone)/.test(normalizedVariableName)) {
46
+ return 'color';
47
+ }
48
+
49
+ if (/(space|gap|padding|margin|size|width|height|inset)/.test(normalizedVariableName)) {
50
+ return 'spacing';
51
+ }
52
+
53
+ if (/(radius|rounded|corner)/.test(normalizedVariableName)) {
54
+ return 'radius';
55
+ }
56
+
57
+ if (/(shadow|elevation)/.test(normalizedVariableName)) {
58
+ return 'shadow';
59
+ }
60
+
61
+ if (/(font|type|line|letter|tracking|leading)/.test(normalizedVariableName)) {
62
+ return 'typography';
63
+ }
64
+
65
+ if (/(motion|duration|easing|ease|animation|transition)/.test(normalizedVariableName)) {
66
+ return 'motion';
67
+ }
68
+
69
+ return 'other';
70
+ }
71
+
72
+ export function inferColorKind(colorValue) {
73
+ if (/^#/i.test(colorValue)) {
74
+ return 'hex';
75
+ }
76
+
77
+ if (/^rgba?\(/i.test(colorValue)) {
78
+ return 'rgb';
79
+ }
80
+
81
+ if (/^hsla?\(/i.test(colorValue)) {
82
+ return 'hsl';
83
+ }
84
+
85
+ if (/^oklch\(/i.test(colorValue)) {
86
+ return 'oklch';
87
+ }
88
+
89
+ return 'other';
90
+ }
91
+
92
+ export function inferUtilityFamily(rawUtilityToken) {
93
+ const normalizedUtilityToken = String(rawUtilityToken || '')
94
+ .trim()
95
+ .split(':')
96
+ .pop()
97
+ ?.replace(/^!/, '')
98
+ ?.replace(/\/.+$/, '')
99
+ ?.trim();
100
+
101
+ if (!normalizedUtilityToken) {
102
+ return '';
103
+ }
104
+
105
+ if (/^grid(?:-|$)/.test(normalizedUtilityToken)) {
106
+ return 'grid';
107
+ }
108
+
109
+ if (/^flex(?:-|$)/.test(normalizedUtilityToken)) {
110
+ return 'flex';
111
+ }
112
+
113
+ if (/^(?:block|inline|hidden|contents)$/.test(normalizedUtilityToken)) {
114
+ return normalizedUtilityToken;
115
+ }
116
+
117
+ if (/^(?:min|max)-\[/.test(normalizedUtilityToken)) {
118
+ return 'arbitrary-breakpoint';
119
+ }
120
+
121
+ return normalizedUtilityToken.split('-')[0];
122
+ }