@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.
- 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 +9 -9
- package/README.md +10 -1
- package/lib/cli/commands/init.mjs +1 -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/sections/audits.mjs +96 -0
- package/lib/cli/project-scaffolder/design-contract/sections/conceptual-anchor.mjs +116 -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 +222 -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/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 +59 -896
- package/lib/cli/project-scaffolder/design-contract.mjs +147 -557
- 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 +3 -2
- package/scripts/validate/coverage-checks.mjs +1 -1
- package/scripts/validate.mjs +93 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit policy sections of the design intent contract: AI-safe UI audit,
|
|
3
|
+
* production content policy, motion-palette decision contract, and the
|
|
4
|
+
* accessibility policy. These are the gates that fire before UI implementation.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export function buildMotionPaletteDecisionSection() {
|
|
8
|
+
return {
|
|
9
|
+
productCategorySignal: 'agent-inferred-starting-heuristic',
|
|
10
|
+
densityDecisionSource: 'Choose motion density from task, content, brand, device, performance, and accessibility. Categories are heuristics.',
|
|
11
|
+
requiredInteractionStates: ['default', 'hover', 'focus-visible', 'active', 'disabled', 'loading', 'empty', 'error', 'success', 'transition'],
|
|
12
|
+
paletteAutopilotRisks: ['dark-slate-default', 'cream-beige-default', 'purple-blue-gradient-default', 'monochrome-template-default', 'uniform-card-surface-default', 'generic-grid-wallpaper-default', 'generic-line-wallpaper-default', 'calibration-mark-wallpaper-default', 'soft-glow-ai-template-default', 'cyber-neon-terminal-default'],
|
|
13
|
+
spatialDecision: 'State 3D/canvas/WebGL fit. If omitted, name product-fit reason and replacement interaction quality.',
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function buildAiSafeUiAuditSection({ projectName }) {
|
|
18
|
+
return {
|
|
19
|
+
status: 'agent-must-complete-before-ui-implementation',
|
|
20
|
+
failureDefinition: 'AI-safe UI uses template cards, generic marks, decorative grid or line wallpaper, calibration-mark wallpaper, test/demo/placeholder copy, terminal-only user paths, safe palettes, glow backgrounds, or copied scaffold composition.',
|
|
21
|
+
interchangeabilityTest: `If this UI can be renamed from ${projectName} to another product category without changing composition, palette, iconography, and motion, revise it.`,
|
|
22
|
+
requiredProductSpecificSignals: [
|
|
23
|
+
'agent-defined-product-specific-data-treatment',
|
|
24
|
+
'agent-defined-product-specific-motion-or-state-behavior',
|
|
25
|
+
'agent-defined-product-specific-morphology-iconography-or-spatial-structure',
|
|
26
|
+
],
|
|
27
|
+
paletteExplorationRule: 'Use a visually exploratory product-derived palette with WCAG contrast and status clarity.',
|
|
28
|
+
backgroundPatternRule: 'Lines, grids, scanlines, noise, glows, blobs, logos, calibration marks, and geometry must serve a named product function; never use grid, line, or calibration-mark backgrounds as first-output filler. Measurement and inspection marks belong to task overlays or controls, not page wallpaper.',
|
|
29
|
+
aiColorAudit: {
|
|
30
|
+
status: 'agent-must-complete-before-ui-implementation',
|
|
31
|
+
failureDefinition: 'AI color drift uses safe defaults before deriving roles from the product anchor.',
|
|
32
|
+
autopilotRisks: ['cream-editorial-default', 'dark-slate-dashboard-default', 'purple-blue-gradient-default', 'monochrome-minimal-default', 'cyber-neon-terminal-default', 'soft-glow-atmosphere-default'],
|
|
33
|
+
requiredEvidence: [
|
|
34
|
+
'anchor-derived-color-logic',
|
|
35
|
+
'semantic-role-contrast-beyond-surface-decoration',
|
|
36
|
+
'product-specific-color-behavior-that-would-not-transfer',
|
|
37
|
+
],
|
|
38
|
+
reviewQuestion: 'Why does this palette belong to this product?',
|
|
39
|
+
},
|
|
40
|
+
motionSpatialCourageAudit: {
|
|
41
|
+
status: 'agent-must-complete-before-ui-implementation',
|
|
42
|
+
defaultStance: 'Treat motion, scroll choreography, canvas, WebGL, and 3D as first-class options.',
|
|
43
|
+
requiredDecisionFields: [
|
|
44
|
+
'signature-motion-or-interaction',
|
|
45
|
+
'spatial-or-3d-fit',
|
|
46
|
+
'performance-and-reduced-motion-fallback',
|
|
47
|
+
],
|
|
48
|
+
rejectionRule: 'State a product reason and replacement interaction quality before omitting 3D/canvas. Package count or vague performance fear is not enough.',
|
|
49
|
+
reviewQuestion: 'Is the interaction as expressive as the product can responsibly support?',
|
|
50
|
+
},
|
|
51
|
+
reviewQuestion: 'What visible evidence proves this is product-specific?',
|
|
52
|
+
blockingByDefault: true,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function buildProductionContentPolicySection() {
|
|
57
|
+
return {
|
|
58
|
+
status: 'agent-must-complete-before-ui-implementation',
|
|
59
|
+
userFacingCopyRule: 'Visible UI copy must be product-ready and task-specific. Do not ship testing, demo, sample, placeholder, lorem, TODO, coming soon, or scaffold labels unless they are real product states.',
|
|
60
|
+
terminalDependencyRule: 'User-facing workflows must be operable through the UI unless the product is explicitly a CLI, developer tool, or operational runbook. Terminal commands belong in setup and deployment docs, not as the only path for core user tasks.',
|
|
61
|
+
allowedExceptions: [
|
|
62
|
+
'test-harness-only',
|
|
63
|
+
'documented-empty-state',
|
|
64
|
+
'admin-or-devtool-diagnostic-surface',
|
|
65
|
+
'explicit-user-requested-prototype',
|
|
66
|
+
],
|
|
67
|
+
reviewQuestion: 'Can this UI be shipped to real users without removing test/demo copy or terminal-only workflow dependencies?',
|
|
68
|
+
blockingByDefault: true,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function buildAccessibilityPolicySection() {
|
|
73
|
+
return {
|
|
74
|
+
hardComplianceFloor: 'WCAG-2.2-AA',
|
|
75
|
+
advisoryContrastModel: 'APCA',
|
|
76
|
+
failOnHardViolations: true,
|
|
77
|
+
advisoryFindingsDoNotBlockByDefault: true,
|
|
78
|
+
hardRequirements: {
|
|
79
|
+
textContrastMinimum: true,
|
|
80
|
+
nonTextContrast: true,
|
|
81
|
+
useOfColorOnlyProhibited: true,
|
|
82
|
+
focusVisible: true,
|
|
83
|
+
focusAppearance: true,
|
|
84
|
+
targetSizeMinimum: true,
|
|
85
|
+
keyboardAccess: true,
|
|
86
|
+
reflowRequired: true,
|
|
87
|
+
accessibleAuthenticationMinimum: true,
|
|
88
|
+
statusMessagesAndDynamicStateAccess: true,
|
|
89
|
+
},
|
|
90
|
+
advisoryChecks: {
|
|
91
|
+
perceptualContrastReview: true,
|
|
92
|
+
darkModeContrastTuning: true,
|
|
93
|
+
typographyReadabilityTuning: true,
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conceptual anchor section of the design intent contract. Encodes the rules
|
|
3
|
+
* that force agents to commit to a real-world reference, motion, and typography
|
|
4
|
+
* decision before UI implementation, instead of defaulting to spatial cliches.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export function buildConceptualAnchorSection() {
|
|
8
|
+
return {
|
|
9
|
+
mode: 'required-when-no-external-research',
|
|
10
|
+
seedMode: 'selection-policy-only',
|
|
11
|
+
anchorReference: 'agent-defined-anchor-reference',
|
|
12
|
+
requiresAgentSelectionBeforeUiImplementation: true,
|
|
13
|
+
userResearchAbsencePolicy: {
|
|
14
|
+
userSuppliedResearchOnly: true,
|
|
15
|
+
scaffoldSeedDoesNotCountAsResearch: true,
|
|
16
|
+
priorUiDoesNotCountAsResearch: true,
|
|
17
|
+
requireAgentLedResearchWhenAvailable: true,
|
|
18
|
+
},
|
|
19
|
+
candidateSelectionPolicy: {
|
|
20
|
+
considerAtLeast: 3,
|
|
21
|
+
discardObviousCandidateCount: 2,
|
|
22
|
+
minimumCandidateDistance: 'high',
|
|
23
|
+
discardPredictableCandidates: true,
|
|
24
|
+
preferDistinctiveOverSafe: true,
|
|
25
|
+
doNotRevealHiddenCandidateList: true,
|
|
26
|
+
outputOnlyChosenAnchor: true,
|
|
27
|
+
avoidSpatialPlaceMetaphorByDefault: true,
|
|
28
|
+
preferMechanismOverPlace: true,
|
|
29
|
+
},
|
|
30
|
+
creativeCommitmentPolicy: {
|
|
31
|
+
requiredBeforeComplianceReview: true,
|
|
32
|
+
recordInDesignDocs: true,
|
|
33
|
+
requiredCommitmentFields: [
|
|
34
|
+
'specificReferencePoint',
|
|
35
|
+
'signatureMotion',
|
|
36
|
+
'typographicDecision',
|
|
37
|
+
],
|
|
38
|
+
rejectGenericQualityWordsOnly: true,
|
|
39
|
+
specificityFloor: 'name-real-material-instrument-artifact-architecture-editorial-genre-cinematic-behavior-exhibition-system-scientific-apparatus-or-industrial-mechanism',
|
|
40
|
+
},
|
|
41
|
+
forbiddenFinalAnchorTerms: [
|
|
42
|
+
'dashboard',
|
|
43
|
+
'cards',
|
|
44
|
+
'admin-panel',
|
|
45
|
+
'saas-shell',
|
|
46
|
+
'minimalist-interface',
|
|
47
|
+
'safe-admin-layout',
|
|
48
|
+
'room',
|
|
49
|
+
'darkroom',
|
|
50
|
+
'counting-room',
|
|
51
|
+
'control-room',
|
|
52
|
+
'war-room',
|
|
53
|
+
'studio',
|
|
54
|
+
'lab',
|
|
55
|
+
'cockpit',
|
|
56
|
+
'command-center',
|
|
57
|
+
],
|
|
58
|
+
sourceDomains: [
|
|
59
|
+
'complex-physical-engineering',
|
|
60
|
+
'cinematic-behavior-and-transition-systems',
|
|
61
|
+
'experimental-editorial-structure',
|
|
62
|
+
'scientific-instrumentation',
|
|
63
|
+
'workflow-and-custody-systems',
|
|
64
|
+
'material-artifacts-and-instruments',
|
|
65
|
+
'premium-interactive-web-experiences',
|
|
66
|
+
],
|
|
67
|
+
visualRiskBudget: {
|
|
68
|
+
mode: 'high-distinctiveness-with-accessibility-and-performance-guardrails',
|
|
69
|
+
allowRichMotionAndMicroInteraction: true,
|
|
70
|
+
rejectTimidDefaultWhenAnchorSupportsExpressiveUi: true,
|
|
71
|
+
rejectDependencyFearAsDownshiftReason: true,
|
|
72
|
+
requireReducedMotionFallback: true,
|
|
73
|
+
},
|
|
74
|
+
literalTranslationPolicy: {
|
|
75
|
+
preferNonLiteralTranslation: true,
|
|
76
|
+
allowedLiteralUse: 'Only use literal anchor artifacts when they serve a named product function, control, state, or task overlay.',
|
|
77
|
+
forbiddenLiteralUse: 'Do not turn anchor artifacts into decorative wallpaper, required chrome, default texture, or unavoidable theme props.',
|
|
78
|
+
},
|
|
79
|
+
spatialAutopilotPolicy: {
|
|
80
|
+
forbiddenHabitTerms: ['room', 'darkroom', 'counting-room', 'control-room', 'war-room', 'studio', 'lab', 'cockpit', 'command-center'],
|
|
81
|
+
allowedOnlyWhen: 'The product has a real physical place model, operational environment, or user workflow that depends on that place metaphor.',
|
|
82
|
+
replacementPreference: 'Use artifacts, custody flows, instruments, data behaviors, material systems, editorial systems, service rituals, or interaction mechanisms.',
|
|
83
|
+
reviewQuestion: 'Could this anchor still work if the word "room" was removed? If not, revise before UI code.',
|
|
84
|
+
},
|
|
85
|
+
requiredDerivedAxes: [
|
|
86
|
+
'typography',
|
|
87
|
+
'morphology',
|
|
88
|
+
'motion',
|
|
89
|
+
'responsive-composition',
|
|
90
|
+
],
|
|
91
|
+
finalAnchorContract: {
|
|
92
|
+
requiredFields: [
|
|
93
|
+
'name',
|
|
94
|
+
'anchorReference',
|
|
95
|
+
'agentResearchMode',
|
|
96
|
+
'sourceDomain',
|
|
97
|
+
'specificReferencePoint',
|
|
98
|
+
'rationale',
|
|
99
|
+
'signatureMotion',
|
|
100
|
+
'typographicDecision',
|
|
101
|
+
'derivedTokenLogic',
|
|
102
|
+
'visualRiskBudget',
|
|
103
|
+
'motionRiskBudget',
|
|
104
|
+
'cohesionChecks',
|
|
105
|
+
],
|
|
106
|
+
derivedTokenLogicAxes: [
|
|
107
|
+
'morphology',
|
|
108
|
+
'motion',
|
|
109
|
+
],
|
|
110
|
+
cohesionChecks: [
|
|
111
|
+
'no-dashboard-mental-model',
|
|
112
|
+
'motion-derived-from-anchor',
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Design execution and handoff sections of the design intent contract:
|
|
3
|
+
* execution policy gates, the structured handoff payload, the review rubric,
|
|
4
|
+
* and the context-hygiene rules that govern continuity across sessions.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { GENERICITY_DRIFT_SIGNALS, VALID_BOLD_SIGNALS } from '../signal-vocab.mjs';
|
|
8
|
+
|
|
9
|
+
export function buildDesignExecutionPolicySection() {
|
|
10
|
+
return {
|
|
11
|
+
representationStrategy: 'surface-plan-v1',
|
|
12
|
+
seedRefinementRequiredBeforeUiImplementation: true,
|
|
13
|
+
requireSurfacePlan: true,
|
|
14
|
+
requireComponentGraph: true,
|
|
15
|
+
requireViewportMutationPlan: true,
|
|
16
|
+
requireInteractionStateMatrix: true,
|
|
17
|
+
requireContentPriorityMap: true,
|
|
18
|
+
requireTaskFlowNarrative: true,
|
|
19
|
+
requireSignatureMoveRationale: true,
|
|
20
|
+
requireCreativeCommitmentGate: true,
|
|
21
|
+
requireStructuredHandoff: true,
|
|
22
|
+
requireRepoEvidenceAlignment: true,
|
|
23
|
+
forbidScreenshotDependency: true,
|
|
24
|
+
separateRequiredOutcomesFromCandidateMoves: true,
|
|
25
|
+
forbidCandidateMovesAsLockedRequirements: true,
|
|
26
|
+
forbidLibraryThemeAsVisualAuthority: true,
|
|
27
|
+
forbidLiteralAnchorChromeWithoutProductFunction: true,
|
|
28
|
+
handoffFormatVersion: 'ui-handoff-v1',
|
|
29
|
+
requirePerSurfaceMutationOps: true,
|
|
30
|
+
forbidUniformSiblingSurfaceTreatment: true,
|
|
31
|
+
zeroBasedRedesignResetsPriorVisualsWhenRequested: true,
|
|
32
|
+
semanticReviewFocus: [
|
|
33
|
+
'distinctiveness-vs-genericity',
|
|
34
|
+
'contract-fidelity',
|
|
35
|
+
'hierarchy-and-task-priority',
|
|
36
|
+
'component-state-behavior',
|
|
37
|
+
'cross-viewport-mutation',
|
|
38
|
+
],
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function buildDesignExecutionHandoffSection({ projectName, primaryDomain, mutationRules }) {
|
|
43
|
+
return {
|
|
44
|
+
version: 'ui-handoff-v1',
|
|
45
|
+
location: 'inline-design-intent',
|
|
46
|
+
status: 'seed-needs-refinement',
|
|
47
|
+
seedMode: 'structure-first-scaffold',
|
|
48
|
+
requiresTaskSpecificRefinement: true,
|
|
49
|
+
primaryExperienceGoal: `Define the main ${String(primaryDomain || 'product').toLowerCase()} journey for ${projectName} from repo evidence, brief, and docs.`,
|
|
50
|
+
surfacePlan: [
|
|
51
|
+
{
|
|
52
|
+
surfaceId: 'agent-defined-primary-experience',
|
|
53
|
+
role: 'primary-context-synthesized-by-agent',
|
|
54
|
+
goal: 'Choose the first task path from product evidence; reject template shells.',
|
|
55
|
+
antiPatterns: ['dashboard-default', 'scale-only-responsive-layout'],
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
componentGraph: {
|
|
59
|
+
nodes: [
|
|
60
|
+
{ id: 'primary-experience', role: 'agent-defined-primary', priority: 'high' },
|
|
61
|
+
{ id: 'supporting-context', role: 'agent-defined-support', priority: 'medium' },
|
|
62
|
+
],
|
|
63
|
+
edges: [
|
|
64
|
+
{ from: 'primary-experience', to: 'supporting-context', relationship: 'task-priority-support' },
|
|
65
|
+
],
|
|
66
|
+
},
|
|
67
|
+
contentPriorityMap: {
|
|
68
|
+
primary: ['agent-defined-core-task-or-reading-path'],
|
|
69
|
+
secondary: ['agent-defined-supporting-context'],
|
|
70
|
+
deferred: ['agent-defined-deferred-or-hidden-content'],
|
|
71
|
+
},
|
|
72
|
+
viewportMutationPlan: {
|
|
73
|
+
mobile: {
|
|
74
|
+
primaryOperation: 'agent-defined-mobile-recomposition',
|
|
75
|
+
requiredSurfaceActions: [
|
|
76
|
+
'choose-mobile-task-order',
|
|
77
|
+
'disclose-or-remove-low-priority-content',
|
|
78
|
+
],
|
|
79
|
+
forbiddenPatterns: ['scale-only-shrink'],
|
|
80
|
+
rationale: mutationRules.mobile,
|
|
81
|
+
},
|
|
82
|
+
tablet: {
|
|
83
|
+
primaryOperation: 'agent-defined-tablet-regrouping',
|
|
84
|
+
requiredSurfaceActions: [
|
|
85
|
+
'define-medium-width-grouping',
|
|
86
|
+
'preserve-task-clarity',
|
|
87
|
+
],
|
|
88
|
+
forbiddenPatterns: ['uniform-module-grid-without-role-change'],
|
|
89
|
+
rationale: mutationRules.tablet,
|
|
90
|
+
},
|
|
91
|
+
desktop: {
|
|
92
|
+
primaryOperation: 'agent-defined-desktop-composition',
|
|
93
|
+
requiredSurfaceActions: [
|
|
94
|
+
'use-space-to-improve-hierarchy',
|
|
95
|
+
'avoid-equalizing-unrelated-content',
|
|
96
|
+
],
|
|
97
|
+
forbiddenPatterns: ['interchangeable-dashboard-or-landing-chrome'],
|
|
98
|
+
rationale: mutationRules.desktop,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
interactionStateMatrix: [
|
|
102
|
+
{
|
|
103
|
+
componentId: 'primary-interaction',
|
|
104
|
+
states: ['default', 'hover', 'focus', 'loading', 'error'],
|
|
105
|
+
notes: 'Refine states from project language and anchor; reject anonymous panels.',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
108
|
+
expressionFlexibility: {
|
|
109
|
+
lockedOutcomes: [
|
|
110
|
+
'preserve-primary-user-goal',
|
|
111
|
+
'preserve-accessibility-floor',
|
|
112
|
+
'preserve-production-content-policy',
|
|
113
|
+
'preserve-forbidden-patterns',
|
|
114
|
+
],
|
|
115
|
+
candidateSignatureMoves: [
|
|
116
|
+
'agent-defined-candidate-move-not-locked-until-refined',
|
|
117
|
+
],
|
|
118
|
+
flexibleAxes: [
|
|
119
|
+
'palette-primitives',
|
|
120
|
+
'typeface-choice',
|
|
121
|
+
'surface-treatment',
|
|
122
|
+
'component-library-skin',
|
|
123
|
+
'motion-implementation',
|
|
124
|
+
'anchor-artifact-literalness',
|
|
125
|
+
],
|
|
126
|
+
lockingRule: 'A candidate move becomes required only after repo evidence, product function, accessibility need, or explicit user approval makes it necessary.',
|
|
127
|
+
},
|
|
128
|
+
taskFlowNarrative: [
|
|
129
|
+
`Entry: start ${projectName} from real evidence, not a generic opener.`,
|
|
130
|
+
'Resolution: define proof, feedback, recovery, and next action.',
|
|
131
|
+
],
|
|
132
|
+
visualResetStrategy: {
|
|
133
|
+
activatesWhenUserRequests: [
|
|
134
|
+
'redesign from zero',
|
|
135
|
+
'redesain dari 0',
|
|
136
|
+
],
|
|
137
|
+
existingUiAllowedAs: ['content-evidence', 'behavior-evidence', 'asset-source-evidence'],
|
|
138
|
+
existingUiForbiddenAs: ['palette-source', 'layout-source', 'motion-source'],
|
|
139
|
+
requiredResetAxes: ['composition', 'hierarchy', 'motion-or-interaction', 'responsive-information-architecture'],
|
|
140
|
+
},
|
|
141
|
+
signatureMoveRationale: 'Choose one project-specific visual, motion, type, or interaction move.',
|
|
142
|
+
creativeCommitment: {
|
|
143
|
+
status: 'agent-must-complete-before-ui-implementation',
|
|
144
|
+
requiredFields: [
|
|
145
|
+
'specificReferencePoint',
|
|
146
|
+
'signatureMotion',
|
|
147
|
+
'typographicDecision',
|
|
148
|
+
],
|
|
149
|
+
failureMode: 'generic quality words without a real-world reference fail',
|
|
150
|
+
},
|
|
151
|
+
implementationGuardrails: {
|
|
152
|
+
requireBuildFromHandoff: true,
|
|
153
|
+
requireGapNotesBeforeFallback: true,
|
|
154
|
+
forbidGenericLayoutFallbackWithoutReason: true,
|
|
155
|
+
requireLockedVsFlexibleDecisionReview: true,
|
|
156
|
+
forbidCandidateMoveHardcoding: true,
|
|
157
|
+
forbidTestingDemoCopyInUi: true,
|
|
158
|
+
forbidTerminalOnlyUserFlows: true,
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export function buildReviewRubricSection() {
|
|
164
|
+
return {
|
|
165
|
+
version: 'ui-rubric-v1',
|
|
166
|
+
genericityAutoFail: true,
|
|
167
|
+
dimensions: [
|
|
168
|
+
{ key: 'distinctiveness', blockingByDefault: true, question: 'Is the UI authored and product-specific?' },
|
|
169
|
+
{ key: 'contractFidelity', blockingByDefault: true, question: 'Does the UI follow contract, priorities, and accessibility?' },
|
|
170
|
+
{ key: 'visualConsistency', blockingByDefault: false, question: 'Do type, spacing, color, and states form one system?' },
|
|
171
|
+
{ key: 'heuristicUxQuality', blockingByDefault: false, question: 'Does the UI preserve clarity, feedback, and confidence?' },
|
|
172
|
+
{ key: 'motionDiscipline', blockingByDefault: false, question: 'Is motion purposeful, performant, reduced-motion-safe, and on-tone?' },
|
|
173
|
+
],
|
|
174
|
+
genericitySignals: [...GENERICITY_DRIFT_SIGNALS],
|
|
175
|
+
validBoldSignals: [...VALID_BOLD_SIGNALS],
|
|
176
|
+
reportingRules: {
|
|
177
|
+
mustExplainGenericity: true,
|
|
178
|
+
mustSeparateTasteFromFailure: true,
|
|
179
|
+
contractFidelityOverridesPersonalTaste: true,
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function buildContextHygieneSection() {
|
|
185
|
+
return {
|
|
186
|
+
continuityMode: 'opt-in-only',
|
|
187
|
+
allowedSources: [
|
|
188
|
+
'current-repo-evidence',
|
|
189
|
+
'current-user-brief',
|
|
190
|
+
'current-project-docs',
|
|
191
|
+
'explicitly-approved-current-task-constraints',
|
|
192
|
+
],
|
|
193
|
+
taintedSources: [
|
|
194
|
+
'prior-chat-visual-memory',
|
|
195
|
+
'unrelated-project-aesthetics',
|
|
196
|
+
'remembered-screenshots-without-current-approval',
|
|
197
|
+
'generic-template-recall',
|
|
198
|
+
],
|
|
199
|
+
repoEvidenceOverridesMemory: true,
|
|
200
|
+
requireExplicitContinuityApproval: true,
|
|
201
|
+
forbidCarryoverWhenUnapproved: true,
|
|
202
|
+
approvedExternalConstraintUsage: 'Convert approved external constraints into current-project rules; do not imitate source surfaces.',
|
|
203
|
+
externalWebsiteReferencePolicy: 'Use outside websites for mechanics, constraints, and quality bar analysis only. Do not copy layout rhythm, palette, component skin, visual metaphor, or brand posture.',
|
|
204
|
+
driftSignals: [
|
|
205
|
+
'palette-reused-without-brief-support',
|
|
206
|
+
'prior-ui-visual-dna-carried-into-reset-request',
|
|
207
|
+
'room-or-control-room-anchor-repeated-without-product-need',
|
|
208
|
+
'external-reference-copied-instead-of-translated',
|
|
209
|
+
],
|
|
210
|
+
};
|
|
211
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lightweight seed-signal helpers used by the contract builder to fill in
|
|
3
|
+
* mathSystems, motion intent, and copy describing the project context. Kept
|
|
4
|
+
* separate so the contract builder file stays focused on assembly.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export function shouldBootstrapDesignDocument(discoveryAnswers, initContext) {
|
|
8
|
+
const normalizedDomain = String(discoveryAnswers.primaryDomain || '').trim().toLowerCase();
|
|
9
|
+
const normalizedBlueprint = String(initContext.blueprintFileName || '').trim().toLowerCase();
|
|
10
|
+
|
|
11
|
+
const isUiDomain = normalizedDomain.includes('web')
|
|
12
|
+
|| normalizedDomain.includes('mobile')
|
|
13
|
+
|| normalizedDomain.includes('frontend')
|
|
14
|
+
|| normalizedDomain.includes('fullstack')
|
|
15
|
+
|| normalizedDomain.includes('ui');
|
|
16
|
+
|
|
17
|
+
const isBackendOnlyDomain = normalizedDomain.includes('api service')
|
|
18
|
+
|| normalizedDomain.includes('cli tool')
|
|
19
|
+
|| normalizedDomain.includes('library');
|
|
20
|
+
|
|
21
|
+
const blueprintLooksUi = normalizedBlueprint.includes('frontend')
|
|
22
|
+
|| normalizedBlueprint.includes('landing')
|
|
23
|
+
|| normalizedBlueprint.includes('ui');
|
|
24
|
+
|
|
25
|
+
if (isUiDomain) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!isBackendOnlyDomain && blueprintLooksUi) {
|
|
30
|
+
return true;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function buildStructureFirstSeedSignals({
|
|
37
|
+
projectName,
|
|
38
|
+
projectDescription,
|
|
39
|
+
primaryDomain,
|
|
40
|
+
supplementalFields = {},
|
|
41
|
+
}) {
|
|
42
|
+
const normalizedDescription = String(projectDescription || '').trim();
|
|
43
|
+
const repoEvidenceSummary = supplementalFields?.repoEvidence?.designEvidenceSummary || null;
|
|
44
|
+
const hasRepoEvidence = Boolean(
|
|
45
|
+
repoEvidenceSummary
|
|
46
|
+
|| (Array.isArray(supplementalFields?.repoEvidence?.workspaceUiEntries)
|
|
47
|
+
&& supplementalFields.repoEvidence.workspaceUiEntries.length > 0),
|
|
48
|
+
);
|
|
49
|
+
const evidenceSourceLabel = hasRepoEvidence
|
|
50
|
+
? 'current repo evidence, existing UI code, and the active brief'
|
|
51
|
+
: 'the active brief and any repo evidence available at synthesis time';
|
|
52
|
+
const projectContextLabel = normalizedDescription
|
|
53
|
+
? `the product context "${normalizedDescription}"`
|
|
54
|
+
: 'the current product context';
|
|
55
|
+
|
|
56
|
+
return {
|
|
57
|
+
designPhilosophy: `Synthesize design for ${projectName || 'this project'} from ${evidenceSourceLabel}. Choose visual language, libraries, color, type, spacing, and interaction from ${projectContextLabel}; verify technology claims with official docs.`,
|
|
58
|
+
typographyScaleRatio: 'agent-calibrated-from-content-platform-and-readability',
|
|
59
|
+
baseGridUnit: 'agent-calibrated-from-platform-density-and-implementation-stack',
|
|
60
|
+
spacingPattern: 'agent-defined-from-task-flow-and-viewport-needs',
|
|
61
|
+
densityMode: 'agent-defined-from-user-task-device-and-content-pressure',
|
|
62
|
+
colorIntent: `Choose semantic palette roles from ${projectContextLabel}, repo evidence, and accessibility. Reject scaffold or SaaS palette defaults.`,
|
|
63
|
+
paletteRoles: ['agent-defined-semantic-roles'],
|
|
64
|
+
distinctiveMoves: [
|
|
65
|
+
'Choose one product-specific move from task, audience, content, repo evidence, and docs.',
|
|
66
|
+
],
|
|
67
|
+
motionPurpose: 'Use expressive motion when it improves hierarchy, continuity, feedback, memorability, or confidence. Verify new motion libraries with official docs.',
|
|
68
|
+
componentMorphology: {
|
|
69
|
+
mobile: 'Recompose for touch, task priority, and constrained attention.',
|
|
70
|
+
tablet: 'Regroup surfaces for medium width without cloning desktop or mobile.',
|
|
71
|
+
desktop: 'Use space for hierarchy and scanability; avoid template grids.',
|
|
72
|
+
},
|
|
73
|
+
mutationRules: {
|
|
74
|
+
mobile: 'Reorder, merge, or disclose content for mobile. Reject scale-only shrink.',
|
|
75
|
+
tablet: 'Regroup for tablet instead of width-only desktop reduction.',
|
|
76
|
+
desktop: 'Use space intentionally; avoid equal-weight modules without evidence.',
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vocabulary lists for genericity / forbidden / valid-bold drift signals used
|
|
3
|
+
* across the design contract. Kept in one file so additions and removals stay
|
|
4
|
+
* traceable.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export const GENERICITY_DRIFT_SIGNALS = [
|
|
8
|
+
'offline-prescribed-style-used-as-final-direction',
|
|
9
|
+
'unresearched-library-or-framework-choice',
|
|
10
|
+
'missing-conceptual-anchor-without-external-research',
|
|
11
|
+
'visual-decisions-not-derived-from-conceptual-anchor',
|
|
12
|
+
'ai-safe-ui-template-look',
|
|
13
|
+
'ai-color-default-palette-without-product-role-behavior',
|
|
14
|
+
'brandless-clean-template-look',
|
|
15
|
+
'interchangeable-product-renaming-test-fails',
|
|
16
|
+
'decorative-grid-or-glow-wallpaper-without-product-function',
|
|
17
|
+
'decorative-line-or-calibration-wallpaper-without-product-function',
|
|
18
|
+
'measurement-or-calibration-marks-used-as-page-background',
|
|
19
|
+
'testing-demo-or-placeholder-copy-shipped-to-ui',
|
|
20
|
+
'terminal-only-user-flow-without-product-reason',
|
|
21
|
+
'safe-cream-slate-or-monochrome-palette-used-as-readability-excuse',
|
|
22
|
+
'generic-abstract-logo-or-iconography',
|
|
23
|
+
'timid-anchor-that-renames-dashboard-or-admin-shell',
|
|
24
|
+
'motion-suppressed-without-accessibility-or-performance-reason',
|
|
25
|
+
'motion-or-3d-omitted-from-fear-without-fit-analysis',
|
|
26
|
+
'modern-library-rejected-from-dependency-fear-without-tradeoff-analysis',
|
|
27
|
+
'component-library-selected-by-habit-without-product-fit',
|
|
28
|
+
'scale-only-responsive-layout',
|
|
29
|
+
'zero-based-redesign-kept-prior-visual-dna',
|
|
30
|
+
'restyle-instead-of-recomposition',
|
|
31
|
+
'literal-anchor-artifacts-used-as-required-ui-chrome',
|
|
32
|
+
'candidate-signature-move-treated-as-locked-implementation',
|
|
33
|
+
'library-theme-tokens-drive-visual-language',
|
|
34
|
+
'spatial-room-anchor-used-by-habit',
|
|
35
|
+
'place-metaphor-used-as-layout-model-without-product-function',
|
|
36
|
+
'external-website-reference-copied-as-style',
|
|
37
|
+
'tailwind-only-or-component-kit-used-as-neutrality-claim',
|
|
38
|
+
'framework-selected-by-familiarity-instead-of-evidence',
|
|
39
|
+
'manual-framework-scaffold-used-when-official-setup-fits',
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
export const FORBIDDEN_PATTERN_SIGNALS = [
|
|
43
|
+
...GENERICITY_DRIFT_SIGNALS.filter((signal) => signal !== 'unresearched-library-or-framework-choice'),
|
|
44
|
+
'single-safe-typographic-family-without-role-contrast-or-rationale',
|
|
45
|
+
];
|
|
46
|
+
|
|
47
|
+
export const VALID_BOLD_SIGNALS = [
|
|
48
|
+
'single-cohesive-conceptual-anchor',
|
|
49
|
+
'high-variance-candidate-selection',
|
|
50
|
+
'context-derived-visual-direction',
|
|
51
|
+
'three-at-a-glance-product-specific-signals',
|
|
52
|
+
'visually-exploratory-accessible-palette-derived-from-product',
|
|
53
|
+
'audacious-accessible-palette-with-product-role-behavior',
|
|
54
|
+
'background-or-geometry-serves-product-function',
|
|
55
|
+
'motion-or-spatial-experience-derived-from-anchor',
|
|
56
|
+
'explicit-3d-canvas-fit-or-nonfit-decision',
|
|
57
|
+
'official-docs-backed-modern-library-choice',
|
|
58
|
+
'headless-or-component-primitive-restyled-to-product-language',
|
|
59
|
+
'responsive-recomposition-by-task-priority',
|
|
60
|
+
'purposeful-motion-with-reduced-motion-path',
|
|
61
|
+
'non-spatial-product-anchor-or-workflow-mechanism',
|
|
62
|
+
'official-scaffolder-used-for-supported-project-shape',
|
|
63
|
+
'framework-choice-compared-against-plausible-alternative',
|
|
64
|
+
];
|