@ryuenn3123/agentic-senior-core 3.0.20 → 3.0.22
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 +20 -0
- package/.agent-context/rules/frontend-architecture.md +8 -0
- package/.agent-context/state/memory-continuity-benchmark.json +1 -1
- package/.cursorrules +1 -1
- package/.windsurfrules +1 -1
- package/lib/cli/project-scaffolder/design-contract.mjs +37 -0
- package/lib/cli/project-scaffolder/prompt-builders.mjs +7 -1
- package/package.json +1 -1
- package/scripts/release-gate/audit-checks.mjs +18 -3
- package/scripts/ui-design-judge/prompting.mjs +1 -1
- package/scripts/ui-design-judge/reporting.mjs +1 -0
- package/scripts/ui-design-judge.mjs +8 -4
|
@@ -19,6 +19,26 @@ The agent must:
|
|
|
19
19
|
6. When choosing a new UI, animation, styling, or component library, research current official docs and choose the latest stable compatible option for this project. Do not rely on offline defaults.
|
|
20
20
|
7. Keep external references non-copying: extract constraints and reasoning only, never clone the surface.
|
|
21
21
|
|
|
22
|
+
## User Research Intake
|
|
23
|
+
|
|
24
|
+
If the user mentions or attaches a research file, article, benchmark, library list, screenshot study, or design note, read it before choosing the visual direction or dependencies. Treat it as candidate evidence, not as a command to copy every recommendation.
|
|
25
|
+
|
|
26
|
+
The agent must summarize what it used from that research, discard what does not fit the project, and verify any library, framework, API, browser feature, or package claim against current official documentation before implementation.
|
|
27
|
+
|
|
28
|
+
User-supplied research may influence the candidate set for motion, scroll, UI primitives, canvas/3D, charts, icons, typography, and interaction patterns, but the final choice must still be project-fit, accessible, performant, and maintainable.
|
|
29
|
+
|
|
30
|
+
## Zero-Based Redesign Protocol
|
|
31
|
+
|
|
32
|
+
If the user says "redesign from zero", "redesain dari 0", "ulang dari 0", "research ulang", or equivalent reset language, activate reset mode.
|
|
33
|
+
|
|
34
|
+
In reset mode:
|
|
35
|
+
- Existing UI and existing design docs are content, behavior, accessibility, and repo-evidence inputs only. They are not visual continuity sources.
|
|
36
|
+
- Replace or materially rewrite `docs/DESIGN.md` and `docs/design-intent.json` before implementation so the new contract cannot inherit old palette, typography, layout, navigation shape, component morphology, motion signature, or image placement by accident.
|
|
37
|
+
- Define a `visualResetStrategy` that names the old visual DNA being discarded and the new direction being selected from current brief, repo evidence, and live official documentation.
|
|
38
|
+
- The implementation must change composition, hierarchy, palette/typography, motion/interaction, and responsive information architecture. A palette swap, dark-mode flip, or same hero with new colors is failure.
|
|
39
|
+
- Keep product data, copy requirements, routes, accessibility needs, and required local assets intact unless the user explicitly says they may be removed.
|
|
40
|
+
- If a modern UI, animation, scroll, 3D, canvas, chart, or icon library is useful, research current official docs and record the selected library, source URL, fetched date, reason, performance risk, and reduced-motion/accessibility fallback.
|
|
41
|
+
|
|
22
42
|
## Design Quality Bar
|
|
23
43
|
|
|
24
44
|
The UI must feel authored by a strong UI/UX designer, not assembled from default cards and safe framework chrome.
|
|
@@ -29,6 +29,14 @@ Do not use this file to teach generic frontend basics the model already knows.
|
|
|
29
29
|
- External references are tainted by default. If the user supplies one, convert only explicit constraints into the current contract and do not compare against or imitate the source surface.
|
|
30
30
|
- If a new UI, animation, styling, or component library is needed, research current official docs and choose the latest stable compatible option for the project.
|
|
31
31
|
|
|
32
|
+
## Zero-Based Redesign Boundary
|
|
33
|
+
|
|
34
|
+
- If the user asks for a redesign "from zero" or equivalent reset language, treat existing UI as behavioral/content evidence only, not as visual direction.
|
|
35
|
+
- Do not preserve prior palette, typography, hero composition, navigation placement, component morphology, motion signature, or image framing unless the user explicitly requests continuity.
|
|
36
|
+
- The new UI must materially recompose at least the primary surface, content hierarchy, interaction model, and responsive information architecture.
|
|
37
|
+
- A dark-mode flip, same layout with different colors, or restyled version of the previous hero is not a zero-based redesign.
|
|
38
|
+
- Record the visual reset in `docs/DESIGN.md` and `docs/design-intent.json` before coding.
|
|
39
|
+
|
|
32
40
|
## Accessibility Split
|
|
33
41
|
|
|
34
42
|
- Treat WCAG 2.2 AA as the hard compliance floor.
|
package/.cursorrules
CHANGED
package/.windsurfrules
CHANGED
|
@@ -131,6 +131,22 @@ function buildDesignIntentContractObject({
|
|
|
131
131
|
distinctiveMoves: inferredKeywords.distinctiveMoves,
|
|
132
132
|
copiedReferenceAllowed: false,
|
|
133
133
|
},
|
|
134
|
+
externalResearchIntake: {
|
|
135
|
+
userSuppliedResearchPolicy: 'read-as-candidate-evidence-not-final-prescription',
|
|
136
|
+
requireSummaryOfUsedSignals: true,
|
|
137
|
+
requireFitFiltering: true,
|
|
138
|
+
requireOfficialDocsVerificationForTechnologyClaims: true,
|
|
139
|
+
candidateDomains: [
|
|
140
|
+
'visual-direction',
|
|
141
|
+
'motion-and-scroll',
|
|
142
|
+
'ui-primitives',
|
|
143
|
+
'canvas-3d-or-rich-media',
|
|
144
|
+
'charts-and-data-visualization',
|
|
145
|
+
'icons-and-illustration',
|
|
146
|
+
'typography-and-interaction-patterns',
|
|
147
|
+
],
|
|
148
|
+
finalDecisionAuthority: 'agent-llm-from-project-fit-accessibility-performance-maintainability-and-current-official-docs',
|
|
149
|
+
},
|
|
134
150
|
mathSystems: {
|
|
135
151
|
typographyScaleRatio: inferredKeywords.typographyScaleRatio,
|
|
136
152
|
baseGridUnit: inferredKeywords.baseGridUnit,
|
|
@@ -237,6 +253,7 @@ function buildDesignIntentContractObject({
|
|
|
237
253
|
handoffFormatVersion: 'ui-handoff-v1',
|
|
238
254
|
requirePerSurfaceMutationOps: true,
|
|
239
255
|
forbidUniformSiblingSurfaceTreatment: true,
|
|
256
|
+
zeroBasedRedesignResetsPriorVisualsWhenRequested: true,
|
|
240
257
|
semanticReviewFocus: [
|
|
241
258
|
'distinctiveness-vs-genericity',
|
|
242
259
|
'contract-fidelity',
|
|
@@ -362,6 +379,17 @@ function buildDesignIntentContractObject({
|
|
|
362
379
|
'Decision: the LLM must define hierarchy, proof, state language, and interaction behavior from the actual task.',
|
|
363
380
|
'Resolution: the LLM must define feedback, recovery, and next-useful-action behavior without defaulting to leftover template chrome.',
|
|
364
381
|
],
|
|
382
|
+
visualResetStrategy: {
|
|
383
|
+
activatesWhenUserRequests: [
|
|
384
|
+
'redesign from zero',
|
|
385
|
+
'redesain dari 0',
|
|
386
|
+
'ulang dari 0',
|
|
387
|
+
'research ulang',
|
|
388
|
+
],
|
|
389
|
+
existingUiAllowedAs: ['content-evidence', 'behavior-evidence', 'accessibility-evidence', 'asset-source-evidence'],
|
|
390
|
+
existingUiForbiddenAs: ['palette-source', 'typography-source', 'layout-source', 'motion-source', 'component-morphology-source'],
|
|
391
|
+
requiredResetAxes: ['composition', 'hierarchy', 'palette-and-typography', 'motion-or-interaction', 'responsive-information-architecture'],
|
|
392
|
+
},
|
|
365
393
|
signatureMoveRationale: 'The LLM must choose the project-specific visual, motion, typographic, compositional, or interaction move after reading current context and explain why a generic fallback would weaken the product.',
|
|
366
394
|
implementationGuardrails: {
|
|
367
395
|
requireBuildFromHandoff: true,
|
|
@@ -405,6 +433,8 @@ function buildDesignIntentContractObject({
|
|
|
405
433
|
'default-component-kit-treatment-without-product-rationale',
|
|
406
434
|
'scale-only-responsive-layout',
|
|
407
435
|
'template-shell-without-product-rationale',
|
|
436
|
+
'zero-based-redesign-kept-prior-visual-dna',
|
|
437
|
+
'restyle-instead-of-recomposition',
|
|
408
438
|
'inaccessible-or-decorative-motion',
|
|
409
439
|
],
|
|
410
440
|
validBoldSignals: [
|
|
@@ -443,6 +473,8 @@ function buildDesignIntentContractObject({
|
|
|
443
473
|
'palette-reused-without-brief-support',
|
|
444
474
|
'motion-signature-reused-without-approval',
|
|
445
475
|
'layout-shape-matches-unrelated-project-memory',
|
|
476
|
+
'prior-ui-visual-dna-carried-into-reset-request',
|
|
477
|
+
'existing-design-doc-treated-as-style-continuity-during-zero-based-redesign',
|
|
446
478
|
],
|
|
447
479
|
},
|
|
448
480
|
experiencePrinciples: [
|
|
@@ -453,6 +485,7 @@ function buildDesignIntentContractObject({
|
|
|
453
485
|
'Modern libraries and interaction patterns may be used when the LLM verifies they fit the project and current official docs.',
|
|
454
486
|
'Motion may be rich and memorable when it improves the product experience, but it must stay purposeful, performant, and optional for reduced-motion users.',
|
|
455
487
|
'At least one visual, interaction, content, or motion decision must be recognizable at a glance and justified from context.',
|
|
488
|
+
'When the user asks for a zero-based redesign, existing UI becomes content and behavior evidence only; prior visual DNA must be discarded unless explicitly approved.',
|
|
456
489
|
],
|
|
457
490
|
forbiddenPatterns: [
|
|
458
491
|
'offline-prescribed-style-used-as-final-direction',
|
|
@@ -460,6 +493,8 @@ function buildDesignIntentContractObject({
|
|
|
460
493
|
'default-component-kit-treatment-without-product-rationale',
|
|
461
494
|
'scale-only-responsive-layout',
|
|
462
495
|
'template-shell-without-product-rationale',
|
|
496
|
+
'zero-based-redesign-kept-prior-visual-dna',
|
|
497
|
+
'restyle-instead-of-recomposition',
|
|
463
498
|
'single-safe-typographic-family-without-role-contrast-or-rationale',
|
|
464
499
|
],
|
|
465
500
|
validationHints: {
|
|
@@ -475,6 +510,7 @@ function buildDesignIntentContractObject({
|
|
|
475
510
|
requireWcagHardFloor: true,
|
|
476
511
|
requireStructuredDesignExecutionPolicy: true,
|
|
477
512
|
requireStructuredDesignHandoff: true,
|
|
513
|
+
requireVisualResetStrategyWhenZeroBasedRedesignRequested: true,
|
|
478
514
|
requireReviewRubric: true,
|
|
479
515
|
requireGenericityExplanation: true,
|
|
480
516
|
genericityAutoFail: true,
|
|
@@ -752,6 +788,7 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
752
788
|
'forbidScreenshotDependency',
|
|
753
789
|
'requirePerSurfaceMutationOps',
|
|
754
790
|
'forbidUniformSiblingSurfaceTreatment',
|
|
791
|
+
'zeroBasedRedesignResetsPriorVisualsWhenRequested',
|
|
755
792
|
]) {
|
|
756
793
|
if (designIntentContract.designExecutionPolicy[requiredFlagName] !== true) {
|
|
757
794
|
validationErrors.push(`designIntent.designExecutionPolicy.${requiredFlagName} must equal true.`);
|
|
@@ -172,6 +172,10 @@ export function buildDesignBootstrapPrompt({
|
|
|
172
172
|
'26. Genericity findings must name the actual drift signal. Do not label something generic without explaining the anti-pattern or rubric dimension.',
|
|
173
173
|
'27. Review rubric must support automatic genericity failure when named drift signals dominate a redesign or new UI surface.',
|
|
174
174
|
'28. Separate taste from failure. Bold direction is allowed when it still follows the contract, serves the product, and stays accessible.',
|
|
175
|
+
'29. If a future user asks for zero-based redesign ("redesign from zero", "redesain dari 0", "ulang dari 0", or "research ulang"), treat existing UI as content and behavior evidence only, not as visual continuity.',
|
|
176
|
+
'30. In zero-based redesign mode, the new contract must name the discarded prior visual DNA and materially reset composition, hierarchy, palette/typography, motion or interaction, and responsive information architecture.',
|
|
177
|
+
'31. If modern UI, animation, scroll, 3D, canvas, chart, or icon libraries are useful, choose them from current official docs and record source URL, fetched date, reason, risk, and accessibility fallback.',
|
|
178
|
+
'32. If the user supplies research files, library lists, screenshots, articles, or benchmark notes, read them as candidate evidence, summarize the useful signals, filter by project fit, and verify technology claims against current official docs before implementation.',
|
|
175
179
|
'',
|
|
176
180
|
'## Project Inputs',
|
|
177
181
|
`- Project name: ${discoveryAnswers.projectName}`,
|
|
@@ -199,7 +203,9 @@ export function buildDesignBootstrapPrompt({
|
|
|
199
203
|
'9. Preserve repoEvidence.designEvidenceSummary when onboarding or detector evidence exists instead of discarding it.',
|
|
200
204
|
'10. If repoEvidence.designEvidenceSummary.structuredInspection exists, use it as stronger evidence for class surfaces, inline style bypasses, and expression-backed UI structure before defaulting to generic assumptions.',
|
|
201
205
|
'11. Ensure both files stay project-specific, dynamic, and practical for implementation and review. The seed may guide structure, but it must not decide style offline.',
|
|
202
|
-
'12.
|
|
206
|
+
'12. Keep visualResetStrategy in the machine-readable handoff so reset-language tasks cannot quietly become restyles of the previous UI.',
|
|
207
|
+
'13. Preserve externalResearchIntake so user-provided research becomes reviewed evidence without turning into an offline style or dependency preset.',
|
|
208
|
+
'14. After the contract exists, use it as a first-class source for future UI tasks.',
|
|
203
209
|
'',
|
|
204
210
|
].join('\n');
|
|
205
211
|
}
|
package/package.json
CHANGED
|
@@ -361,13 +361,28 @@ export function runAuditReleaseChecks(results, diagnostics) {
|
|
|
361
361
|
'ui-design-judge-advisory',
|
|
362
362
|
`ui-design-judge executed (passed=${uiDesignJudgeExecution.report.passed}, skipped=${uiDesignJudgeExecution.report.skipped}, mode=${uiDesignJudgeExecution.report.mode})`
|
|
363
363
|
);
|
|
364
|
+
|
|
365
|
+
pushResult(
|
|
366
|
+
results,
|
|
367
|
+
uiDesignJudgeExecution.report.passed === true,
|
|
368
|
+
'ui-design-judge-contract-hard-rule',
|
|
369
|
+
uiDesignJudgeExecution.report.passed === true
|
|
370
|
+
? 'UI design judge contract hard-rule passed or no blocking auto-fail was triggered'
|
|
371
|
+
: `UI design judge reported blocking design drift: ${Array.isArray(uiDesignJudgeExecution.report.findings)
|
|
372
|
+
? uiDesignJudgeExecution.report.findings
|
|
373
|
+
.filter((finding) => finding?.blockingRecommended === true)
|
|
374
|
+
.map((finding) => `${finding.area}: ${finding.problem}`)
|
|
375
|
+
.join('; ') || 'blocking drift reported without detailed findings'
|
|
376
|
+
: 'blocking drift reported without detailed findings'}`
|
|
377
|
+
);
|
|
378
|
+
|
|
364
379
|
pushResult(
|
|
365
380
|
results,
|
|
366
|
-
uiDesignJudgeExecution.report.advisoryOnly === true,
|
|
381
|
+
uiDesignJudgeExecution.report.advisoryOnly === true || uiDesignJudgeExecution.report.autoFailTriggered === true,
|
|
367
382
|
'ui-design-judge-non-blocking-policy',
|
|
368
383
|
uiDesignJudgeExecution.report.advisoryOnly === true
|
|
369
|
-
? 'UI design judge remains advisory by default
|
|
370
|
-
: 'UI design judge
|
|
384
|
+
? 'UI design judge remains advisory by default when no auto-fail drift is detected'
|
|
385
|
+
: 'UI design judge entered blocking-recommended mode because genericityAutoFail detected named drift'
|
|
371
386
|
);
|
|
372
387
|
|
|
373
388
|
const hasStructuredDesignDiagnostics = typeof uiDesignJudgeExecution.report?.summary?.designExecutionSignalCount === 'number'
|
|
@@ -19,7 +19,7 @@ export function buildSystemPrompt() {
|
|
|
19
19
|
'Treat WCAG 2.2 AA failures as hard accessibility drift.',
|
|
20
20
|
'Treat APCA as advisory perceptual tuning only. Do not set blocking solely because APCA indicates a stronger readability adjustment when WCAG hard requirements still pass.',
|
|
21
21
|
'Check focus visibility, focus appearance, target size, keyboard access, accessible authentication, and status or dynamic state access when the diff touches those surfaces.',
|
|
22
|
-
'
|
|
22
|
+
'Check design-intent.json for reviewRubric.genericityAutoFail. If true and forbiddenPatterns or genericitySignals are detected in the changed UI, this audit is no longer merely advisory for that finding: set blockingRecommended to true, mark the relevant rubric dimension as blocking, and require rebuilding the drifted surface instead of polishing it.',
|
|
23
23
|
'Focus on color intent, typographic hierarchy, responsive re-layout, purposeful motion, component morphology across states, interaction behavior, and genericity drift.',
|
|
24
24
|
'If you call something generic, explain the specific genericity signal or anti-pattern that caused that judgment.',
|
|
25
25
|
'Separate taste from failure. A bold design that follows the contract must not be penalized only because it is unusual.',
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
* Advisory-default UI design contract judge.
|
|
8
8
|
*
|
|
9
9
|
* Repo-internal workflow audit; no user-facing runtime modes.
|
|
10
|
-
* Stays advisory
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Stays advisory when no provider is configured or no auto-fail signal is found.
|
|
11
|
+
* reviewRubric.genericityAutoFail escalates named drift signals and forbidden
|
|
12
|
+
* patterns into blocking findings and blocking required actions when provider
|
|
13
|
+
* evidence is available.
|
|
13
14
|
*
|
|
14
15
|
* Validation anchors for repo governance:
|
|
15
16
|
* - Do not reward generic SaaS defaults or popular template patterns.
|
|
@@ -269,7 +270,10 @@ async function main() {
|
|
|
269
270
|
emitMachineReadableReport(buildReport({
|
|
270
271
|
provider: selectedProvider.providerName,
|
|
271
272
|
contractPresent: true,
|
|
272
|
-
|
|
273
|
+
mode: autoFailResolution.autoFailTriggered ? 'blocking-recommended' : 'advisory',
|
|
274
|
+
advisoryOnly: !autoFailResolution.autoFailTriggered,
|
|
275
|
+
passed: !autoFailResolution.autoFailTriggered,
|
|
276
|
+
autoFailTriggered: autoFailResolution.autoFailTriggered,
|
|
273
277
|
malformedVerdict: malformed,
|
|
274
278
|
summary: {
|
|
275
279
|
changedUiFileCount: changedUiFiles.length,
|