@ryuenn3123/agentic-senior-core 3.0.50 → 4.0.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 (83) hide show
  1. package/.agent-context/review-checklists/pr-checklist.md +1 -0
  2. package/.agent-context/rules/api-docs.md +63 -47
  3. package/.agent-context/rules/architecture.md +133 -120
  4. package/.agent-context/rules/database-design.md +36 -18
  5. package/.agent-context/rules/docker-runtime.md +66 -43
  6. package/.agent-context/rules/efficiency-vs-hype.md +38 -17
  7. package/.agent-context/rules/error-handling.md +35 -16
  8. package/.agent-context/rules/event-driven.md +35 -18
  9. package/.agent-context/rules/frontend-architecture.md +103 -76
  10. package/.agent-context/rules/git-workflow.md +81 -197
  11. package/.agent-context/rules/microservices.md +42 -41
  12. package/.agent-context/rules/naming-conv.md +27 -8
  13. package/.agent-context/rules/performance.md +32 -12
  14. package/.agent-context/rules/realtime.md +26 -9
  15. package/.agent-context/rules/security.md +39 -20
  16. package/.agent-context/rules/testing.md +36 -16
  17. package/AGENTS.md +9 -9
  18. package/README.md +10 -1
  19. package/lib/cli/commands/init.mjs +1 -0
  20. package/lib/cli/compiler.mjs +1 -0
  21. package/lib/cli/detector/constants.mjs +135 -0
  22. package/lib/cli/detector/design-evidence/collector.mjs +256 -0
  23. package/lib/cli/detector/design-evidence/constants.mjs +39 -0
  24. package/lib/cli/detector/design-evidence/file-traversal.mjs +83 -0
  25. package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +117 -0
  26. package/lib/cli/detector/design-evidence/summary.mjs +109 -0
  27. package/lib/cli/detector/design-evidence/utility-helpers.mjs +122 -0
  28. package/lib/cli/detector/design-evidence.mjs +25 -610
  29. package/lib/cli/detector/stack-detection.mjs +243 -0
  30. package/lib/cli/detector/ui-signals.mjs +150 -0
  31. package/lib/cli/detector/workspace-scan.mjs +177 -0
  32. package/lib/cli/detector.mjs +20 -688
  33. package/lib/cli/memory-continuity.mjs +1 -0
  34. package/lib/cli/project-scaffolder/design-contract/sections/audits.mjs +96 -0
  35. package/lib/cli/project-scaffolder/design-contract/sections/conceptual-anchor.mjs +116 -0
  36. package/lib/cli/project-scaffolder/design-contract/sections/execution-handoff.mjs +211 -0
  37. package/lib/cli/project-scaffolder/design-contract/seed-signals.mjs +79 -0
  38. package/lib/cli/project-scaffolder/design-contract/signal-vocab.mjs +64 -0
  39. package/lib/cli/project-scaffolder/design-contract/validation/anchor-validators.mjs +222 -0
  40. package/lib/cli/project-scaffolder/design-contract/validation/audit-validators.mjs +117 -0
  41. package/lib/cli/project-scaffolder/design-contract/validation/completeness.mjs +83 -0
  42. package/lib/cli/project-scaffolder/design-contract/validation/execution-validators.mjs +328 -0
  43. package/lib/cli/project-scaffolder/design-contract/validation/helpers.mjs +8 -0
  44. package/lib/cli/project-scaffolder/design-contract/validation/structural-validators.mjs +79 -0
  45. package/lib/cli/project-scaffolder/design-contract/validation/system-validators.mjs +256 -0
  46. package/lib/cli/project-scaffolder/design-contract/validation.mjs +59 -896
  47. package/lib/cli/project-scaffolder/design-contract.mjs +147 -557
  48. package/mcp.json +30 -9
  49. package/package.json +17 -2
  50. package/scripts/audit-cache-layer-contract.mjs +258 -0
  51. package/scripts/audit-caching-scope-hygiene.mjs +263 -0
  52. package/scripts/audit-file-size.mjs +219 -0
  53. package/scripts/audit-reflection-citations.mjs +163 -0
  54. package/scripts/audit-release-bundle.mjs +170 -0
  55. package/scripts/audit-rule-id-uniqueness.mjs +313 -0
  56. package/scripts/benchmark-evidence-bundle.mjs +1 -0
  57. package/scripts/build-release-benchmark-bundle.mjs +204 -0
  58. package/scripts/context-triggered-audit.mjs +1 -0
  59. package/scripts/documentation-boundary-audit.mjs +1 -0
  60. package/scripts/explain-on-demand-audit.mjs +2 -1
  61. package/scripts/frontend-usability-audit.mjs +10 -10
  62. package/scripts/llm-judge/checklist-loader.mjs +45 -0
  63. package/scripts/llm-judge/constants.mjs +66 -0
  64. package/scripts/llm-judge/diff-collection.mjs +74 -0
  65. package/scripts/llm-judge/prompting.mjs +78 -0
  66. package/scripts/llm-judge/providers.mjs +111 -0
  67. package/scripts/llm-judge/verdict.mjs +134 -0
  68. package/scripts/llm-judge.mjs +21 -482
  69. package/scripts/mcp-server/tool-registry.mjs +55 -0
  70. package/scripts/mcp-server/tools.mjs +137 -1
  71. package/scripts/migrate-rule-format/id-prefix-table.mjs +37 -0
  72. package/scripts/migrate-rule-format/parse-legacy.mjs +180 -0
  73. package/scripts/migrate-rule-format/render-new.mjs +169 -0
  74. package/scripts/migrate-rule-format/roundtrip-validate.mjs +89 -0
  75. package/scripts/migrate-rule-format.mjs +192 -0
  76. package/scripts/release-gate/constants.mjs +1 -1
  77. package/scripts/release-gate/static-checks.mjs +1 -1
  78. package/scripts/rules-guardian-audit.mjs +5 -2
  79. package/scripts/single-source-lazy-loading-audit.mjs +2 -1
  80. package/scripts/ui-design-judge/git-input.mjs +3 -0
  81. package/scripts/validate/config.mjs +3 -2
  82. package/scripts/validate/coverage-checks.mjs +1 -1
  83. package/scripts/validate.mjs +93 -1
@@ -0,0 +1,117 @@
1
+ /**
2
+ * Structured attribute-aware inspection: counts class attributes, bound class
3
+ * expressions, JSX/Vue inline styles, and Tailwind utility families seen in the
4
+ * source. These metrics complement the raw regex pass with a structurally
5
+ * aware view that better matches modern frontend authorship patterns.
6
+ */
7
+
8
+ import {
9
+ COLOR_PATTERN,
10
+ CSS_VARIABLE_REFERENCE_PATTERN,
11
+ EXPRESSION_CLASS_ATTRIBUTE_PATTERN,
12
+ JSX_INLINE_STYLE_PATTERN,
13
+ RAW_RADIUS_PATTERN,
14
+ RAW_SHADOW_PATTERN,
15
+ RAW_SPACING_PATTERN,
16
+ STRING_CLASS_ATTRIBUTE_PATTERN,
17
+ VUE_INLINE_STYLE_PATTERN,
18
+ } from './constants.mjs';
19
+ import {
20
+ countPatternMatches,
21
+ getFirstDefinedCapture,
22
+ incrementCountMap,
23
+ inferUtilityFamily,
24
+ normalizeEvidenceSample,
25
+ pushSampleValue,
26
+ } from './utility-helpers.mjs';
27
+
28
+ function collectTailwindUtilityFamilies(classValue, utilityFamilyCounts, utilityFamilySamples, utilityFamilySampleSet) {
29
+ for (const utilityToken of String(classValue || '').split(/\s+/g)) {
30
+ const utilityFamily = inferUtilityFamily(utilityToken);
31
+ if (!utilityFamily) {
32
+ continue;
33
+ }
34
+
35
+ incrementCountMap(utilityFamilyCounts, utilityFamily);
36
+ pushSampleValue(utilityFamilySamples, utilityFamily, utilityFamilySampleSet);
37
+ }
38
+ }
39
+
40
+ function applyInlineStyleInspection(styleSourceText, summary, styleSampleSet) {
41
+ const normalizedStyleSource = normalizeEvidenceSample(styleSourceText);
42
+ pushSampleValue(summary.structuredInspection.inlineStyleSamples, normalizedStyleSource, styleSampleSet);
43
+
44
+ const hardcodedColorCount = countPatternMatches(styleSourceText, COLOR_PATTERN);
45
+ const rawSpacingCount = countPatternMatches(styleSourceText, RAW_SPACING_PATTERN);
46
+ const rawRadiusCount = countPatternMatches(styleSourceText, RAW_RADIUS_PATTERN);
47
+ const rawShadowCount = countPatternMatches(styleSourceText, RAW_SHADOW_PATTERN);
48
+ const cssVariableReferenceCount = countPatternMatches(styleSourceText, CSS_VARIABLE_REFERENCE_PATTERN);
49
+
50
+ summary.structuredInspection.inlineTokenBypassSignals.hardcodedColorCount += hardcodedColorCount;
51
+ summary.structuredInspection.inlineTokenBypassSignals.rawSpacingCount += rawSpacingCount;
52
+ summary.structuredInspection.inlineTokenBypassSignals.rawRadiusCount += rawRadiusCount;
53
+ summary.structuredInspection.inlineTokenBypassSignals.rawShadowCount += rawShadowCount;
54
+ summary.structuredInspection.inlineTokenBypassSignals.cssVariableReferenceCount += cssVariableReferenceCount;
55
+ }
56
+
57
+ export function collectStructuredAttributeEvidence(
58
+ sourceText,
59
+ summary,
60
+ classSampleSet,
61
+ styleSampleSet,
62
+ utilityFamilySampleSet,
63
+ ) {
64
+ for (const classAttributeMatch of sourceText.matchAll(STRING_CLASS_ATTRIBUTE_PATTERN)) {
65
+ const classValue = getFirstDefinedCapture(classAttributeMatch.slice(1));
66
+ if (!classValue) {
67
+ continue;
68
+ }
69
+
70
+ summary.structuredInspection.classAttributeCount += 1;
71
+ pushSampleValue(
72
+ summary.structuredInspection.classAttributeSamples,
73
+ normalizeEvidenceSample(classValue),
74
+ classSampleSet,
75
+ );
76
+ collectTailwindUtilityFamilies(
77
+ classValue,
78
+ summary.structuredInspection.utilityFamilyCounts,
79
+ summary.structuredInspection.utilityFamilySamples,
80
+ utilityFamilySampleSet,
81
+ );
82
+ }
83
+
84
+ for (const expressionClassAttributeMatch of sourceText.matchAll(EXPRESSION_CLASS_ATTRIBUTE_PATTERN)) {
85
+ const expressionValue = getFirstDefinedCapture(expressionClassAttributeMatch.slice(1));
86
+ if (!expressionValue) {
87
+ continue;
88
+ }
89
+
90
+ summary.structuredInspection.boundClassExpressionCount += 1;
91
+ pushSampleValue(
92
+ summary.structuredInspection.classAttributeSamples,
93
+ normalizeEvidenceSample(expressionValue),
94
+ classSampleSet,
95
+ );
96
+ }
97
+
98
+ for (const inlineStyleMatch of sourceText.matchAll(JSX_INLINE_STYLE_PATTERN)) {
99
+ const inlineStyleSource = getFirstDefinedCapture(inlineStyleMatch.slice(1));
100
+ if (!inlineStyleSource) {
101
+ continue;
102
+ }
103
+
104
+ summary.structuredInspection.inlineStyleObjectCount += 1;
105
+ applyInlineStyleInspection(inlineStyleSource, summary, styleSampleSet);
106
+ }
107
+
108
+ for (const vueInlineStyleMatch of sourceText.matchAll(VUE_INLINE_STYLE_PATTERN)) {
109
+ const inlineStyleSource = getFirstDefinedCapture(vueInlineStyleMatch.slice(1));
110
+ if (!inlineStyleSource) {
111
+ continue;
112
+ }
113
+
114
+ summary.structuredInspection.inlineStyleBindingCount += 1;
115
+ applyInlineStyleInspection(inlineStyleSource, summary, styleSampleSet);
116
+ }
117
+ }
@@ -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
+ }