@ryuenn3123/agentic-senior-core 3.0.43 → 3.0.45

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.
@@ -64,6 +64,8 @@ function buildAnchorCommitmentHeader(designIntent) {
64
64
  const conceptualAnchor = designIntent.conceptualAnchor || {};
65
65
  const derivedTokenLogic = designIntent.derivedTokenLogic || {};
66
66
  const creativeCommitment = designIntent.designExecutionHandoff?.creativeCommitment || {};
67
+ const designFlexibilityPolicy = designIntent.designFlexibilityPolicy || {};
68
+ const expressionFlexibility = designIntent.designExecutionHandoff?.expressionFlexibility || {};
67
69
  const anchorReference = conceptualAnchor.anchorReference || derivedTokenLogic.anchorReference;
68
70
  const conceptualAnchorName = conceptualAnchor.name || anchorReference;
69
71
  const signatureMove = conceptualAnchor.signatureMove
@@ -74,6 +76,12 @@ function buildAnchorCommitmentHeader(designIntent) {
74
76
  const typographicDecision = conceptualAnchor.typographicDecision
75
77
  || creativeCommitment.typographicDecision
76
78
  || derivedTokenLogic.typographyDerivationSource;
79
+ const flexibleAxes = Array.isArray(designFlexibilityPolicy.flexibleExpressionAxes)
80
+ ? designFlexibilityPolicy.flexibleExpressionAxes
81
+ : expressionFlexibility.flexibleAxes;
82
+ const lockedOutcomes = Array.isArray(expressionFlexibility.lockedOutcomes)
83
+ ? expressionFlexibility.lockedOutcomes
84
+ : designFlexibilityPolicy.lockedOutcomeTypes;
77
85
 
78
86
  if (!conceptualAnchorName && !anchorReference) {
79
87
  return [
@@ -92,6 +100,8 @@ function buildAnchorCommitmentHeader(designIntent) {
92
100
  `Signature Move: ${toSingleLine(signatureMove, 'MISSING - define one concrete authored move before UI implementation')}`,
93
101
  `Motion Signature: ${toSingleLine(signatureMotion, 'MISSING - define timing/easing/choreography before UI implementation')}`,
94
102
  `Typographic Decision: ${toSingleLine(typographicDecision, 'MISSING - define role contrast before UI implementation')}`,
103
+ `Locked Outcomes: ${toSingleLine(Array.isArray(lockedOutcomes) ? lockedOutcomes.join(', ') : '', 'user goals, accessibility, production readiness, forbidden patterns')}`,
104
+ `Flexible Expression: ${toSingleLine(Array.isArray(flexibleAxes) ? flexibleAxes.join(', ') : '', 'exact primitives, typeface, surface treatment, component skin, candidate moves')}`,
95
105
  'If the UI output does not reflect these lines, stop and revise the design contract before continuing.',
96
106
  ].join('\n');
97
107
  }
@@ -412,7 +422,9 @@ export async function buildCompiledRulesContent({
412
422
  '3. .agent-context/prompts/review-code.md -> review, audit, check, analyze',
413
423
  '4. .agent-context/prompts/bootstrap-design.md -> ui, ux, layout, screen, tailwind, frontend, redesign',
414
424
  'Documentation-first policy:',
415
- '- Create or refine required project docs before implementation: docs/project-brief.md, docs/architecture-decision-record.md, docs/flow-overview.md, docs/api-contract.md when APIs, firmware endpoints, CLI commands, or web application flows exist, docs/database-schema.md when persistent data exists, and docs/DESIGN.md plus docs/design-intent.json for UI scope.',
425
+ '- Create or refine required project docs before implementation: README.md for every fresh or existing project; docs/project-brief.md; docs/architecture-decision-record.md; docs/flow-overview.md; docs/api-contract.md when APIs, firmware endpoints, CLI commands, or web application flows exist; docs/database-schema.md when persistent data exists; and docs/DESIGN.md plus docs/design-intent.json for UI scope.',
426
+ '- Keep README.md public and developer friendly, including for private projects: explain what the project is, who it is for, setup, usage, configuration, and links to deeper docs. Do not put secrets, internal agent notes, private reasoning, or governance policy dumps in it.',
427
+ '- Keep docs complete but compact. Add extra docs files only for stable, distinct, or long workflows such as hardware setup, deployment, operations, testing validation, or troubleshooting.',
416
428
  '- Write formal project docs in English by default unless the user explicitly asks for another documentation language.',
417
429
  '- For docs-only/docs-first requests, do not write application, firmware, or UI code until the user asks or approves an implementation plan.',
418
430
  'UI trigger policy:',
@@ -533,6 +545,7 @@ export async function buildCompiledRulesContent({
533
545
  const hasBootstrapDesignPrompt = await pathExists(bootstrapDesignPromptPath);
534
546
 
535
547
  if (await pathExists(projectBriefPath)) {
548
+ const hasRootReadme = await pathExists(path.join(resolvedTargetDirectoryPath, 'README.md'));
536
549
  const projectDocsEntries = ['project-brief.md'];
537
550
  const candidateDocFileNames = [
538
551
  'architecture-decision-record.md',
@@ -555,15 +568,18 @@ export async function buildCompiledRulesContent({
555
568
  '## LAYER 9: PROJECT CONTEXT (MANDATORY)',
556
569
  'These documents describe the specific project being built.',
557
570
  'Read them before writing any application code:',
558
- ...projectDocsEntries.map((docFileName, docIndex) => `${docIndex + 1}. docs/${docFileName}`),
571
+ ...(hasRootReadme ? ['1. README.md'] : []),
572
+ ...projectDocsEntries.map((docFileName, docIndex) => `${(hasRootReadme ? 2 : 1) + docIndex}. docs/${docFileName}`),
559
573
  '',
560
574
  'Universal SOP hard block policy:',
575
+ '- README.md must exist and read as a public and developer entrypoint.',
561
576
  '- Stop implementation if docs/project-brief.md is missing.',
562
577
  '- Stop implementation if docs/architecture-decision-record.md (alias: docs/Architecture-Decision-Record.md) is missing.',
563
578
  '- Stop implementation if docs/flow-overview.md is missing.',
564
579
  '- If the product uses persistent data, docs/database-schema.md must exist before coding continues.',
565
580
  '- If the product exposes API or web application flows, docs/api-contract.md must exist before coding continues.',
566
581
  '- For UI scope, stop implementation if docs/DESIGN.md or docs/design-intent.json is missing.',
582
+ '- Keep README.md overview-level, public, and developer friendly; do not put secrets, internal agent notes, private reasoning, or governance policy dumps in it.',
567
583
  '- Materialize missing docs first, then continue coding.',
568
584
  '- Bootstrap missing docs from real repo evidence and the latest user request. Do not write generic placeholder templates.',
569
585
  '- Separate confirmed facts from assumptions and end each major explanation with the next validation action.',
@@ -573,7 +589,7 @@ export async function buildCompiledRulesContent({
573
589
  'Latest user prompt defines current feature scope and product direction.',
574
590
  'Treat requested features as dynamic, but keep stack/database/auth constraints consistent',
575
591
  'with project docs unless the user explicitly asks for a migration.',
576
- 'When scope changes, implement the new request and update docs/* in the same change',
592
+ 'When scope changes, implement the new request and update README.md plus docs/* in the same change when documented context changes',
577
593
  'so generated context stays aligned with the codebase.',
578
594
  'Update them as the project evolves. They are living references, not frozen specs.',
579
595
  ].join('\n')
@@ -595,6 +611,7 @@ export async function buildCompiledRulesContent({
595
611
  ...bootstrapPromptEntries.map((promptFilePath, promptIndex) => `${promptIndex + 1}. ${promptFilePath}`),
596
612
  '',
597
613
  'Bootstrap policy:',
614
+ '- Create README.md as a public and developer entrypoint before coding continues.',
598
615
  '- Hard block: do not write application code until docs/project-brief.md and docs/architecture-decision-record.md exist.',
599
616
  '- docs/flow-overview.md must also exist before coding continues.',
600
617
  '- Add docs/database-schema.md when persistent data is involved.',
@@ -113,6 +113,36 @@ export function validateDesignIntentContract(designIntentContract) {
113
113
  }
114
114
  }
115
115
 
116
+ if (!designIntentContract.designFlexibilityPolicy || typeof designIntentContract.designFlexibilityPolicy !== 'object') {
117
+ validationErrors.push('designIntent.designFlexibilityPolicy must exist.');
118
+ } else {
119
+ const designFlexibilityPolicy = designIntentContract.designFlexibilityPolicy;
120
+ if (designFlexibilityPolicy.mode !== 'locked-outcomes-flexible-expression') {
121
+ validationErrors.push('designIntent.designFlexibilityPolicy.mode must equal "locked-outcomes-flexible-expression".');
122
+ }
123
+ if (!hasNonEmptyString(designFlexibilityPolicy.contractRole)) {
124
+ validationErrors.push('designIntent.designFlexibilityPolicy.contractRole must be a non-empty string.');
125
+ }
126
+ if (!Array.isArray(designFlexibilityPolicy.lockedOutcomeTypes) || designFlexibilityPolicy.lockedOutcomeTypes.length < 4) {
127
+ validationErrors.push('designIntent.designFlexibilityPolicy.lockedOutcomeTypes must list the locked outcome categories.');
128
+ }
129
+ if (!Array.isArray(designFlexibilityPolicy.flexibleExpressionAxes) || designFlexibilityPolicy.flexibleExpressionAxes.length < 4) {
130
+ validationErrors.push('designIntent.designFlexibilityPolicy.flexibleExpressionAxes must list flexible expression axes.');
131
+ }
132
+ if (!hasNonEmptyString(designFlexibilityPolicy.tokenLockingRule)) {
133
+ validationErrors.push('designIntent.designFlexibilityPolicy.tokenLockingRule must be a non-empty string.');
134
+ }
135
+ if (!String(designFlexibilityPolicy.signatureMovePolicy || '').includes('candidate')) {
136
+ validationErrors.push('designIntent.designFlexibilityPolicy.signatureMovePolicy must separate candidate moves from required outcomes.');
137
+ }
138
+ if (!String(designFlexibilityPolicy.libraryVisualLanguagePolicy || '').includes('Libraries supply')) {
139
+ validationErrors.push('designIntent.designFlexibilityPolicy.libraryVisualLanguagePolicy must keep libraries from dictating visual language.');
140
+ }
141
+ if (!String(designFlexibilityPolicy.literalAnchorPolicy || '').includes('Translate anchors')) {
142
+ validationErrors.push('designIntent.designFlexibilityPolicy.literalAnchorPolicy must require non-literal anchor translation.');
143
+ }
144
+ }
145
+
116
146
  if (!designIntentContract.conceptualAnchor || typeof designIntentContract.conceptualAnchor !== 'object') {
117
147
  validationErrors.push('designIntent.conceptualAnchor must exist.');
118
148
  } else {
@@ -228,6 +258,20 @@ export function validateDesignIntentContract(designIntentContract) {
228
258
  validationErrors.push('designIntent.conceptualAnchor.visualRiskBudget.requireReducedMotionFallback must equal true.');
229
259
  }
230
260
  }
261
+ const literalTranslationPolicy = conceptualAnchor.literalTranslationPolicy;
262
+ if (!literalTranslationPolicy || typeof literalTranslationPolicy !== 'object') {
263
+ validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy must exist.');
264
+ } else {
265
+ if (literalTranslationPolicy.preferNonLiteralTranslation !== true) {
266
+ validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy.preferNonLiteralTranslation must equal true.');
267
+ }
268
+ if (!hasNonEmptyString(literalTranslationPolicy.allowedLiteralUse)) {
269
+ validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy.allowedLiteralUse must be a non-empty string.');
270
+ }
271
+ if (!String(literalTranslationPolicy.forbiddenLiteralUse || '').includes('decorative wallpaper')) {
272
+ validationErrors.push('designIntent.conceptualAnchor.literalTranslationPolicy.forbiddenLiteralUse must reject decorative wallpaper.');
273
+ }
274
+ }
231
275
  if (
232
276
  !Array.isArray(conceptualAnchor.requiredDerivedAxes)
233
277
  || !conceptualAnchor.requiredDerivedAxes.includes('typography')
@@ -392,6 +436,20 @@ export function validateDesignIntentContract(designIntentContract) {
392
436
  if (designIntentContract.tokenSystem.componentTokensConsumeSemantic !== true) {
393
437
  validationErrors.push('designIntent.tokenSystem.componentTokensConsumeSemantic must equal true.');
394
438
  }
439
+ const tokenLockingPolicy = designIntentContract.tokenSystem.tokenLockingPolicy;
440
+ if (!tokenLockingPolicy || typeof tokenLockingPolicy !== 'object') {
441
+ validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy must exist.');
442
+ } else {
443
+ if (tokenLockingPolicy.defaultLockState !== 'semantic-roles-locked-primitives-flexible') {
444
+ validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy.defaultLockState must preserve semantic roles while keeping primitives flexible.');
445
+ }
446
+ if (!Array.isArray(tokenLockingPolicy.flexibleByDefault) || tokenLockingPolicy.flexibleByDefault.length < 4) {
447
+ validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy.flexibleByDefault must list flexible primitive axes.');
448
+ }
449
+ if (!hasNonEmptyString(tokenLockingPolicy.promotionRule)) {
450
+ validationErrors.push('designIntent.tokenSystem.tokenLockingPolicy.promotionRule must be a non-empty string.');
451
+ }
452
+ }
395
453
  const fallbackPolicy = designIntentContract.tokenSystem.fallbackPolicy;
396
454
  if (!fallbackPolicy || typeof fallbackPolicy !== 'object') {
397
455
  validationErrors.push('designIntent.tokenSystem.fallbackPolicy must exist.');
@@ -589,6 +647,10 @@ export function validateDesignIntentContract(designIntentContract) {
589
647
  'requireStructuredHandoff',
590
648
  'requireRepoEvidenceAlignment',
591
649
  'forbidScreenshotDependency',
650
+ 'separateRequiredOutcomesFromCandidateMoves',
651
+ 'forbidCandidateMovesAsLockedRequirements',
652
+ 'forbidLibraryThemeAsVisualAuthority',
653
+ 'forbidLiteralAnchorChromeWithoutProductFunction',
592
654
  'requirePerSurfaceMutationOps',
593
655
  'forbidUniformSiblingSurfaceTreatment',
594
656
  'zeroBasedRedesignResetsPriorVisualsWhenRequested',
@@ -674,6 +736,23 @@ export function validateDesignIntentContract(designIntentContract) {
674
736
  if (!Array.isArray(designIntentContract.designExecutionHandoff.interactionStateMatrix) || designIntentContract.designExecutionHandoff.interactionStateMatrix.length < 1) {
675
737
  validationErrors.push('designIntent.designExecutionHandoff.interactionStateMatrix must list key component state expectations.');
676
738
  }
739
+ const expressionFlexibility = designIntentContract.designExecutionHandoff.expressionFlexibility;
740
+ if (!expressionFlexibility || typeof expressionFlexibility !== 'object') {
741
+ validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility must exist.');
742
+ } else {
743
+ if (!Array.isArray(expressionFlexibility.lockedOutcomes) || expressionFlexibility.lockedOutcomes.length < 3) {
744
+ validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.lockedOutcomes must list locked outcomes.');
745
+ }
746
+ if (!Array.isArray(expressionFlexibility.candidateSignatureMoves) || expressionFlexibility.candidateSignatureMoves.length < 1) {
747
+ validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.candidateSignatureMoves must include at least one candidate move placeholder.');
748
+ }
749
+ if (!Array.isArray(expressionFlexibility.flexibleAxes) || expressionFlexibility.flexibleAxes.length < 4) {
750
+ validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.flexibleAxes must list flexible implementation axes.');
751
+ }
752
+ if (!String(expressionFlexibility.lockingRule || '').includes('candidate')) {
753
+ validationErrors.push('designIntent.designExecutionHandoff.expressionFlexibility.lockingRule must explain when candidate moves become required.');
754
+ }
755
+ }
677
756
  if (!Array.isArray(designIntentContract.designExecutionHandoff.taskFlowNarrative) || designIntentContract.designExecutionHandoff.taskFlowNarrative.length < 2) {
678
757
  validationErrors.push('designIntent.designExecutionHandoff.taskFlowNarrative must describe the key UI task flow in sequence.');
679
758
  }
@@ -707,6 +786,8 @@ export function validateDesignIntentContract(designIntentContract) {
707
786
  'requireBuildFromHandoff',
708
787
  'requireGapNotesBeforeFallback',
709
788
  'forbidGenericLayoutFallbackWithoutReason',
789
+ 'requireLockedVsFlexibleDecisionReview',
790
+ 'forbidCandidateMoveHardcoding',
710
791
  'forbidTestingDemoCopyInUi',
711
792
  'forbidTerminalOnlyUserFlows',
712
793
  ]) {
@@ -21,9 +21,14 @@ const GENERICITY_DRIFT_SIGNALS = [
21
21
  'timid-anchor-that-renames-dashboard-or-admin-shell',
22
22
  'motion-suppressed-without-accessibility-or-performance-reason',
23
23
  'motion-or-3d-omitted-from-fear-without-fit-analysis',
24
+ 'modern-library-rejected-from-dependency-fear-without-tradeoff-analysis',
25
+ 'component-library-selected-by-habit-without-product-fit',
24
26
  'scale-only-responsive-layout',
25
27
  'zero-based-redesign-kept-prior-visual-dna',
26
28
  'restyle-instead-of-recomposition',
29
+ 'literal-anchor-artifacts-used-as-required-ui-chrome',
30
+ 'candidate-signature-move-treated-as-locked-implementation',
31
+ 'library-theme-tokens-drive-visual-language',
27
32
  ];
28
33
 
29
34
  const FORBIDDEN_PATTERN_SIGNALS = [
@@ -41,6 +46,8 @@ const VALID_BOLD_SIGNALS = [
41
46
  'background-or-geometry-serves-product-function',
42
47
  'motion-or-spatial-experience-derived-from-anchor',
43
48
  'explicit-3d-canvas-fit-or-nonfit-decision',
49
+ 'official-docs-backed-modern-library-choice',
50
+ 'headless-or-component-primitive-restyled-to-product-language',
44
51
  'responsive-recomposition-by-task-priority',
45
52
  'purposeful-motion-with-reduced-motion-path',
46
53
  ];
@@ -176,7 +183,30 @@ function buildDesignIntentContractObject({
176
183
  'ui-primitives-or-rich-media',
177
184
  'typography-and-interaction',
178
185
  ],
179
- finalDecisionAuthority: 'project-fit-accessibility-performance-maintainability-official-docs',
186
+ finalDecisionAuthority: 'project-fit-accessibility-performance-maintainability-delivery-speed-official-docs',
187
+ },
188
+ designFlexibilityPolicy: {
189
+ mode: 'locked-outcomes-flexible-expression',
190
+ contractRole: 'Use docs/design-intent.json as review invariants and handoff structure, not as a frozen visual recipe unless the user explicitly locks a decision.',
191
+ lockedOutcomeTypes: [
192
+ 'confirmed-user-goals',
193
+ 'repo-evidence-and-runtime-constraints',
194
+ 'accessibility-and-production-readiness',
195
+ 'forbidden-patterns-and-safety-gates',
196
+ 'user-approved-brand-or-continuity-decisions',
197
+ ],
198
+ flexibleExpressionAxes: [
199
+ 'exact-palette-primitives',
200
+ 'font-family-selection',
201
+ 'radius-shadow-and-surface-treatment',
202
+ 'component-kit-theme-mapping',
203
+ 'signature-move-implementation',
204
+ 'literal-anchor-artifacts',
205
+ ],
206
+ tokenLockingRule: 'Semantic roles are required, but exact primitive values stay flexible until repo evidence, accessibility validation, implementation constraints, or explicit user approval locks them.',
207
+ signatureMovePolicy: 'Record the required experience outcome separately from candidate implementation moves; replace a candidate move when another move better fits the product.',
208
+ libraryVisualLanguagePolicy: 'Libraries supply behavior, accessibility, primitives, and delivery speed; they must not dictate final composition, theme, morphology, or visual language.',
209
+ literalAnchorPolicy: 'Translate anchors into workflow, hierarchy, density, typography, material behavior, state language, and interaction grammar before requiring literal props, marks, or chrome.',
180
210
  },
181
211
  conceptualAnchor: {
182
212
  mode: 'required-when-no-external-research',
@@ -228,8 +258,14 @@ function buildDesignIntentContractObject({
228
258
  mode: 'high-distinctiveness-with-accessibility-and-performance-guardrails',
229
259
  allowRichMotionAndMicroInteraction: true,
230
260
  rejectTimidDefaultWhenAnchorSupportsExpressiveUi: true,
261
+ rejectDependencyFearAsDownshiftReason: true,
231
262
  requireReducedMotionFallback: true,
232
263
  },
264
+ literalTranslationPolicy: {
265
+ preferNonLiteralTranslation: true,
266
+ allowedLiteralUse: 'Only use literal anchor artifacts when they serve a named product function, control, state, or task overlay.',
267
+ forbiddenLiteralUse: 'Do not turn anchor artifacts into decorative wallpaper, required chrome, default texture, or unavoidable theme props.',
268
+ },
233
269
  requiredDerivedAxes: [
234
270
  'typography',
235
271
  'morphology',
@@ -267,7 +303,7 @@ function buildDesignIntentContractObject({
267
303
  spacingDerivationSource: 'Explain spacing rhythm, density, and exceptions from anchorReference. Spacing grids are layout math, not decorative background lines.',
268
304
  typographyDerivationSource: 'Explain display, body, metadata, and data roles from anchorReference.',
269
305
  motionDerivationSource: 'Explain duration, easing, choreography, and reduced-motion from anchorReference.',
270
- validationRule: 'Every token must trace to anchorReference; revise tokens that cannot.',
306
+ validationRule: 'Every semantic token role must trace to anchorReference; keep exact primitive values flexible unless locked by repo evidence, accessibility validation, implementation constraints, or explicit user approval.',
271
307
  },
272
308
  motionPaletteDecision: {
273
309
  productCategorySignal: 'agent-inferred-starting-heuristic',
@@ -306,7 +342,7 @@ function buildDesignIntentContractObject({
306
342
  'spatial-or-3d-fit',
307
343
  'performance-and-reduced-motion-fallback',
308
344
  ],
309
- rejectionRule: 'State a product reason and replacement interaction quality before omitting 3D/canvas.',
345
+ rejectionRule: 'State a product reason and replacement interaction quality before omitting 3D/canvas. Package count or vague performance fear is not enough.',
310
346
  reviewQuestion: 'Is the interaction as expressive as the product can responsibly support?',
311
347
  },
312
348
  reviewQuestion: 'What visible evidence proves this is product-specific?',
@@ -329,11 +365,12 @@ function buildDesignIntentContractObject({
329
365
  libraryDecisions: [
330
366
  {
331
367
  library: 'agent-defined-or-none',
332
- purpose: 'Verify UI-related libraries against current official docs before imports.',
368
+ purpose: 'Select UI-related libraries dynamically from product fit, accessibility, interaction quality, maintenance, and current official docs before imports.',
333
369
  verifiedAt: null,
334
370
  sourceUrl: null,
335
371
  stableVersion: null,
336
372
  fallbackIfUnavailable: 'Use native CSS, browser APIs, or existing dependencies.',
373
+ selectionPolicy: 'Do not default to shadcn, native-only, Tailwind-only, or dependency avoidance by habit.',
337
374
  },
338
375
  ],
339
376
  mathSystems: {
@@ -357,6 +394,12 @@ function buildDesignIntentContractObject({
357
394
  forbidRawSpacingOutsidePrimitives: true,
358
395
  requireDocumentedExceptionForLegacyBypass: true,
359
396
  },
397
+ tokenLockingPolicy: {
398
+ defaultLockState: 'semantic-roles-locked-primitives-flexible',
399
+ lockedByDefault: ['semantic-role-purpose', 'accessibility-floor', 'state-role-meaning'],
400
+ flexibleByDefault: ['exact-color-values', 'font-family', 'radius-values', 'shadow-values', 'component-skin'],
401
+ promotionRule: 'Promote flexible tokens to locked only when user approval, repo evidence, accessibility validation, or implementation constraints require it.',
402
+ },
360
403
  namingConstraints: {
361
404
  forbidCurlyBracesInNames: true,
362
405
  forbidDotsInNames: true,
@@ -430,6 +473,10 @@ function buildDesignIntentContractObject({
430
473
  requireStructuredHandoff: true,
431
474
  requireRepoEvidenceAlignment: true,
432
475
  forbidScreenshotDependency: true,
476
+ separateRequiredOutcomesFromCandidateMoves: true,
477
+ forbidCandidateMovesAsLockedRequirements: true,
478
+ forbidLibraryThemeAsVisualAuthority: true,
479
+ forbidLiteralAnchorChromeWithoutProductFunction: true,
433
480
  handoffFormatVersion: 'ui-handoff-v1',
434
481
  requirePerSurfaceMutationOps: true,
435
482
  forbidUniformSiblingSurfaceTreatment: true,
@@ -531,6 +578,26 @@ function buildDesignIntentContractObject({
531
578
  notes: 'Refine states from project language and anchor; reject anonymous panels.',
532
579
  },
533
580
  ],
581
+ expressionFlexibility: {
582
+ lockedOutcomes: [
583
+ 'preserve-primary-user-goal',
584
+ 'preserve-accessibility-floor',
585
+ 'preserve-production-content-policy',
586
+ 'preserve-forbidden-patterns',
587
+ ],
588
+ candidateSignatureMoves: [
589
+ 'agent-defined-candidate-move-not-locked-until-refined',
590
+ ],
591
+ flexibleAxes: [
592
+ 'palette-primitives',
593
+ 'typeface-choice',
594
+ 'surface-treatment',
595
+ 'component-library-skin',
596
+ 'motion-implementation',
597
+ 'anchor-artifact-literalness',
598
+ ],
599
+ lockingRule: 'A candidate move becomes required only after repo evidence, product function, accessibility need, or explicit user approval makes it necessary.',
600
+ },
534
601
  taskFlowNarrative: [
535
602
  `Entry: start ${projectName} from real evidence, not a generic opener.`,
536
603
  'Resolution: define proof, feedback, recovery, and next action.',
@@ -558,6 +625,8 @@ function buildDesignIntentContractObject({
558
625
  requireBuildFromHandoff: true,
559
626
  requireGapNotesBeforeFallback: true,
560
627
  forbidGenericLayoutFallbackWithoutReason: true,
628
+ requireLockedVsFlexibleDecisionReview: true,
629
+ forbidCandidateMoveHardcoding: true,
561
630
  forbidTestingDemoCopyInUi: true,
562
631
  forbidTerminalOnlyUserFlows: true,
563
632
  },
@@ -44,8 +44,11 @@ export function buildProjectContextBootstrapPrompt({
44
44
  ? discoveryAnswers.features.map((feature, featureIndex) => `${featureIndex + 1}. ${feature}`).join('\n')
45
45
  : 'Derive the first concrete feature set from the project name, description, and domain. Do not invent arbitrary modules just to fill space.';
46
46
 
47
- const expectedDocsList = expectedDocFileNames
48
- .map((fileName, fileIndex) => `${fileIndex + 1}. docs/${fileName}`)
47
+ const expectedDocsList = [
48
+ 'README.md',
49
+ ...expectedDocFileNames.map((fileName) => `docs/${fileName}`),
50
+ ]
51
+ .map((filePath, fileIndex) => `${fileIndex + 1}. ${filePath}`)
49
52
  .join('\n');
50
53
 
51
54
  return [
@@ -73,7 +76,9 @@ export function buildProjectContextBootstrapPrompt({
73
76
  '10. Do not invent modules or architecture layers only to make the docs look complete.',
74
77
  '11. If runtime or framework setup is unresolved, recommend the latest stable compatible option from the brief, constraints, and live official documentation before coding. If an official setup flow yields newer, better-supported defaults than manual package assembly, use that path after approval.',
75
78
  '12. Treat topology as an agent decision unless the user explicitly constrained it. If monolith fits, explain why. If a service split fits, document the evidence and service boundary logic.',
76
- '13. Required docs coverage must include feature plan, architecture rationale, flow, public API or integration contracts when relevant, data model when relevant, UI/design when relevant, security assumptions, testing strategy, runtime/deployment notes, and next validation actions.',
79
+ '13. Required docs coverage must include a public and developer README entrypoint, feature plan, architecture rationale, flow, public API or integration contracts when relevant, data model when relevant, UI/design when relevant, security assumptions, testing strategy, runtime/deployment notes, and next validation actions.',
80
+ '14. README.md must be public and developer friendly, including for private projects: what it is, who it is for, setup, core workflow, configuration, and links to deeper docs. Do not include secrets, internal agent notes, private reasoning, or governance policy dumps.',
81
+ '15. Keep docs complete but compact. Add extra docs files only for stable, distinct, or long workflows such as hardware setup, deployment, operations, testing validation, or troubleshooting.',
77
82
  '',
78
83
  '## Project Inputs',
79
84
  `- Project name: ${discoveryAnswers.projectName}`,
@@ -101,8 +106,9 @@ export function buildProjectContextBootstrapPrompt({
101
106
  '1. Create all required docs files listed above with complete Markdown content.',
102
107
  '2. Make the docs adaptive to the real repo and prompt context. These are living references, not frozen templates.',
103
108
  '3. In docs/project-brief.md and docs/architecture-decision-record.md, include explicit sections for confirmed facts, assumptions to validate, and next validation actions whenever context is incomplete.',
104
- '4. Keep content original, specific to this project, and actionable for implementation.',
105
- '5. After writing docs, continue coding tasks using these docs as living project context.',
109
+ '4. Before implementation, use the docs to confirm stack, runtime, architecture, public contracts, data, validation, and delivery assumptions.',
110
+ '5. Keep content original, specific to this project, and actionable for implementation.',
111
+ '6. After writing docs, continue coding tasks using these docs as living project context.',
106
112
  '',
107
113
  ].join('\n');
108
114
  }
@@ -155,28 +161,29 @@ export function buildDesignBootstrapPrompt({
155
161
  '4. designPhilosophy',
156
162
  '5. visualDirection',
157
163
  '6. externalResearchIntake',
158
- '7. conceptualAnchor',
159
- '8. derivedTokenLogic',
160
- '9. motionPaletteDecision',
161
- '10. aiSafeUiAudit',
162
- '11. productionContentPolicy',
163
- '12. libraryResearchStatus',
164
- '13. libraryDecisions',
165
- '14. mathSystems',
166
- '15. tokenSystem',
167
- '16. colorTruth',
168
- '17. crossViewportAdaptation',
169
- '18. motionSystem',
170
- '19. componentMorphology',
171
- '20. accessibilityPolicy',
172
- '21. designExecutionPolicy',
173
- '22. designExecutionHandoff',
174
- '23. reviewRubric',
175
- '24. contextHygiene',
176
- '25. forbiddenPatterns',
177
- '26. requiredDesignSections',
178
- '27. implementation',
179
- '28. repoEvidence when onboarding or detector evidence exists',
164
+ '7. designFlexibilityPolicy',
165
+ '8. conceptualAnchor',
166
+ '9. derivedTokenLogic',
167
+ '10. motionPaletteDecision',
168
+ '11. aiSafeUiAudit',
169
+ '12. productionContentPolicy',
170
+ '13. libraryResearchStatus',
171
+ '14. libraryDecisions',
172
+ '15. mathSystems',
173
+ '16. tokenSystem',
174
+ '17. colorTruth',
175
+ '18. crossViewportAdaptation',
176
+ '19. motionSystem',
177
+ '20. componentMorphology',
178
+ '21. accessibilityPolicy',
179
+ '22. designExecutionPolicy',
180
+ '23. designExecutionHandoff',
181
+ '24. reviewRubric',
182
+ '25. contextHygiene',
183
+ '26. forbiddenPatterns',
184
+ '27. requiredDesignSections',
185
+ '28. implementation',
186
+ '29. repoEvidence when onboarding or detector evidence exists',
180
187
  '',
181
188
  '## Mechanical Gates',
182
189
  '1. Do not copy external style guides.',
@@ -191,6 +198,7 @@ export function buildDesignBootstrapPrompt({
191
198
  '10. Define viewport mutation rules for mobile, tablet, and desktop. Shrinking desktop is failure.',
192
199
  '11. Keep structured execution representation-first: surface plan, component graph, content-priority map, viewport mutation plan, and interaction-state matrix.',
193
200
  '12. Make design-intent.json carry designExecutionPolicy and designExecutionHandoff, not prose-only policy.',
201
+ '12a. Make design-intent.json carry designFlexibilityPolicy so locked outcomes, candidate moves, and flexible expression axes stay separate.',
194
202
  '13. Keep semantic review focused on contract fidelity, distinctiveness, hierarchy, state behavior, and viewport mutation.',
195
203
  '14. Treat WCAG 2.2 AA as the hard floor. Use APCA only as advisory tuning.',
196
204
  '15. Cover focus visibility, focus appearance, target size, accessible authentication, keyboard access, and dynamic status/state access.',
@@ -208,13 +216,18 @@ export function buildDesignBootstrapPrompt({
208
216
  '27. Reject anchors described only as modern, clean, premium, expressive, minimal, or bold.',
209
217
  '28. Set conceptualAnchor.anchorReference and make derivedTokenLogic.anchorReference match exactly.',
210
218
  '29. Fill derivedTokenLogic before code. If a token cannot trace to anchorReference, revise it.',
219
+ '29a. Lock semantic roles before exact values. Do not freeze fonts, color primitives, radius, shadows, or component-kit theme treatment unless repo evidence, accessibility validation, implementation constraints, or explicit user approval requires it.',
211
220
  '30. Research current official docs before importing any new UI-related library.',
212
- '31. If research is unavailable, set libraryResearchStatus to pending-verification and use native CSS, browser APIs, or existing dependencies.',
213
- '32. Define reviewRubric and require genericity findings to name the actual drift signal.',
214
- '33. Separate taste from failure. Bold accessible work is valid.',
215
- '34. For zero-based redesign, create visualResetStrategy and reset composition, hierarchy, palette/typography, motion or interaction, and responsive information architecture.',
216
- '35. Treat productionContentPolicy as blocking: remove visible testing, demo, sample, placeholder, lorem, TODO, coming soon, and scaffold copy unless it is a real product state.',
217
- '36. Do not make core user workflows terminal-only unless the product is explicitly a CLI, developer tool, or operational runbook.',
221
+ '31. Do not default to shadcn/ui, Tailwind-only, native-only, or any component kit by habit; choose the UI foundation from product fit, accessibility, interaction quality, runtime constraints, and official docs.',
222
+ '32. If research is unavailable, set libraryResearchStatus to pending-verification and use native CSS, browser APIs, or existing dependencies only when they can preserve the intended ambition.',
223
+ '33. Do not reject modern lightweight libraries solely because they add a dependency; package count or vague performance fear is not a blocker by itself.',
224
+ '34. Define reviewRubric and require genericity findings to name the actual drift signal.',
225
+ '35. Separate taste from failure. Bold accessible work is valid.',
226
+ '36. For zero-based redesign, create visualResetStrategy and reset composition, hierarchy, palette/typography, motion or interaction, and responsive information architecture.',
227
+ '37. Treat productionContentPolicy as blocking: remove visible testing, demo, sample, placeholder, lorem, TODO, coming soon, and scaffold copy unless it is a real product state.',
228
+ '38. Do not make core user workflows terminal-only unless the product is explicitly a CLI, developer tool, or operational runbook.',
229
+ '39. Separate required experience outcomes from candidate implementation moves. Candidate signature moves are proposals until product evidence, accessibility, or user approval makes them required.',
230
+ '40. Translate conceptual anchors non-literally first. Do not turn anchor artifacts into required chrome, decorative props, wallpaper, or theme objects unless they serve a named product function.',
218
231
  '',
219
232
  '## Creative Ambition Floor',
220
233
  'Before implementation, the design contract must name one authored visual bet, one product-derived palette move, one signature motion/spatial/interaction behavior, and one morphology or composition choice that would not appear in a generic AI template.',
@@ -224,11 +237,13 @@ export function buildDesignBootstrapPrompt({
224
237
  '',
225
238
  '## Token Derivation Audit',
226
239
  'Before implementation, docs/design-intent.json must include derivedTokenLogic.anchorReference plus colorDerivationSource, spacingDerivationSource, typographyDerivationSource, motionDerivationSource, and validationRule.',
227
- 'Every token must be explainable from anchorReference. If the rationale is only looks good, common practice, modern default, or framework default, derive the token again before UI code.',
240
+ 'Every semantic token role must be explainable from anchorReference. If the rationale is only looks good, common practice, modern default, or framework default, derive the token again before UI code.',
241
+ 'Keep exact primitive values flexible until repo evidence, accessibility validation, implementation constraints, or explicit user approval locks them.',
228
242
  '',
229
243
  '## Library Research Protocol',
230
244
  'If web search is available, verify every new UI, animation, scroll, 3D, canvas, chart, icon, styling, or primitive library against current official docs and record source URL, fetched date, stable compatible version, purpose, risk, and fallback.',
231
- 'If web search is unavailable or fails, set libraryResearchStatus to pending-verification, record LIBRARY_TO_VERIFY notes, and use native CSS, browser APIs, or already-present project dependencies until verification is possible.',
245
+ 'If web search is unavailable or fails, set libraryResearchStatus to pending-verification, record LIBRARY_TO_VERIFY notes, and use native CSS, browser APIs, or already-present project dependencies only when they can preserve the intended ambition until verification is possible.',
246
+ 'Select UI foundations dynamically. Use ready-made primitives or component kits for mechanics when they fit, but replace library-default visual language with project-specific composition, tokens, motion, state treatment, and morphology.',
232
247
  '',
233
248
  '## Project Inputs',
234
249
  `- Project name: ${discoveryAnswers.projectName}`,
@@ -252,6 +267,7 @@ export function buildDesignBootstrapPrompt({
252
267
  '5. Encode structured design execution as policy: representation strategy, surface plan, component graph, content-priority map, viewport mutation plan, interaction-state matrix, semantic review focus, and structured handoff requirements.',
253
268
  '6. Encode an explicit structured handoff inside docs/design-intent.json: surface plan, component graph, content-priority map, viewport mutation plan, interaction-state matrix, task-flow narrative, and signature move rationale.',
254
269
  '7. Encode a stable review rubric: required dimensions, genericity signals, valid bold signals, and reporting rules that separate taste from real failure.',
270
+ '7a. Encode designFlexibilityPolicy and designExecutionHandoff.expressionFlexibility so future agents know what is locked and what can change.',
255
271
  '8. Make the handoff executable without screenshot dependency. The contract must still guide high-precision UI generation from repo evidence and changed code alone.',
256
272
  '9. Preserve repoEvidence.designEvidenceSummary when onboarding or detector evidence exists instead of discarding it.',
257
273
  '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.',
@@ -261,6 +277,7 @@ export function buildDesignBootstrapPrompt({
261
277
  '14. Preserve conceptualAnchor so prompt-only UI work has one cohesive non-template concept instead of a mixed collection of bold but unrelated visual decisions.',
262
278
  '15. Record conceptualAnchor.agentResearchMode, specificReferencePoint, signatureMotion, typographicDecision, visualRiskBudget, motionRiskBudget, and cohesionChecks so the final UI cannot quietly fall back to a timid dashboard/admin mental model.',
263
279
  '16. Preserve derivedTokenLogic, libraryResearchStatus, and libraryDecisions so token choices and dependency uncertainty stay visible before implementation.',
280
+ '16a. Preserve designFlexibilityPolicy so the machine contract guides consistency without freezing literal anchor artifacts, exact token primitives, or component-kit visual language.',
264
281
  '17. Preserve productionContentPolicy so UI output is ship-ready and not a testing-looking scaffold.',
265
282
  '18. After the contract exists, use it as a first-class source for future UI tasks.',
266
283
  '',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ryuenn3123/agentic-senior-core",
3
- "version": "3.0.43",
3
+ "version": "3.0.45",
4
4
  "type": "module",
5
5
  "description": "Force your AI Agent to code like a Staff Engineer, not a Junior.",
6
6
  "bin": {
@@ -58,7 +58,7 @@ const REQUIRED_FRONTEND_RULE_SNIPPETS = [
58
58
  '## Activation',
59
59
  '## Authority',
60
60
  'Treat `.agent-context/` as design governance authority.',
61
- 'Treat `README.md` as overview/install/user context only',
61
+ 'Treat `README.md` as public and developer overview, setup, usage, and user-facing context only',
62
62
  'Do not choose final style, framework, palette, typography, layout paradigm, or animation library offline.',
63
63
  'Keep design continuity opt-in.',
64
64
  'Repo evidence outranks memory residue.',
@@ -94,6 +94,8 @@ const REQUIRED_BOOTSTRAP_DESIGN_SNIPPETS = [
94
94
  'WCAG 2.2 AA is the hard floor',
95
95
  'APCA may be used only as advisory perceptual tuning',
96
96
  'unresearched dependency choices',
97
+ 'Dynamic UI Foundation Selection',
98
+ 'A new dependency, package count, or vague performance concern is not a blocker by itself.',
97
99
  'default component-kit styling without product rationale',
98
100
  'genericity findings that cannot name the exact drift signal',
99
101
  ];
@@ -59,7 +59,7 @@ function buildThinAdapter({
59
59
  'This repository is governed by a strict instruction contract.',
60
60
  `Use [${CANONICAL_SOURCE_PATH}](${canonicalLink}) as the canonical policy source.`,
61
61
  'Use .agent-context/ for technical rules, prompts, checklists, policies, and state.',
62
- 'Treat README.md as overview/install/user context only when governance files conflict.',
62
+ 'Treat README.md as public and developer overview, setup, usage, and user-facing context only when governance files conflict.',
63
63
  '',
64
64
  '## Critical Bootstrap Floor',
65
65
  '',
@@ -70,6 +70,7 @@ function buildThinAdapter({
70
70
  '- For UI scope, include a one-line Motion/Palette Decision in the Bootstrap Receipt; product categories are heuristics, not style presets.',
71
71
  '- For UI scope, create or refine `docs/DESIGN.md` and `docs/design-intent.json` before UI implementation.',
72
72
  '- For documentation-first requests, create or refine required project docs in English by default and do not write application, firmware, or UI code until the user asks or approves.',
73
+ '- Create or refine root README.md as the public and developer entrypoint before implementation.',
73
74
  `- For backend, API, data, auth, error, event, queue, worker, or distributed-system requests, load only relevant global rules from .agent-context/rules/ ([link](${rulesLink})).`,
74
75
  '- For ecosystem, framework, dependency, or Docker claims, perform live web research.',
75
76
  '- Resolve runtime choices from project evidence and live official documentation; resolve structural planning from constraints and architecture boundaries.',