@ryuenn3123/agentic-senior-core 3.0.20 → 3.0.21
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 +12 -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 +21 -0
- package/lib/cli/project-scaffolder/prompt-builders.mjs +5 -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,18 @@ 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
|
+
## Zero-Based Redesign Protocol
|
|
23
|
+
|
|
24
|
+
If the user says "redesign from zero", "redesain dari 0", "ulang dari 0", "research ulang", or equivalent reset language, activate reset mode.
|
|
25
|
+
|
|
26
|
+
In reset mode:
|
|
27
|
+
- Existing UI and existing design docs are content, behavior, accessibility, and repo-evidence inputs only. They are not visual continuity sources.
|
|
28
|
+
- 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.
|
|
29
|
+
- 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.
|
|
30
|
+
- 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.
|
|
31
|
+
- Keep product data, copy requirements, routes, accessibility needs, and required local assets intact unless the user explicitly says they may be removed.
|
|
32
|
+
- 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.
|
|
33
|
+
|
|
22
34
|
## Design Quality Bar
|
|
23
35
|
|
|
24
36
|
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
|
@@ -237,6 +237,7 @@ function buildDesignIntentContractObject({
|
|
|
237
237
|
handoffFormatVersion: 'ui-handoff-v1',
|
|
238
238
|
requirePerSurfaceMutationOps: true,
|
|
239
239
|
forbidUniformSiblingSurfaceTreatment: true,
|
|
240
|
+
zeroBasedRedesignResetsPriorVisualsWhenRequested: true,
|
|
240
241
|
semanticReviewFocus: [
|
|
241
242
|
'distinctiveness-vs-genericity',
|
|
242
243
|
'contract-fidelity',
|
|
@@ -362,6 +363,17 @@ function buildDesignIntentContractObject({
|
|
|
362
363
|
'Decision: the LLM must define hierarchy, proof, state language, and interaction behavior from the actual task.',
|
|
363
364
|
'Resolution: the LLM must define feedback, recovery, and next-useful-action behavior without defaulting to leftover template chrome.',
|
|
364
365
|
],
|
|
366
|
+
visualResetStrategy: {
|
|
367
|
+
activatesWhenUserRequests: [
|
|
368
|
+
'redesign from zero',
|
|
369
|
+
'redesain dari 0',
|
|
370
|
+
'ulang dari 0',
|
|
371
|
+
'research ulang',
|
|
372
|
+
],
|
|
373
|
+
existingUiAllowedAs: ['content-evidence', 'behavior-evidence', 'accessibility-evidence', 'asset-source-evidence'],
|
|
374
|
+
existingUiForbiddenAs: ['palette-source', 'typography-source', 'layout-source', 'motion-source', 'component-morphology-source'],
|
|
375
|
+
requiredResetAxes: ['composition', 'hierarchy', 'palette-and-typography', 'motion-or-interaction', 'responsive-information-architecture'],
|
|
376
|
+
},
|
|
365
377
|
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
378
|
implementationGuardrails: {
|
|
367
379
|
requireBuildFromHandoff: true,
|
|
@@ -405,6 +417,8 @@ function buildDesignIntentContractObject({
|
|
|
405
417
|
'default-component-kit-treatment-without-product-rationale',
|
|
406
418
|
'scale-only-responsive-layout',
|
|
407
419
|
'template-shell-without-product-rationale',
|
|
420
|
+
'zero-based-redesign-kept-prior-visual-dna',
|
|
421
|
+
'restyle-instead-of-recomposition',
|
|
408
422
|
'inaccessible-or-decorative-motion',
|
|
409
423
|
],
|
|
410
424
|
validBoldSignals: [
|
|
@@ -443,6 +457,8 @@ function buildDesignIntentContractObject({
|
|
|
443
457
|
'palette-reused-without-brief-support',
|
|
444
458
|
'motion-signature-reused-without-approval',
|
|
445
459
|
'layout-shape-matches-unrelated-project-memory',
|
|
460
|
+
'prior-ui-visual-dna-carried-into-reset-request',
|
|
461
|
+
'existing-design-doc-treated-as-style-continuity-during-zero-based-redesign',
|
|
446
462
|
],
|
|
447
463
|
},
|
|
448
464
|
experiencePrinciples: [
|
|
@@ -453,6 +469,7 @@ function buildDesignIntentContractObject({
|
|
|
453
469
|
'Modern libraries and interaction patterns may be used when the LLM verifies they fit the project and current official docs.',
|
|
454
470
|
'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
471
|
'At least one visual, interaction, content, or motion decision must be recognizable at a glance and justified from context.',
|
|
472
|
+
'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
473
|
],
|
|
457
474
|
forbiddenPatterns: [
|
|
458
475
|
'offline-prescribed-style-used-as-final-direction',
|
|
@@ -460,6 +477,8 @@ function buildDesignIntentContractObject({
|
|
|
460
477
|
'default-component-kit-treatment-without-product-rationale',
|
|
461
478
|
'scale-only-responsive-layout',
|
|
462
479
|
'template-shell-without-product-rationale',
|
|
480
|
+
'zero-based-redesign-kept-prior-visual-dna',
|
|
481
|
+
'restyle-instead-of-recomposition',
|
|
463
482
|
'single-safe-typographic-family-without-role-contrast-or-rationale',
|
|
464
483
|
],
|
|
465
484
|
validationHints: {
|
|
@@ -475,6 +494,7 @@ function buildDesignIntentContractObject({
|
|
|
475
494
|
requireWcagHardFloor: true,
|
|
476
495
|
requireStructuredDesignExecutionPolicy: true,
|
|
477
496
|
requireStructuredDesignHandoff: true,
|
|
497
|
+
requireVisualResetStrategyWhenZeroBasedRedesignRequested: true,
|
|
478
498
|
requireReviewRubric: true,
|
|
479
499
|
requireGenericityExplanation: true,
|
|
480
500
|
genericityAutoFail: true,
|
|
@@ -752,6 +772,7 @@ export function validateDesignIntentContract(designIntentContract) {
|
|
|
752
772
|
'forbidScreenshotDependency',
|
|
753
773
|
'requirePerSurfaceMutationOps',
|
|
754
774
|
'forbidUniformSiblingSurfaceTreatment',
|
|
775
|
+
'zeroBasedRedesignResetsPriorVisualsWhenRequested',
|
|
755
776
|
]) {
|
|
756
777
|
if (designIntentContract.designExecutionPolicy[requiredFlagName] !== true) {
|
|
757
778
|
validationErrors.push(`designIntent.designExecutionPolicy.${requiredFlagName} must equal true.`);
|
|
@@ -172,6 +172,9 @@ 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.',
|
|
175
178
|
'',
|
|
176
179
|
'## Project Inputs',
|
|
177
180
|
`- Project name: ${discoveryAnswers.projectName}`,
|
|
@@ -199,7 +202,8 @@ export function buildDesignBootstrapPrompt({
|
|
|
199
202
|
'9. Preserve repoEvidence.designEvidenceSummary when onboarding or detector evidence exists instead of discarding it.',
|
|
200
203
|
'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
204
|
'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.
|
|
205
|
+
'12. Keep visualResetStrategy in the machine-readable handoff so reset-language tasks cannot quietly become restyles of the previous UI.',
|
|
206
|
+
'13. After the contract exists, use it as a first-class source for future UI tasks.',
|
|
203
207
|
'',
|
|
204
208
|
].join('\n');
|
|
205
209
|
}
|
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,
|