@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.
- package/.agent-context/prompts/bootstrap-design.md +3 -1
- package/.agent-context/prompts/research-design.md +165 -0
- package/.agent-context/review-checklists/pr-checklist.md +1 -0
- package/.agent-context/rules/api-docs.md +63 -47
- package/.agent-context/rules/architecture.md +133 -120
- package/.agent-context/rules/database-design.md +36 -18
- package/.agent-context/rules/docker-runtime.md +66 -43
- package/.agent-context/rules/efficiency-vs-hype.md +38 -17
- package/.agent-context/rules/error-handling.md +35 -16
- package/.agent-context/rules/event-driven.md +35 -18
- package/.agent-context/rules/frontend-architecture.md +103 -76
- package/.agent-context/rules/git-workflow.md +81 -197
- package/.agent-context/rules/microservices.md +42 -41
- package/.agent-context/rules/naming-conv.md +27 -8
- package/.agent-context/rules/performance.md +32 -12
- package/.agent-context/rules/realtime.md +26 -9
- package/.agent-context/rules/security.md +39 -20
- package/.agent-context/rules/testing.md +36 -16
- package/AGENTS.md +21 -20
- package/README.md +10 -1
- package/lib/cli/commands/init.mjs +12 -0
- package/lib/cli/commands/upgrade.mjs +11 -0
- package/lib/cli/compiler.mjs +1 -0
- package/lib/cli/detector/constants.mjs +135 -0
- package/lib/cli/detector/design-evidence/collector.mjs +256 -0
- package/lib/cli/detector/design-evidence/constants.mjs +39 -0
- package/lib/cli/detector/design-evidence/file-traversal.mjs +83 -0
- package/lib/cli/detector/design-evidence/structured-attribute-evidence.mjs +117 -0
- package/lib/cli/detector/design-evidence/summary.mjs +109 -0
- package/lib/cli/detector/design-evidence/utility-helpers.mjs +122 -0
- package/lib/cli/detector/design-evidence.mjs +25 -610
- package/lib/cli/detector/stack-detection.mjs +243 -0
- package/lib/cli/detector/ui-signals.mjs +150 -0
- package/lib/cli/detector/workspace-scan.mjs +177 -0
- package/lib/cli/detector.mjs +20 -688
- package/lib/cli/memory-continuity.mjs +1 -0
- package/lib/cli/project-scaffolder/design-contract/research-dossier-migration.mjs +165 -0
- package/lib/cli/project-scaffolder/design-contract/sections/audits.mjs +96 -0
- package/lib/cli/project-scaffolder/design-contract/sections/conceptual-anchor.mjs +233 -0
- package/lib/cli/project-scaffolder/design-contract/sections/execution-handoff.mjs +211 -0
- package/lib/cli/project-scaffolder/design-contract/seed-signals.mjs +79 -0
- package/lib/cli/project-scaffolder/design-contract/signal-vocab.mjs +64 -0
- package/lib/cli/project-scaffolder/design-contract/validation/anchor-validators.mjs +456 -0
- package/lib/cli/project-scaffolder/design-contract/validation/audit-validators.mjs +117 -0
- package/lib/cli/project-scaffolder/design-contract/validation/completeness.mjs +83 -0
- package/lib/cli/project-scaffolder/design-contract/validation/execution-validators.mjs +328 -0
- package/lib/cli/project-scaffolder/design-contract/validation/helpers.mjs +8 -0
- package/lib/cli/project-scaffolder/design-contract/validation/research-dossier-validators.mjs +104 -0
- package/lib/cli/project-scaffolder/design-contract/validation/structural-validators.mjs +79 -0
- package/lib/cli/project-scaffolder/design-contract/validation/system-validators.mjs +256 -0
- package/lib/cli/project-scaffolder/design-contract/validation.mjs +61 -896
- package/lib/cli/project-scaffolder/design-contract.mjs +151 -556
- package/lib/cli/project-scaffolder/prompt-builders.mjs +9 -0
- package/mcp.json +30 -9
- package/package.json +17 -2
- package/scripts/audit-cache-layer-contract.mjs +258 -0
- package/scripts/audit-caching-scope-hygiene.mjs +263 -0
- package/scripts/audit-file-size.mjs +219 -0
- package/scripts/audit-reflection-citations.mjs +163 -0
- package/scripts/audit-release-bundle.mjs +170 -0
- package/scripts/audit-rule-id-uniqueness.mjs +313 -0
- package/scripts/benchmark-evidence-bundle.mjs +1 -0
- package/scripts/build-release-benchmark-bundle.mjs +204 -0
- package/scripts/context-triggered-audit.mjs +1 -0
- package/scripts/documentation-boundary-audit.mjs +1 -0
- package/scripts/explain-on-demand-audit.mjs +2 -1
- package/scripts/frontend-usability-audit.mjs +10 -10
- package/scripts/llm-judge/checklist-loader.mjs +45 -0
- package/scripts/llm-judge/constants.mjs +66 -0
- package/scripts/llm-judge/diff-collection.mjs +74 -0
- package/scripts/llm-judge/prompting.mjs +78 -0
- package/scripts/llm-judge/providers.mjs +111 -0
- package/scripts/llm-judge/verdict.mjs +134 -0
- package/scripts/llm-judge.mjs +21 -482
- package/scripts/mcp-server/tool-registry.mjs +55 -0
- package/scripts/mcp-server/tools.mjs +137 -1
- package/scripts/migrate-rule-format/id-prefix-table.mjs +37 -0
- package/scripts/migrate-rule-format/parse-legacy.mjs +180 -0
- package/scripts/migrate-rule-format/render-new.mjs +169 -0
- package/scripts/migrate-rule-format/roundtrip-validate.mjs +89 -0
- package/scripts/migrate-rule-format.mjs +192 -0
- package/scripts/release-gate/constants.mjs +1 -1
- package/scripts/release-gate/static-checks.mjs +1 -1
- package/scripts/rules-guardian-audit.mjs +5 -2
- package/scripts/single-source-lazy-loading-audit.mjs +2 -1
- package/scripts/ui-design-judge/git-input.mjs +3 -0
- package/scripts/validate/config.mjs +27 -2
- package/scripts/validate/coverage-checks.mjs +1 -1
- 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
|
+
}
|